IBMi DB2 PHP Extension - Work with Relational Database Directory Entry


This article applies to:




Work with Relational Database Directory Entry



To retrieve your IBMi OS Relational Database name run the OS command Work with Relational Data Base Directory Entry.

From an i5 command line: WRKRDBDIRE


The command allows you to work with one or more entries from the relational database (RDB) directory.

With this command, you can do the following with the RDB directory:

  •  Add new entries
  •  Change existing entries
  •  Remove entries
  •  Show the details of an entry
  •  Print an entry
  •  Print a list of all entries


The RDB name that is used with db2_connect function etc.




<Title>PHP WRKRDBDIRE </title>
<p>PHP running WRKRDBDIRE <br>
$lsout = `/QOpenSys/usr/bin/system 'WRKRDBDIRE'`;
$line = strtok($lsout," ");
print "<table border CELLSPACING=2 CELLPADDING=0 BGCOLOR="#00FF7F">";
print "<tr ALIGN=LEFT>";
print "<td><pre>";
print $line;
print "</pre></td>";
print "</tr>";
while ($line = strtok(" "))
if (preg_match("/Relational databases+./", $line))
print "<tr>";
print "<td style="background-color: # FF7F00"><pre>$line</pre></td>";
print "</tr>";
print "<tr>";
print "<td><pre>$line</pre></td>";
print "</tr>";
print "</table>";
print "the end";



For more information on i5/OS commands see IBM Information Center (links below)


Work with Relational database directory entry


Have more questions? Submit a request


Powered by Zendesk