Solved

Insert Into Blob field

Posted on 2002-06-03
13
31,831 Views
Last Modified: 2013-12-09
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
0
Comment
Question by:AmyWiles
  • 4
  • 4
  • 2
  • +2
13 Comments
 
LVL 1

Expert Comment

by:thegroup
ID: 7062140
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.
0
 

Author Comment

by:AmyWiles
ID: 7062859
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)
0
 
LVL 1

Expert Comment

by:thegroup
ID: 7062889
What language are you using ? Visual Basic ?
0
 

Author Comment

by:AmyWiles
ID: 7063002
VB Script... its an asp page
0
 
LVL 4

Expert Comment

by:YodaMage
ID: 7096126
What is the subtype of your blob field?
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7096341
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
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 4

Expert Comment

by:YodaMage
ID: 7096377
thegroup should get the points if noone returns.
0
 

Author Comment

by:AmyWiles
ID: 7096753
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
0
 
LVL 4

Accepted Solution

by:
YodaMage earned 70 total points
ID: 7096763
Try changing the subtype to Binary as it works much better that way with strings.
0
 

Author Comment

by:AmyWiles
ID: 7097327
Do I need to use AppendChunk?
0
 
LVL 4

Expert Comment

by:YodaMage
ID: 7097361
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)
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7099076
Thanks for returning and finalizing this.
Moondancer - EE Moderator
0
 

Expert Comment

by:dhanyaknair
ID: 10754967
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.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Folder Replication 4 59
SQL Insert Query Help 16 96
MSSQL Convert Char To Date 4 53
How to remove numeric and alpha from an alphanumeric field? 5 72
APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now