0
votes

I have a SP where I need to insert into a table . The requirement is the values of all the columns I am inserting are coming from a select query except the last one , which is coming as a parameter in SP

So , will the below insert syntax works ?

insert into ABC(a,b,c,...y,z) values ((select a,b,c,...y from XYZ ),@p_z);

where @p_z is parameter of SP which should be inserted in z column of ABC

1

1 Answers

0
votes

You can use insert-select:

insert into ABC(a,b,c,...y,z) 
  select a,b,c,...y, p_z from XYZ;

PS. variables in oracle have no @-prefix