Solved

REading a blob field in the SQL

Posted on 2002-07-24
9
3,616 Views
Last Modified: 2013-12-09
I have few blob fields in my interbase database. They only store cahracter data. I want to read them along with the other normal fields so that I can export them into Excel or something. When I use the normal SQL with the blob field name included, the data is not comming( no error also).

I tried using a cursor , is not working.

0
Comment
Question by:binsaji
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 4

Expert Comment

by:YodaMage
ID: 7196161
Why not post your SQL?
0
 

Author Comment

by:binsaji
ID: 7200176
what do u mean by posting the SQL?
0
 
LVL 4

Accepted Solution

by:
YodaMage earned 250 total points
ID: 7204179
"When I use the normal SQL with the blob field name included"

-Lets see the normal SQL, or any code relavent to your operation. Better yet, what EXACTLY are you trying to do? Are you trying to write out IB records into some type of portable ASCII file?
0
Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

 

Author Comment

by:binsaji
ID: 7216227
I have a table with few normal charaster and numeric fields with one or more blob field. I want to run a simple SQL to extract all these fields and display ina  grid and then export that into an XLS file.

The grid is showing all other data except the blob and the blob is only showing an eclipses where I can click and open  another window to see the data of the blob field.

I am using a Quantum grid which has a method to export the data into an excel file. When I do that except the blob field everythign else gets exported, except the blob field. I want to see the data of the blob field also in the XLS fiel as a column. Is that possible?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7258110
you could try a cast as varchar,

not sure about the syntax, something like

select f1, cast(blobfieldname as varchar(2000)) from whatever

meikl ;-)
0
 
LVL 1

Assisted Solution

by:unordained
unordained earned 250 total points
ID: 7348679
Blob data is not available for direct query through SQL statements. You can try casting it, yes, but varchars have a limit of 32k characters, and a single row returned may not exceed 64kb total -- including expanded (space-padded) char fields.

Do you not have the option of writing a program (C, Delphi, or even PHP) which can request the Blob identifier and download the 'file'? (In this case, the blob acts much like a file handle, from which you read data as from any other file.)

As I said above, varchars can support up to 32k characters (at least in ascii mode) so for small amounts of text, they could replace blobs entirely. You would still have to convert all existing rows, again using a method as above, but it would solve your problem in the future by not requiring you to have access to anything but SQL.
0
 
LVL 10

Expert Comment

by:kacor
ID: 9795533
Hi binsaji,

if you got the needed answer, please accept it by clicking on Accept in the header of the good answer. By this way you can express thanks for expert's support

with best regards

Janos
0
 
LVL 10

Expert Comment

by:kacor
ID: 9824686
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to split points as follows:
                 167 points for YodaMage - tried to get useful info
                 167 points for kretzschmar - offered the possible solution
                 166 points for unordained - explained detailled
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

kacor
EE Cleanup Volunteer
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Read about achieving the basic levels of HRIS security in the workplace.
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
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…

739 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