Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
A poster asked whether Informix supports CREATE TABLE AS SELECT to copy a table. Sergey E. Volkov said it did not. Brett Randall suggested SELECT INTO TEMP with NO LOG for a session-only copy. Art S. Kagel gave a pipeline using dbschema -t, sed to rename the table, and an INSERT INTO new SELECT from old fed to dbaccess.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
schan4me@yahoo.com — — source: Informix-list mailing list archive (1991-1998)
Hi,
Can one do a create table ... as select ... from ... where ...?
Or if there an equivalent?
Basically, I am looking to copy a table from one schema to
another.
Thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.
↪ replying to schan4me@yahoo.com
Sergey E. Volkov — — source: Informix-list mailing list archive (1991-1998)
Informix doesn't support 'create ... as select ... where ... '.
<schan4me@yahoo.com> ''''' ' ''''''''':8tpr4t$e1r$1@nnrp1.deja.com...
> Hi,
>
> Can one do a create table ... as select ... from ... where ...?
> Or if there an equivalent?
>
> Basically, I am looking to copy a table from one schema to
> another.
>
> Thanks.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
↪ replying to Sergey E. Volkov
Brett Randall — — source: Informix-list mailing list archive (1991-1998)
"Sergey E. Volkov" wrote:
> Informix doesn't support 'create ... as select ... where ... '.
unless of course you only want your copy as a temp table i.e. :-
select ...
from ...
into temp blah with no logselect *
from blah
Temp table is of course only persistent for the current session.
-----
Brett
↪ replying to schan4me@yahoo.com
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
(dbschema -d mydbs -t oldtabl |sed -e 's/oldtabl/newtabl/'; echo 'insert into
newtabl select * from oldtabl;') | dbaccess mydbs
Art S. Kagel
schan4me@yahoo.com wrote:
>
> Hi,
>
> Can one do a create table ... as select ... from ... where ...?
> Or if there an equivalent?
>
> Basically, I am looking to copy a table from one schema to
> another.
>
> Thanks.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.