0
votes

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.

1
What do these scripts do? If you're not getting all the spool, maybe there's at least one script that disables the spool, or changes the spool destination - Aleksej
@Aleksej scripts contains update or insert or some plsql blocks. Few o fthe scripts have spoll written inside them also. - Vishal5364
If you want to have all the spool in the place that you decide in the "main" script, you need to remove all SPOOL commands from within the called scripts - Aleksej

1 Answers

0
votes

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;