03-30-2011 10:11 PM
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.
03-31-2011 04:44 PM
Hi labnz,
Can you expand upon what you mean by "unable to insert values" Are you receiving any error messages?
03-31-2011 04:57 PM
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
04-03-2011 09:13 PM
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.