[NTLUG:Discuss] MS SQL query from a linux client....can it be done? *SOLVED*

Richard Geoffrion ntlug at rain4us.net
Fri Mar 24 11:39:53 CST 2006


Kyle Davenport wrote:

>*** Authentication Certificate ***
>
>  
>
>>>Richard Geoffrion writes:
>>>- Can a linux client make an MS SQL query and post a file(pdf) into the
>>>- database.
>>>
>I do it all the time.  There are different drivers for different versions
>of MS SQL.  I use FreeTDS ODBC with unixODBC.  You can also use a jdbc.
>
>Kyle
>
>
>
>  
>
Thanks for all your help guys!  I finally succeeded!  I did however 
rethink the posting of the .pdf file INTO the database.  Instead, I just 
save a pointer to the file.

After downloading and installing unixodbc and freetds (I don't even 
think I'm using the freetds libraries at this point) and after finally 
configuring the DSN properly,  I was able to use the isql utility to 
post what I wanted into the MS SQL database.

the syntax I used was...
echo "INSERT INTO $tablename ($fieldname1,$fieldname2) value 
($valueforfield1,$valueforfield2)" |\
isql $DSN_CONNECTION_NAME  $USERNAME $PASSWORD

or to see it done manually....

---
#isql esttable estuser estpassword

SQL> INSERT INTO esttable
(date,spec_combo,spec_descr,customer,prod_descr,file_link) VALUES ('2006/0
3/01','92869','multi-spec: rainbow','The Balloon Factory','balloon wraps for
rainbow baloons','n:\es
timate\2006\03\01.14.23.92869.pdf')
SQLRowCount returns 1
SQL>

---

thanks everyone!

-- 
Richard




More information about the Discuss mailing list