Link to home
Start Free TrialLog in
Avatar of AmyWiles
AmyWiles

asked on

Insert Into Blob field

I am trying to insert records into a table using the SQL syntax: INSERT INTO TABLE(Field list) VALUES(Value list). My code is choking on the BLOB field. I get the error:

SQLState: HY000
Native Error Code: 335544334
conversion error from string "BLOB"

Please help!!

Amy
Avatar of thegroup
thegroup

You can't insert a blob field directly in the insert.
you need to use:

insert into (field1, field2, blobfield)
values ('TEST', 135, :blobparam)

Then you can assign a value to that parameter.

If you need further explanations post a message and I could send you a piece of code.
Avatar of AmyWiles

ASKER

This is what I currently have...how should I alter it?

Descript=request.form("prodDesc")

SQL = "INSERT INTO PRODUCTS (PROD_SPECIAL,PROD_DESCRIPT) VALUES (" & NewID & "," & Descript & "')"
Set rs = conn.Execute(SQL)
What language are you using ? Visual Basic ?
VB Script... its an asp page
What is the subtype of your blob field?
Please update and finalize this question.  It is vital that you remain active in the questions you ask here and provide feedback to the Experts who so willingly step in to help you.

Experts, if no response in 7 days, please provide me with closing recommendations.
Thanks,
Moondancer - EE Moderator
thegroup should get the points if noone returns.
I answered on 6/7 and no one responded again until today (6/20)...I don't understand what the problem is-I've responded to every comment. If the question hasn't been answered, what am I supposed to do?
-PS-The subtype is text.
-Amy
ASKER CERTIFIED SOLUTION
Avatar of YodaMage
YodaMage

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do I need to use AppendChunk?
I use Delphi and or C++ and neither use Appendchunk method, so for VB?

Here is DLL for one of the Blob I use:

ORIGOBLIGOR    BLOB SUB_TYPE 0 SEGMENT SIZE 2000,

I can then:
A) Create a text file and write it directly to Blob
B) Use a data aware memo component and tie it directly to Blob
C) Pull contents of blob out to a stringlist or array of strings, modify, drop back.

Does VB have a data aware memo component?

(I haven't looked at VB since about version 2 when I decided I didn't like it)
Thanks for returning and finalizing this.
Moondancer - EE Moderator
Hi,

I am looking out for a piece of code which will insert a text file into a table as a LongBlob datatype?

urgent help required.