<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog.mycado.fr &#187; IBM DB2</title>
	<atom:link href="http://blog.mycado.fr/category/ibmdb2/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mycado.fr</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 28 Oct 2009 12:21:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DB2 Data compression</title>
		<link>http://blog.mycado.fr/2009/09/db2-data-compression/</link>
		<comments>http://blog.mycado.fr/2009/09/db2-data-compression/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 14:36:59 +0000</pubDate>
		<dc:creator>Stéphane Journot</dc:creator>
				<category><![CDATA[IBM DB2]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[DB2]]></category>

		<guid isPermaLink="false">http://blog.mycado.fr/?p=213</guid>
		<description><![CDATA[Disk storage is not cheaper, take place, make noise, so, for large warehouses (or huge volumes database), the cost of the storage become important. IBM DB2 have a solution, with the data compression named &#8220;Venom&#8221; technology, reducing storage requirements, improving I/O, and providing quicker data access from the disk.
DB2 uses a dictionary based algorithm for [...]]]></description>
			<content:encoded><![CDATA[<p>Disk storage is not cheaper, take place, make noise, so, for large warehouses (or huge volumes database), the cost of the storage become important. IBM DB2 have a solution, with the data compression named &#8220;Venom&#8221; technology, reducing storage requirements, improving I/O, and providing quicker data access from the disk.</p>
<p>DB2 uses a dictionary based algorithm for compressing data records. DB2 9 will scan tables, and search for duplicate occurrences, then assign a short numeric key to each entries. You will understand better with a picture:</p>
<div id="attachment_216" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-216" title="db2compressdata" src="http://blog.mycado.fr/wp-content/uploads/2009/09/db2compressdata.png" alt="Compress data " width="500" height="200" /><p class="wp-caption-text">Compress data </p></div>
<p>Each new occurences of &#8220;Sophie&#8221;, &#8220;New York&#8221;, &#8220;IBM US&#8221;, will be respectively assign to &#8220;(01)&#8221;, &#8220;(19)&#8221; and &#8220;(09)&#8221;. This is very useful on large table. Each time a new row is added to the table, DB2 will automatically compress these new data.</p>
<p>Seems to be good, let&#8217;s try on our DB2 now. To enable the compression,  we should turn on the &#8220;COMPRESS&#8221; option on the table.</p>
<pre>CREATE TABLE Users COMPRESS YES</pre>
<p>or use alter if the table is already created:</p>
<pre>ALTER TABLE Users COMPRESS YES</pre>
<p>Typically, we can save an average ratio of 45 to 75 percent of our storage space. Next time, we&#8217;ll see how to use the inspect tool, to determine the compression ratio.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mycado.fr/2009/09/db2-data-compression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customize your DB2 CLP prompt</title>
		<link>http://blog.mycado.fr/2009/09/customize-your-db2-clp-prompt/</link>
		<comments>http://blog.mycado.fr/2009/09/customize-your-db2-clp-prompt/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 04:59:14 +0000</pubDate>
		<dc:creator>Stéphane Journot</dc:creator>
				<category><![CDATA[IBM DB2]]></category>
		<category><![CDATA[CLP]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[db2set]]></category>
		<category><![CDATA[prompt]]></category>

		<guid isPermaLink="false">http://blog.mycado.fr/?p=194</guid>
		<description><![CDATA[You have a nice DB2 CLP prompt, looks like &#8220;db2&#62;&#8221;, but you want more, you want a efficient prompt. It is possible with DB2 to add or modify your CLP ! DB2 have a registry variable named DB2_CLPPROMPT which allows us to define the prompt to be used in the CLP interactive mode.
To define this [...]]]></description>
			<content:encoded><![CDATA[<p>You have a nice DB2 CLP prompt, looks like &#8220;db2&gt;&#8221;, but you want more, you want a efficient prompt. It is possible with DB2 to add or modify your CLP ! DB2 have a registry variable named DB2_CLPPROMPT which allows us to define the prompt to be used in the CLP interactive mode.</p>
<p>To define this variable, let&#8217;s use the DB2set command:</p>
<pre>Db2set DB2_CLPPROMPT="db2isgreat&gt; "</pre>
<p>Our new DB2 Prompt will be &#8220;<strong>db2isgreat&gt;</strong> &#8220;. It&#8217;s much more better, but we can do more. DB2_CLPPROMPT registry variable can contain the tokens %n, %ia, %d, %da and %i:</p>
<ul>
<li><strong>%n</strong> &#8211; New line</li>
<li><strong>%ia</strong> &#8211; Authorization ID of the current instance attachment</li>
<li><strong>%d</strong> &#8211; Local alias of the currently connected database</li>
<li><strong>%da</strong> &#8211; Authorization ID of the current database connection</li>
<li><strong>%i</strong> &#8211; Local alias of the currently attached instance</li>
</ul>
<p>Now, let&#8217;s try with these tokens:</p>
<pre>Db2set DB2_CLPPROMPT="%ia@%i, %da@%d&gt; "</pre>
<p>With an instance attachment to instance &#8220;DB2&#8243; with authorization ID &#8220;mycado&#8221;. Database &#8220;sample&#8221; with authorization ID &#8220;mycadoax&#8221;, will return something like:</p>
<pre>MYCADO@DB2, MYCADOAX@SAMPLE &gt;</pre>
<p>You can now everytime where you are, and one which instance/database you&#8217;re working on.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mycado.fr/2009/09/customize-your-db2-clp-prompt/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Terminology mapping between Oracle and DB2</title>
		<link>http://blog.mycado.fr/2009/08/terminology-mapping-between-oracle-and-db2/</link>
		<comments>http://blog.mycado.fr/2009/08/terminology-mapping-between-oracle-and-db2/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 12:25:53 +0000</pubDate>
		<dc:creator>Stéphane Journot</dc:creator>
				<category><![CDATA[IBM DB2]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://blog.mycado.fr/?p=165</guid>
		<description><![CDATA[For people wants move from Oracle to DB2, this a little terminology mapping:



Oracle
DB2


Instance
Instance


Redo logs
Logs files


Statement cache
Package cache


Datafiles
DMS containers


Data cache
Buffer pools


Data dictionary
System catalog


Datafiles
Containers


Segments
Objects


Data blocks
Pages


Database Link
Federated System



And also, some useful mapping between Oracle and DB2 products:



Oracle
DB2


Oracle EE
DB2 Entreprise


Oracle Gateway
DB2 Connect


SQL *PLUS
DB2 CLP / DB2 CLP PLUS


PL/SQL
SQL Procedural Language



You should also take care of the &#8220;package&#8221; term. For [...]]]></description>
			<content:encoded><![CDATA[<p>For people wants move from Oracle to DB2, this a little terminology mapping:</p>
<table style="height: 44px;" border="1" width="220">
<tbody>
<tr>
<td><strong>Oracle</strong></td>
<td><strong>DB2</strong></td>
</tr>
<tr>
<td>Instance</td>
<td>Instance</td>
</tr>
<tr>
<td>Redo logs</td>
<td>Logs files</td>
</tr>
<tr>
<td>Statement cache</td>
<td>Package cache</td>
</tr>
<tr>
<td>Datafiles</td>
<td>DMS containers</td>
</tr>
<tr>
<td>Data cache</td>
<td>Buffer pools</td>
</tr>
<tr>
<td>Data dictionary</td>
<td>System catalog</td>
</tr>
<tr>
<td>Datafiles</td>
<td>Containers</td>
</tr>
<tr>
<td>Segments</td>
<td>Objects</td>
</tr>
<tr>
<td>Data blocks</td>
<td>Pages</td>
</tr>
<tr>
<td>Database Link</td>
<td>Federated System</td>
</tr>
</tbody>
</table>
<p>And also, some useful mapping between Oracle and DB2 products:</p>
<table style="height: 44px;" border="1" width="220">
<tbody>
<tr>
<td><strong>Oracle</strong></td>
<td><strong>DB2</strong></td>
</tr>
<tr>
<td>Oracle EE</td>
<td>DB2 Entreprise</td>
</tr>
<tr>
<td>Oracle Gateway</td>
<td>DB2 Connect</td>
</tr>
<tr>
<td>SQL *PLUS</td>
<td>DB2 CLP / DB2 CLP PLUS</td>
</tr>
<tr>
<td>PL/SQL</td>
<td>SQL Procedural Language</td>
</tr>
</tbody>
</table>
<p>You should also take care of the &#8220;package&#8221; term. For Oracle it&#8217;s a logical grouping of PL/SQL blocks that can be invoked by other PL/SQL applications, and for DB2 it&#8217;s a precompiled access plan for an embedded static SQL application stored in the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mycado.fr/2009/08/terminology-mapping-between-oracle-and-db2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Queries on XML data with XQuery</title>
		<link>http://blog.mycado.fr/2009/08/queries-on-xml-data-with-xquery/</link>
		<comments>http://blog.mycado.fr/2009/08/queries-on-xml-data-with-xquery/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 14:09:32 +0000</pubDate>
		<dc:creator>Stéphane Journot</dc:creator>
				<category><![CDATA[IBM DB2]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XQuery]]></category>

		<guid isPermaLink="false">http://blog.mycado.fr/?p=84</guid>
		<description><![CDATA[We know how to store native XML data in our DB2 tables, and now we will see how we can access to these data. We can choose between standard SQL queries and XQuery.. or both ! The first solution, with a SQL query, only query at the column level of your table; this query will [...]]]></description>
			<content:encoded><![CDATA[<p>We know how to <a title="Store native XML in DB2 table" href="http://blog.mycado.fr/2009/08/stocker-du-xml-natif-dans-un-table-db2/" target="_blank">store native XML data in our DB2 tables</a>, and now we will see how we can access to these data. We can choose between standard SQL queries and <strong>XQuery</strong>.. or both ! The first solution, with a SQL query, only query at the column level of your table; this query will return the full XML data. The second solution, with XQuery, allow us to make a &#8220;query&#8221; inside our XML data.</p>
<p>For the SQL query, nothing more than a <strong>SELECT</strong>:</p>
<pre>SELECT id, info from client</pre>
<p>Easy, but not really powerful for XML data, let&#8217;s try with XQuery, who give us two functions for DB2. <strong>db2-fn:sqlquery</strong> and <strong>db2-fn:xmlcolumn</strong>. The first function r<span>etrieves a sequence that is the result of an SQL fullselect and the second </span><span>retrieves a sequence from a column</span><span>. One important thing you should keep in mind, SQL is not a case-sensitive language alors que XQuery is a case-sensitive language.<br />
</span></p>
<p>An example which return all the XML data from the &#8220;<strong>info</strong>&#8221; column:</p>
<pre>XQUERY db2-fnxmlcolumn ('CLIENT.INFO')</pre>
<p>Which is same as this SQL query:</p>
<pre>SELECT info FROM client</pre>
<p>Let&#8217;s see something more nice. This query will return all the elements in &lt;<strong>name</strong>&gt; , inside the &#8220;info&#8221; column, and with the &lt;<strong>city</strong>&gt; element which containt &#8220;Paris&#8221;:</p>
<pre>XQUERY declare defaut element namespace "http://posample.org";
for $d in db2-fn:xmlcolumn('CLIENT.INFO')/clientinfo
  where $d/addr/city="Paris"
return &lt;out&gt;{$d/name}&lt;/out&gt;</pre>
<p>db2-fn:xmlcolumn retrieves the data from the &#8220;info&#8221; column in the &#8220;client&#8221; table. We add a $d variable, for each element of &lt;clientinfo&gt;, and we use a <strong>where</strong> to filter the &lt;<strong>city</strong>&gt; element which should be &#8220;Paris. To finish, we use &lt;<strong>out</strong>&gt; to output the data:</p>
<pre>&lt;out xmlns="http://posample.org"&gt;
  &lt;name&gt;Sophie Bool&lt;/name&gt;
&lt;/out&gt;</pre>
<div>
<p>To finish, the same example with a SQL query inside the XQuery:</p>
<pre>XQUERY declare default element namespace "http://posample.org";
for $d in db2-fn:sqlquery('SELECT info FROM client')/clientinfo
  where $d/addr/city="Paris
return &lt;out&gt;{$d/name}&lt;/out&gt;</pre>
<p>Enough for today, we will see next time how to do more complex and more powerful query with XQuery !</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.mycado.fr/2009/08/queries-on-xml-data-with-xquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Store native XML in a DB2 table</title>
		<link>http://blog.mycado.fr/2009/08/stocker-du-xml-natif-dans-un-table-db2/</link>
		<comments>http://blog.mycado.fr/2009/08/stocker-du-xml-natif-dans-un-table-db2/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 11:04:26 +0000</pubDate>
		<dc:creator>Stéphane Journot</dc:creator>
				<category><![CDATA[IBM DB2]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://blog.mycado.fr/?p=69</guid>
		<description><![CDATA[IBM DB2 is the first RDBMS to provide a native XML facility, in a table. You will be able to insert in a column, some XML data. It will be easier to make direct requests to these data with XQuery.
So, it&#8217;s funny, but why it&#8217;s interesting to do that ? Because XML data are hierarchic [...]]]></description>
			<content:encoded><![CDATA[<p>IBM DB2 is the first RDBMS to provide a native XML facility, in a table. You will be able to insert in a column, some XML data. It will be easier to make direct requests to these data with XQuery.</p>
<p>So, it&#8217;s funny, but why it&#8217;s interesting to do that ? Because XML data are hierarchic (instead of relational data which are flat) and data self-describing through XML tags. XML also allows a better flexibility for data structures required to change very often. In the other hand, access time performances will be a little slower, we lose the integrity constraints, and OLAP queries will be more difficult. The important question is &#8220;Which flexibility-performance ratio do you need ?&#8221;.</p>
<p>Let&#8217;s start now with the creation of a database, which should be encoded with UTF-8, to store XML. For that, we use the <strong>CREATE DATABASE</strong> command:</p>
<pre>CREATE DATABASE xmldb USING CODESET UTF-8 TERRITORY US</pre>
<p>We have our table, now we should create the &#8220;client&#8221; table, with an &#8220;info&#8221; column who contain client information, in XML format:</p>
<pre>CONNECT TO xmldb
CREATE TABLE client (id INT, info XML)</pre>
<p>Let&#8217;s try to insert a new client with a SQL query:</p>
<pre width="69">INSERT INTO client (id, info) VALUES (1, '&lt;clientinfo xmlns="http://posample.org" Cid="1"&gt;&lt;name&gt;Sophie Bool&lt;/name&gt;&lt;addr country="France"&gt;&lt;street&gt;5 rue du chateau de stable&lt;/street&gt;&lt;city&gt;Paris&lt;/city&gt;&lt;/addr&gt;&lt;phone type="work"&gt;01 72 92 02 88&lt;/phone&gt;&lt;/clientinfo&gt;')</pre>
<p>The first thing you will told me is <em>this query is a normal SQL query</em>, and this is right, insert XML isn&#8217;t more difficult. The second thing is about the XML, here we have a short XML data, but if we have more, it will be very difficult to use. This why, we will use XQuery to manipulate these data or use a XDS import. I&#8217;ll come back soon on these points.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mycado.fr/2009/08/stocker-du-xml-natif-dans-un-table-db2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL tuning teleconference on September 1 from IBM</title>
		<link>http://blog.mycado.fr/2009/08/sql-tuning-teleconference-on-september-1-from-ibm/</link>
		<comments>http://blog.mycado.fr/2009/08/sql-tuning-teleconference-on-september-1-from-ibm/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 03:11:27 +0000</pubDate>
		<dc:creator>Stéphane Journot</dc:creator>
				<category><![CDATA[IBM DB2]]></category>
		<category><![CDATA[IBM system z]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[system z]]></category>
		<category><![CDATA[teleconference]]></category>

		<guid isPermaLink="false">http://blog.mycado.fr/?p=137</guid>
		<description><![CDATA[A new teleconference from IBM on SQL tuning for DB2 on system z coming on Tuesday, September 1, starting at 3pm (UTC). Aim for application programmers, application development managers, database administrators and database managers,  with an intermediate technical level. With the growing of the IT infrastructure, we must find how can we deliver a scalable, [...]]]></description>
			<content:encoded><![CDATA[<p>A new teleconference from IBM on SQL tuning for DB2 on system z coming on <strong>Tuesday, September 1</strong>, starting at <strong>3pm</strong> (UTC). Aim for application programmers, application development managers, database administrators and database managers,  with an intermediate technical level. With the growing of the IT infrastructure, we must find how can we deliver a <em>scalable, reliable, available and highly secure database infrastructure, in a cost-effective data server environment</em> !</p>
<p>The case study will explain:</p>
<ul>
<li>How the project was started</li>
<li>Which techniques and strategy were used</li>
<li>How follow-up was done</li>
<li>What investments where made</li>
<li>What was the return on investment</li>
</ul>
<p>The speakers are Surekha Parekh, DB2 Market Manager/Strategist, IBM Software Group and Kurt Struyf, Senior Consultant from Competence Partners.</p>
<p>You can register at <a title="IBM SQL Tuning teleconference" href="https://www-950.ibm.com/events/wwe/systemz/sztecsem.nsf/enrollallv16?openform&amp;seminar=kwo311" target="_blank">SQL tuning: the necessity, the benefits, a business case</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mycado.fr/2009/08/sql-tuning-teleconference-on-september-1-from-ibm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2 queries with PHP</title>
		<link>http://blog.mycado.fr/2009/08/utilisation-de-db2-avec-php/</link>
		<comments>http://blog.mycado.fr/2009/08/utilisation-de-db2-avec-php/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 06:25:45 +0000</pubDate>
		<dc:creator>Stéphane Journot</dc:creator>
				<category><![CDATA[IBM DB2]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[blob]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.mycado.fr/?p=37</guid>
		<description><![CDATA[You want to use PHP as programmation language to query your DB2 databases. We will see how to do. We only need a HTTP server with the PECL ibm_db2 extension. This extension allow us to use new functions, relative to IBM DB2, but also work with IBM Cloudscape and Apache Derby.
After the installation, we will [...]]]></description>
			<content:encoded><![CDATA[<p>You want to use PHP as programmation language to query your DB2 databases. We will see how to do. We only need a HTTP server with the <a title="PECL IBM_DB2" href="http://pecl.php.net/package/ibm_db2" target="_blank">PECL ibm_db2</a> extension. This extension allow us to use new functions, relative to IBM DB2, but also work with IBM Cloudscape and Apache Derby.</p>
<p>After the installation, we will use these functions as normal PHP functions. This is a connection example to the SAMPLE database. You can click on the function to get more information:</p>
<pre>&lt;?php
$conn = <a title="PHP db2_connect" href="http://fr.php.net/manual/en/function.db2-connect.php" target="_blank">db2_connect</a>('SAMPLE', 'db2user', 'secretpass');

if($conn) {
  echo "connection to sample: ok.";
} else {
  echo "connection to sample: failed.";
}

<a title="PHP db2_close" href="http://fr.php.net/manual/en/function.db2-close.php" target="_blank">db2_close</a>($conn);
?&gt;</pre>
<p>Nothing very complicated here, we connect to the SAMPLE database with the <strong>db2_connect</strong> function, and we check if the connection works, then we close the connection with <strong>db2_close</strong>.</p>
<p>Now, let&#8217;s do something more interesting, do some query on our tables !</p>
<pre>&lt;?php
$query = "SELECT * FROM ADMINISTRATOR.EMPLOYEE";
$stmt = <a title="PHP db2_prepare" href="http://fr3.php.net/manual/en/function.db2-prepare.php" target="_blank">db2_prepare</a>($conn, $query);

if($stmt) {
  $ex = <a title="PHP db2_execute" href="http://fr3.php.net/manual/en/function.db2-execute.php" target="_blank">db2_execute</a>($stmt);
  if($ex) {
    while($ligne = <a title="PHP db2_fetch_array" href="http://fr3.php.net/manual/en/function.db2-fetch-array.php" target="_blank">db2_fetch_array</a>($stmt)) {
      $lastname = ligne[3];
      echo "&lt;br /&gt;- $lastname";
    }
  }
}
?&gt;</pre>
<p>We put your query in the $query variable, and we use the <strong>db2_prepare</strong> function with the previous connection ($conn). This function will &#8220;prepare&#8221; (I&#8217;m so smart), it will create an optimized path in DB2, to be more fast. We execute this result ($stmt) with the <strong>db2_execute</strong> function, who do the query on your database. To finish, we use <strong>db2_fetch_array</strong> to retrieve our data in an array.</p>
<p>A BLOB example.. or Binary Large OBject, an image, a audio or video file,..</p>
<pre>$filename = '/home/mycado/itsme.jpg';
$name = 'My cute picture";

$query = 'INSERT INTO photo (id, name, image) VALUES (?, ?, ?)';
$stmt = <a title="PHP db2_prepare" href="http://fr.php.net/manual/en/function.db2-prepare.php" target="_blank">db2_prepare</a>($conn, $query);

if($stmt) {
  <a title="PHP db2_bind_param" href="http://fr.php.net/manual/en/function.db2-bind-param.php" target="_blank">db2_bind_param</a>($stmt, 1, 'id', DB2_PARAM_IN);
  <a title="PHP db2_bind_param" href="http://fr.php.net/manual/en/function.db2-bind-param.php" target="_blank">db2_bind_param</a>($stmt, 2, 'name', DB2_PARAM_IN);
  <a title="PHP db2_bind_param" href="http://fr.php.net/manual/en/function.db2-bind-param.php" target="_blank">db2_bind_param</a>($stmt, 3, 'filename', DB2_PARAM_FILE);

  $ex = <a title="PHP db2_execute" href="http://fr.php.net/manual/en/function.db2-execute.php" target="_blank">db2_execute</a>($stmt);
}</pre>
<p>We use the flag <strong>db2_bind_param</strong> we give us more precision with the data type in our request. The first two variables, an id and a string, use DB2_PARAM_IN, an classical input parameter et we put your picture with <strong>DB2_PARAM_FILE</strong>. Note that the question marks are not an error !</p>
<p>It&#8217;s enough for now, I advice you to read the ebook &#8220;<a title="IBM Redbook PHP DB2" href="http://www.redbooks.ibm.com/abstracts/sg247301.html?Open" target="_blank">DB2 Express-C: The Developer Handbook for XML, PHP, C/C++, Java, and .NET</a>&#8216;. About the ibm_db2 functions, you can find them all on <a title="PHP ibm_db2 functions" href="http://php.net/manual/en/ref.ibm-db2.php" target="_blank">php.net</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mycado.fr/2009/08/utilisation-de-db2-avec-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Start on DB2 with IBM DB2 Express-C</title>
		<link>http://blog.mycado.fr/2009/08/commencer-sous-db2-avec-ibm-db2-express-c/</link>
		<comments>http://blog.mycado.fr/2009/08/commencer-sous-db2-avec-ibm-db2-express-c/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 12:48:08 +0000</pubDate>
		<dc:creator>Stéphane Journot</dc:creator>
				<category><![CDATA[IBM DB2]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[Express-C]]></category>

		<guid isPermaLink="false">http://blog.mycado.fr/?p=28</guid>
		<description><![CDATA[You should have heard something about IBM DB2, but it&#8217;s still two letters and a number for you. We will see how to start with DB2, in the good and free way ! (and.. legal).
IBM DB2 is a relational database management system, using SQL language. Created in 1983 by IBM, and the last version is [...]]]></description>
			<content:encoded><![CDATA[<p>You should have heard something about IBM DB2, but it&#8217;s still two letters and a number for you. We will see how to start with DB2, in the good and free way ! (and.. legal).</p>
<p>IBM DB2 is a relational database management system, using SQL language. Created in 1983 by IBM, and the last version is the 9.7 (Cobra). Compatible with the major operating systems (z/OS, AIX, Unix, Linux, Windows, Mac OS,..), DB2 ranks second in terms of market share, behind Oracle. There are several versions of DB2, more or less specialized and offer more or less services, but we will choose the free version, who can be use by students, developers, or small companies. DB2 Express-C is free to develop, deploy and distribute.</p>
<p>DB2 Express-C only have two limitations, which are not problem for us. It supports only 2 core and up to 2GB of RAM, which is enough for our tests. This version is available for Linux (32bit, 64bit and POWER), Windos (32bit and 64bit), Solaris (Intel 64bit), and Mac OS X (Intel 64bit), but unavailable for z/OS.. still not a problem for us ! There is no other limitation, we are free for the database size, number of connected users,.. Whether you develop in Java, .Net, Ruby, Python, Perl or pretty much any other programming language out there</p>
<p>We will proceed to the crucial stage, downloading <a title="Download DB2 Express-C 9.7" href="http://www.ibm.com/db2/express/download.html?S_CMP=ECDDWW01&amp;S_TACT=DCFRSJ03" target="_blank">DB2 Express-C 9.7</a> and install it on your system. To go further, don&#8217;t hesitate to consult the excellent ebook <span style="margin: 0px; padding: 0px; text-decoration: none;">&#8220;<a title="Getting started with DB2 Express-C" href="http://www.ibm.com/developerworks/wikis/display/DB2/FREE+Book-+Getting+Started+with+DB2+Express-C" target="_blank">Getting Started with DB2 Express-C</a>&#8221; </span>and watch the videos on<span style="margin: 0px; padding: 0px; text-decoration: none;"> <a title="ChannelDB2" href="http://www.channeldb2.com/" target="_blank">channelDB2</a>.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mycado.fr/2009/08/commencer-sous-db2-avec-ibm-db2-express-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check the service level and version of DB2</title>
		<link>http://blog.mycado.fr/2009/08/verifier-la-version-et-le-service-level-de-votre-db2/</link>
		<comments>http://blog.mycado.fr/2009/08/verifier-la-version-et-le-service-level-de-votre-db2/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 11:59:06 +0000</pubDate>
		<dc:creator>Stéphane Journot</dc:creator>
				<category><![CDATA[IBM DB2]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[db2level]]></category>
		<category><![CDATA[fix pack]]></category>

		<guid isPermaLink="false">http://blog.mycado.fr/?p=9</guid>
		<description><![CDATA[A short easy command will allow us to check the version and service level (build level and fix pack) of our DB2 instance. For that, use the db2level command:
DXIIC:/ mycado$ db2level
DB221085I Instance &#8220;DB2&#8243; uses &#8220;32&#8243; bits and DB2 code release &#8220;SQL09052&#8243; with level identifier &#8220;03030107&#8243;.
Informational tokens are &#8220;DB2 v9.5.200.315&#8243;, &#8220;s080811&#8243;, &#8220;WR21411&#8243;, and Fix Pack &#8220;2&#8243;.
Product [...]]]></description>
			<content:encoded><![CDATA[<p>A short easy command will allow us to check the version and service level (build level and fix pack) of our DB2 instance. For that, use the <strong>db2level</strong> command:</p>
<blockquote><p><strong>DXIIC:/ mycado$</strong> db2level</p>
<p>DB221085I Instance &#8220;DB2&#8243; uses &#8220;32&#8243; bits and DB2 code release &#8220;SQL09052&#8243; with level identifier &#8220;03030107&#8243;.<br />
Informational tokens are &#8220;DB2 v9.5.200.315&#8243;, &#8220;s080811&#8243;, &#8220;WR21411&#8243;, and Fix Pack &#8220;2&#8243;.<br />
Product is installed at &#8220;C:\DB2v95&#8243; with DB2 Copy Name &#8220;DB2COPY1&#8243;.</p></blockquote>
<p>Here I use a DB2 9.5 with the fix pack 2 ! These information can be useful when you search information or when you need a support from IBM, but essentially to know if you have the <a title="IBM Fix pack" href="http://www-01.ibm.com/support/docview.wss?rs=71&amp;uid=swg27007053">latest fixpack</a>. The latest fixpack for DB2 9.5 is the <a title="IBM DB2 9.5 Fix pack 4" href="http://www.ibm.com/support/docview.wss?rs=71&amp;uid=swg24023213" target="_blank">fix pack 4</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mycado.fr/2009/08/verifier-la-version-et-le-service-level-de-votre-db2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
