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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: DBI:
problem inserting into memo field Invalid precision value (SQL-HY104)



Apr 18, 2011, 1:36 AM

Post #1 of 2 (10726 views)
problem inserting into memo field Invalid precision value (SQL-HY104) Can't Post


I read though an XML file and then insert values into an access database. It all works fine until I have to insert a large text into the memo field.

I get this error. I've attached part of my code which works unless the text is large.

DBD::ODBC::st execute failed: [Microsoft][ODBC Microsoft Access Driver]Invalid precision value (SQL-HY104)

I found this link which says its a known issue but I don't know how to resolve this. Please can someone help?



I found a solution to iserting memo fields, just bind the variables and specify formats before inserting. However I'm still having problems with inserting dates

$sth->bind_param( 2, $rowdata{1}, &{"DBI::SQL_VARCHAR"});
$sth->bind_param( 3, $rowdata{2}, &{"DBI::SQL_VARCHAR"});
$sth->bind_param( 4, $rowdata{3}, &{"DBI::SQL_VARCHAR"});
$sth->bind_param( 5, $rowdata{4}, &{"DBI::SQL_VARCHAR"});
$sth->bind_param( 6, $rowdata{5}, &{"DBI::SQL_DATE"});
$sth->bind_param( 7, $rowdata{6}, &{"DBI::SQL_VARCHAR"});
$sth->bind_param( 8, $rowdata{7}, &{"DBI::SQL_VARCHAR"});
$sth->bind_param( 9, $rowdata{8}, &{"DBI::SQL_VARCHAR"});
$sth->bind_param( 10, $rowdata{9},&{"DBI::SQL_DATE"});
$sth->bind_param( 11, $rowdata{10},&{"DBI::SQL_DATE"});
$sth->bind_param( 12, $rowdata{11}, &{"DBI::SQL_LONGVARCHAR"});


(This post was edited by sam001 on Apr 18, 2011, 9:29 AM)
Attachments: dbi_error.txt (1.08 KB)


Apr 18, 2011, 9:41 AM

Post #2 of 2 (10697 views)
Re: [sam001] problem inserting into memo field Invalid precision value (SQL-HY104) [In reply to] Can't Post

Don't use Access, so can't say.

However, I can point out a small streamlining you can do to your code line

print $data->{DATA_UNIVERSE}->{ROW}->[0]->{CELL}->[0]->{content};

Note the dereferencing arrows -> are implied between any {} and [] group.

print $data->{DATA_UNIVERSE}{ROW}[0]{CELL}[0]{content};


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

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