<?
$v_dbname = "";			//データベースの名前を変数へ代入
$v_user = "";			//ユーザー名を変数へ代入
$v_password = "";		//パスワードを変数へ代入
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<title>View一覧</title>
</head>
<body>
<div align="center">
<table width="350" border="0" bgcolor="#009999">
	<tr> 
		<td height="12"> 
			<div align="center"><b><font color="#FFFFFF">View一覧</font></b></div>
		</td>
	</tr>
</table>
<br>
<table width="300" border="0" cellspacing="2" cellpadding="2" align="center">
	<tr bgcolor="#113333">
		<td height="20" width="30">
			<div align="center"><b><font color="#FFFFFF">Num</font></b></div>
		</td>
		<td height="20" width="140">
			<div align="center"><b><font color="#FFFFFF">View名</font></b></div>
		</td>
		<td height="20" width="130">
			<div align="center"><b><font color="#FFFFFF">tableowner</font></b></div>
		</td>
	</tr>

<?
// Connect to DB
if (@pg_connect("dbname=$v_dbname user=$v_user password=$v_password") == false) {
	print("unable to connect to database.");
	exit;
}
pg_exec("SET CLIENT_ENCODING = 'SJIS'");

$sql = "select viewname,viewowner from pg_views where viewname not like 'pg_%';";
@$result = pg_exec($sql);
if ($result == false) {
	printf("failed to exec SQL:¥"$sql¥"");
	exit;
}
$rows = pg_numrows($result);
$iro = "CCEEEE";
for ($i = 0; $i < $rows; $i++) {
	$viewname = pg_result($result, $i, "viewname");
	$viewowner = pg_result($result, $i, "viewowner");
	if ($iro == "AACCCC") {
		$iro = "CCEEEE";
	} else {
		$iro = "AACCCC";
	}

	print ("<tr bgcolor=¥"#$iro¥">");
	print ("¥n");
	print ("<td height=¥"26¥">$i</td>");
	print ("¥n");
	print ("<td height=¥"26¥">$tablename</td>");
	print ("¥n");
	print ("<td height=¥"26¥">$tableowner</td>");
	print ("¥n");

	print ("</tr>¥n");

}
pg_close();
?>
</table>
<hr>
</div>
</body>
</html>

戻る

(Last Update 2002/07/06)