This file is indexed.

/usr/share/doc/HOWTO/ja-html/WWW-mSQL-HOWTO-4.html is in doc-linux-ja-html 2006.05.25-1.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE>A mSQL and perl Web Server Mini HOWTO: ¥Æ¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¼Â¹Ô</TITLE>
 <LINK HREF="WWW-mSQL-HOWTO-5.html" REL=next>
 <LINK HREF="WWW-mSQL-HOWTO-3.html" REL=previous>
 <LINK HREF="WWW-mSQL-HOWTO.html#toc4" REL=contents>
</HEAD>
<BODY>
<A HREF="WWW-mSQL-HOWTO-5.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="WWW-mSQL-HOWTO-3.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="WWW-mSQL-HOWTO.html#toc4">Ìܼ¡¤Ø</A>
<HR>
<H2><A NAME="s4">4. ¥Æ¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¼Â¹Ô</A></H2>

<P>¥·¥¹¥Æ¥à¥¤¥ó¥¹¥È¡¼¥ë½ªÎ»¸å¡¢¥â¥Ç¥ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿msql¤Î¥Ð¡¼¥¸¥ç¥ó¤äperl¥Ç¡¼¥¿¥Ù¡¼¥¹¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë°Í¸¤·
¤·¡¢¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò£²¡Á£³½¤Àµ¤·¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡£
<P>¤Þ¤º<CODE>/home/httpd/html/</CODE>¤Ë¤¢¤ë<CODE>index.html</CODE>¥Õ¥¡¥¤¥ë¤¬¥µ¥ó¥×¥ë¥Ç¡¼¥¿
¥Ù¡¼¥¹¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¸Æ¤Ó½Ð¤¹¤è¤¦¤Ë½¤Àµ¤·¤Þ¤¹¡£<CODE>/home/httpd/html/test/</CODE>¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹(¥¢¡¼¥«¥¤¥Ö̾¤Ï<CODE>perl.lst.ck</CODE>¤Ç¤¹¤¬¡¢<CODE>database.cgi</CODE>
¤¢¤ë¤¤¤Ï<CODE>inventur.cgi</CODE>¤È¸Æ¤Ó¤Þ¤¹)¤ËÃÖ¤­´¹¤¨¤Þ¤¹¡£
<P><CODE>index.html</CODE>¤Ë°ì¹Ô¤òÄɲä·¤Þ¤¹(¤â¤Á¤í¤ó³Æ¼«¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Ë¹ç¤ï¤»¤Æ²¼¤µ¤¤)¡£
<HR>
<PRE>
&lt;LI>Test the &lt;A HREF="test/database.cgi">Database, DBI:DBD-mSQL style!&lt;/A>
&lt;LI>Test the &lt;A HREF="test/inventur.cgi">Database, MsqlPerl style!&lt;/A>
</PRE>
<HR>

Ä̾ï¤Ï¤³¤Î£²¤Ä¤Î¤¦¤Á¤«¤é°ì¤Ä¤òÁªÂò¤¹¤ë¤Î¤Ç¤¹¤¬¡¢¤â¤·Î¾Êý¤È¤â¥¤¥ó¥¹¥È¡¼¥ë
¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¾å¤Î¤è¤¦¤Ë£²¹Ô¤òÄɲ乤뤳¤È¤â¤Ç¤­¤Þ¤¹¡££²¤Ä¤ò»È¤¨¤ì¤Ð
¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤Ê¤É¤òÈæ³Ó¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
<P>
<H2><A NAME="ss4.1">4.1 MsqlPerl¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È¤ÎÄɲÃ</A>
</H2>

<P>¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È¤ÏMsqlPerl¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»È¤¦¤è¤¦¤Ë¤·¤Þ¤¹¡£
¤½¤Î¤¿¤á¤ËŬÅö¤Ê²Õ½ê¤ò½ñ¤­´¹¤¨¤Þ¤¹¡£¤Ï¤¸¤á¤Ë¥Õ¥¡¥¤¥ë¤Î¤Ï¤¸¤á¤¢¤¿¤ê¤Î<CODE>use</CODE>
»ØÄê¤òÊѹ¹¤·¤Þ¤¹¡£
<HR>
<PRE>
#
# use DBI;            # Generisches Datenbank-Interface 
use Msql;
</PRE>
<HR>

¤½¤·¤Æ27¹ÔÉÕ¶á¤ÇMsqlPerl syntax¤¬ÆÃÄê¤Î¥É¥é¥¤¥Ð¤òɬÍפȤ·¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡£
<HR>
<PRE>
# $dbh = DBI->connect($host, $database, '', $driver) ||
$dbh = Msql->connect($host, $database) ||
</PRE>
<HR>

