LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database: Search in binary type

I just began with the utilization of database and I created a small database (with the database toolkit)  for technical papers and patents.  To store the abstract I use a binary type.  I want to know if it is possible to make a search in this field (i.e. SELECT * FROM Documents WHERE Résumé LIKE '%alumina%' AND Provenance = 'journal'; )?

 

 

Source.jpg

 

Jean-Marc

0 Kudos
Message 1 of 8
(2,905 Views)

Have you tried this by executing the querry?  This should return the records as an array of variants if the querry is supported by your database.  I think Like is supported in binary fields but I usually just use strings not binary types.

 

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 8
(2,883 Views)
Yes, but nothing is found (there no error):  I am supposed to have more than 25 hits.  I used the binary field only because I am limited with 255 characters if I take the string type.

If I made a query in others fields, everything is fine and I retrieve all the data.

Jean-Marc
0 Kudos
Message 3 of 8
(2,875 Views)

I don't remember where I took the value of 255 characters, this is true?

 

Jean-Marc

0 Kudos
Message 4 of 8
(2,863 Views)

J-M wrote:

I don't remember where I took the value of 255 characters, this is true?

 

Jean-Marc


 

I think you may be confusing the amount of characters with the value of the characters. In a string-type column/field the values can take on 1-255 (i.e., one-byte ASCII values). The length depends on which database you're actually using. For instance, in SQL Server a varchar column/field can be up to 8000 characters.

0 Kudos
Message 5 of 8
(2,838 Views)

What database are you communicating with (sql server, access ...)?  Can you verify that the sql command works outside of labview, there are slightly different sql syntax depending on the database.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 8
(2,819 Views)
I utilize Access.  I solved my problem with the use of "memo type" instead of binary type.  I was able to create a table with "memo type" by modifying DBToolsCreateTable.vi (it is not elegant but it is working).  To insert a new record in the table, I use "DB Tools Execute Query.vi" instead of "DB Tools Insert Data.vi".
 
I still have a problem.  For some town with a French name like "Saint Martin D'arc" with an apostrophe:  I have to write "Saint Martin D arc".                     
 
insert into Documents2 values ('US20040168931.pdf','brevet','Choisir','','2004','','','0','17','','Bonnardel, Oliver (Saint Martin D arc, FR), Vanvoren, Claude (Saint Jean De Maurienne, FR)','Method for regulating an electrolysis cell','Bonnardel, Oliver (Saint Martin D arc, FR), Vanvoren, Claude (Saint Jean De Maurienne, FR)','','')
 
There is a way to write data with an apostrophe?

 

Jean-Marc
0 Kudos
Message 7 of 8
(2,779 Views)

With a small research on google I found:  replace ' by ''.

 

JM

0 Kudos
Message 8 of 8
(2,771 Views)