Monday, January 14th, 2008
Oracle'da cursor kullanımı
declare
vRC1 SYS_REFCURSOR;
vTemp acc_def%rowtype;
begin
OPEN vRC1 FOR SELECT * from acc_def;
loop
fetch vRC1 into vTemp;
exit when vRC1%notfound;
dbms_output.put_line(':'||vTemp.id_no || '-'||vTemp.description);
end loop;
end;
Posted in genel, oracle, sql, yardımcı kod | No Comments »
Thursday, September 20th, 2007
Bir veritabanındaki tüm tablolara update statistics ve sp_recompile yapmak istiyorsanız aşağıdaki sql kodunu çalıştırarak ilgili kodu üreterek çalıştırabilirsiniz:
select 'update statistics ' + db_name() + '..' + name + ' go exec ' + db_name() + '..sp_recompile ' + name + ' go ' from sysobjects where type='U'
Posted in sql, sybase, yardımcı kod | No Comments »