Is it possible to set the server output only into the spool file and not in the shell ? Inside MY_PROCEDURE I have this : I would like to put Hello World only in log.txt, not in the screen shell. Answer Simplest way is to pipe the unix output to /dev/null
Tag: sqlplus
Using SQL*Plus from command line
I have a small vbscript to load data and process it using sqlldr and sqlplus. I have 2 questions about sqlplus usage though: 1) Can I exec a stored procedure without using an .sql script file? e.g. sqlplus user/pass@server @exec proc_myname 2) Can I use .sql script files on a shared UNC path? e.g. sqlplus user/pass@server @serverpathscript.sql I’ve tried playing
How to get the employees with their managers
This is what I want the output to look like: Employee Emp# Manager Mgr# BLAKE 7698 KING 7839 CLARK 7782 KING 7839 JONES 7566 KING 7839 MARTIN 7654 BLAKE 7698 …
How can I see the contents of an Oracle index?
Is it possible to have a look at what is there inside an index using SQL*Plus? If I have a table like this: Table A ———————— rowid | id name 123 | 1 A 124 | 4 G 125 …
Force index use in Oracle
I encountered this question in an interview and had no clue how to answer: There is a table which has a index on a column, and you query: The query takes too long, and you find out that the index is not being used. If you think the performance of the query will be better using the index, how could
Displaying the constraints in a table
Hello I am trying to display the constraints in one of my tables but for some reason I get the message no rows selected. Noted below is the table I have created. This is the code I am using to show my constraints. I am a rookie so I want to make sure I understand what is wrong. I have
How do I spool to a CSV formatted file using SQLPLUS?
I want to extract some queries to a CSV output format. Unfortunately, I can’t use any fancy SQL client or any language to do it. I must use SQLPLUS. How do I do it?