IBMi DB2 PHP Extension - Work with Relational Database Directory Entry

Follow

This article applies to:

IBMi

 

Preface

Work with Relational Database Directory Entry

 

Details

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

 

Note:
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>

 

 

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

Comments

Powered by Zendesk