Home » SQL & PL/SQL » SQL & PL/SQL » select *, "app" as Status from tablename
select *, "app" as Status from tablename [message #317907] Sun, 04 May 2008 19:07 Go to next message
vasu4us
Messages: 3
Registered: May 2008
Junior Member
select *, "app" as Status from tablename
doesnot work error out saying from not found where expected.

any help iamnew to orcl.

thanks
Re: select *, "app" as Status from tablename [message #317908 is a reply to message #317907] Sun, 04 May 2008 19:13 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & FOLLOW posting guidelines as stated above

Re: select *, "app" as Status from tablename [message #317928 is a reply to message #317907] Mon, 05 May 2008 00:52 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Database SQL Reference
Chapter 2 Basic Elements of Oracle SQL
Section Literals

Regards
Michel
Re: select *, 'app' as Status from tablename [message #318059 is a reply to message #317907] Mon, 05 May 2008 08:43 Go to previous messageGo to next message
vasu4us
Messages: 3
Registered: May 2008
Junior Member
Thanks all,
Hi this is my first post and I am just learning the rules.

My query looks like this

SELECT * , 'REW' as TYPE_CD FROM table1;

looks simple but I am getting error.

Error starting at line 1 in command:
SELECT *, 'REW' as TYPE_CD FROM table1
Error at Command Line:1 Column:8
Error report:
SQL Error: ORA-00923: FROM keyword not found where expected
00923. 00000 - "FROM keyword not found where expected"
*Cause:
*Action:

Re: select *, 'app' as Status from tablename [message #318060 is a reply to message #318059] Mon, 05 May 2008 08:49 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
In the rule it is explain how to post and format.
Among this there is you have to copy and paste your session.
Use SQL*Plus for your test, it is easier.

Like:
SQL> select *, 'foo' as foo from emp;
select *, 'foo' as foo from emp
        *
ERROR at line 1:
ORA-00923: FROM keyword not found where expected

There we see what you exactly did and where is the error.
SQL> select emp.*, 'foo' as foo from emp;
     EMPNO ENAME      JOB              MGR HIREDATE          SAL       COMM     DEPTNO FOO
---------- ---------- --------- ---------- ---------- ---------- ---------- ---------- ---
      7369 SMITH      CLERK           7902 17/12/1980        800                    20 foo
      7499 ALLEN      SALESMAN        7698 20/02/1981       1600        300         30 foo
      7521 WARD       SALESMAN        7698 22/02/1981       1250        500         30 foo
      7566 JONES      MANAGER         7839 02/04/1981       2975                    20 foo
      7654 MARTIN     SALESMAN        7698 28/09/1981       1250       1400         30 foo
      7698 BLAKE      MANAGER         7839 01/05/1981       2850                    30 foo
      7782 CLARK      MANAGER         7839 09/06/1981       2450                    10 foo
      7788 SCOTT      ANALYST         7566 19/04/1987       3000                    20 foo
      7839 KING       PRESIDENT            17/11/1981       5000                    10 foo
      7844 TURNER     SALESMAN        7698 08/09/1981       1500          0         30 foo
      7876 ADAMS      CLERK           7788 23/05/1987       1100                    20 foo
      7900 JAMES      CLERK           7698 03/12/1981        950                    30 foo
      7902 FORD       ANALYST         7566 03/12/1981       3000                    20 foo
      7934 MILLER     CLERK           7782 23/01/1982       1300                    10 foo

14 rows selected.

Regards
Michel
Re: select *, "app" as Status from tablename [message #318077 is a reply to message #317907] Mon, 05 May 2008 09:17 Go to previous message
vasu4us
Messages: 3
Registered: May 2008
Junior Member
Thanks Michel, That was very quick.
Previous Topic: Update another table
Next Topic: DayLightSaving and TimeZone Conversion (merged)
Goto Forum:
  


Current Time: Thu Dec 08 20:23:44 CST 2016

Total time taken to generate the page: 0.30793 seconds