How many of you wanted to get xml output from oracle quickly.. well here is a smiple way
SET LONG 100000;
select xmlgen.getxml(‘select * from scott.emp’/*your query should be here*/) from dual;
To get the schema also you can pass the parameter to the getXMl file like this
xmlgen.getxml(‘select * from scott.emp’/*your query should be here*/,2) from dual;
But to get the cheese you should refer to this ..
Quite a good competition to the claim of XML support in MS SQL server.
Now when unlike SQL server, filling datasets were a little different on Oracle Stored Procedures.
For starters lets define and procedure.
The sys_refcursor is an object in Oracle 9i that would be used to fill the dataset.
OR REPLACE PROCEDURE sp_getItems (
p_refcursor OUT sys_refcursor,
SELECT itemid FROM itemmas;
From now on calling the procedure would be the same.
OrCmd.CommandText = “sp_getItems”
OrCmd.CommandType = CommandType.StoredProcedure
OrCmd.Parameters.Add(new OracleParameter(“rc”,OracleType.Cursor)).Direction = ParameterDirection.Output
Now just a tip for testing the sp in SQL+ is as follow
SQL> var rc refcursor;
SQL> exec sp_getItems(:rc);
SQL> print rc;
Why doesnt oracle support boolean ? PL/SQL has boolean type.. but the RDBMS doesnt… Funny isint it .. the standard way on many websites is to use a wrapper.. even after all this cant this be implemented Or is there any other reason? line link i came across… on oreview.. http://www.oreview.com/9703plsq.htm