How to execute an SQL string in DB2 -


how execute sql string statement in db2? i'm using ibm data studio.

do mean executing dynamic sql string? like:

declare stmt varchar(1000); declare my_table varchar(50); set my_table = 'dept_'||deptnumber; set stmt = 'select * '||my_table; prepare s1 stmt; execute s1; 

you can in stored proc though. 1 defined create procedure getdeptinfo (deptnumber varchar(5)) example. read execute , prepare in db2 docs http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -