From oracle-l-bounce@freelists.org Tue Sep 20 09:06:09 2005 Return-Path: Received: from air891.startdedicated.com (root@localhost) by orafaq.com (8.12.10/8.12.10) with ESMTP id j8KE69H3028560 for ; Tue, 20 Sep 2005 09:06:09 -0500 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air891.startdedicated.com (8.12.10/8.12.10) with ESMTP id j8KE5u6H028524 for ; Tue, 20 Sep 2005 09:05:57 -0500 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 14D881EE9E9; Tue, 20 Sep 2005 09:01:33 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08736-01; Tue, 20 Sep 2005 09:01:32 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7B75A1EEE8D; Tue, 20 Sep 2005 09:01:32 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C5BDEB.7E752483" Subject: XML Question Date: Tue, 20 Sep 2005 09:59:17 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: XML Question Thread-Index: AcW9633pNoSF9qHeRaOgpxRIiLfrsQ== From: "Davey, Alan" To: X-OriginalArrivalTime: 20 Sep 2005 13:59:19.0073 (UTC) FILETIME=[7EB5B910:01C5BDEB] X-archive-position: 25669 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: ddavey@harris.com Precedence: normal Reply-To: ddavey@harris.com X-list: oracle-l X-Virus-Scanned: by amavisd-new-20030616-p9 (Debian) at avenirtech.net X-mailscan-MailScanner-Information: Please contact the ISP for more information X-mailscan-MailScanner: Found to be clean X-MailScanner-From: oracle-l-bounce@freelists.org X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on air891.startdedicated.com X-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=ham version=2.63 ------_=_NextPart_001_01C5BDEB.7E752483 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I have a pl/sql routine that is generating XML data. When calling function xmlelement(), I want to supply a variable as the first parameter. However, Oracle (v10.1.0.4 on windows) takes the parameter name (not its value) and uses it as the element name as the following example shows: Wrote file afiedt.buf 1 declare 2 cName constant varchar2(4) :=3D 'Name'; 3 l_xml xmltype; 4 begin 5 select xmlelement(cName,'Larry') 6 into l_xml 7 from dual; 8 dbms_output.put_line(l_xml.getCLOBVal()); 9* end; adavey@EASDEV> / Larry PL/SQL procedure successfully completed. If you replace cName with xyz (no quotes), Oracle runs the pl/sql and uses as the element tag name. Every example that I see in the FM is using a literal string for the element name. Is it possible to use a variable name for this parameter? If not, is this just an oversight on the part of Oracle? =20 Thanks, ------------------------------- Alan Davey Senior Programmer/Analyst, Advertising Solutions Oracle 9i OCA; 3/4 OCP Harris Corporation w) 212-295-3458 ------_=_NextPart_001_01C5BDEB.7E752483 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable XML Question

Hi,

I have a pl/sql routine that is = generating XML data.  When calling function xmlelement(), I want to = supply a variable as the first parameter.  However, Oracle = (v10.1.0.4 on windows) takes the parameter name (not its value) and uses = it as the element name as the following example shows:

Wrote file afiedt.buf

  1  declare
  2  cName constant = varchar2(4) :=3D 'Name';
  3  l_xml xmltype;
  4  begin
  5    select = xmlelement(cName,'Larry')
  6    into = l_xml
  7    from = dual;
  8    = dbms_output.put_line(l_xml.getCLOBVal());
  9* end;
adavey@EASDEV> /
<CNAME>Larry</CNAME>

PL/SQL procedure successfully = completed.

If you replace cName with xyz (no = quotes), Oracle runs the pl/sql and uses <xyz> as the element tag = name.  Every example that I see in the FM is using a literal string = for the element name.  Is it possible to use a variable name for = this parameter?  If not, is this just an oversight on the part of = Oracle? 

Thanks,
-------------------------------
Alan Davey
Senior Programmer/Analyst, = Advertising Solutions
Oracle 9i OCA; 3/4 OCP
Harris Corporation
w) 212-295-3458


------_=_NextPart_001_01C5BDEB.7E752483-- -- http://www.freelists.org/webpage/oracle-l