|
When I do a: CREATE TABLE QTEMP.TableName AS ( SELECT Fields FROM File WHERE Fielda = :Variable ) with Data I get an error message that I can not use a host variable in this statement. I tried it in both embedded RPG and in a SQL procedure. So instead I've been doing CREATE TABLE QTEMP.TableName AS ( SELECT Fields FROM File ) with No Data; INSERT INTO QTEMP.TABLENAME SELECT Fields FROM File WHERE Fielda = :Variable Now I get my table with the data I need but I need to maintain my select statement in two spots...On the CREATE TABLE and on the INSERT. Anybody have a better method of using SQL to create a temporary file. In this case I'm using an email package to email the file off in a CSV file and then deleting the file. David Smith IT Consultant
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.