Skip site navigation (1) Skip section navigation (2)

insetion Bytea atrr error!

From: "Mehdi Jabal Ameli" <jabalameli(at)ce(dot)sharif(dot)edu>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: insetion Bytea atrr error!
Date: 2002-06-26 16:05:56
Message-ID: 000801c21d2b$5be94a50$f42ee1c2@sunset (view raw or flat)
Thread:
Lists: pgsql-interfaces
hi,
I want to add jpg file a attr pic that it's type is Bytea in Perl script;
I do following commands:

$name='mehdi';
$filename="sh.gif";
open(inp, "$filename") ;
my $INP = join '', <inp>;
close inp;

$result=$conn->exec("insert into tablename values ($name,$inp)");

but it return error code 7 (PGRES_FATAL_ERROR);
how can I resolve this problem?
Would u help me please?


Mehdi Jabalameli 
jabalameli(at)ce(dot)sharif(dot)edu
ce.sharif.edu/~jabalameli

pgsql-interfaces by date

Next:From: Booth, RobertDate: 2002-06-26 16:54:18
Subject: Re: [ODBC] Views, Access 2000 and write conflicts
Previous:From: Jan WieckDate: 2002-06-26 15:30:51
Subject: Re: Where is PLbash ??

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group