CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Connection refused !!! DBI module HELP !!

 



mackiew
Deleted

Oct 24, 2000, 1:34 PM

Post #1 of 4 (976 views)
Connection refused !!! DBI module HELP !! Can't Post

I have this problem:
The next message appears when I try to make an INSERT into a table:


Connection refused
DBD::Pg::st execute failed: ERROR:
parser: parse error at or near "refused"


The situation is the next: I have a lot of processes making insertions
in the same database, and I suspect that is the cause of the message,
but I'm not sure.

Could be another cause?
How can I solve it?

I have tried the "autocommit" option on, and i still have the
problem.

Thank you.


dws
Deleted

Oct 24, 2000, 4:50 PM

Post #2 of 4 (975 views)
Re: Connection refused !!! DBI module HELP !! [In reply to] Can't Post

From your post, it's unclear whether you are able to sucessfully do INSERTs before you hit one that fails.

Post the INSERT query, so that we can take a look at it. From the error you're seeing, it's likely that there's a syntax error in the query.

(Autocommit iscompletely unrelated to a problem like this.)


mackiew
Deleted

Oct 24, 2000, 6:28 PM

Post #3 of 4 (975 views)
Re: Connection refused !!! DBI module HELP !! [In reply to] Can't Post

I do can make inserts before this one. in fact, a lot of processes
that are copies of this one, (created with "forks") are making
insertions successfully.

The problematic code is as follows:


if (defined @pointerToARegistros) {
foreach $pointerRegistro (@pointerToARegistros) {
if (defined $pointerRegistro) {

my $sth = $dbh->prepare("insert into TNS values (
?,
?,
?,
?,
?,
?
)");

$sth->execute(
$pointerRegistro->{zona},
$pointerRegistro->{nombre_servidor},
$pointerRegistro->{orden},
$pointerRegistro->{transferencia},
$pointerRegistro->{nro_serie},
$pointerRegistro->{causa_inactividad}) ;
}
}
}


------------

thank you so much...


wardk
Deleted

Nov 21, 2000, 3:26 PM

Post #4 of 4 (975 views)
Re: Connection refused !!! DBI module HELP !! [In reply to] Can't Post

could it be that the data has embedded quotes ? that might explain why just an odd insert fails. you may want to scrub the data before the insert, at least to escape characters that might confuse the parser.
Maybe print the SQL command being executed on failure so you can look at it, confirm it's syntax. If users are entering the data, you could get just about anything.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives