Forum: Ruby on Rails Error writing blob to sqlserver

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Marlon M. (Guest)
on 2007-02-22 21:20
(Received via mailing list)
I've got a rails app that retrieve tif files from the filesystem,
creates multi-page pdfs and stores them in an image field in the
database.  It works great, except for a couple of files.  The files it
chokes on are anything really different from the others, they're not
the largest, nor the smallest.  Everytime I try to run the app on
these files, I get this error.

DBI::DatabaseError: Not enough SQL parameters: INSERT INTO invoices
([account], [invoice_date], [id], [pdf]) VALUES('BY0905001', '20060912
00:00:00', 13,
<binary data has been removed from the email>')

I can see the EOF marker of the pdf file at the very end of the binary
data, so I know its sending the whole shebang.

I've tried using the DBD:ADO connection and the DBD:ODBC connection,
but both fail in the same way.

Any hints on where to start with this?  I don't know if it matters or
not, but on the error output there are a lot of single quote
characters.  I'm assuming they're automatically escaped.


--
Marlon
Ron P. (Guest)
on 2007-02-22 21:45
(Received via mailing list)
Marlon M. <marlon.moyer@...> writes:

> ([account], [invoice_date], [id], [pdf]) VALUES('BY0905001', '20060912
> not, but on the error output there are a lot of single quote
> characters.  I'm assuming they're automatically escaped.
>


Look at "Skeeterbug's" comment (#15) at
http://weblog.rubyonrails.org/2007/1/5/rails-1-2-r... and
at
the bug report at http://dev.rubyonrails.org/ticket/6436

I don't think these are corrected; perhaps that's the problem. I know I
couldn't
get acts_as_attachment storage :db_system working with SQL Server at
all, but it
worked just fine with MySQL.

Ron
Marlon M. (Guest)
on 2007-02-22 22:25
(Received via mailing list)
dang, that's not the answer I wanted to hear!  :)

On 2/22/07, Ron P.  wrote:
> > the largest, nor the smallest.  Everytime I try to run the app on
> > I've tried using the DBD:ADO connection and the DBD:ODBC connection,
> at
>
>
>
> >
>


--
This topic is locked and can not be replied to.