db2_exec

PECL ibm_db2 >= 1.0.0
db2_exec - Executes an SQL statement directly
Manual
Code Examples

Example #1 Creating a table with db2_exec

Result: Successfully created the table. Insert... Insert... Insert... Insert... Insert... Insert... Insert...
PHP Version:

Example #2 Executing a SELECT statement with a scrollable cursor

Result: Bubbles Gizmo Pook Rickety Ride
PHP Version:

Example #3 Returning XML data as an SQL ResultSet

Result: 1000 Kathy Smith 416-555-1358 1001 Kathy Smith 905-555-7258
PHP Version:

Example #4 Performing a "JOIN" with XML data

Result: 1001 Kathy Smith 905-555-7258 5002 Shipped
PHP Version:

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>
PHP Version: