This article applies to:

IBMi

Preface

Work with Relational Database Directory Entry

Details

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

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

From a 5250 command line:

 WRKRDBDIRE


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


The RDB name that is used with db2_connect function etc.

Example:

<html>
<Head>
<Title>PHP WRKRDBDIRE </title>
</Head>
<p>PHP running WRKRDBDIRE <br>
<?php
$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>";
}
else
{
print "<tr>";
print "<td><pre>$line</pre></td>";
print "</tr>";
}}
print "</table>";
print "the end";
?>
</body>
</html>