Solved

REading a blob field in the SQL

Posted on 2002-07-24
9
3,623 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

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…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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…
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…

630 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