LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

related to sql server with labWindowsCVI

I am writing an app on Labwindows to store results in MSSQL Server 2008 after
radios undergo certain tests.

Well I am unable to insert values which is in this case is dat file into a
field of varbinary(max) in a table.

Could you please look into the subject.

Do let me know if you need any more info.

Cheers.

0 Kudos
Message 1 of 4
(3,015 Views)

Hi labnz, 

 

Can you expand upon what you mean by "unable to insert values"  Are you receiving any error messages? 

Regards,

Hassan Atassi
Senior Group Manager, Digital Support
0 Kudos
Message 2 of 4
(2,999 Views)

Thanks for your quick reply.

 

hstmt = DBImmediateSQL (hdbc, "INSERT INTO tableName (Value1,Value2,DatFile) SELECT ' value1',' value2',BulkColumn FROM OPENROWSET(Bulk 'datfile', SINGLE_BLOB)AS BLOB");

 

I AM TRYING TO INSERT VALUES FROM LOCAL MACHINE INTO THE SQL SERVER present in another machine.

 

Here the problem is value1,value2 are of datatype integers but datfile is of datatype varbinary(max).In the above statement, 'datfile' is 'c:\filename.dat' but on local machine

 

So I am unsure as to how i should insert the dat file.

Also unsure whether the statement in bold works.

 

If you could shed light as how to insert values with varbinary(max) that would be really helpful.

 

Cheers

0 Kudos
Message 3 of 4
(2,997 Views)

Hi labnz,

 

The way DBImmediateSQL works, is that it simply sends the command in parentheses to the database, so unfortunately this is not really related to the functionality of CVI per se, but more to the functionality of the database.  While there definitely are people within the user community that use CVI to communicate with an SQL database, you may be able to get better answers to your questions on a forum dedicated to database programming.

 

 

Regards,

Hassan Atassi
Senior Group Manager, Digital Support
0 Kudos
Message 4 of 4
(2,983 Views)