Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

REading a blob field in the SQL

Posted on 2002-07-24
9
Medium Priority
?
3,628 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 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

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…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

730 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