Hi Everyone;
I'm new to this list... Here's what I'm trying to do:
I have a postgresql database running on a Mac G5 tower. I have a perl
script that is making a ODBC connection to a MSSQL database, extracting a
long list of users and email addresses and then making a database connection
to the postgres database, and inserting them into a table.
I have verified that each of these individual statements work, and the MSSQL
connection works, as I have printed the results to a file. However, when
the script gets to the point to do the INSERT script on the Postgres, I get
the following error message:
"DBD::ODBC:db prepare failed: [unixODBC]Connection is readonly, only select
statements are allowed. (SQL-HY000)"
Now, I know the permissions are okay, because I can run the INSERT
statements directly on the database using PgÅdmin or the isql client from
unixODBC. It's just the DBI connection from perl that is only allowing a
readonly connection.
This is the DBI statement that fails due to the readonly permissions:
$dbh=DBI -> connect("dbi:ODBC:server","postgres",);
$sth=$dbh -> prepare($statement);
$rv=$sth -> execute();
The statement actually fails upon execute.
I suppose the real issue is, is this a DBI problem, or a postgres problem?
I wonder is there a DBI switch that will enable the execute to connect with
write, or is it defaulting to a readonly connection?
Thanks,
Alex Medina-