db2_exec
PECL ibm_db2 >= 1.0.0
db2_exec - Executes an SQL statement directly
Example #1 Creating a table with db2_exec
Result: Successfully created the table.
Insert... Insert... Insert... Insert... Insert... Insert... Insert...
Example #2 Executing a SELECT statement with a scrollable cursor
Result: Bubbles
Gizmo
Pook
Rickety Ride
Example #3 Returning XML data as an SQL ResultSet
Result: 1000 Kathy Smith 416-555-1358
1001 Kathy Smith 905-555-7258
Example #4 Performing a "JOIN" with XML data
Result: 1001 Kathy Smith 905-555-7258 5002 Shipped
Example #5 Returning SQL data as part of a larger XML document
Result: <promoList xmlns="http://posample.org">
<promoitem>
<product pid="100-100-01">
<description>
<name>Snow Shovel, Basic 22 inch</name>
<details>Basic Snow Shovel, 22 inches wide, straight handle with D-Grip</details>
<price>9.99</price>
<weight>1 kg</weight>
</description>
</product>
<startdate>2004-11-19</startdate>
<enddate>2004-12-19</enddate>
<promoprice>7.25</promoprice>
</promoitem>
</promoList>