Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

REading a blob field in the SQL

Posted on 2002-07-24
9
Medium Priority
?
3,635 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
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 1000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 1000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

972 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