I want to run a query on both Oracle and SQL Server. The problem I have is that the query inserts into a column called PERCENT which I believe is a keyword in SQL Server.
A straight insert like this fails on SQL Server
INSERT INTO testtable
(PERCENT,VALUE)
VALUES
(50,'test');
To overcome the above SQL Server allows it if it is changed to one of the following
INSERT INTO testtable
([PERCENT],[VALUE])
VALUES
(50,'test');
INSERT INTO testtable
("PERCENT","VALUE")
VALUES
(50,'test');
The problem now is that Oracle does not support any of the above formats. Oracle only allows this format:
INSERT INTO testtable
(PERCENT,VALUE)
VALUES
(50,'test');
Is there a way I can run the above query in both Oracle and SQL Server without any problems?
Actually Oracle does support this format:
Here is a direct paste from my SQL Plus session: