Issue #23100 Fix fetchnumber function to work for non-public schema tables

Issue #23100 Fix fetchnumber function to work for non-public schema tables