Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
Convert sql server insert script into oracle insert script?

this sql server script below..


INSERT [dbo].[tblPayMaster] ([NoteNumber], [NoteDate], [CentreCode], [ParamCode], [Fromdate], [ToDate], [PayedServiceType], [PayedEmployeeType], [PayedServiceStatus], [LocationType], [LocatonCode], [StateCode]) VALUES (N'', CAST(N'2011-10-12 00:00:00.000' AS DateTime), 8, N'', CAST(N'2011-09-01 00:00:00.000' AS DateTime), CAST(N'2011-09-30 00:00:00.000' AS DateTime), 4, 14, 62, 2, 8, 1)


convert into oracle 10 g script.
Posted
Comments
CHill60 17-Mar-15 7:34am    
Have you tried running it in Oracle 10g????
Abdul Imran 17-Mar-15 8:01am    
i have tried with 10g but still it is unsolved

1 solution

This should work:

INSERT INTO tblPayMaster(NoteNumber, NoteDate, CentreCode, ParamCode, Fromdate, ToDate, PayedServiceType, PayedEmployeeType, PayedServiceStatus, LocationType, LocatonCode, StateCode)
VALUES(TO_DATE('2010/10/12', 'yyyy/mm/dd')), 8, '', TO_DATE('2011/09/01', 'yyyy/mm/dd')), TO_DATE('2011/09/30', 'yyyy/mm/dd')), 4, 14, 62, 2, 8, 1);
commit;

* Note, you it is not good practice to suffix tables "tbl" also I am assuming the last 6 attributes are integers.
 
Share this answer
 
Comments
Abdul Imran 17-Mar-15 7:44am    
yes i have tried in oracle 10g but it not getting done.
Jörgen Andersson 17-Mar-15 8:00am    
Any error messages?
jgakenhe 17-Mar-15 8:01am    
Looks like there is no value for NoteNumber, below is the fix. If it doesn't work then the datatypes are wrong, but you should be able to handle it from here.

INSERT INTO tblPayMaster(NoteNumber, NoteDate, CentreCode, ParamCode, Fromdate, ToDate, PayedServiceType, PayedEmployeeType, PayedServiceStatus, LocationType, LocatonCode, StateCode)
VALUES(1000, TO_DATE('2010/10/12', 'yyyy/mm/dd')), 8, '', TO_DATE('2011/09/01', 'yyyy/mm/dd')), TO_DATE('2011/09/30', 'yyyy/mm/dd')), 4, 14, 62, 2, 8, 1);
commit;

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