1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

set xmlnode usin oracle9i

Discussion in 'SQL PL/SQL' started by nrupa, Apr 16, 2012.

  1. nrupa

    nrupa Active Member

    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    90
    I am using xml element in my query as follows

    SELECT XMLELEMENT("name", e.ename) AS employee
    FROM emp e
    WHERE e.empno = 1;

    and I am getting following error

    Error starting at line 1 in command:
    SELECT XMLELEMENT("name", e.ename) AS employee
    FROM emp e
    WHERE e.empno = 1
    Error at Command Line:1 Column:7
    Error report:
    SQL Error: ORA-00904: invalid column name
    00904. 00000 - "%s: invalid identifier"

    if there any other way to set xmlnode using oracle9i

    it's urgent please help me out

    Thank you in advance
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,346
    Likes Received:
    347
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    It appears that the "" are the problem; use this instead:

    SELECT XMLELEMENT('name', e.ename) AS employee
    FROM emp e
    WHERE e.empno = 1;
     
  3. rajavu

    rajavu Forum Guru

    Messages:
    815
    Likes Received:
    52
    Trophy Points:
    610
    Location:
    @ Bangalore , India
    Which version of Oracle 9i you are using ? Oracle 9i Release 1 doesn't support the XMLTYPE. XMLTYPE is supported from Oracle 9i Release 2.