hi,

i want to store an lm-object in mysql and use the following command:

dbSendQuery(con,paste("INSERT INTO tablename 
(id,name,result,result_txt,rsquared) VALUES 
(",x,",'",z2,"','",serialize(z1,NULL,ascii=F),"','",serialize(z1,NULL,ascii=T),"',",summary(z1)$r.squared,")",sep=""))

z1 is the lm-object
z2 is just as string

i try to read it back: v=dbReadTable(con,"tablename")

but i think the binary is stored wrong in the database and the text is too 
long.
the binary stops on the first \n
the text is too long. when i try to read it back i get dbi internal error 
field truncated.

in the end it is not possible to restore the object with unserialize.

please help me to write & read the object correctly.

thank & best regards,
gg
-- 
---------------------------------------------------
Gottfried Gruber
mailto:[EMAIL PROTECTED]
www: http://gogo.sehrsupa.net

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to