-
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
-
what does a 'l' (list) at the sql prompt give u after u get the error ?
SQL> L
-
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
-
what does a 'l' (list) at the sql prompt give u after u get the error ?
Never give up !
Nanda Kumar - Vellore
-
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
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|