Home » SQL & PL/SQL » SQL & PL/SQL » syntax doubt
syntax doubt [message #242202] Fri, 01 June 2007 01:07 Go to next message
rajalakshmi
Messages: 5
Registered: May 2007
Junior Member
I have data in oracle database.I need to report the tables in asp.net application.
In my asp page when i run a query like "select name as "emp name" from empoyee" following error is occuring.
ORA00923 from keyword not found where expected.
so i gave like this
"select name as emp name from empoyee".This also causing compilation error.
How i have to enclose the alias name?
i tried for different combinations.not found correct answer.
using .net framework 2.0 and orace 10g express edition.
plz reply

Re: syntax doubt [message #242204 is a reply to message #242202] Fri, 01 June 2007 01:16 Go to previous messageGo to next message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select ename as "emp name" from emp;
emp name
----------
SMITH
ALLEN
WARD
JONES
MARTIN
BLAKE
CLARK
SCOTT
KING
TURNER
ADAMS
JAMES
FORD
MILLER

14 rows selected.

Works for me.
This is not a SQL problem. Have a look at how you assign your variable in your code.

Regards
Michel
Re: syntax doubt [message #242210 is a reply to message #242202] Fri, 01 June 2007 01:36 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
If you use double quotes (") surrounding your statement, you have to somehow escape the double quotes you use for the alias. This is an ASP thing, not an Oracle thing.
Previous Topic: bulk collect & delete
Next Topic: PLS-00364 while creating a procedure
Goto Forum:
  


Current Time: Sun Dec 11 04:13:36 CST 2016

Total time taken to generate the page: 0.19690 seconds