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: DBI:
problem inserting into memo field Invalid precision value (SQL-HY104)

 



sam001
Novice

Apr 18, 2011, 1:36 AM

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

Hi,

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?

http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Storage/DBI/ODBC/ACCESS.pm

Thanks

Sam


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(1,$rowdata{0},&{"DBI::SQL_VARCHAR"});
$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"});



$sth->execute;


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


miller
User

Apr 18, 2011, 9:41 AM

Post #2 of 2 (9878 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


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


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


Code
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