Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Create table syntax query

Re: Create table syntax query

From: John Russell <netnews3_at_johnrussell.mailshell.com>
Date: Thu, 04 Jul 2002 21:05:14 GMT
Message-ID: <sqd9iukfp0160d5eei11ktbj4n35cn5gk9@4ax.com>


On 3 Jul 2002 05:21:16 -0700, sburgeon_at_hotmail.com (Spencer) wrote:

>I need to create tables on the fly with sequential numbers from, for
>example, 500 to 40,500 in it.
>
>The table definition is
>
>CREATE TABLE tblTest(testdata NUMBER(6));
>
>Presently I am populating the table in a stored procedure using a
>LOOP. The word on the street is that I can create a table & populate
>the testdata column with the 40,000 numbers in it with a single SQL
>statement.
>
>Is this right?

I don't know about the single SQL statement part, but take a look at the PL/SQL FORALL statement to speed up the loop. You might need to create a PL/SQL table first containing the numbers, but it should still be faster to "batch" all the INSERTs using FORALL.

John

--
Got an Oracle database question?
Try the search engine for the database docs at:
http://tahiti.oracle.com/

The opinions expressed above are mine and do not
necessarily reflect those of Oracle Corporation.
Received on Thu Jul 04 2002 - 16:05:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US