Solved

REading a blob field in the SQL

Posted on 2002-07-24
9
3,595 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
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 4

Expert Comment

by:YodaMage
Comment Utility
Why not post your SQL?
0
 

Author Comment

by:binsaji
Comment Utility
what do u mean by posting the SQL?
0
 
LVL 4

Accepted Solution

by:
YodaMage earned 250 total points
Comment Utility
"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
 

Author Comment

by:binsaji
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
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…

762 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