Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2002
    Posts
    2

    Cool Unanswered: 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;

  2. #2
    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


    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;

Posting Permissions

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