Computing.Net > Forums > Unix > unix sqlplus appworx

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

unix sqlplus appworx

Reply to Message Icon

Name: steff2009
Date: July 16, 2009 at 16:45:58 Pacific
OS: Windows XP
Subcategory: Software Problems
Comment:

Your help is much appreciated.In a prompt in Appworx
the variable name is SPOOLFILE,
so I am moving the path to
oSPOOLFILE. The path is {#DS_OUTPUT_DIRECTORY}/DS_CS_DQ_MO_RC_output.txtIs that correct.

Also I put an exit in my sqlplus,
so I commented out the second SQLplus command.Can you please tell me how to get my spooled output from the sql into the $SPOOLFILE?


oSPOOLFILE= $SPOOLFILE
export oSPOOLFILE
echo $oSPOOLFILE
#
# set the local connection variable, login,password/dbs
# export the local variable to convert to environment variable that will be visible by the program
#
EDW_CONN_STR=$db_login/$db_password$net_connect
export EDW_CONN_STR

#
# print the text listed
#
echo "Updating T_ETL_DQ_QUERY_RESULTS table ..."
#
# login to the database and execute the "Student" row count queries
#
sqlplus -s ${EDW_CONN_STR} @/prod/DS/sql/DS_CS_DQ_MO_RC.sql
echo "came back from sql"
echo $oSPOOLFILE
#sqlplus -s ${EDW_CONN_STR} >$oSPOOLFILE<<-EOF
set echo off feed off veri off pages 0 head off
# Spool file to network location
unix2dos $oSPOOLFILE $oSPOOLFILE 2>/dev/null
twc=`grep T_ $oSPOOLFILE|wc -l`





Sponsored Link
Ads by Google

Response Number 1
Name: wollie
Date: July 17, 2009 at 05:23:32 Pacific
Reply:

well, what about:

spool outputfilename;
sql-cmd;
sql-cmd;
... ... ... :
spool off;

within your sql-session?
it can be done either interactively or included in a batch file

cheers

Wollie


0

Response Number 2
Name: steff2009
Date: July 17, 2009 at 06:55:34 Pacific
Reply:

Thank you very much for your help and your response. I have
the spool off in the sqlplus. I had to add an 'exit' so it would return to the unix script. I need to write the spooled results to this 'SPOOLFILE' that is in the unix script, but since I exited in the sqlplus... the command ' ${EDW_CONN_STR} >$oSPOOLFILE<<-EOF' no longer works..... (I am supposed to modify this script'. How can I write what came from the
sqlplus to the $oSPOOLFILE?


0

Response Number 3
Name: tvc
Date: August 15, 2009 at 13:05:54 Pacific
Reply:

SPOOL is an SQLPLUS command ... just start it with "spool filename" and use "spool off" at the moment you don't want data to be logged anymore, all within the SQL session. There's nothing more to it.

You can redirect ouput to a file, but that has nothing to do with the SQL spooling, this is unix redirecting:

sqlplus user/pass $/some/file.sql > /some/output.log

In this example, don't use SQLPLUS spooling, as you already are logging output on OS level.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: unix sqlplus appworx

sqlplus from unix shell www.computing.net/answers/unix/sqlplus-from-unix-shell/8207.html

sql query in unix scritp www.computing.net/answers/unix/sql-query-in-unix-scritp/6420.html

Pass parameter from plsql to unix www.computing.net/answers/unix/pass-parameter-from-plsql-to-unix/6500.html