Click here to Skip to main content
15,911,711 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I learnt that logging for an oralce SQL commands can be achieved using SPOOL Command, it is working fine if I execute the oracle sql scripts via SQL Plus or Toad, whereas the same logic is not working when i try to execute the sql script via C#.

On a high level my need is, a button click in a web page should execute a set of DML statements against Oracle DB and the log file should be created for the above action.

Please advise in executing the sql from C# and generating the log file for the same.

Trial Code:
-----------

Spool 'D:/MyFolder/MyLogFile.txt';

select sysdate from dual;

Spool off;

Thanks,
Priya
Posted

1 solution

You don't need to start SQLPlus to do some SQL work. You may use ODP.NET to connect to Oracle Database and execute your SQL script.
 
Share this 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