Create xml attribute with xmlattribute function : xmlattribute « XML « Oracle PL/SQL Tutorial






SQL> CREATE TABLE products(
  2    product_id              NUMBER(6),
  3    name            VARCHAR2(50),
  4    category        VARCHAR2(50),
  5    price      NUMBER(8,2),
  6    min_price       NUMBER(8,2)
  7  );

Table created.

SQL>
SQL> select xmlelement( "Product",xmlattributes(p.product_id,p.name as "Name"),xmlforest(p.category as "Category",p.price as "price"))
  2  from products p;

no rows selected

SQL>
SQL> drop table products;

Table dropped.

SQL>
SQL>








33.10.xmlattribute
33.10.1.Create xml attribute with xmlattribute function
33.10.2.Must use 'a single-group group function' with xmlattribute