Thursday, 15 July 2010

SYBASE: how to capture error on a exceute -



SYBASE: how to capture error on a exceute -

i have query has multiple dynamic statements, each table takes creations. build sentence dynamic not how capture error if can not create table.

select @sql_create = 'select * ' || @bd || 'pat_cdf_conceptos_servicio_acc' || fecha_number || ' '|| @bd || 'pat_cdf_conceptos_servicio; commit;'; execute (@sql_create);

if using ase can utilize syntax bellow:

execute (@sql_create); if @@error = 0 begin print 'table created' end else begin print 'error' end

sybase

No comments:

Post a Comment