RE: Re: Reuse of REF Cursor

Поиск
Список
Период
Сортировка
Искать
От
Abraham, Danny
Тема
RE: Re: Reuse of REF Cursor
Дата
Msg-id
PH0PR02MB7446F3EBF0DF1B24212FC53F8E719@PH0PR02MB7446.namprd02.prod.outlook.com
Ответ на
Список
Дерево обсуждения
Reuse of REF Cursor "Abraham, Danny" <danny_abraham@bmc.com>
Re: Reuse of REF Cursor Tom Lane <tgl@sss.pgh.pa.us>
RE: Re: Reuse of REF Cursor "Abraham, Danny" <danny_abraham@bmc.com>
Re: Reuse of REF Cursor Tom Lane <tgl@sss.pgh.pa.us>
RE: Re: Reuse of REF Cursor "Abraham, Danny" <danny_abraham@bmc.com>
Re: Reuse of REF Cursor Tom Lane <tgl@sss.pgh.pa.us>
RE: Re: Reuse of REF Cursor "Abraham, Danny" <danny_abraham@bmc.com>
Re: Reuse of REF Cursor Ron <ronljohnsonjr@gmail.com>
Re: Reuse of REF Cursor "David G. Johnston" <david.g.johnston@gmail.com>
  stmt := 'select count(*) from ' || table_name;
   open C1 for execute  stmt;
   fetch C1 into rc;
   close C1;

   if (debug_level = 1) then
      if rc > 0 then
         perform diag_print(func_name,format('Counted %s records in table %s',rc,table_name) );
      else
         perform diag_print(func_name,format('Table %s is empty.',table_name) );
         return 0;
      end if;
   end if;

   stmt := 'select count(*) from ' || table_name || ' where orderno not in ( select orderno from cmr_ajf) ' ;
   if lower(table_name) = 'cmr_setvar'  then
        stmt := stmt || ' and orderno <> 0';
   end if;
   open C1 for execute  stmt;
   fetch C1 into rc;  <========================= Sometimes fail here
   close C1;
   if rc>0 then


Should I use a different variable for every refcursor usage ?




В списке pgsql-general по дате отправления
От: Adrian Klaver
Дата:
От: Tom Lane
Дата:
Сообщение: Re: Reuse of REF Cursor
FAQ