Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
SQL/XML Presentation Scripts

SQL/XML Presentation Scripts



|Views: 550|Likes:
Published by Lewis Cunningham
SQL to follow along with the presentation at: http://www.scribd.com/doc/2402063/SQLXML-For-Postgres-Developers
SQL to follow along with the presentation at: http://www.scribd.com/doc/2402063/SQLXML-For-Postgres-Developers

More info:

Published by: Lewis Cunningham on Mar 30, 2008
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less





SQL to follow along with the presentation at:http://www.scribd.com/doc/2402063/SQLXML-For-Postgres-DevelopersSlide 25CREATE TABLE EMP(LAST_NAME text,EMP_ID integer NOT NULL,FIRST_NAME text,DEPT_ID integer,SALARY integer,CONSTRAINT EMP_pkey PRIMARY KEY (EMP_ID))WITH (OIDS=FALSE);ALTER TABLE EMP OWNER TO xmluser;Slide 26INSERT INTOEMP(LAST_NAME, EMP_ID, FIRST_NAME, DEPT_ID, SALARY)VALUES('Blow', 1, 'Joe', 1, 10000),('Head', 2, 'Helmut', 1, 12000),('Jack', 3, 'Noe', 1, 12000),('Hard', 4, 'Blow', 2, 20000),('First', 5, 'Hugo', 2, 21000),('Spaem',6, 'Kingoof', 2, 20000),('Ventura', 7, 'Ace', 3, 35000),('Nickleby', 8, 'Nick', 3, 400000),('Budd', 9, 'Billy', 4, 99000),('Cleaver', 10, 'Wally', 4, 100000) ;Slide 29SELECT xmlelement(name main, last_name) from emp;Slide 30SELECT xmlelement(name main, last_name),xmlelement(name main, first_name)FROM emp;Slide 31SELECT XMLForest(last_name, first_name)FROM emp;Slide 32SELECT xmlelement(name main,xmlforest(last_name, first_name) )FROM emp;
Slide 33SELECT XMLAgg(XMLForest(last_name, first_name) )FROM emp;Slide 34SELECT XMLElement(name main,XMLAgg(XMLForest(last_name, first_name) ))FROM emp;Slide 35SELECT XMLElement(name main, XMLAttributes(nextval('t_seq') AS rownum) )FROM emp;Slide 36CREATE TEMP SEQUENCE t_seq;SELECT xmlelement(name main, xmlattributes(nextval('t_seq') AS rownum),xmlforest(last_name, first_name) )FROM emp;DROP SEQUENCE t_seq;Slide 38SELECT xmlelement(name main,xmlforest(last_name || first_name AS fullname, salary) )FROM emp;Slide 39SELECT xmlelement(name main,xmlelement(name fullname, xmlattributes(dept_id), last_name ||first_name ),xmlforest(salary) )FROM emp;Slide 40SELECT xmlelement(name main, xmlcomment('Each Name Goes Here'),xmlforest(last_name, first_name))FROM emp;Slide 41SELECT xmlelement(name lastname, last_name),xmlelement(name firstname, first_name)

Activity (5)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
jayavardhankoti liked this
son liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->