× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Betcha it's something to do with system naming vs SQL naming, and something I have to set on my options statement.  How much ya wanna bet?

On 8/20/2019 3:25 PM, Joe Pluta wrote:
Okay, this one has me scratching my head.

I've always used a prepared statement to create tables, but I wanted to try using the current schema this time.  Basically I'm creating a summary table for extract, and I wanted to it like this:

SET SCHEMA = :newSchema;
CREATE TABLE NEWTABLE AS (SELECT ...) WITH DATA;
SET SCHEMA = DEFAULT;

This seems pretty straightforward.  When I do it in STRSQL and hardcode the library name, everything works fine.  But when I do this in an embedded SQL program the file is always created in QGPL.

I went so far as to do this:

SET SCHEMA = :newSchema;
SET :curSchema = CURRENT_SCHEMA;
CREATE TABLE NEWTABLE AS (SELECT ...) WITH DATA;
SET SCHEMA = DEFAULT;

I thought maybe the current schema was getting reset somehow, but the variable curSchema ends up with the same value as newSchema. But the new table still ends up in QGPL.

Any idea what I'm missing?



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.