sqlplus

How do I Open a Stored Procedure and Edit it in SQL*Plus

I need to make some changes to an old Oracle stored procedure on an obsolete box that is being kept around to run an old legacy process. The only tool I can connect to the db with is SQL*Plus. How do I load a stored proc into memory for editing in SQL*Plus? The tutorials I've found on-line don't exlain how that's done. :-( ...

Oracle-sqlplus query

Hi All, I am giving a select statement in sqlplus,It is retreving the data but the column name is displayed every time after certain number of rows.I want column name to be displayed only once.For example- select emp_name from employee. output: emp_name ======== raman sunil rajesh dilip emp_name ======== rahul pramod ankita I...

Oracle-sqlplus

Hi All, I am using set colsep'|' in sqlplus.However,It appends the pipe(|) column-sperator in between two columns only not at the begining and the end of the column.Example-It give output like this- emp_name|emp_department|emp_salary I want the out put like this(Append "|") in the begning and end also: |emp_name|emp_department|emp_salar...

How do I set the window title for a SQL*Plus (Windows) instance?

I have multiple databases that I connect to using SQL*Plus in Windows (not the command window). I've been looking for a way to change the title of the window, so that I can distinguish one instance from another, from the task bar. Yes, I know I can change the prompt, but then I have to switch between the instances and read the prompt, ...

What is the Difference between SQL and SQL*Plus?

What is the Difference between SQL and SQL*Plus? ...

Oracle-SQLPLUS

Hi All, When I am spooling the record in the textpad it will fetch the record,However the first row is blank.It will dsplay the record from the 2nd line in textpad.Please suggest me how I can remove the first blank row.Ex-It is display record like this: first line is blank column1 column2 xyz abc I want to remove the first lin...

How to Execute an Orace SQL Statements with VBScript

...

Differences between SQL Plus and "regular" SQL?

I'm new to the Oracle Platform (having primarily used MySQL, with a little Postgres and SQL Server as well). I recently discovered the following statment DESC TABLE_NAME; will only work in the SQL*Plus tool I use to test my queries. It will NOT work when I use PHP's standard functions to connect to the oracle database. I need to us...

Webrick Very Slow When Accessing Applications From Remote Desktop

I have a rails application that I'm running on my server. When I go to a remote desktop and attempt to load the application, the server takes a good 3-4 minutes to respond with a simple html page. However, when I load up the page locally on the server, the page shows up in just a second. I tried pinging the server from my remote desktop ...

SQLPlus variable definition

I want to do this in SQLPlus: define a file which contains today's date in its name and spool off the output of a SQL statement to that file. I know how to spool the output of an SQL statement to a file. Just don't know how to declare the file name as a variable containing today's date. For example, select all the rows with today's time...

problem with oracle sqlplus with whitespace in the path of the @ command

I'm running Oracle 11g on Linux and I'm trying to run a script which will create my database. This script runs fine on windows, but when I test it on Linux, I get the following error: SP2-0556: Invalid File Name The problem may be that the path to the file name has a space in it. I'm going to simplify the problem down to one of the ...

How do I get SQL*Plus to create views / tables with a blank line in the middle of the create statement?

I wish to create some views using SQL*Plus via script, but seem to hit a problem if a developer has placed a blank line mid statement. The following statement works fine in TOAD / PL/SQL developer etc, but fails in SQL*Plus. (This is usually scripted, but entering it manually gives exactly the same error) Can anyone tell me why / how ...

Oracle UPDATEs to Certain Table Hang Indefinitely

I can update some tables just fine, but a certain table I have cannot be updated by either my ASP.NET application or SQLPLUS. Both hang indefinitely. I have to forcibly quit SQLPLUS. I have update statments both in standard OracleCommand objects running a: cmd.ExecuteNonQuery(); but I also have asp:SqlDataSources bound to a GridVie...

Oracle: Set NLS_PARAMETERS with sqlplus

I found out my servers, running Oracle 10g, were not initializing with the same NLS_SORT value when using the sqlplus binary. Is there a way to set the default NLS_SESSION_PARAMETERS for every instance of sqlplus? PS: The idea is not to do an ALTER SESSION at the beginning of every sql script. ...

How do I run PL/SQL code within SQLPlus?

I am trying to run the following code within SQLPlus: exec lbacsys.sa_sysdba.create_policy(policy_name => 'ACCESS_LOCATIONS', column_name => 'OLS_COLUMN', default_options => 'READ_CONTROL,INSERT_CONTROL,UPDATE_CONTROL,DELETE_CONTROL,LABEL_DEFAULT,LABEL_UPDATE,CH...

Display Dynamic EXECUTE Output Within pl/sql From sqlplus

How to get the dynamic select results of EXECUTE within pl/sql from Oracle sqlplus? I'm writing a simple sqlplus script to collect the sum of all NUMBER columns of a given table -- SET SERVEROUTPUT ON DECLARE CURSOR column_cur IS SELECT column_name FROM ALL_TAB_COLS WHERE owner = '&scheme_name' ...

Why does SQL*Plus commit on exit?

Surely this should be the same as a termination of a session and cause a rollback? It seems to me to be the most un-Oracle thing possible. I was actually shocked when I found out that it did this More importantly - would anyone object if Oracle changed it to rollback on exit? ...

How do I capture a SQLPlus exit code within a shell script?

I have a korn shell script that is login into sqlplus and executing a script. Within the shell script I would like to capture the status code of the sql statement that was executed. Currently there is an error with sql I'm unable to capture it by checking $?. How would I capture the success or error code from the sql statement and pass...

Favorite SQLPLUS tips and tricks

So many times I just need a quick connection to an Oracle DB, where SQLPLUS handles the job. I imagine when people start using Oracle, the first thing they are told to do is to install Toad or SQLDeveloper. Even so, sometimes you don't want to wait for those tools to load, if you are performing some simple queries. I have a script tha...

Oracle Sqlplus Problem on Mac OSX Snow Leopard

I just installed the Oracle Instant Client for Mac OSX with the SQLPlus extension and have the following problem. I can connect to a database instance and schema and I can do queries but when I try the "describe command" it just hangs. For example: SQL> SELECT COUNT(*) FROM APPROVABLETAB; COUNT(*) ---------- 8 SQL> desc APPROVABLE...