Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using variable as table name for Insert

MathBobOct 16 2015 — edited Oct 20 2015

Hello,

I'm trying to use a varible as table name to do an insert.

The name of the table where my datas have to be insert is EVV_ + the Ref_var of the data.

My code will be more explicit:

SELECT 'EVV_' || Ref_Equip

      INTO v_Ref_Equip

      FROM user.c_equip

      WHERE clef_equip = v_clef_equip;

      INSERT INTO 'user.' || v_Ref_Equip (Clef_var, Date1, Valeur)

      VALUES ( v_clef_var, '18/05/01','49,156' );

I don't find the good syntax for the insert into. I've tried many syntax, but not the good one.

So, how can I concatenate 'user.' + my variable v_Ref_Equip ?

Thank for the help

This post has been answered by Utsav on Oct 16 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 17 2015
Added on Oct 16 2015
11 comments
3,392 views