Reading text from a blob to String problem

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Reading text from a blob to String problem

Postby pbakker » Thu Sep 30, 2004 10:29 am

Hi,

I've got an Oracle DB with blob's in which SQL statements are stored.

I want to retrieve the SQL from the Blob and then run the SQL with getDateSetByQuery from Servoy. But I'm getting the following error:

org.mozilla.javascript.PropertyException: Constructor for "TypeError" not found.

The way I retrieve the text from the blob is the following:

var query = new java.lang.String(sql); //sql is the blobfield in the DB

I figured out that it's a type conversion error, because if I display the the var query in an infodialog, I see the text correct.

I then tried doing the following, just to test:

application.setClipboardContent(new java.lang.String(sql))
var query = application.getClipboardString();

After setting the text from the blob into the clipboard and then retrieve it again into var query, when I use var query in the getDateSetByQuery, all works fine.

How can I get this to work without copying and retrieving to/from the clipboard?

tnx in advance...

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Jan Aleman » Thu Sep 30, 2004 3:53 pm

try sticking it in a global
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby pbakker » Thu Sep 30, 2004 4:29 pm

Brilliant, it works!
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Karel Broer » Tue Oct 05, 2004 10:20 pm

BLOB :?:
Karel Broer
ServoyCamp - http://www.servoycamp.com
User avatar
Karel Broer
 
Posts: 779
Joined: Mon May 03, 2004 12:49 am
Location: Doetinchem

Postby bcusick » Tue Oct 05, 2004 10:25 pm

BLOB = Binary Large OBject
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Postby Karel Broer » Tue Oct 05, 2004 10:27 pm

Thanx Bob! So this could be a Word document or a PDF file?
User avatar
Karel Broer
 
Posts: 779
Joined: Mon May 03, 2004 12:49 am
Location: Doetinchem

Postby pbakker » Tue Oct 05, 2004 10:42 pm

yep, any kind of file (audio, images, textfile, PDF's etc)

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: Reading text from a blob to String problem

Postby Karel Broer » Tue Oct 05, 2004 11:01 pm

I want to retrieve the SQL from the Blob and then run the SQL with getDateSetByQuery from Servoy


So this would mean that it's possible to perform search WITHIN a Blob file?
User avatar
Karel Broer
 
Posts: 779
Joined: Mon May 03, 2004 12:49 am
Location: Doetinchem

Postby Jan Aleman » Wed Oct 06, 2004 1:12 am

Depends on your backend database and on how you program it. If you're just getting started you don't want to go into this. Most db's will offer you either access through stored procedures or full text search capabilities to search through any blob. Oracle has some interesting full text search capabilities that will search inside many kinds of documents stored in BLOB's for example. So if your customer really wants it (and has some cash to get it implemented): Yes it can be done (as anything in Servoy can).
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 35 guests