Click here to Skip to main content
15,906,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
After running this query I am getting Result properly:

SELECT REGEXP_REPLACE(REGEXP_SUBSTR(TBLUSERACTIVITIES.ACTION, 'Event [0-9]+'),'Event ') as EventId1, REGEXP_REPLACE(REGEXP_SUBSTR(TBLUSERACTIVITIES.ACTION, 'Event [0-9]+',1,2,'i'),'Event ') as EventId2 FROM EAITEMP.TBLUSERACTIVITIES TBLUSERACTIVITIES

Out Put :

EventID1 | EventID2
123 | 235


But While running this query i am getting error as :
CSS
Error report:
SQL Error: ORA-00936: missing expression
00936. 00000 -  "missing expression"
*Cause:
*Action:


insert into EAITEMP.TBLUSERACTIVITIES(EventID1, EventID2) values(SELECT REGEXP_REPLACE(REGEXP_SUBSTR(TBLUSERACTIVITIES.ACTION, 'Event [0-9]+'),'Event ') as EventId1, REGEXP_REPLACE(REGEXP_SUBSTR(TBLUSERACTIVITIES.ACTION, 'Event [0-9]+',1,2,'i'),'Event ') as EventId2 FROM EAITEMP.TBLUSERACTIVITIES TBLUSERACTIVITIES);

Thanks in Advance
Posted

1 solution

You should not use the VALUES clause with INSERT INTO .... SELECT

Try this syntax:
SQL
INSERT INTO Table1 (Col1, Col2)
SELECT Col1, Col2 FROM Table2
 
Share this answer
 
Comments
Mohd Shamim Ansari 30-Jan-14 9:46am    
Thanks Shameel
[no name] 30-Jan-14 9:51am    
You're welcome. If it worked, mark this as answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900