您的位置:首页 >> Web开发 >> CGI技术 >> 正文
CGI技术 RSS
 

尝试用sql查询语句操纵普通文本数据库!使用简单的select就可以实现文本的索引访问,用update……

http://www.rdxx.com 06年04月21日 07:27 网海之贝 我要投稿


    # Records split by ","

    my $db = "/dbname";

    @main::recordNames = &db_connect($db); # Necessary! must be @main::recordNames,
    # Get RecordNames from db-info file

    my $sqlStr = "SELECT * FROM $db";
    my @resoult = &executeStr($sqlStr);

    my $line;
    foreach $line (@resoult)
    {
        my $keys;
        foreach $keys (keys %$line)
        {
            print $keys." : ".$line->{$keys}."    ";
         }
         print "
\n";
    }

=head1 DESCRIPTION
    
    This modules, JTDB.pm, is a tool of control  txt-database  width  SQL-words.
    For now,only SELECT,INSERT,DELETE,UPDATE can be used in this script,and It's
    very simple.

    It is only  opening-words, and I think  some one will  make it fullness and
    mightiness one day! So,you can modify it at will!    and I hope you tell us
    the headway of this modules and share it width everybody.   at last, I hope
    you do not remove my copyright,if u will...

    Enjoy it!

=item db_connect

    open dbname_info.txt and get @recordNames

=item executeStr

    Execute sql-script,and return a Array of Array

    my @resoult = &executeStr($sqlStr);

    my $line;
    foreach $line (@resoult)

共11页  第1页 第2页 第3页 第4页 第5页 第6页 第7页 第8页 第9页 第10页 第11页


 
 
标签: 文本数据 , 文本 , 索引访问 , 查询语句 , Update , Select , SQL , 数据 , 语句 , PD , 查询 , 索引 , 访问 打印本文
 
 
  相关资讯
RSS
 
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站