Pg and xml field data type

[email protected] ("[email protected]")
Newsgroups perl.dbi.users
Organization http://groups.google.com
Message-ID <826fa669-d334-45a0-a6d9-f97edd90cf35@v19g2000yqa.googlegroups.com>
DBI Exception: DBD::Pg::st execute failed: ERROR:  could not determine
data type of parameter $2 [for Statement "insert into Jobs_Solleciti
(sollecito, state_description, email_utente) values (?,xmlelement(name
description, ?),?)" with ParamValues: 1='498', 2='fax da spedire',
3='[email protected]']

sbo_devel=> \d jobs_solleciti
                      Table "public.jobs_solleciti"
      Column       |            Type             |
Modifiers
-------------------+-----------------------------
+------------------------
 sollecito         | integer                     | not null
 data              | timestamp without time zone | not null default
now()
 done              | boolean                     | default false
 state             | integer                     | default 0
 state_descruption | xml                         |
 email_utente      | text                        |
Indexes:
    "jobs_solleciti_pkey" PRIMARY KEY, btree (sollecito, data)
Foreign-key constraints:
    "jobs_solleciti_sollecito_fkey" FOREIGN KEY (sollecito) REFERENCES
solleciti(id)

this error was first for following statement:

my $sth = $dbh->prepare(q(insert into Jobs_Solleciti (sollecito,
state_description, email_utente) values (?,xmlelement(name
description, ?),?)));

$sth->execute($sollecito->id, $descrizione_stato, $email_utente);

Then I've exchange last with:

	    $sth->bind_param(1, $sollecito->id);
	    $sth->bind_param(2, $descrizione_stato, {PG_TYPE=>'PG_XML'});
	    $sth->bind_param(3, $email_utente);
	    $sth->execute();

without success
and again:

-	    $sth->bind_param(2, $descrizione_stato, {PG_TYPE=>'PG_XML'});
+	    $sth->bind_param(2, $descrizione_stato, {PG_TYPE=>'PG_TEXT'});

but without success too.

Have you hint?

Thank you in advance,             \ferz

PS:
DBI           1.615
DBD::Pg   2.17.1
perl 5.10.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.