pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
postgres & perl
2+ messages / 2 participants
[nested] [flat]

* postgres & perl
@ 2003-01-01 08:25  Farah <cwfarah@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Farah @ 2003-01-01 08:25 UTC (permalink / raw)
  To: pgsql-admin


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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: postgres & perl
@ 2003-01-02 14:09  Devinder K Rajput <Devinder.Rajput@ipaper.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Devinder K Rajput @ 2003-01-02 14:09 UTC (permalink / raw)
  To: Farah <cwfarah@yahoo.com>; +Cc: pgsql-admin; pgsql-admin-owner@postgresql.org

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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-01-02 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-01 08:25 postgres & perl Farah <cwfarah@yahoo.com>
2003-01-02 14:09 Re: postgres & perl Devinder K Rajput <Devinder.Rajput@ipaper.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox