DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Throw some light !

  1. #1
    Join Date
    May 2002
    Posts
    108

    Throw some light !

    Hi All,

    When I was writing a query accidentally I missed the 'SELECT' statement in the query but was surprised Oracle didn't report any error, neither any results. Then I tried all the following, none of them reports any error. How does the parser treat this? Looks like it is ignored in SQL*Plus itself?(The query doesn't seem to be submitted even though it is terminated with a semi colon.A '/' after all these statements however throws an error). Any thoughts?

    11:51:40 SQL> * from emp;
    11:51:52 SQL> *
    Invalid line number
    11:51:57 SQL> * from ;
    11:52:03 SQL> * from
    11:52:09 SQL> * from emp where empno= 7128;
    11:52:30 SQL>
    11:52:30 SQL> * from emp a, dept b where a.deptno = b.deptno;
    11:56:07 SQL>

    12:03:25 SQL> * from emp;
    12:03:50 SQL> /
    from emp
    *
    ERROR at line 1:
    ORA-00900: invalid SQL statement

    Nandu
    Never give up !

    Nanda Kumar - Vellore

  2. #2
    Join Date
    Sep 2000
    Location
    Chennai, India
    Posts
    865
    what does a 'l' (list) at the sql prompt give u after u get the error ?

    SQL> L

  3. #3
    Join Date
    Sep 2000
    Location
    Chennai, India
    Posts
    865

    TST: SYS>
    TST: SYS> * from emp;
    TST: SYS> * from ;
    TST: SYS> * from
    TST: SYS> * from emp where empno=7128;
    TST: SYS> * from emp a, dept b where a.deptno = b.deptno;
    TST: SYS> * from emp;
    TST: SYS> /
    from emp
    *
    ERROR at line 1:
    ORA-00900: invalid SQL statement


    TST: SYS> l
    1 from emp
    2 from emp a, dept b where a.deptno = b.deptno
    3 from emp where empno=7128
    4 from
    5 from
    6* from emp

    TST: SYS>
    Now, what is your conclusion?

    HTH

  4. #4
    Join Date
    May 2002
    Posts
    108

    what does a 'l' (list) at the sql prompt give u after u get the error ?

    SQL> list
    1* from emp
    Never give up !

    Nanda Kumar - Vellore

  5. #5
    Join Date
    Nov 2002
    Location
    Dublin, Ireland
    Posts
    133
    I had this once and I still do sm times...
    if you missed the 'SELECT' statement then type "* select *" ...fire, list and fire

    SQL>* from emp ;
    SQL>l
    1* from emp
    SQL>* select *
    SQL>l
    1 select *
    2* from emp
    SQL>/

    HTH
    Giani

  6. #6
    Join Date
    May 2002
    Posts
    108
    Thats cool Giani. It works.

    What ever we type after '*' seems to get added before the first line of the LIST. Is that a known command or an undocumented feature of SQL*plus ?!
    Never give up !

    Nanda Kumar - Vellore

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width