Home » RDBMS Server » Server Administration » Send query values to a table
Send query values to a table [message #374377] Fri, 08 June 2001 13:05 Go to next message
Srikanth Tutukuri
Messages: 3
Registered: June 2001
Junior Member
I am trying to send the results of a query into a table. The sql statement is as follws.

Select OL_ID, OL_NAME into BestSellers from Orders;

where BestSellers is the name of the temporary table. I have not created the table BestSellers before. Do we need to create a table before we can insert data into it or can we send the data from a query result into a temporary table. Can anyone help me on this. Any help is highly appreciated.
Re: Send query values to a table [message #374390 is a reply to message #374377] Sat, 09 June 2001 20:42 Go to previous messageGo to next message
Bala
Messages: 205
Registered: November 1999
Senior Member
Hi,

If You want to create a table and insert records in one step then you should

create table BestSellers as (select OL_ID, OL_NAME from orders);
Re: Send query values to a table [message #375206 is a reply to message #374377] Sat, 04 August 2001 05:50 Go to previous message
hisham
Messages: 4
Registered: August 2001
Junior Member
Do the following way to insert records into
your temporary table.

Step 1,
CREATE GLOBAL TEMPORARY TABLE BestSellers
(OL_ID VARCHAR2(15), OL_NAME VARCHAR2(35))

Step 2,
Select OL_ID, OL_NAME into BestSellers from Orders
Previous Topic: Pleaze help with slow query
Next Topic: Case Sensitive PostgreSQL
Goto Forum:
  


Current Time: Tue Dec 24 06:29:59 CST 2024