* Paul Boutros <[EMAIL PROTECTED]> [230504, 09:05]:
> I think the problem comes in returning from an INSERT statement. I
> believe there was a thread on this mailing list about that recently
> about that which you might be able to dig up.
>
> The other thing you might try is to replace the interpolated variables
> with place-holders. This:
> 'ARRAY(0x84eb058)'
> in your dump_query() output rings alarm bells in my head. Try the code
> below and see if it helps. Also, are you sure $qbody is a scalar?
>
> ### BEING CODE
> $query = $dbh->prepare("
> begin
> INSERT INTO MAIL (DATEI, DATEM, SUB, OBJ, INV)
> VALUES (?,?,?,?,?);
> SELECT [EMAIL PROTECTED]@IDENTITY;
> end") or
> die "Can't prepare the SQL statement: $DBI::errstr";
>
> $query->execute(
> $today,
> $date,
> $qsubject,
> $qbody,
> $inv_ric
> ) or die "Can't execute the SQL statement: $DBI::errstr";
>
> my $row = $query->fetchrow_arrayref();
> my $inserted_id = $row->[0];
>
> print ("IDENTITY: $inserted_id\n");
>
> my $list = $query->dump_results();
> print $list;
> ### END CODE
>
> Paul
Hi Paul,
thanks for your reply. I still tryed using INSERT with syntax like
(?, ?, ?...) but it seems to be not supported by my ODBC driver so come back
using the simplest one.
This is the error after I execute the code with the suggested syntax:
DBD::ODBC::st execute failed: [unixODBC][Driver Manager]Driver does not
support this function (SQL-IM001)(DBD: _rebind_ph/SQLBindParameter
err=-1) at /home/dbmail/dbmail.pl line 233.
Can't execute the SQL statement: [unixODBC][Driver Manager]Driver does
not support this function (SQL-IM001)(DBD: _rebind_ph/SQLBindParameter
err=-1) at /home/dbmail/dbmail.pl line 233.
I am using Debian Woody 3.0 with ODBC and FreeTDS driver.
> 'ARRAY(0x84eb058)'
regarding $qbody contains ARRAY(0xdata) i noticed that is wrong but
doesn't break the query.
In fact into the db I cat see the data inserted and 'ARRAY(0x84eb058)'
in OBJ column insted of the real data.
So at this moment I'm not sure that $qbody is a scalar and I have to fix
this but don't know really how.
bye