How to insert values from Variable and table in single query
Hello All,
I am stuck with a problem. Could somebody show me as to how to accomplish following thing in Oracle 10g?
I need to insert 4 different claim number from a table along with a constant value from variable.
for example:
'some value', 123456
'some value', 223344
'some value', 555555
'some value', 123457
Possible Solution:
=================
DECLARE
XCONST VARCHAR2(20);
BEGIN
XCONST:= 'some value';
INSERT INTO A_TABLE(SOME_VALUE, CLAIMNUMBER)
SELECT (SELECT XTEST FROM DUAL), CLAIMNUMBER FROM TBLVOUCHERS WHERE ROWNUM <=4;
END;
Also I would want to avoid using any loop or cursor here. Is it possible?
Thank in Advance
Vinod
__________________
Vinod Pawar
United States
|