Vishal5364
Vishal5364

Reputation: 293

SPOOLING in sqlplus

I have multiple sql scripts which I need to run from sqlplus. I have put all the file names in a file all.sql like this

SPOOL a.log;
@635155_IPAB_mmsg.sql
@635558_MMSG_INSERT.sql
@635585_Insert_COMT.sql
@638272_MMSG_INSERT.sql
@638464_mmsg_insert.sql
@639155.sql
@645015_mms.sql
@646412_MMSG_Modify.sql
SPOOL OFF;

Once I run sqlplus>@all.sql I dont get all the error messages in the a.log file. Is there any other way to put everything in log file.

Upvotes: 0

Views: 150

Answers (1)

Dmitry Demin
Dmitry Demin

Reputation: 2113

This utility adds sqlplus command PROMPT sql file names to sql file before call sql script. For example output file

SPOOL a.log;
PROMPT "Start script: 635155_IPAB_mmsg.sql"
@635155_IPAB_mmsg.sql
PROMPT "---------------------------------------------------------------------------------------------------------"
PROMPT "Start script: 635558_MMSG_INSERT.sql"
@635558_MMSG_INSERT.sql
PROMPT "---------------------------------------------------------------------------------------------------------"
PROMPT "Start script: 635585_Insert_COMT.sql"
@635585_Insert_COMT.sql
PROMPT "---------------------------------------------------------------------------------------------------------"
PROMPT "Start script: 638272_MMSG_INSERT.sql"
@638272_MMSG_INSERT.sql
PROMPT "---------------------------------------------------------------------------------------------------------"
PROMPT "Start script: 638464_mmsg_insert.sql"
@638464_mmsg_insert.sql
PROMPT "---------------------------------------------------------------------------------------------------------"
PROMPT "Start script: 639155.sql"
@639155.sql
PROMPT "---------------------------------------------------------------------------------------------------------"
PROMPT "Start script: 645015_mms.sql"
@645015_mms.sql
PROMPT "---------------------------------------------------------------------------------------------------------"
PROMPT "Start script: 646412_MMSG_Modify.sql"
@646412_MMSG_Modify.sql
PROMPT "---------------------------------------------------------------------------------------------------------"
SPOOL OFF;

Upvotes: 0

Related Questions