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: Some questions Oracle (SQL)

Re: Some questions Oracle (SQL)

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 2000/03/22
Message-ID: <bdiidskeki8vrqpcser4qm6tdqm5qf45gn@4ax.com>#1/1

A copy of this was sent to rhillebrand_at_starren.nl (if that email address didn't require changing) On Wed, 22 Mar 2000 21:50:45 GMT, you wrote:

>Thanks,
>
>Oracle Version is 8.0.1.5
>Can you help me on the way.
>
>R. Hillebrand
>

I'll have to assume you mean 8.1.5 as there was no released 8.0.1 version.... (8.0.3, 8.0.4, 8.0.5 were released)

It would be:

begin
  execute immediate 'create table ' || varTable || ' (.....)'; end;

or

begin

   execute immediate
    'insert into ' || varTable || ' vlaues ( :x )' USING varValue; end;

>In article <953753525.3018.0.pluto.d4ee154e_at_news.demon.nl>,
>"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote:
>> You'll need to use dbms_sql and/or other dynamic sql mechanisms for
 this.
>> As you don't specify your version I can't provide any specific
 pointers.
>>
>> Hth,
>>
>> Sybrand Bakker, Oracle DBA
>>
>> <rhillebrand_at_starren.nl> wrote in message
>> news:8bb5cq$ghn$1_at_nnrp1.deja.com...
>> > Hello,
>> > Some questions about oracle :
>> > How to create a stored procedure to create a Table with a variable.
>> > Example :
>> > CREATE PROCEDURE UPCREATETABLE(varTable VARCHAR2) AS
>> > BEGIN
>> > CREATE TABLE varTable(...);
>> > END;
>> > How to create a stored procedure insert into a Table with a
 variable :
>> > Example :
>> > CREATE PROCEDURE UPINSERTDATA(varTable VARCHAR2, varValue as
 NUMBER) AS
>> > BEGIN
>> > INSERT INTO varTable VALUES (varValue)
>> > END;
>> > Is this possible ?
>> > R. Hillebrand
>> >
>> >
>> > Sent via Deja.com http://www.deja.com/
>> > Before you buy.
>>
>>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

-- 
http://osi.oracle.com/~tkyte/
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Wed Mar 22 2000 - 00:00:00 CST

Original text of this message

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