HOW TO INCLUDE LOG IN INFORMATION IN AN SQL SCRIPT
Please I have an SQL update statement which I want to put in an SQL script which users can run to update an oracle9i database running on a windows 2003 server.The statement is as follows: update jobs set JOBSTATE = 3 where APPID = 5 ; COMMIT; Exit I do not want users to be opening the script and be putting username, password and database name when they want to run the script but I want to include the username, password and database name inside the script so that when they just run it will automatically log in and update the table. Please How can I write such SQL script? So that users will not have reason to be editing the script. Thank you, Idongesit Daniel Udoh idongesitu@yahoo.com

Software/Hardware used:
ASKED: January 21, 2008  12:06 PM
UPDATED: January 23, 2008  8:16 PM

Answer Wiki:
Suggestion is somthing like the following: . ${HOME}/.profile ...... sqlplus $ASQLUSER @$SQL_DEPOT/sqlplus_filename.sql ...... if [ Check-ERROR-Condition-of-SQL-Output-File ] then echo "The Tariff Group Revert Back to Residential Type Customer for Antillia is not completed." | mailx -s "A NTILLIA BOC ERROR $0" $MAILTO exit; fi = = = = = = = = = = = = = = = = = = = = = = In . ${HOME}/.profile $ASQLUSER=rcrp/rcrp = = = = = = = = = = = = = = = = = = = = = = In $SQL_DEPOT/sqlplus_filename.sql spool $SQL_DEPOT/LOGS/sqlplus_filename.log update PRICE_CLASS_DET set PCD_VALUE=1 where PCD_ID=11313; commit; = = = = = = = = = = = = = = = = = = = = = = The above is from a Unix system, but you could incorporate a large portion of it to a DOS script. Hope it helps some.
Last Wiki Answer Submitted:  January 23, 2008  8:16 pm  by  Denny Cherry   64,520 pts.
All Answer Wiki Contributors:  Denny Cherry   64,520 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _