I tried the below sql query
INSERT INTO test.ACT_QUERY values(2139,2,'SELECT ''D'',ORDER_ID from dual');
When a java program run this select statement from test.ACT_QUERY table and spools to a output file it gives a “D”, 123. I just want D,123. Not sure why the quotes are coming up. What i need to replace in the select statement to get the output as D,123
It is difficult to visualize your problem. Certainly there is nothing wrong in principle with what you’re doing, and it works in PL/SQL.
Here is your test data, slightly tweaked to run in my DB:
Let’s roll!
So, you need to explain your situation in a bit more detail, with cut’n’paste of actual output.