Select into...
Posted in 1999
Topics: General Discussion
Hi,
I am a MSSQL user trying to find the equivalent to a "Select into". What
this does is create a table from another table without writing to a log
file. Something like this...
Select * into table1 from table2
Is there something like this in Informix?
Thanks in advance,
Jeff
I may be wrong, and I've never tried this on Informix, but I think in Oracle
you can do the following:
create table2 as select * from table1
Jeff wrote in message ...
>Hi,
>
>I am a MSSQL user trying to find the equivalent to a "Select into". What
>this does is create a table from another table without writing to a log
>file. Something like this...
>
>Select * into table1 from table2>
>Is there something like this in Informix?
>
>Thanks in advance,
>Jeff
In article <7u36ac$dsf$1@autumn.news.rcn.net>, Mako Joe
<eyeofthestorm2@hotmail.com> writes
>I may be wrong, and I've never tried this on Informix, but I think in Oracle
>you can do the following:
>create table2 as select * from table1
>
select * from table1 into temp table2 with no log
This only works for temporary tables though.
>Jeff wrote in message ...
>>Hi,
>>
>>I am a MSSQL user trying to find the equivalent to a "Select into". What
>>this does is create a table from another table without writing to a log
>>file. Something like this...
>>
>>Select * into table1 from table2>>
>>Is there something like this in Informix?
>>
>>Thanks in advance,
>>Jeff
>
>
>
--
David Williams
This requires going outside isql/dbaccess & may take awhile depending on table
size but you won't have to type all the fields...
dbschema -d databasename -t oldtable tempfile.sql (from shell)edit tempfile.sql, change tablename from old to new (drop unnecessay indexes,
rename remaining)
run tempfile.sql
insert into newtable select * from oldtable;alter newtable drop fieldname;
select * from newtable
Curt
David Williams wrote:
> In article <7u36ac$dsf$1@autumn.news.rcn.net>, Mako Joe
> <eyeofthestorm2@hotmail.com> writes
> >I may be wrong, and I've never tried this on Informix, but I think in Oracle
> >you can do the following:
> >create table2 as select * from table1
> >
>
> select * from table1 into temp table2 with no log>
> This only works for temporary tables though.
>
> >Jeff wrote in message ...
> >>Hi,
> >>
> >>I am a MSSQL user trying to find the equivalent to a "Select into". What
> >>this does is create a table from another table without writing to a log
> >>file. Something like this...
> >>
> >>Select * into table1 from table2> >>
> >>Is there something like this in Informix?
> >>
> >>Thanks in advance,
> >>Jeff
> >
> >
> >
>
> --
> David Williams
I tried the syntax that I mentioned, and it does not work in Informix. Unless anyone has a solution, I suppose you might have to do it manually, following a routine such as what Curt suggested. >I may be wrong, and I've never tried this on Informix, but I think in Oracle >you can do the following: >create table2 as select * from table1