sql - IBM DB2 // Create Alias in Stored Procedure -
i using latest edition of ibm´s db2 express-c. in 1 of stored procedures trying add create alias - statement existing table.
"unexpected token" error message after executing create statement stored procedure.
so question: read documentation create alias. there no limitation special context. implment create alias in stored procedure successfuly?
this snipped dbproc:
declare sql varchar(450); set t1 = 'm2f.m2f_k' || i_tablenr; set t2 = 'm2f.m2f_k' || i_tablenr || '_zuodoc z' ; -- create alias m2f.kxx t1; create alias m2f.kxx m2f.m2f_k11; for_loop: rs c1 cursor
thank you! oliver
most ddl statements, including create alias
, must executed dynamically in stored procedures:
execute immediate 'create alias m2f.kxx ' || t1;
here's link manuals for latest version of db2 luw.
Comments
Post a Comment