From cwfarah@yahoo.com Wed Jan 1 08:25:25 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E79294753A1 for ; Wed, 1 Jan 2003 03:25:25 -0500 (EST) Received: from web20109.mail.yahoo.com (web20109.mail.yahoo.com [216.136.226.46]) by postgresql.org (Postfix) with SMTP id 7F5C6475AD7 for ; Wed, 1 Jan 2003 03:25:24 -0500 (EST) Message-ID: <20030101082525.10307.qmail@web20109.mail.yahoo.com> Received: from [216.148.246.134] by web20109.mail.yahoo.com via HTTP; Wed, 01 Jan 2003 00:25:25 PST Date: Wed, 1 Jan 2003 00:25:25 -0800 (PST) From: Farah Subject: postgres & perl To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1936551470-1041409525=:10167" X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/5 X-Sequence-Number: 6847 --0-1936551470-1041409525=:10167 Content-Type: text/plain; charset=us-ascii admin, (sorry if my english is not well) i want to know the perl source code for delete and editing the table values from pgsql. i have a problem of that. can you help me...? --------------------------------- Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now --0-1936551470-1041409525=:10167 Content-Type: text/html; charset=us-ascii

admin, (sorry if my english is not well)

i want to know the perl source code for delete and editing the table values from pgsql. i have a problem of that. can you help me...? 



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now --0-1936551470-1041409525=:10167-- From Devinder.Rajput@ipaper.com Thu Jan 2 14:10:15 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E281E476032; Thu, 2 Jan 2003 09:10:15 -0500 (EST) Received: from mx02.ipaper.com (mx02.ipaper.com [141.129.1.11]) by postgresql.org (Postfix) with ESMTP id 553754761EC; Thu, 2 Jan 2003 09:09:50 -0500 (EST) Received: from S02ATW02.na.ipaper.com (s02atw02.ipaper.com [164.103.63.148]) by mx02.ipaper.com (8.11.6+Sun/8.10.2) with ESMTP id h02EAoO19642; Thu, 2 Jan 2003 08:10:52 -0600 (CST) Received: from 164.103.62.7 by S02ATW02.na.ipaper.com with ESMTP ( Tumbleweed MMS SMTP Relay (MMS v5.0)); Thu, 02 Jan 2003 08:09:41 -0600 X-Server-Uuid: AF46FF6A-C785-473C-8C32-637F1D084C73 MIME-Version: 1.0 To: Farah Cc: pgsql-admin@postgresql.org, pgsql-admin-owner@postgresql.org Subject: Re: postgres & perl X-Mailer: Lotus Notes Release 5.0.6a January 17, 2001 Message-ID: From: "Devinder K Rajput" Date: Thu, 2 Jan 2003 08:09:39 -0600 X-MIMETrack: Serialize by Router on SWMTA1.ipaper.com/IPAPER(Release 5.0.11 |July 24, 2002) at 01/02/2003 08:09:41 AM, Serialize complete at 01/02/2003 08:09:41 AM X-WSS-ID: 120A97AF1697963-01-01 Content-Type: multipart/alternative; boundary="=_alternative 004DCA1086256CA2_=" X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/11 X-Sequence-Number: 6853 This is a multipart message in MIME format. --=_alternative 004DCA1086256CA2_= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit here is some sample code: use Pg; # perl module for PostgreSQL # connect to the database $conn = Pg::connectdb("dbname = $database_name"); # make sure connection to db was established if (PGRES_CONNECTION_OK ne $conn->status) { print $conn->errorMessage; exit(-1); } print "connected to db $database_name\n"; # Build query: $sql_query = ("UPDATE items \ SET vendor_group = " . $group . " \ WHERE number = '" . $row[ITEM_NUMBER] . "' \ and hub_id = " . $row[HUB_ID] . " \ "); #Execute query: $result = $conn->exec("$_[0]"); #Error Checking: if($result->resultStatus ne PGRES_COMMAND_OK && $result->resultStatus ne PGRES_TUPLES_OK) { ... } You can build your delete statements and any other queries just by modifying the "Build query:" section. regards, Devinder Rajput Stores Division Corporate Offices Chicago, IL (773) 442-6474 Farah Sent by: pgsql-admin-owner@postgresql.org 01/01/2003 02:25 AM To: pgsql-admin@postgresql.org cc: Subject: [ADMIN] postgres & perl admin, (sorry if my english is not well) i want to know the perl source code for delete and editing the table values from pgsql. i have a problem of that. can you help me...? Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now --=_alternative 004DCA1086256CA2_= Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit
here is some sample code:

use Pg;  # perl module for PostgreSQL

# connect to the database
        $conn = Pg::connectdb("dbname = $database_name");
        # make sure connection to db was established
        if (PGRES_CONNECTION_OK ne $conn->status) {
                print $conn->errorMessage;
                exit(-1);
        }
        print "connected to db $database_name\n";

# Build query:
        $sql_query = ("UPDATE items \
                SET vendor_group  =  " . $group . " \
                WHERE number      = '" . $row[ITEM_NUMBER] . "' \
                and hub_id      =  " . $row[HUB_ID] . " \
                ");

#Execute query:
        $result = $conn->exec("$_[0]");

#Error Checking:
        if($result->resultStatus ne PGRES_COMMAND_OK &&
        $result->resultStatus ne PGRES_TUPLES_OK) {
                ...
        }

You can build your delete statements and any other queries just by modifying the "Build query:" section.

regards,

Devinder Rajput
Stores Division Corporate Offices
Chicago, IL
(773) 442-6474



Farah <cwfarah@yahoo.com>
Sent by: pgsql-admin-owner@postgresql.org

01/01/2003 02:25 AM

       
        To:        pgsql-admin@postgresql.org
        cc:        
        Subject:        [ADMIN] postgres & perl



admin, (sorry if my english is not well)

i want to know the perl source code for delete and editing the table values from pgsql. i have a problem of that. can you help me...?


Do you Yahoo!?

Yahoo! Mail Plus - Powerful. Affordable. Sign up now

--=_alternative 004DCA1086256CA2_=--