If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > OraOLEDB.Oracle :: Retreiving database columns containing spaces

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-15-02, 08:29
blackbee blackbee is offline
Registered User
 
Join Date: Apr 2002
Posts: 2
Cool OraOLEDB.Oracle :: Retreiving database columns containing spaces

Hi *

I've got a table on an Oracle 8i database.
This table contains several column names which are defined
with spaces

ex. "my salary"

I connect through OraOLEDB.Oracle provider on my ASP pages.
How do I retreive data from such coulmns which are defined with space.


SQLTemp = "select ""my salary"" from MYTable"
Set rsGlob=Conn_fie.Execute(SQLTemp)
Do While NOT rsGlob.EOF
Response.Write rsGlob("my salary")
rsGlob.MoveNext
Loop

OraOLEDB.Oracle report... ORA-00904: invalid column name

NOTE*
Everything works fine in SQL Plus.
ex.
select "my salry" from MyTable;
Reply With Quote
  #2 (permalink)  
Old 03-05-03, 12:08
8xD 8xD is offline
Registered User
 
Join Date: Mar 2003
Posts: 1
Re: OraOLEDB.Oracle :: Retreiving database columns containing spaces

I see this question is pretty old but just incase..

Try aliasing the column ..

SQLTemp = "Select "my Salary" MySalary From MYTable

Set rsGlob=Conn_fie.Execute(SQLTemp)
Do While NOT rsGlob.EOF
Response.Write rsGlob("MySalary")
rsGlob.MoveNext
Loop


Quote:
Originally posted by blackbee
Hi *

I've got a table on an Oracle 8i database.
This table contains several column names which are defined
with spaces

ex. "my salary"

I connect through OraOLEDB.Oracle provider on my ASP pages.
How do I retreive data from such coulmns which are defined with space.


SQLTemp = "select ""my salary"" from MYTable"
Set rsGlob=Conn_fie.Execute(SQLTemp)
Do While NOT rsGlob.EOF
Response.Write rsGlob("my salary")
rsGlob.MoveNext
Loop

OraOLEDB.Oracle report... ORA-00904: invalid column name

NOTE*
Everything works fine in SQL Plus.
ex.
select "my salry" from MyTable;
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On