Home » SQL & PL/SQL » SQL & PL/SQL » INSERTING TABLE INFORMATION
INSERTING TABLE INFORMATION [message #36245] Tue, 13 November 2001 05:55 Go to next message
Amy
Messages: 29
Registered: September 1999
Junior Member
I have been trying to insert information from one table to another table. The problem I have is that my insert also has to include some constant fields with each line inserted. Here is an example below:

my constant values: Table2.field1 = True
table2.field4 = 27

Table1
field1 ; field 2
---------------
truck ; blue
car ; red

Table2 (resulting table inserts)
field1 ; field2 ; field3 ; field4
--------------------------------
True ; truck ; Blue ; 27
true ; car ; red ; 27

This is what I have tried to do but I get a fatal error and it exits me out of worksheet:

insert into table2(field1,field2,field3,field4)
values
('True'. table1.field1, table1.field2, '27')

I appreciate any insight you can give me on this. Thank You.

(note: the semicolons were to just to help separate the field values not to be in the table)

----------------------------------------------------------------------
Re: INSERTING TABLE INFORMATION [message #36246 is a reply to message #36245] Tue, 13 November 2001 06:32 Go to previous message
oraboy
Messages: 97
Registered: October 2001
Member
insert into table2(col1,col2...col4)
select 'True',field1,field2,'27' from table1;

----------------------------------------------------------------------
Previous Topic: help reqd..vry impt..
Next Topic: Re: How to Retrieve CLOB withADODB Command Parameter...?
Goto Forum:
  


Current Time: Fri Mar 29 05:36:16 CDT 2024