我想返回所有表格及其旁边的计数。最快的方法是什么?
我知道在 Oracle 中,您可以执行以下操作,但不确定 Sybase:
declare n number;
begin
for rec in (select object_name from user_objects where object_type='TABLE')
loop
execute immediate 'select count(*) from '||rec.object_name into n;
dbms_output.put_line (rec.object_name||':'||n);
end loop;
end;