ok not sure if this gives you an idea.
I have the following (for example use, not realworld but using this for the example) select statement which I can use with an Insert
Insert into tableK(name)
select name from tableZ where name = 'Gofer'
I want to dynamically do this using a variable I have populated with a single row of data from a select statment before running the main select statement as it were
So for example
Declare newname varchar2(20)
newname = select surname from tableB where name = 'PHATZ'
Insert into tableK (name)
select name from tableZ where name = newname
Can someone give me a basic interpretation of this and how it would look in a script?
Many Thanks
I have the following (for example use, not realworld but using this for the example) select statement which I can use with an Insert
Insert into tableK(name)
select name from tableZ where name = 'Gofer'
I want to dynamically do this using a variable I have populated with a single row of data from a select statment before running the main select statement as it were
So for example
Declare newname varchar2(20)
newname = select surname from tableB where name = 'PHATZ'
Insert into tableK (name)
select name from tableZ where name = newname
Can someone give me a basic interpretation of this and how it would look in a script?
Many Thanks
Comment