¤Þ¤¿33¹Ô¤«¤éºÇ¸å¤Þ¤Ç<CODE>do</CODE>¤ò<CODE>query</CODE>¤ËÊѹ¹¤·¤Þ¤¹¡£
<HR>
<PRE>
# $dbh->do("SELECT * FROM hw") || db_init($dbh);
$dbh->query("SELECT * FROM hw") || db_init($dbh);
</PRE>
<HR>

ºÇ¸å¤Ë¡¢207¹Ô¤ò¥³¥á¥ó¥È¥¢¥¦¥È¤·¤Þ¤¹¡£
<HR>
<PRE>
# $sth->execute || msg("SQL Error:", $sth->errstr);
</PRE>
<HR>

¤Þ¤¿<CODE>errmsg</CODE>¤ËÂФ¹¤ëÁ°¤Î¥³¡¼¥É¥Õ¥é¥°¥á¥ó¥È¤Î°ì¤Ä¤Î¤è¤¦¤ËÁ´<CODE>errstr</CODE>¥³¡¼¥ë
¤ò¥¹¥ï¥Ã¥×¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ï¥Ð¡¼¥¸¥ç¥ó¤Ë°Í¸¤¹¤ë¤â¤Î¤Ç¤¹¡£
°Ê¾å¤Îºî¶È¤¬½ªÎ»¤·¤¿¤é¥¹¥¯¥ê¥×¥È¤Ï¥¹¥à¡¼¥º¤Ë¼Â¹Ô¤µ¤ì¤Þ¤¹¡£
<P>
<P>
<P>
<H2><A NAME="ss4.2">4.2 msql-2ÍÑ¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È¤ÎÄɲÃ</A>
</H2>

<P>SQL syntax¤Ïmslq-2¤Î³«È¯Ãæ¤ËºÆÄêµÁ¤µ¤ì¤Þ¤·¤¿¡£¥ª¥ê¥¸¥Ê¥ë¥¹¥¯¥ê¥×¥È¤Ï
45¡Á58¹Ô¤Ë¥Æ¡¼¥Ö¥ë½é´ü²½¥¹¥Æ¡¼¥È¥á¥ó¥È¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
<CODE>primary key</CODE> modifier¤Ïmsql-2¤Ç¤Ï¤â¤¦¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
°Ê²¼¤ò¥¹¥­¥Ã¥×¤·¤Þ¤¹¡§
<HR>
<PRE>
    $dbh->do(&lt;&lt;EOT) || die $dbh->errstr; # Neue Personen-Tabelle ¿·µ¬¸Ä¿Í¥Æ¡¼¥Ö¥ë
        create table person (
# We do not need the 'primary key' modifier anymore in msql-2!
#           pn        int primary key,   # Personalnummer¸Ä¿ÍÈÖ¹æ
            pn        int,               # Personalnummer
            name      char(80),          # Nachname, Vorname À«¡¢Ì¾
            raum      int                # Raumnummer¶õ´ÖÈÖ¹æ
        )
EOT
    $dbh->do(&lt;&lt;EOT) || die $dbh->errstr; # Neue Hardware-Tabelle
        create table hw (
# We do not need the 'primary key' modifier anymore in msql-2!
#           asset int primary key,       # Inventurnummer ´ÉÍýÈÖ¹æ
            asset int,                   # Inventurnummer
            name   char(80),             # Bezeichnung ̾¾Î
            person int                   # Besitzer   ½êÍ­¼Ô
        )
EOT
</PRE>
<HR>

¤³¤Î¥¹¥¯¥ê¥×¥È¤Ï¸Ä¿ÍÈֹ椬Ʊ¤¸¤â¤Î¤â¿·¤·¤¯¥¨¥ó¥È¥ê¡¼¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
msql-1¤Ï<CODE>primary key</CODE>¤ò¤³¤ÎÆ°ºî¤òËɤ°¤Î¤Ë»È¤¤¤Þ¤¹¡£msql-2¥É¥­¥å¥á¥ó¥È
¤Ï<CODE>CREATE INDEX</CODE>¤¬Í£°ì¤Î¥¨¥ó¥È¥êȯ¹Ô¤òÊĤ¸¤ëÊýË¡¤Ë¤Ä¤¤¤Æ½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡£
<P>
<P>
<P>
<HR>
<A HREF="WWW-mSQL-HOWTO-5.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="WWW-mSQL-HOWTO-3.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="WWW-mSQL-HOWTO.html#toc4">Ìܼ¡¤Ø</A>
</BODY>
</HTML>