Specify SQL Table-creation Library at Runtime
April 25, 2012 Hey, Ted
I have an RPG programs that creates work tables in QTEMP. I’d like to be able to specify the library at runtime. I tried using a host variable for the library in a CREATE TABLE command, but that didn’t fly. I am using the system naming convention. Can you help? –Ben I wish CREATE TABLE would allow a host variable for the explicit qualifier, but it doesn’t. Here are a few ways that work. 1. Use dynamic SQL. Embed the library name in the SQL command. D SqlCommand s 256a varying D WorkLib s 10a /free *inlr = *on; SqlCommand |