Sample Header Ad - 728x90

Printing comments or statements when executing script to a output file using TOAD/ORACLE

3 votes
3 answers
34644 views
Coming from a SQL SSMS environment, I would like to duplicate their Print Command which allows you to print commands or variables while executing a query. I am looking for this feature to help identify particular sections of the script during the execution. For instance we have a .sql script that runs in the evening that checks for discrepancies on particular inventory numbers. These inventory numbers have lets say a store_id of 1, 2, 3, 4, 5. The script has a select statement attached to each of these store_id. I would like to be able to place a PRINT statement for the select statement of Store_ID 1 so I can see the output.txt file and see the heading 'Store_id 1" then the inventory numbers, then see heading "Store_id 2" etc... in MSSQL SSMS it would like something like this PRINT 'Searching Inventory Discrepancies at Store 1' Select * from table1 where store_id = '1' etc... PRINT 'Searching Inventory Discrepancies at Store 2' Select * from table1 where store_id = '2' etc... If I need to clarify please advise, thank you!
Asked by Hector (1042 rep)
Jun 26, 2015, 02:52 PM
Last activity: Jun 14, 2022, 12:11 PM