Home » SQL & PL/SQL » SQL & PL/SQL » problem with set operator
problem with set operator [message #7611] Tue, 24 June 2003 22:34 Go to next message
sri
Messages: 154
Registered: February 2000
Senior Member
hi ,
this is sri. Can any one slove this problem. when i am running this script, i am getting this error

set pagesize 37
*
ERROR at line 1:
ORA-00922: missing or invalid option

THIS IS THE SCRIPT:
set pagesize 37
set linesize 60
set feedback off
TTITLA 'EMPLOYEE&#124REPORT'
BTITLE 'CONFIDENTIAL'
BREAK ON JOB
COLUMN JOB HEADING 'JOB&#124CATEGORY' FORMAT A15
COLUMN ENAME HEADING 'EMPLOYEE' FORMAT A15
COLUMN SAL HEADING 'SALARY' FORMAT $99,999.99
REM ** INSERT SELECT STATEMENT
select job,ename,sal from emp where sal<3000
ORDER BY JOB,ENAME
/
SET FEEDBACK ON
REM CLEAR ALL FORMATTING COMMANDS ..

THANK U
SRI
Re: problem with set operator [message #7628 is a reply to message #7611] Wed, 25 June 2003 10:02 Go to previous messageGo to next message
Art Metzer
Messages: 2480
Registered: December 2002
Senior Member
Sri,

Could it be because of the typographical error in your original post? In the script that you had posted, you'd listed the command as TTITLA instead of as TTITLE.

The following script works on my machine:
SQL> set pagesize 37
SQL> set linesize 60
SQL> set feedback off
SQL> TTITLE 'EMPLOYEE&#124REPORT'
SQL> BTITLE 'CONFIDENTIAL'
SQL> BREAK ON JOB
SQL> COLUMN JOB HEADING 'JOB&#124CATEGORY' FORMAT A15
SQL> COLUMN ENAME HEADING 'EMPLOYEE' FORMAT A15
SQL> COLUMN SAL HEADING 'SALARY' FORMAT $99,999.99
SQL> REM ** INSERT SELECT STATEMENT
SQL> select job,ename,sal from emp where sal<3000
  2  ORDER BY JOB,ENAME
  3  /
  
Wed Jun 25                                         page    1
                          EMPLOYEE
                           REPORT
  
JOB
CATEGORY        EMPLOYEE             SALARY
--------------- --------------- -----------
CLERK           ADAMS             $1,100.00
                JAMES               $950.00
                MILLER            $1,300.00
                SMITH               $800.00
MANAGER         BLAKE             $2,850.00
                CLARK             $2,450.00
                JONES             $2,975.00
SALESMAN        ALLEN             $1,600.00
                MARTIN            $1,250.00
                TURNER            $1,500.00
                WARD              $1,250.00
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
                        CONFIDENTIAL
SQL> SET FEEDBACK ON
SQL> REM CLEAR ALL FORMATTING COMMANDS ..
SQL>   
Good luck,

Art
Re: problem with set operator [message #7630 is a reply to message #7628] Wed, 25 June 2003 12:35 Go to previous messageGo to next message
sri
Messages: 154
Registered: February 2000
Senior Member
Hi Art,

Thanks for reply. But i am facing another problem. Can u please solve this.
The error is

set feedback on
*
ERROR at line 4:
ORA-00936: missing expression

This is the Script:

set pagesize 37
set linesize 60
set feedback off
TTITLE 'EMPLOYEE&#124REPORT'
BTITLE 'CONFIDENTIAL'
BREAK ON JOB
COLUMN JOB HEADING 'JOB&#124CATEGORY' FORMAT A15
COLUMN ENAME HEADING 'EMPLOYEE' FORMAT A15
COLUMN SAL HEADING 'SALARY' FORMAT $99,999.99
REM ** INSERT SELECT STATEMENT
select job,ename,sal from emp where sal<3000
ORDER BY JOB,ENAME
/
set feedback on
REM CLEAR ALL FORMATTING COMMANDS..

Thank you

Sri
Re: problem with set operator [message #7631 is a reply to message #7630] Wed, 25 June 2003 13:08 Go to previous messageGo to next message
Art Metzer
Messages: 2480
Registered: December 2002
Senior Member
I have no problem running the script you have provided.

What version of Oracle are you using?

What is the name of your script?

How are you executing your script?

Art
Re: problem with set operator [message #7632 is a reply to message #7631] Wed, 25 June 2003 13:22 Go to previous messageGo to next message
sri
Messages: 154
Registered: February 2000
Senior Member
My version is Oracle8. And the script name is b1.sql.
I am executing with START b1.sql

Sri
Re: problem with set operator [message #7635 is a reply to message #7611] Thu, 26 June 2003 00:19 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Possible causes:
1. There's an unprintable character before the first command.
2. The command is interpreted as an SQL command and not an SQL*Plus command. You are running the script through SQL*Plus, right? I can force the error in SQL*Plus by editing an sql command and adding the "set" command. This causes sql*plus to interpret the error as an SQL and not an SQL*Plus error. In SQL*Nav, I can provoke the error in a similar way.

MHE
Previous Topic: Interacting between PL/SQL code and GUI - Help
Next Topic: Help from OCP's
Goto Forum:
  


Current Time: Sat Apr 20 02:51:30 CDT 2024