بتاريخ: 14 نوفمبر 200619 سنة comment_82874 i want to make xmlfile from databaselike in emp tablei want to to take the data and convert it to xml تقديم بلاغ
بتاريخ: 15 نوفمبر 200619 سنة comment_82908 i want to make xmlfile from databaselike in emp tablei want to to take the data and convert it to xml82874[/snapback] Hi fishyou can do select xmlelement("Employees", xmlagg(xmlelement("emp", xmlforest(EMPNO,ENAME, JOB,MGR,HIREDATE))))from emp;or SQL> SET AUTOPRINT ONSQL> SET LONG 100000SQL> VAR result CLOBSQL> DECLARE qryCtx DBMS_XMLGEN.CTXHANDLE;BEGIN qryCtx := DBMS_XMLGEN.NEWCONTEXT('SELECT employee_id AS "@id", first_name AS "FirstName", last_name AS "LastName", email AS "Email", phone_number AS "Phone" FROM employees WHERE salary > 20000'); DBMS_XMLGEN.SETROWSETTAG(qryCtx,'EMPLOYEES'); DBMS_XMLGEN.SETROWTAG(qryCtx,'EMPLOYEE'); :result := DBMS_XMLGEN.GETXML(qryCtx); DBMS_XMLGEN.CLOSECONTEXT(qryCtx);END; تقديم بلاغ
بتاريخ: 15 نوفمبر 200619 سنة كاتب الموضوع comment_82943 thanks alotwe can usexmlagg -- xmlelement --xmlforestand the link discuss how to put in filehttp://www.oracle-base.com/articles/9i/XMLGeneration9i.php تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.