From freddy77 at gmail.com Fri Jul 1 02:11:59 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 1 Jul 2016 07:11:59 +0100 Subject: [freetds] sqsh build fails with FreeTDS 1.0 In-Reply-To: References: Message-ID: On 1 Jul 2016 05:37, "Stuart Henderson" wrote: > > On 2016-06-29, Merle Reinhart wrote: > > I ran into this even before FreeTDS 1.0 when I was trying to check out > > some of the features of 7.2 and 7.3 via sqsh. > > Yes, that's the easily-fixed one I mentioned. > > > On 2016-06-29, Igor Korot wrote: > > Hi, Stuart, > > > > On Tue, Jun 28, 2016 at 5:19 PM, Stuart Henderson wrote: > >> sqsh build is failing with newer FreeTDS. There's an easily fixed > >> CS_TDS_80 that can be replaced with CS_TDS_71, but when that's done > >> I run into this in src/dsp_conv.c: > > > > What is you OS? What is you configure line? What is the exact error > > message you received? > > OS is OpenBSD/amd64 -current (not that it's relevant in this > case), and I showed the exact error message: > > >> dsp_conv.c: In function 'dsp_datetime_conv': > >> dsp_conv.c:665: error: 'CS_DATEREC' has no member named 'datesecfrac' > > freetds-1.00.9/include/cspublic.h now lists new bind types e.g. > > 581:#define CS_BIGDATETIME_TYPE TDS_STATIC_CAST(CS_INT, 35) > > The code in dsp_conv.c does this: > > >> /* > >> * Take the existing format and strip it down according to the > >> * type of date that we are processing and replace the ms > >> * field if it exists. > >> */ > >> #if defined(CS_BIGDATETIME_TYPE) && defined(CS_BIGTIME_TYPE) > >> if (dt_fmt->datatype == CS_BIGDATETIME_TYPE || dt_fmt->datatype == CS_BIGTIME_TYPE) > >> fmt = dsp_datetime_strip( dt_fmt->datatype, conv_fmt, (int) dr.datesecfrac ); > >> else > >> #endif > >> fmt = dsp_datetime_strip( dt_fmt->datatype, conv_fmt, (int) dr.datemsecond ); > > dr is a CS_DATEREC struct, but the definition in cstypes.h doesn't > have datesecfrac and datesecprec fields so it's clear why the error > occurs. > > Perhaps the better fix would be for FreeTDS to add them to the struct > and cs_dt_crack(). > > http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc20155.1550/html/newfesd/newfesd48.htm > > Yes but this must be done in a ABI compatible way. Just adding fields to a structure is not enough. They must be set in the right way. Frediano From Sean.Harris at nordstrom.com Mon Jul 4 17:43:50 2016 From: Sean.Harris at nordstrom.com (Harris, Sean) Date: Mon, 4 Jul 2016 21:43:50 +0000 Subject: [freetds] FOR XML, TYPE seems broken with latest 1.0x Message-ID: Hey guys, So I updated a mac dev machine to the latest release available via home brew (1.00.9). After this any queries using the TYPE directive for XML return an unknown type error. example query: SELECT * FROM users WHERE id = 123 FOR XML PATH('users'), ROOT('xmlObject'), TYPE About the TYPE directive: https://msdn.microsoft.com/en-us/library/ms190025.aspx From ikorot01 at gmail.com Tue Jul 5 12:21:15 2016 From: ikorot01 at gmail.com (Igor Korot) Date: Tue, 5 Jul 2016 12:21:15 -0400 Subject: [freetds] FOR XML, TYPE seems broken with latest 1.0x In-Reply-To: References: Message-ID: Hi, Sean, On Mon, Jul 4, 2016 at 5:43 PM, Harris, Sean wrote: > Hey guys, > > So I updated a mac dev machine to the latest release available via home brew (1.00.9). > > After this any queries using the TYPE directive for XML return an unknown type error. > > example query: SELECT * FROM users WHERE id = 123 FOR XML PATH('users'), ROOT('xmlObject'), TYPE > > About the TYPE directive: https://msdn.microsoft.com/en-us/library/ms190025.aspx I presume this was working before? Also, which protocol you use to talk to the server from freetds? Thank you. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Tue Jul 5 16:08:53 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Tue, 5 Jul 2016 21:08:53 +0100 Subject: [freetds] FOR XML, TYPE seems broken with latest 1.0x In-Reply-To: References: Message-ID: On 5 Jul 2016 17:06, "Harris, Sean" wrote: > > Hey guys, > > So I updated a mac dev machine to the latest release available via home brew (1.00.9). > > After this any queries using the TYPE directive for XML return an unknown type error. > > example query: SELECT * FROM users WHERE id = 123 FOR XML PATH('users'), ROOT('xmlObject'), TYPE > > About the TYPE directive: https://msdn.microsoft.com/en-us/library/ms190025.aspx > Which tool are you using for doing the query? Frediano From jyan at tableau.com Tue Jul 5 17:16:43 2016 From: jyan at tableau.com (Johnny Yan) Date: Tue, 5 Jul 2016 21:16:43 +0000 Subject: [freetds] Set up client charset with DSN-less configuration Message-ID: Hi, We're writing data analytic application on Linux using FreeTDS(0.95.81) with unixODBC(2.3.4) to connect to SQL Server databases. Since we need to programmatically decide the hosts and other info provided by our customers, we decided to use the DSN-less configuration and pass the attributes through the connection string. However it seems that we can't set up the client side charset correctly. >From the attached simple sample code, you could see that we could connect with that connection string(you need to change the server and username/password if you want to test it). And we get the following head in the freetds.log file, log.c:167:Starting log file for FreeTDS 0.95.81 on 2016-06-30 18:17:32 with debug flags 0x4fff. iconv.c:328:tds_iconv_open(0xff47a0, UTF-8) iconv.c:187:local name for ISO-8859-1 is ISO-8859-1 iconv.c:187:local name for UTF-8 is UTF-8 iconv.c:187:local name for UCS-2LE is UCS-2LE iconv.c:187:local name for UCS-2BE is UCS-2BE iconv.c:346:setting up conversions for client charset "UTF-8" iconv.c:348:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion iconv.c:395:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion It seems that the client charset is set to UTF-8. Am I correct? My understanding is that this is from the LANG env variable since we didn't specify it anywhere. Right? However when we try to specify the charset in the connection string, that is appending ";ClientCharset=UTF-16" to the connection string in the sample, we didn't observe the expected behavior. In another words, we still see the above bold line which implies that the ClientCharset attr in the connection string didn't make any difference. Is that expected? Did we do it correctly? Probably not. If so, how can we make it right? Let me know if you need any other info. Thank you very much! Johnny -------------- next part -------------- A non-text attachment was scrubbed... Name: sample.cpp Type: text/x-c++src Size: 676 bytes Desc: sample.cpp URL: From freddy77 at gmail.com Wed Jul 6 07:34:01 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Wed, 6 Jul 2016 12:34:01 +0100 Subject: [freetds] Set up client charset with DSN-less configuration In-Reply-To: References: Message-ID: 2016-07-05 22:16 GMT+01:00 Johnny Yan : > Hi, > > > We're writing data analytic application on Linux using FreeTDS(0.95.81) with unixODBC(2.3.4) to connect to SQL Server databases. Since we need to programmatically decide the hosts and other info provided by our customers, we decided to use the DSN-less configuration and pass the attributes through the connection string. However it seems that we can't set up the client side charset correctly. > > > From the attached simple sample code, you could see that we could connect with that connection string(you need to change the server and username/password if you want to test it). And we get the following head in the freetds.log file, > > > log.c:167:Starting log file for FreeTDS 0.95.81 > on 2016-06-30 18:17:32 with debug flags 0x4fff. > iconv.c:328:tds_iconv_open(0xff47a0, UTF-8) > iconv.c:187:local name for ISO-8859-1 is ISO-8859-1 > iconv.c:187:local name for UTF-8 is UTF-8 > iconv.c:187:local name for UCS-2LE is UCS-2LE > iconv.c:187:local name for UCS-2BE is UCS-2BE > iconv.c:346:setting up conversions for client charset "UTF-8" > iconv.c:348:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion > iconv.c:395:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion > > > It seems that the client charset is set to UTF-8. Am I correct? My understanding is that this is from the LANG env variable since we didn't specify it anywhere. Right? > > > However when we try to specify the charset in the connection string, that is appending ";ClientCharset=UTF-16" to the connection string in the sample, we didn't observe the expected behavior. In another words, we still see the above bold line which implies that the ClientCharset attr in the connection string didn't make any difference. Is that expected? Did we do it correctly? Probably not. If so, how can we make it right? > > > Let me know if you need any other info. Thank you very much! > > > Johnny > Hi, ClientCharset setting is for multi-byte, not wide. To use wide use *W versions of the APIs. Internally utf-8 is used so this is normal. ODBC does not force libTDS to do conversion to multi-byte so only one conversion is done (beside metadatas). Frediano From jyan at tableau.com Wed Jul 6 13:28:29 2016 From: jyan at tableau.com (Johnny Yan) Date: Wed, 6 Jul 2016 17:28:29 +0000 Subject: [freetds] Set up client charset with DSN-less configuration In-Reply-To: References: , Message-ID: Hi Frediano, Thanks for the reply. Actually we use *W version of APIs internally. I think the sample was over-simplified. Sorry about that. Attached please find the updated sample with SQLDriverConnectW. However with or without ClientCharset, we didn't see the client charset is set up correspondingly. Also about UTF-8, I think you implied this is your internal default? Is there any way to change this? If my understanding is correct, FreeTDS is doing something like <-> UCS-2LE <-> . Let me know otherwise though. What we want is to set the to UTF-16 if possible. Hope this doesn't make you more confused. But let me know if it does. We could provide more info. Thanks, Johnny ________________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Wednesday, July 6, 2016 4:34:01 AM To: FreeTDS Development Group Subject: Re: [freetds] Set up client charset with DSN-less configuration 2016-07-05 22:16 GMT+01:00 Johnny Yan : > Hi, > > > We're writing data analytic application on Linux using FreeTDS(0.95.81) with unixODBC(2.3.4) to connect to SQL Server databases. Since we need to programmatically decide the hosts and other info provided by our customers, we decided to use the DSN-less configuration and pass the attributes through the connection string. However it seems that we can't set up the client side charset correctly. > > > From the attached simple sample code, you could see that we could connect with that connection string(you need to change the server and username/password if you want to test it). And we get the following head in the freetds.log file, > > > log.c:167:Starting log file for FreeTDS 0.95.81 > on 2016-06-30 18:17:32 with debug flags 0x4fff. > iconv.c:328:tds_iconv_open(0xff47a0, UTF-8) > iconv.c:187:local name for ISO-8859-1 is ISO-8859-1 > iconv.c:187:local name for UTF-8 is UTF-8 > iconv.c:187:local name for UCS-2LE is UCS-2LE > iconv.c:187:local name for UCS-2BE is UCS-2BE > iconv.c:346:setting up conversions for client charset "UTF-8" > iconv.c:348:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion > iconv.c:395:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion > > > It seems that the client charset is set to UTF-8. Am I correct? My understanding is that this is from the LANG env variable since we didn't specify it anywhere. Right? > > > However when we try to specify the charset in the connection string, that is appending ";ClientCharset=UTF-16" to the connection string in the sample, we didn't observe the expected behavior. In another words, we still see the above bold line which implies that the ClientCharset attr in the connection string didn't make any difference. Is that expected? Did we do it correctly? Probably not. If so, how can we make it right? > > > Let me know if you need any other info. Thank you very much! > > > Johnny > Hi, ClientCharset setting is for multi-byte, not wide. To use wide use *W versions of the APIs. Internally utf-8 is used so this is normal. ODBC does not force libTDS to do conversion to multi-byte so only one conversion is done (beside metadatas). Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds -------------- next part -------------- A non-text attachment was scrubbed... Name: sampleW.cpp Type: text/x-c++src Size: 1117 bytes Desc: sampleW.cpp URL: From Sean.Harris at nordstrom.com Wed Jul 6 21:49:53 2016 From: Sean.Harris at nordstrom.com (Harris, Sean) Date: Thu, 7 Jul 2016 01:49:53 +0000 Subject: [freetds] FOR XML, TYPE seems broken with latest 1.0x In-Reply-To: References: Message-ID: Sorry for the delay. It was working before. We are using PHP PDO to query the database. Interestingly an App we use from the MacApp store recently updated it?s internal build of FreeTDS and it stopped working for these queries too. That app is SQLPro for MSSQL.app We run the same PHP code on a windows box except we use Microsoft?s driver ?SQLSRV? and it works just fine. Sean Harris Studio N Tech Operations On Jul 5, 2016, at 1:08 PM, Frediano Ziglio > wrote: On 5 Jul 2016 17:06, "Harris, Sean" > wrote: Hey guys, So I updated a mac dev machine to the latest release available via home brew (1.00.9). After this any queries using the TYPE directive for XML return an unknown type error. example query: SELECT * FROM users WHERE id = 123 FOR XML PATH('users'), ROOT('xmlObject'), TYPE About the TYPE directive: https://msdn.microsoft.com/en-us/library/ms190025.aspx Which tool are you using for doing the query? Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Thu Jul 7 17:35:43 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 7 Jul 2016 22:35:43 +0100 Subject: [freetds] Set up client charset with DSN-less configuration In-Reply-To: References: Message-ID: On 7 Jul 2016 22:56, "Johnny Yan" wrote: > > Hi Frediano, > > Thanks for the reply. Actually we use *W version of APIs internally. I think the sample was over-simplified. Sorry about that. > > Attached please find the updated sample with SQLDriverConnectW. However with or without ClientCharset, we didn't see the client charset is set up correspondingly. > ClientCharset is just for multi/single bytes, don't use utf16. > Also about UTF-8, I think you implied this is your internal default? Is there any way to change this? > No but utf8 is automatically converted to whatever you need. Also is used only for Metadata not for normal data. Normal data are stored in server encoding for odbc. Odbc internally tell libTDS to use utf8 but not convert normal data. > If my understanding is correct, FreeTDS is doing something like <-> UCS-2LE <-> . Let me know otherwise though. What we want is to set the to UTF-16 if possible. > Simply use *W function. Depending on driver manager will be utf16 or ucs4/utf32 > Hope this doesn't make you more confused. But let me know if it does. We could provide more info. > > Thanks, > Johnny > Frediano ________________________________________ > From: FreeTDS on behalf of Frediano Ziglio > Sent: Wednesday, July 6, 2016 4:34:01 AM > To: FreeTDS Development Group > Subject: Re: [freetds] Set up client charset with DSN-less configuration > > 2016-07-05 22:16 GMT+01:00 Johnny Yan : > > Hi, > > > > > > We're writing data analytic application on Linux using FreeTDS(0.95.81) with unixODBC(2.3.4) to connect to SQL Server databases. Since we need to programmatically decide the hosts and other info provided by our customers, we decided to use the DSN-less configuration and pass the attributes through the connection string. However it seems that we can't set up the client side charset correctly. > > > > > > From the attached simple sample code, you could see that we could connect with that connection string(you need to change the server and username/password if you want to test it). And we get the following head in the freetds.log file, > > > > > > log.c:167:Starting log file for FreeTDS 0.95.81 > > on 2016-06-30 18:17:32 with debug flags 0x4fff. > > iconv.c:328:tds_iconv_open(0xff47a0, UTF-8) > > iconv.c:187:local name for ISO-8859-1 is ISO-8859-1 > > iconv.c:187:local name for UTF-8 is UTF-8 > > iconv.c:187:local name for UCS-2LE is UCS-2LE > > iconv.c:187:local name for UCS-2BE is UCS-2BE > > iconv.c:346:setting up conversions for client charset "UTF-8" > > iconv.c:348:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion > > iconv.c:395:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion > > > > > > It seems that the client charset is set to UTF-8. Am I correct? My understanding is that this is from the LANG env variable since we didn't specify it anywhere. Right? > > > > > > However when we try to specify the charset in the connection string, that is appending ";ClientCharset=UTF-16" to the connection string in the sample, we didn't observe the expected behavior. In another words, we still see the above bold line which implies that the ClientCharset attr in the connection string didn't make any difference. Is that expected? Did we do it correctly? Probably not. If so, how can we make it right? > > > > > > Let me know if you need any other info. Thank you very much! > > > > > > Johnny > > > > Hi, > ClientCharset setting is for multi-byte, not wide. To use wide use > *W versions of the APIs. Internally utf-8 is used so this is normal. > ODBC does not force libTDS to do conversion to multi-byte so only one > conversion is done (beside metadatas). > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From freddy77 at gmail.com Thu Jul 7 17:37:20 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 7 Jul 2016 22:37:20 +0100 Subject: [freetds] FOR XML, TYPE seems broken with latest 1.0x In-Reply-To: References: Message-ID: A tdsdump would be helpful. Probably they are using dblib Frediano On 7 Jul 2016 22:57, "Harris, Sean" wrote: > Sorry for the delay. > > It was working before. We are using PHP PDO to query the database. > Interestingly an App we use from the MacApp store recently updated it?s > internal build of FreeTDS and it stopped working for these queries too. > That app is SQLPro for MSSQL.app > > We run the same PHP code on a windows box except we use Microsoft?s driver > ?SQLSRV? and it works just fine. > > Sean Harris > Studio N Tech Operations > > On Jul 5, 2016, at 1:08 PM, Frediano Ziglio freddy77 at gmail.com>> wrote: > > On 5 Jul 2016 17:06, "Harris, Sean" Sean.Harris at nordstrom.com>> wrote: > > Hey guys, > > So I updated a mac dev machine to the latest release available via home > brew (1.00.9). > > After this any queries using the TYPE directive for XML return an unknown > type error. > > example query: SELECT * FROM users WHERE id = 123 FOR XML PATH('users'), > ROOT('xmlObject'), TYPE > > About the TYPE directive: > https://msdn.microsoft.com/en-us/library/ms190025.aspx > > > Which tool are you using for doing the query? > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From no-reply at appveyor.com Fri Jul 8 15:20:32 2016 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 08 Jul 2016 19:20:32 +0000 Subject: [freetds] Build failed: freetds 636 Message-ID: <20160708192032.15540.66418.E7745AB3@appveyor.com> From freddy77 at gmail.com Sun Jul 10 10:42:47 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Sun, 10 Jul 2016 15:42:47 +0100 Subject: [freetds] Availability Groups support in master! Message-ID: Pushed last patch for this feature. Thanks to Paul-Andre Panon for the time looking for documentation and testing on a real setup. Frediano From no-reply at appveyor.com Sun Jul 10 11:27:33 2016 From: no-reply at appveyor.com (AppVeyor) Date: Sun, 10 Jul 2016 15:27:33 +0000 Subject: [freetds] Build completed: freetds 637 Message-ID: <20160710152733.29014.79389.A6CD7A00@appveyor.com> From lacak at zoznam.sk Tue Jul 12 04:29:12 2016 From: lacak at zoznam.sk (LacaK) Date: Tue, 12 Jul 2016 10:29:12 +0200 Subject: [freetds] Client charset in lowercase Message-ID: <06a3ca4e-1a99-3df5-a41b-76ffc98bf275@zoznam.sk> Hi *, now I found, that when I specify client charset as 'utf-8' and not as 'UTF-8' I get error in log: iconv.c:348:preparing iconv for "utf-8" <-> "UCS-2LE" conversion iconv.c:423:tds_iconv_info_init: client charset name "-1" invalid I am using "dblib" and I set charset using setlname() Is it expected, documented ? Thanks -Laco. From freddy77 at gmail.com Tue Jul 12 14:58:37 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Tue, 12 Jul 2016 19:58:37 +0100 Subject: [freetds] Client charset in lowercase In-Reply-To: <06a3ca4e-1a99-3df5-a41b-76ffc98bf275@zoznam.sk> References: <06a3ca4e-1a99-3df5-a41b-76ffc98bf275@zoznam.sk> Message-ID: 2016-07-12 9:29 GMT+01:00 LacaK : > Hi *, > > now I found, that when I specify client charset as 'utf-8' and not as > 'UTF-8' I get error in log: > > iconv.c:348:preparing iconv for "utf-8" <-> "UCS-2LE" conversion > iconv.c:423:tds_iconv_info_init: client charset name "-1" invalid > > I am using "dblib" and I set charset using setlname() > > Is it expected, documented ? > > Thanks > > -Laco. > No, the set of character sets is not documented. Would not be hard to change the comparison. Frediano From lacak at zoznam.sk Wed Jul 13 01:25:27 2016 From: lacak at zoznam.sk (LacaK) Date: Wed, 13 Jul 2016 07:25:27 +0200 Subject: [freetds] Client charset in lowercase In-Reply-To: References: <06a3ca4e-1a99-3df5-a41b-76ffc98bf275@zoznam.sk> Message-ID: <4c593961-a510-d953-1822-571f1433129a@zoznam.sk> >> Hi *, >> >> now I found, that when I specify client charset as 'utf-8' and not as >> 'UTF-8' I get error in log: >> >> iconv.c:348:preparing iconv for "utf-8" <-> "UCS-2LE" conversion >> iconv.c:423:tds_iconv_info_init: client charset name "-1" invalid >> >> I am using "dblib" and I set charset using setlname() >> >> Is it expected, documented ? >> >> Thanks >> >> -Laco. >> > No, the set of character sets is not documented. Would not be hard to > change the comparison. May be it will be usefull do it ... ;-) -Laco. From pratik31687 at outlook.com Sun Jul 17 15:43:03 2016 From: pratik31687 at outlook.com (Pratik Gandhi) Date: Sun, 17 Jul 2016 19:43:03 +0000 Subject: [freetds] Setting up FreeTDS to work with ODBC Data Source Administrator on Windows 7 Message-ID: Hi, I am currently working on a database migration project from MS SQL Server to MySQL and am using the MySQL Workbench 6.3 for it. However, I have ran across a problem in migrating some of the data due to character encoding issues and it has been suggested that using FreeTDS driver (instead of Microsoft's ODBC drivers) could be of help. Now, I have spend past couple of days reading stuff online to try and figure out how I can set up my Windows machine with FreeTDS so that ODBC Data Source Administrator recognizes it, which is what is being used by MySQL Workbench. I have, however, been unable to make any progress and am pretty stuck right now. I have downloaded windows binaries from couple of places, but honestly don't know what to do with them. I have also tried working with CMake, but again no luck there as I absolutely have no prior experience with it. I will really appreciate if anyone can help me here and guide me through the process of making this work. Thanks, Pratik From freddy77 at gmail.com Mon Jul 18 05:53:34 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Mon, 18 Jul 2016 10:53:34 +0100 Subject: [freetds] Setting up FreeTDS to work with ODBC Data Source Administrator on Windows 7 In-Reply-To: References: Message-ID: 2016-07-17 20:43 GMT+01:00 Pratik Gandhi : > Hi, > > > I am currently working on a database migration project from MS SQL Server to MySQL and am using the MySQL Workbench 6.3 for it. However, I have ran across a problem in migrating some of the data due to character encoding issues and it has been suggested that using FreeTDS driver (instead of Microsoft's ODBC drivers) could be of help. > > > Now, I have spend past couple of days reading stuff online to try and figure out how I can set up my Windows machine with FreeTDS so that ODBC Data Source Administrator recognizes it, which is what is being used by MySQL Workbench. I have, however, been unable to make any progress and am pretty stuck right now. I have downloaded windows binaries from couple of places, but honestly don't know what to do with them. I have also tried working with CMake, but again no luck there as I absolutely have no prior experience with it. > > > I will really appreciate if anyone can help me here and guide me through the process of making this work. > > > > Thanks, > > Pratik Actually it's much easier than it seems. The main page you should look is http://www.freetds.org/userguide/osissues.htm#WINDOWS. Actually you can download last 1.0 build from https://ci.appveyor.com/project/FreeTDS/freetds/build/639. Mainly choose one compiler version (VS 2008/2010/2015 either 32 or 64 bit) mostly based on bit and the library you have on your machine to avoid having to install required library. If you don't have OpenSSL you can download from http://slproweb.com/products/Win32OpenSSL.html. At this point copy the tdsodbc.dll file somewhere in the system making sure it can find OpenSSL libraries and register with "regsvr32 tdsodbc.dll" (from an administrator command line window). You'll find the driver in your ODBC Data Source Administrator. Configuration is not very attractive but the ODBC driver is much better. At this point you probably want to set "ClientCharset" to UTF-8 (not sure you can do graphically) and use Workbench. Frediano From pratik31687 at outlook.com Mon Jul 18 11:56:28 2016 From: pratik31687 at outlook.com (Pratik Gandhi) Date: Mon, 18 Jul 2016 15:56:28 +0000 Subject: [freetds] Setting up FreeTDS to work with ODBC Data Source Administrator on Windows 7 In-Reply-To: References: , Message-ID: Thanks Frediano for your response, that was really helpful. I have now successfully registered the driver and it's showing up on the ODBC screen. However, when I try to create a new DSN using it, I get a 'The setup routines for the FreeTDS ODBC driver could not be loaded due to system error code 126: The specified module could not be found'. Any idea why that might be? Thanks, Pratik ________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Monday, July 18, 2016 4:53 AM To: FreeTDS Development Group Subject: Re: [freetds] Setting up FreeTDS to work with ODBC Data Source Administrator on Windows 7 2016-07-17 20:43 GMT+01:00 Pratik Gandhi : > Hi, > > > I am currently working on a database migration project from MS SQL Server to MySQL and am using the MySQL Workbench 6.3 for it. However, I have ran across a problem in migrating some of the data due to character encoding issues and it has been suggested that using FreeTDS driver (instead of Microsoft's ODBC drivers) could be of help. > > > Now, I have spend past couple of days reading stuff online to try and figure out how I can set up my Windows machine with FreeTDS so that ODBC Data Source Administrator recognizes it, which is what is being used by MySQL Workbench. I have, however, been unable to make any progress and am pretty stuck right now. I have downloaded windows binaries from couple of places, but honestly don't know what to do with them. I have also tried working with CMake, but again no luck there as I absolutely have no prior experience with it. > > > I will really appreciate if anyone can help me here and guide me through the process of making this work. > > > > Thanks, > > Pratik Actually it's much easier than it seems. The main page you should look is http://www.freetds.org/userguide/osissues.htm#WINDOWS. Actually you can download last 1.0 build from https://ci.appveyor.com/project/FreeTDS/freetds/build/639. Mainly choose one compiler version (VS 2008/2010/2015 either 32 or 64 bit) mostly based on bit and the library you have on your machine to avoid having to install required library. If you don't have OpenSSL you can download from http://slproweb.com/products/Win32OpenSSL.html. At this point copy the tdsodbc.dll file somewhere in the system making sure it can find OpenSSL libraries and register with "regsvr32 tdsodbc.dll" (from an administrator command line window). You'll find the driver in your ODBC Data Source Administrator. Configuration is not very attractive but the ODBC driver is much better. At this point you probably want to set "ClientCharset" to UTF-8 (not sure you can do graphically) and use Workbench. Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds -------------- next part -------------- A non-text attachment was scrubbed... Name: freetds_error.jpg Type: image/jpeg Size: 43985 bytes Desc: freetds_error.jpg URL: From pratik31687 at outlook.com Mon Jul 18 12:05:23 2016 From: pratik31687 at outlook.com (Pratik Gandhi) Date: Mon, 18 Jul 2016 16:05:23 +0000 Subject: [freetds] Setting up FreeTDS to work with ODBC Data Source Administrator on Windows 7 In-Reply-To: References: , , Message-ID: Got it working...seems OpenSSL files were missing from system directory...reinstalled it and worked fine. Thanks ________________________________ From: Pratik Gandhi Sent: Monday, July 18, 2016 10:56:28 AM To: FreeTDS Development Group Subject: Re: [freetds] Setting up FreeTDS to work with ODBC Data Source Administrator on Windows 7 Thanks Frediano for your response, that was really helpful. I have now successfully registered the driver and it's showing up on the ODBC screen. However, when I try to create a new DSN using it, I get a 'The setup routines for the FreeTDS ODBC driver could not be loaded due to system error code 126: The specified module could not be found'. Any idea why that might be? Thanks, Pratik ________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Monday, July 18, 2016 4:53 AM To: FreeTDS Development Group Subject: Re: [freetds] Setting up FreeTDS to work with ODBC Data Source Administrator on Windows 7 2016-07-17 20:43 GMT+01:00 Pratik Gandhi : > Hi, > > > I am currently working on a database migration project from MS SQL Server to MySQL and am using the MySQL Workbench 6.3 for it. However, I have ran across a problem in migrating some of the data due to character encoding issues and it has been suggested that using FreeTDS driver (instead of Microsoft's ODBC drivers) could be of help. > > > Now, I have spend past couple of days reading stuff online to try and figure out how I can set up my Windows machine with FreeTDS so that ODBC Data Source Administrator recognizes it, which is what is being used by MySQL Workbench. I have, however, been unable to make any progress and am pretty stuck right now. I have downloaded windows binaries from couple of places, but honestly don't know what to do with them. I have also tried working with CMake, but again no luck there as I absolutely have no prior experience with it. > > > I will really appreciate if anyone can help me here and guide me through the process of making this work. > > > > Thanks, > > Pratik Actually it's much easier than it seems. The main page you should look is http://www.freetds.org/userguide/osissues.htm#WINDOWS. Actually you can download last 1.0 build from https://ci.appveyor.com/project/FreeTDS/freetds/build/639. Mainly choose one compiler version (VS 2008/2010/2015 either 32 or 64 bit) mostly based on bit and the library you have on your machine to avoid having to install required library. If you don't have OpenSSL you can download from http://slproweb.com/products/Win32OpenSSL.html. At this point copy the tdsodbc.dll file somewhere in the system making sure it can find OpenSSL libraries and register with "regsvr32 tdsodbc.dll" (from an administrator command line window). You'll find the driver in your ODBC Data Source Administrator. Configuration is not very attractive but the ODBC driver is much better. At this point you probably want to set "ClientCharset" to UTF-8 (not sure you can do graphically) and use Workbench. Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From pratik31687 at outlook.com Mon Jul 18 14:28:14 2016 From: pratik31687 at outlook.com (Pratik Gandhi) Date: Mon, 18 Jul 2016 18:28:14 +0000 Subject: [freetds] SQL_NO_TOTAL error while using freeTDS 1.00 Message-ID: Hi, I am getting a SQL_NO_TOTAL error for one of the columns with data type as nvarchar(1024) when trying to move data from MS SQL Server 2014 to MySQL 5.7. I am using freeTDS 1.00 version with MySQL Workbench on a Windows 7 machine. Regards, Pratik Gandhi From freddy77 at gmail.com Tue Jul 19 05:55:12 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Tue, 19 Jul 2016 10:55:12 +0100 Subject: [freetds] SQL_NO_TOTAL error while using freeTDS 1.00 In-Reply-To: References: Message-ID: 2016-07-18 19:28 GMT+01:00 Pratik Gandhi : > Hi, > > I am getting a SQL_NO_TOTAL error for one of the columns with data type as nvarchar(1024) when trying to move data from MS SQL Server 2014 to MySQL 5.7. I am using freeTDS 1.00 version with MySQL Workbench on a Windows 7 machine. > > Regards, > Pratik Gandhi It's not an error, it's a legal value returned. Frediano From pratik31687 at outlook.com Tue Jul 19 09:07:26 2016 From: pratik31687 at outlook.com (Pratik Gandhi) Date: Tue, 19 Jul 2016 13:07:26 +0000 Subject: [freetds] SQL_NO_TOTAL error while using freeTDS 1.00 In-Reply-To: References: , Message-ID: Well, that's interesting to know. Any idea what might be causing it and how do i get around it? Is it something that needs to be handled at the driver level or from the application? Regards, Pratik Gandhi On Tue, Jul 19, 2016 at 5:58 AM -0400, "Frediano Ziglio" > wrote: 2016-07-18 19:28 GMT+01:00 Pratik Gandhi : > Hi, > > I am getting a SQL_NO_TOTAL error for one of the columns with data type as nvarchar(1024) when trying to move data from MS SQL Server 2014 to MySQL 5.7. I am using freeTDS 1.00 version with MySQL Workbench on a Windows 7 machine. > > Regards, > Pratik Gandhi It's not an error, it's a legal value returned. Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From john at capps.com Thu Jul 21 11:03:46 2016 From: john at capps.com (John Kendall) Date: Thu, 21 Jul 2016 15:03:46 +0000 Subject: [freetds] freebcp fails on identity column on MS SQL In-Reply-To: References: <4DD72274-7D03-42D8-9BA3-4DF694D0E8C4@capps.com> Message-ID: <4B238E45-1C36-4FFB-8F42-CFB5E31D8F94@capps.com> Frediano, Thanks for the fix to freebcp for Sybase identity columns. I finally had a chance to do more tests and freebcp (1.0.11) has a problem with identity columns on MS SQL: select id_col=identity(int) into tempdb..tbl $ freebcp tempdb..tbl out tbl.bcp -S $DSQUERY -U usr -P pw -c Starting copy... 1 rows copied. $ freebcp tempdb..tbl in tbl.bcp -S $DSQUERY -U usr -P pw -c Starting copy... Msg 102, Level 15, State 1 Server 'ATHENA', Line 1 Incorrect syntax near ')'. Msg 20018, Level 15 General SQL Server error: Check messages from the SQL Server bcp copy in failed The same error occurs when using the -n or -c. There is no error when adding the -E option. Thanks. John > On Jun 27, 2016, at 5:12 AM, Frediano Ziglio wrote: > > Fixed > > Frediano > > > 2016-06-26 9:39 GMT+01:00 John Kendall : >> >>> On Jun 26, 2016, at 12:34 AM, Frediano Ziglio wrote: >>> >>> 2016-06-22 16:01 GMT+01:00 John Kendall : >>>> My last attempt to report this was a bit muddled. Here's another try. >>>> Using version 1.00.6. >>>> >>>> Using the bcp -n (native file format) and -E (retain identity values) options together produces: >>>> >>>> Msg 20060, Level 11 >>>> Unknown datatype encountered >>>> >>>> Error in bcp_colfmt col 1 >>>> >>>> >>>> I see this happening on Sybase (11 & 16) and MS SQL 2008. >>>> >>>> >>>> Test to reproduce: >>>> >>>> select id_col=identity(5) into tempdb..tbl -- Sybase >>>> select id_col=identity(int) into tempdb..tbl -- MS SQL >>>> >>>> $ freebcp tempdb..tbl out tbl.bcp -S $DSQUERY -U usr -P pw -n -E >>>> Msg 20060, Level 11 >>>> Unknown datatype encountered >>>> >>>> Error in bcp_colfmt col 1 >>>> >>>> datacopy also has a problem with the -E option, I assume the problems are related. >>>> >>>> John >>>> >>> >>> Hi, >>> finally found some time to look at this issue. >>> >>> Basically the sequence become: >>> 1- do a query to get row format >>> 2- initialize bcp >>> 3- do a query for identity inserts >>> 4- fill the bcp columns information with information from step 1. >>> The problem is that the step 3 clear the information needed in step 4. >>> Moving the query at step 1 after 3 (I put after bcp_control and before >>> bcp_columns) fix the issue. Not sure about datacopy. >>> >>> Can you test master (or tomorrow nightly snapshot) ? >>> >>> Frediano >> >> That fixed the bcp out, but if I then truncate the table and try to copy back into it I get (with Sybase 11 & 16): >> >> freebcp tempdb..tbl in tbl.bcp -S $DSQUERY -U usr -P pw -n -E >> >> Starting copy... >> >> Msg 20219, Level 4 >> Internal Conversion error >> >> Msg 20219, Level 4 >> Internal Conversion error >> >> Msg 20219, Level 4 >> Internal Conversion error >> >> Msg 20219, Level 4 >> Internal Conversion error >> >> Msg 20219, Level 4 >> Internal Conversion error >> >> Msg 20219, Level 4 >> Internal Conversion error >> >> Msg 20219, Level 4 >> Internal Conversion error >> >> Msg 20219, Level 4 >> Internal Conversion error >> >> Msg 20219, Level 4 >> Internal Conversion error >> >> Msg 20219, Level 4 >> Internal Conversion error >> >> Msg 20219, Level 4 >> Internal Conversion error >> >> bcp copy in failed >> >> >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Mon Jul 25 16:04:47 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Mon, 25 Jul 2016 21:04:47 +0100 Subject: [freetds] SQL_NO_TOTAL error while using freeTDS 1.00 In-Reply-To: References: Message-ID: Should be handled by the application. Workbench in this case. Frediano 2016-07-19 14:07 GMT+01:00 Pratik Gandhi : > Well, that's interesting to know. Any idea what might be causing it and how do i get around it? Is it something that needs to be handled at the driver level or from the application? > > Regards, > Pratik Gandhi > > > > On Tue, Jul 19, 2016 at 5:58 AM -0400, "Frediano Ziglio" > wrote: > > 2016-07-18 19:28 GMT+01:00 Pratik Gandhi : >> Hi, >> >> I am getting a SQL_NO_TOTAL error for one of the columns with data type as nvarchar(1024) when trying to move data from MS SQL Server 2014 to MySQL 5.7. I am using freeTDS 1.00 version with MySQL Workbench on a Windows 7 machine. >> >> Regards, >> Pratik Gandhi > > > It's not an error, it's a legal value returned. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Mon Jul 25 16:17:00 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Mon, 25 Jul 2016 21:17:00 +0100 Subject: [freetds] freebcp fails on identity column on MS SQL In-Reply-To: <4B238E45-1C36-4FFB-8F42-CFB5E31D8F94@capps.com> References: <4DD72274-7D03-42D8-9BA3-4DF694D0E8C4@capps.com> <4B238E45-1C36-4FFB-8F42-CFB5E31D8F94@capps.com> Message-ID: I think the problem in this case (all columns are identities) is that a "insert bulk table_name ()" is generated. Actually if there are no column and you are importing... sounds weird but probably you should just the the same number of rows with identities generated. Frediano 2016-07-21 16:03 GMT+01:00 John Kendall : > Frediano, > Thanks for the fix to freebcp for Sybase identity columns. I finally had a > chance to do more tests and freebcp (1.0.11) has a problem with identity > columns on MS SQL: > > select id_col=identity(int) into tempdb..tbl > > $ freebcp tempdb..tbl out tbl.bcp -S $DSQUERY -U usr -P pw -c > > Starting copy... > 1 rows copied. > > $ freebcp tempdb..tbl in tbl.bcp -S $DSQUERY -U usr -P pw -c > > Starting copy... > Msg 102, Level 15, State 1 > Server 'ATHENA', Line 1 > Incorrect syntax near ')'. > Msg 20018, Level 15 > General SQL Server error: Check messages from the SQL Server > > bcp copy in failed > > The same error occurs when using the -n or -c. > There is no error when adding the -E option. > > Thanks. > John > > >> On Jun 27, 2016, at 5:12 AM, Frediano Ziglio wrote: >> >> Fixed >> >> Frediano >> >> >> 2016-06-26 9:39 GMT+01:00 John Kendall : >>> >>>> On Jun 26, 2016, at 12:34 AM, Frediano Ziglio wrote: >>>> >>>> 2016-06-22 16:01 GMT+01:00 John Kendall : >>>>> My last attempt to report this was a bit muddled. Here's another try. >>>>> Using version 1.00.6. >>>>> >>>>> Using the bcp -n (native file format) and -E (retain identity values) options together produces: >>>>> >>>>> Msg 20060, Level 11 >>>>> Unknown datatype encountered >>>>> >>>>> Error in bcp_colfmt col 1 >>>>> >>>>> >>>>> I see this happening on Sybase (11 & 16) and MS SQL 2008. >>>>> >>>>> >>>>> Test to reproduce: >>>>> >>>>> select id_col=identity(5) into tempdb..tbl -- Sybase >>>>> select id_col=identity(int) into tempdb..tbl -- MS SQL >>>>> >>>>> $ freebcp tempdb..tbl out tbl.bcp -S $DSQUERY -U usr -P pw -n -E >>>>> Msg 20060, Level 11 >>>>> Unknown datatype encountered >>>>> >>>>> Error in bcp_colfmt col 1 >>>>> >>>>> datacopy also has a problem with the -E option, I assume the problems are related. >>>>> >>>>> John >>>>> >>>> >>>> Hi, >>>> finally found some time to look at this issue. >>>> >>>> Basically the sequence become: >>>> 1- do a query to get row format >>>> 2- initialize bcp >>>> 3- do a query for identity inserts >>>> 4- fill the bcp columns information with information from step 1. >>>> The problem is that the step 3 clear the information needed in step 4. >>>> Moving the query at step 1 after 3 (I put after bcp_control and before >>>> bcp_columns) fix the issue. Not sure about datacopy. >>>> >>>> Can you test master (or tomorrow nightly snapshot) ? >>>> >>>> Frediano >>> >>> That fixed the bcp out, but if I then truncate the table and try to copy back into it I get (with Sybase 11 & 16): >>> >>> freebcp tempdb..tbl in tbl.bcp -S $DSQUERY -U usr -P pw -n -E >>> >>> Starting copy... >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> bcp copy in failed >>> >>> >>> _______________________________________________ >>> FreeTDS mailing list >>> FreeTDS at lists.ibiblio.org >>> http://lists.ibiblio.org/mailman/listinfo/freetds >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From Karen.Pease at isavia.is Fri Aug 5 13:03:08 2016 From: Karen.Pease at isavia.is (Karen Pease) Date: Fri, 5 Aug 2016 17:03:08 +0000 Subject: [freetds] "DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field" - FreeTDS trying to convert to SYBMONEY for some reason? Message-ID: <1470416588834.22693@isavia.is> Hi, all. I'm trying to get a piece of software to work on 64 bit and as a consequence I can no longer use the "sybase-ocsd" package that we'd been using, since I can only locate it in 32 bit. So I'm trying FreeTDS. But I can't make heads or tails of the error I'm getting. In my code, I'm running: dbcmd (ET_dbproc, " select distinct a.program_name, b.name "); dbcmd (ET_dbproc, " from sysprocesses a, sysdatabases b"); dbcmd (ET_dbproc, " where a.dbid = b.dbid"); dbsqlexec (ET_dbproc); SYDBRESULT (ET_dbproc); dbbind (ET_dbproc, 1, NTBSTRINGBIND, (DBCHAR) 0, program); dbbind (ET_dbproc, 2, NTBSTRINGBIND, (DBCHAR) 0, dname); printf("%d\n", __LINE__); dbnextrow(ET_dbproc); printf("%d\n", __LINE__); printf ("program %s, dname %s", program, dname); Program and dname are of course character arrays. On the database end, a.program_name is a char(8) and name is sysname(30). >From that, I see: 421 syeh: DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field os error, Success 423 program , dname Dumping the debug output to a file, it ends like: ------- token.c:564:processing result tokens. marker is d1(ROW) token.c:1951:tds_process_row(): reading column 0 data.c:534:tds_get_data: type 47, varint size 1 data.c:587:tds_get_data(): wire column size is 16 token.c:1951:tds_process_row(): reading column 1 data.c:534:tds_get_data: type 39, varint size 1 data.c:587:tds_get_data(): wire column size is 6 util.c:165:Changed query state from READING to PENDING buffering.h:305:buffer_transfer_bound_data(0x24c2670 4040 -1 0x24c2660 0) dblib.c:7210:copy_data_to_host_var(47 [SYBCHAR] len 16 => 60 [SYBMONEY] len 0) dblib.c:7364:copy_data_to_host_var(): tds_convert returned 8 dblib.c:7210:copy_data_to_host_var(39 [SYBVARCHAR] len 6 => 60 [SYBMONEY] len 0) dblib.c:7364:copy_data_to_host_var(): tds_convert returned -3 dblib.c:7925:dbperror(0x24c2660, 20050, 0) dblib.c:7993:dbperror: Calling dblib_err_handler with msgno = 20050; msg->msgtext = "Attempt to convert data stopped by syntax error in source field" dblib.c:4865:dbdead(0x24c2660) [alive] dblib.c:8015:dbperror: dblib_err_handler for msgno = 20050; msg->msgtext = "Attempt to convert data stopped by syntax error in source field" -- returns 2 (INT_CANCEL) dblib.c:2117:leaving dbnextrow() returning REG_ROW/MORE_ROWS ------- Huh? SYBMONEY? How did money come into the picture here? Lots more errors are coming up, but let's start at the beginning with this, because it's sure left me scratching my head... (Full disclosure: I'm a newbie at Sybase; my experience lies mainly with postgres. But the task at hand for me involves porting our app to 64 bit, so....) - kv, Karen From freddy77 at gmail.com Fri Aug 5 13:24:34 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 5 Aug 2016 18:24:34 +0100 Subject: [freetds] "DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field" - FreeTDS trying to convert to SYBMONEY for some reason? In-Reply-To: <1470416588834.22693@isavia.is> References: <1470416588834.22693@isavia.is> Message-ID: 2016-08-05 18:03 GMT+01:00 Karen Pease : > Hi, all. I'm trying to get a piece of software to work on 64 bit and as a consequence I can no longer use the "sybase-ocsd" package that we'd been using, since I can only locate it in 32 bit. So I'm trying FreeTDS. But I can't make heads or tails of the error I'm getting. > > In my code, I'm running: > > dbcmd (ET_dbproc, " select distinct a.program_name, b.name "); > dbcmd (ET_dbproc, " from sysprocesses a, sysdatabases b"); > dbcmd (ET_dbproc, " where a.dbid = b.dbid"); > dbsqlexec (ET_dbproc); > SYDBRESULT (ET_dbproc); > dbbind (ET_dbproc, 1, NTBSTRINGBIND, (DBCHAR) 0, program); > dbbind (ET_dbproc, 2, NTBSTRINGBIND, (DBCHAR) 0, dname); > printf("%d\n", __LINE__); > dbnextrow(ET_dbproc); > printf("%d\n", __LINE__); > printf ("program %s, dname %s", program, dname); > > Program and dname are of course character arrays. On the database end, a.program_name is a char(8) and name is sysname(30). > > From that, I see: > > 421 > syeh: DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field > os error, Success > 423 > program , dname > > > Dumping the debug output to a file, it ends like: > > ------- > token.c:564:processing result tokens. marker is d1(ROW) > token.c:1951:tds_process_row(): reading column 0 > data.c:534:tds_get_data: type 47, varint size 1 > data.c:587:tds_get_data(): wire column size is 16 > token.c:1951:tds_process_row(): reading column 1 > data.c:534:tds_get_data: type 39, varint size 1 > data.c:587:tds_get_data(): wire column size is 6 > util.c:165:Changed query state from READING to PENDING > buffering.h:305:buffer_transfer_bound_data(0x24c2670 4040 -1 0x24c2660 0) > dblib.c:7210:copy_data_to_host_var(47 [SYBCHAR] len 16 => 60 [SYBMONEY] len 0) > dblib.c:7364:copy_data_to_host_var(): tds_convert returned 8 > dblib.c:7210:copy_data_to_host_var(39 [SYBVARCHAR] len 6 => 60 [SYBMONEY] len 0) > dblib.c:7364:copy_data_to_host_var(): tds_convert returned -3 > dblib.c:7925:dbperror(0x24c2660, 20050, 0) > dblib.c:7993:dbperror: Calling dblib_err_handler with msgno = 20050; msg->msgtext = "Attempt to convert data stopped by syntax error in source field" > dblib.c:4865:dbdead(0x24c2660) [alive] > dblib.c:8015:dbperror: dblib_err_handler for msgno = 20050; msg->msgtext = "Attempt to convert data stopped by syntax error in source field" -- returns 2 (INT_CANCEL) > dblib.c:2117:leaving dbnextrow() returning REG_ROW/MORE_ROWS > ------- > > Huh? SYBMONEY? How did money come into the picture here? > > Lots more errors are coming up, but let's start at the beginning with this, because it's sure left me scratching my head... > > (Full disclosure: I'm a newbie at Sybase; my experience lies mainly with postgres. But the task at hand for me involves porting our app to 64 bit, so....) > > > - kv, Karen > Simple, you are using Sybase headers and linking with FreeTDS. NTBSTRINGBIND is 13 under Sybase headers but 13 is MONEYBIND in FreeTDS headers. There is no ABI compatibility. Frediano From Karen.Pease at isavia.is Sat Aug 6 13:58:22 2016 From: Karen.Pease at isavia.is (Karen Pease) Date: Sat, 6 Aug 2016 17:58:22 +0000 Subject: [freetds] "DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field" - FreeTDS trying to convert to SYBMONEY for some reason? In-Reply-To: References: <1470416588834.22693@isavia.is>, Message-ID: <1470506302531.39547@isavia.is> That indeed was the problem - thanks a bunch :) I didn't have the sybase package installed, which was confusing, but apparently our app has some of the sybase headers in its include directory; I had to remove them. One more piece of weirdness I'm hitting... and it took me a long time to track down: int32 count; ... dbcmd (ET_fillas_dbp1, " select count(*) "); dbcmd (ET_fillas_dbp1, " from AIRSPACE_BOUND "); dbfcmd (ET_fillas_dbp1, " where Airspace_Vol_Name = '%s' ", volname); dbsqlexec (ET_fillas_dbp1); if (dbresults (ET_fillas_dbp1) != SUCCEED) return; dbbind (ET_fillas_dbp1, 1, INTBIND, (DBINT) 0, &count); dbnextrow (ET_fillas_dbp1); printf("%d, %X, %lX\n", __LINE__, count, count, count); So, obviously, count is just an integer, it should never be negative. For example, if I run that query in in tsql, it returns '4'. But the output in the code is: 4 4 7FFF00000004 ... as if it's doing some sort of weird negative conversion (???). It took a long time to catch because when I was just printing it out with "%d" it looked fine, but it was crashing me in a calloc statement. Any clue what's going on there? The dump ends: dblib.c:2031:dbnextrow(0x1afeb80) dblib.c:2043:dbnextrow() dbresults_state = 2 (_DB_RES_RESULTSET_ROWS) token.c:549:tds_process_tokens(0x1aff550, 0x7ffe79928be4, (nil), 0x1508) util.c:165:Changed query state from PENDING to READING token.c:564:processing result tokens. marker is d1(ROW) token.c:1951:tds_process_row(): reading column 0 data.c:534:tds_get_data: type 56, varint size 0 data.c:587:tds_get_data(): wire column size is 4 util.c:165:Changed query state from READING to PENDING buffering.h:305:buffer_transfer_bound_data(0x1afeb90 4040 -1 0x1afeb80 0) dblib.c:7210:copy_data_to_host_var(56 [SYBINT4] len 4 => 56 [SYBINT4] len 0) dblib.c:7252:copy_data_to_host_var() srctype == desttype dblib.c:2117:leaving dbnextrow() returning REG_ROW/MORE_ROWS - kv, Karen ________________________________________ Fr?: FreeTDS fyrir h?nd Frediano Ziglio Sent: 5. ?g?st 2016 17:24 Til: FreeTDS Development Group Efni: Re: [freetds] "DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field" - FreeTDS trying to convert to SYBMONEY for some reason? 2016-08-05 18:03 GMT+01:00 Karen Pease : > Hi, all. I'm trying to get a piece of software to work on 64 bit and as a consequence I can no longer use the "sybase-ocsd" package that we'd been using, since I can only locate it in 32 bit. So I'm trying FreeTDS. But I can't make heads or tails of the error I'm getting. > > In my code, I'm running: > > dbcmd (ET_dbproc, " select distinct a.program_name, b.name "); > dbcmd (ET_dbproc, " from sysprocesses a, sysdatabases b"); > dbcmd (ET_dbproc, " where a.dbid = b.dbid"); > dbsqlexec (ET_dbproc); > SYDBRESULT (ET_dbproc); > dbbind (ET_dbproc, 1, NTBSTRINGBIND, (DBCHAR) 0, program); > dbbind (ET_dbproc, 2, NTBSTRINGBIND, (DBCHAR) 0, dname); > printf("%d\n", __LINE__); > dbnextrow(ET_dbproc); > printf("%d\n", __LINE__); > printf ("program %s, dname %s", program, dname); > > Program and dname are of course character arrays. On the database end, a.program_name is a char(8) and name is sysname(30). > > From that, I see: > > 421 > syeh: DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field > os error, Success > 423 > program , dname > > > Dumping the debug output to a file, it ends like: > > ------- > token.c:564:processing result tokens. marker is d1(ROW) > token.c:1951:tds_process_row(): reading column 0 > data.c:534:tds_get_data: type 47, varint size 1 > data.c:587:tds_get_data(): wire column size is 16 > token.c:1951:tds_process_row(): reading column 1 > data.c:534:tds_get_data: type 39, varint size 1 > data.c:587:tds_get_data(): wire column size is 6 > util.c:165:Changed query state from READING to PENDING > buffering.h:305:buffer_transfer_bound_data(0x24c2670 4040 -1 0x24c2660 0) > dblib.c:7210:copy_data_to_host_var(47 [SYBCHAR] len 16 => 60 [SYBMONEY] len 0) > dblib.c:7364:copy_data_to_host_var(): tds_convert returned 8 > dblib.c:7210:copy_data_to_host_var(39 [SYBVARCHAR] len 6 => 60 [SYBMONEY] len 0) > dblib.c:7364:copy_data_to_host_var(): tds_convert returned -3 > dblib.c:7925:dbperror(0x24c2660, 20050, 0) > dblib.c:7993:dbperror: Calling dblib_err_handler with msgno = 20050; msg->msgtext = "Attempt to convert data stopped by syntax error in source field" > dblib.c:4865:dbdead(0x24c2660) [alive] > dblib.c:8015:dbperror: dblib_err_handler for msgno = 20050; msg->msgtext = "Attempt to convert data stopped by syntax error in source field" -- returns 2 (INT_CANCEL) > dblib.c:2117:leaving dbnextrow() returning REG_ROW/MORE_ROWS > ------- > > Huh? SYBMONEY? How did money come into the picture here? > > Lots more errors are coming up, but let's start at the beginning with this, because it's sure left me scratching my head... > > (Full disclosure: I'm a newbie at Sybase; my experience lies mainly with postgres. But the task at hand for me involves porting our app to 64 bit, so....) > > > - kv, Karen > Simple, you are using Sybase headers and linking with FreeTDS. NTBSTRINGBIND is 13 under Sybase headers but 13 is MONEYBIND in FreeTDS headers. There is no ABI compatibility. Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Sun Aug 7 11:00:28 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Sun, 7 Aug 2016 16:00:28 +0100 Subject: [freetds] "DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field" - FreeTDS trying to convert to SYBMONEY for some reason? In-Reply-To: <1470506302531.39547@isavia.is> References: <1470416588834.22693@isavia.is> <1470506302531.39547@isavia.is> Message-ID: 2016-08-06 18:58 GMT+01:00 Karen Pease : > That indeed was the problem - thanks a bunch :) I didn't have the sybase package installed, which was confusing, but apparently our app has some of the sybase headers in its include directory; I had to remove them. > > One more piece of weirdness I'm hitting... and it took me a long time to track down: > > int32 count; > ... > dbcmd (ET_fillas_dbp1, " select count(*) "); > dbcmd (ET_fillas_dbp1, " from AIRSPACE_BOUND "); > dbfcmd (ET_fillas_dbp1, " where Airspace_Vol_Name = '%s' ", volname); > dbsqlexec (ET_fillas_dbp1); > if (dbresults (ET_fillas_dbp1) != SUCCEED) > return; > dbbind (ET_fillas_dbp1, 1, INTBIND, (DBINT) 0, &count); > dbnextrow (ET_fillas_dbp1); > printf("%d, %X, %lX\n", __LINE__, count, count, count); > > So, obviously, count is just an integer, it should never be negative. For example, if I run that query in in tsql, it returns '4'. But the output in the code is: > > 4 4 7FFF00000004 > > ... as if it's doing some sort of weird negative conversion (???). It took a long time to catch because when I was just printing it out with "%d" it looked fine, but it was crashing me in a calloc statement. > I don't know your system but I suppose that sizeof(int) == 4 and sizeof(long) == 8 and you are doing something bad with printf. INTBIND is supposed to write a 4 byte integer. Explaining what's going on requires to understand how does variadic functions work and the architecture you are using. I cannot see the calloc call. How is defined the int32? Usually DBINT is safer. > Any clue what's going on there? The dump ends: > > dblib.c:2031:dbnextrow(0x1afeb80) > dblib.c:2043:dbnextrow() dbresults_state = 2 (_DB_RES_RESULTSET_ROWS) > token.c:549:tds_process_tokens(0x1aff550, 0x7ffe79928be4, (nil), 0x1508) > util.c:165:Changed query state from PENDING to READING > token.c:564:processing result tokens. marker is d1(ROW) > token.c:1951:tds_process_row(): reading column 0 > data.c:534:tds_get_data: type 56, varint size 0 > data.c:587:tds_get_data(): wire column size is 4 > util.c:165:Changed query state from READING to PENDING > buffering.h:305:buffer_transfer_bound_data(0x1afeb90 4040 -1 0x1afeb80 0) > dblib.c:7210:copy_data_to_host_var(56 [SYBINT4] len 4 => 56 [SYBINT4] len 0) > dblib.c:7252:copy_data_to_host_var() srctype == desttype > dblib.c:2117:leaving dbnextrow() returning REG_ROW/MORE_ROWS > > - kv, Karen > Frediano From sf at 4js.com Tue Aug 9 03:48:23 2016 From: sf at 4js.com (Sebastien FLAESCH) Date: Tue, 9 Aug 2016 09:48:23 +0200 Subject: [freetds] SQL Server 2016 support Message-ID: <57A98AC7.60101@4js.com> Hi all, What is the status of SQL Server 2016 support? I could not find any thread with "FreeTDS" + "SQL Server 2016" on the net. Is there any doc / howto available? For example, what is the TDS protocol version to be used? We have executed our SQL regressions tests. FreeTDS 1.0 seems to work fine with SQL Server 2016 using: TDS_Version = 7.3 Thanks, Seb From Karen.Pease at isavia.is Tue Aug 9 03:57:50 2016 From: Karen.Pease at isavia.is (Karen Pease) Date: Tue, 9 Aug 2016 07:57:50 +0000 Subject: [freetds] "DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field" - FreeTDS trying to convert to SYBMONEY for some reason? In-Reply-To: References: <1470416588834.22693@isavia.is> <1470506302531.39547@isavia.is>, Message-ID: <1470729470435.46669@isavia.is> Thank you. The calloc call is in a subfunction, with the following local variables: p_nbblk: count p_size: sizeof(Con_area) The code therein, with added debugging info (four attempts to narrow down the problem), is: bufp = (char *) calloc (1, 1); // Attempt #1: Smallest possible calloc printf("%d: %d: %d, %s\n", __LINE__, bufp, errno, strerror(errno)); if (bufp) free(bufp); bufp = (char *) calloc (4, 184); // Attempt #2: Actual values of what we should be allocating printf("%d: %d: %d, %s\n", __LINE__, bufp, errno, strerror(errno)); if (bufp) free(bufp); size_t a = p_nbblk, b=p_size; bufp = (char *) calloc (a, b); // Attempt #3: using temporary variables printf("%d: %d: %d, %s\n", __LINE__, bufp, errno, strerror(errno)); if (bufp) free(bufp); bufp = (char *) calloc ((size_t) p_nbblk, (size_t) p_size); // Attempt #4: Actual code printf("%d: %d: %d, %s\n", __LINE__, bufp, errno, strerror(errno)); * The first attempt works * The second attempt works * The third attempt fails, errno 12 * The fourth attempt fails, errno 12 So, as you can see, passing in the value of "count" returned from the select statement and fetched by dbnextrow causes a failure. int32 is defined as: typedef long int int32; I can't speak to what the standard is supposed to do, I can only attest to the fact that the code worked when linked with sybase and is no longer working now that I'm trying to use it with FreeTDS. - kv, Karen ________________________________________ Fr?: FreeTDS fyrir h?nd Frediano Ziglio Sent: 7. ?g?st 2016 15:00 Til: FreeTDS Development Group Efni: Re: [freetds] "DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field" - FreeTDS trying to convert to SYBMONEY for some reason? 2016-08-06 18:58 GMT+01:00 Karen Pease : > That indeed was the problem - thanks a bunch :) I didn't have the sybase package installed, which was confusing, but apparently our app has some of the sybase headers in its include directory; I had to remove them. > > One more piece of weirdness I'm hitting... and it took me a long time to track down: > > int32 count; > ... > dbcmd (ET_fillas_dbp1, " select count(*) "); > dbcmd (ET_fillas_dbp1, " from AIRSPACE_BOUND "); > dbfcmd (ET_fillas_dbp1, " where Airspace_Vol_Name = '%s' ", volname); > dbsqlexec (ET_fillas_dbp1); > if (dbresults (ET_fillas_dbp1) != SUCCEED) > return; > dbbind (ET_fillas_dbp1, 1, INTBIND, (DBINT) 0, &count); > dbnextrow (ET_fillas_dbp1); > printf("%d, %X, %lX\n", __LINE__, count, count, count); > > So, obviously, count is just an integer, it should never be negative. For example, if I run that query in in tsql, it returns '4'. But the output in the code is: > > 4 4 7FFF00000004 > > ... as if it's doing some sort of weird negative conversion (???). It took a long time to catch because when I was just printing it out with "%d" it looked fine, but it was crashing me in a calloc statement. > I don't know your system but I suppose that sizeof(int) == 4 and sizeof(long) == 8 and you are doing something bad with printf. INTBIND is supposed to write a 4 byte integer. Explaining what's going on requires to understand how does variadic functions work and the architecture you are using. I cannot see the calloc call. How is defined the int32? Usually DBINT is safer. > Any clue what's going on there? The dump ends: > > dblib.c:2031:dbnextrow(0x1afeb80) > dblib.c:2043:dbnextrow() dbresults_state = 2 (_DB_RES_RESULTSET_ROWS) > token.c:549:tds_process_tokens(0x1aff550, 0x7ffe79928be4, (nil), 0x1508) > util.c:165:Changed query state from PENDING to READING > token.c:564:processing result tokens. marker is d1(ROW) > token.c:1951:tds_process_row(): reading column 0 > data.c:534:tds_get_data: type 56, varint size 0 > data.c:587:tds_get_data(): wire column size is 4 > util.c:165:Changed query state from READING to PENDING > buffering.h:305:buffer_transfer_bound_data(0x1afeb90 4040 -1 0x1afeb80 0) > dblib.c:7210:copy_data_to_host_var(56 [SYBINT4] len 4 => 56 [SYBINT4] len 0) > dblib.c:7252:copy_data_to_host_var() srctype == desttype > dblib.c:2117:leaving dbnextrow() returning REG_ROW/MORE_ROWS > > - kv, Karen > Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From Karen.Pease at isavia.is Tue Aug 9 04:11:47 2016 From: Karen.Pease at isavia.is (Karen Pease) Date: Tue, 9 Aug 2016 08:11:47 +0000 Subject: [freetds] "DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field" - FreeTDS trying to convert to SYBMONEY for some reason? In-Reply-To: References: <1470416588834.22693@isavia.is> <1470506302531.39547@isavia.is>, Message-ID: <1470730307676.88300@isavia.is> Then again, perhaps Sybase would have messed up on this as well. (I'll reiterate that this is old code that I didn't write that I've been tasked to deal with). The last platform it was on was 32 bit where long int was indeed 4 bytes / 32 bits. But on the new platform "long int" is 8 bytes / 64 bits. So maybe that's the problem if, as you say, INTBND is designed to only write 4 bytes but there's an 8 byte value on hand. I'll try correcting our local definition to use an actual 32 bit value and see if that solves the problem. - kv, Karen ________________________________________ Fr?: FreeTDS fyrir h?nd Frediano Ziglio Sent: 7. ?g?st 2016 15:00 Til: FreeTDS Development Group Efni: Re: [freetds] "DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field" - FreeTDS trying to convert to SYBMONEY for some reason? 2016-08-06 18:58 GMT+01:00 Karen Pease : > That indeed was the problem - thanks a bunch :) I didn't have the sybase package installed, which was confusing, but apparently our app has some of the sybase headers in its include directory; I had to remove them. > > One more piece of weirdness I'm hitting... and it took me a long time to track down: > > int32 count; > ... > dbcmd (ET_fillas_dbp1, " select count(*) "); > dbcmd (ET_fillas_dbp1, " from AIRSPACE_BOUND "); > dbfcmd (ET_fillas_dbp1, " where Airspace_Vol_Name = '%s' ", volname); > dbsqlexec (ET_fillas_dbp1); > if (dbresults (ET_fillas_dbp1) != SUCCEED) > return; > dbbind (ET_fillas_dbp1, 1, INTBIND, (DBINT) 0, &count); > dbnextrow (ET_fillas_dbp1); > printf("%d, %X, %lX\n", __LINE__, count, count, count); > > So, obviously, count is just an integer, it should never be negative. For example, if I run that query in in tsql, it returns '4'. But the output in the code is: > > 4 4 7FFF00000004 > > ... as if it's doing some sort of weird negative conversion (???). It took a long time to catch because when I was just printing it out with "%d" it looked fine, but it was crashing me in a calloc statement. > I don't know your system but I suppose that sizeof(int) == 4 and sizeof(long) == 8 and you are doing something bad with printf. INTBIND is supposed to write a 4 byte integer. Explaining what's going on requires to understand how does variadic functions work and the architecture you are using. I cannot see the calloc call. How is defined the int32? Usually DBINT is safer. > Any clue what's going on there? The dump ends: > > dblib.c:2031:dbnextrow(0x1afeb80) > dblib.c:2043:dbnextrow() dbresults_state = 2 (_DB_RES_RESULTSET_ROWS) > token.c:549:tds_process_tokens(0x1aff550, 0x7ffe79928be4, (nil), 0x1508) > util.c:165:Changed query state from PENDING to READING > token.c:564:processing result tokens. marker is d1(ROW) > token.c:1951:tds_process_row(): reading column 0 > data.c:534:tds_get_data: type 56, varint size 0 > data.c:587:tds_get_data(): wire column size is 4 > util.c:165:Changed query state from READING to PENDING > buffering.h:305:buffer_transfer_bound_data(0x1afeb90 4040 -1 0x1afeb80 0) > dblib.c:7210:copy_data_to_host_var(56 [SYBINT4] len 4 => 56 [SYBINT4] len 0) > dblib.c:7252:copy_data_to_host_var() srctype == desttype > dblib.c:2117:leaving dbnextrow() returning REG_ROW/MORE_ROWS > > - kv, Karen > Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From sf at 4js.com Tue Aug 9 11:48:05 2016 From: sf at 4js.com (Sebastien FLAESCH) Date: Tue, 9 Aug 2016 17:48:05 +0200 Subject: [freetds] SQL Server 2016 support In-Reply-To: <57A98AC7.60101@4js.com> References: <57A98AC7.60101@4js.com> Message-ID: <57A9FB35.7020601@4js.com> In fact from time to time the connection to SQL Server 2016 fails. No idea if this is a server issue or FreeTDS bug, but it occurs only with FreeTDS. We do the same tests with Easysoft's ODBC driver for SQL Server and no problem with that one. Attached the TDSDUMP... hopefully this can help. Seb On 08/09/2016 09:48 AM, Sebastien FLAESCH wrote: > Hi all, > > What is the status of SQL Server 2016 support? > > I could not find any thread with "FreeTDS" + "SQL Server 2016" on the net. > > Is there any doc / howto available? > > For example, what is the TDS protocol version to be used? > > We have executed our SQL regressions tests. > > FreeTDS 1.0 seems to work fine with SQL Server 2016 using: > > TDS_Version = 7.3 > > Thanks, > Seb > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > -------------- next part -------------- A non-text attachment was scrubbed... Name: tdsdump.log Type: text/x-log Size: 106978 bytes Desc: not available URL: From ikorot01 at gmail.com Tue Aug 9 15:38:07 2016 From: ikorot01 at gmail.com (Igor Korot) Date: Tue, 9 Aug 2016 15:38:07 -0400 Subject: [freetds] "DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field" - FreeTDS trying to convert to SYBMONEY for some reason? In-Reply-To: <1470730307676.88300@isavia.is> References: <1470416588834.22693@isavia.is> <1470506302531.39547@isavia.is> <1470730307676.88300@isavia.is> Message-ID: Karen, On Tue, Aug 9, 2016 at 4:11 AM, Karen Pease wrote: > Then again, perhaps Sybase would have messed up on this as well. (I'll reiterate that this is old code that I didn't write that I've been tasked to deal with). The last platform it was on was 32 bit where long int was indeed 4 bytes / 32 bits. But on the new platform "long int" is 8 bytes / 64 bits. So maybe that's the problem if, as you say, INTBND is designed to only write 4 bytes but there's an 8 byte value on hand. I'll try correcting our local definition to use an actual 32 bit value and see if that solves the problem. Or you can just call: memset( , 0, sizeof( ) ); Thank you. > > - kv, Karen > > ________________________________________ > Fr?: FreeTDS fyrir h?nd Frediano Ziglio > Sent: 7. ?g?st 2016 15:00 > Til: FreeTDS Development Group > Efni: Re: [freetds] "DB-lib error, no 20050, Attempt to convert data stopped by syntax error in source field" - FreeTDS trying to convert to SYBMONEY for some reason? > > 2016-08-06 18:58 GMT+01:00 Karen Pease : >> That indeed was the problem - thanks a bunch :) I didn't have the sybase package installed, which was confusing, but apparently our app has some of the sybase headers in its include directory; I had to remove them. >> >> One more piece of weirdness I'm hitting... and it took me a long time to track down: >> >> int32 count; >> ... >> dbcmd (ET_fillas_dbp1, " select count(*) "); >> dbcmd (ET_fillas_dbp1, " from AIRSPACE_BOUND "); >> dbfcmd (ET_fillas_dbp1, " where Airspace_Vol_Name = '%s' ", volname); >> dbsqlexec (ET_fillas_dbp1); >> if (dbresults (ET_fillas_dbp1) != SUCCEED) >> return; >> dbbind (ET_fillas_dbp1, 1, INTBIND, (DBINT) 0, &count); >> dbnextrow (ET_fillas_dbp1); >> printf("%d, %X, %lX\n", __LINE__, count, count, count); >> >> So, obviously, count is just an integer, it should never be negative. For example, if I run that query in in tsql, it returns '4'. But the output in the code is: >> >> 4 4 7FFF00000004 >> >> ... as if it's doing some sort of weird negative conversion (???). It took a long time to catch because when I was just printing it out with "%d" it looked fine, but it was crashing me in a calloc statement. >> > > I don't know your system but I suppose that sizeof(int) == 4 and > sizeof(long) == 8 and you are doing something bad with printf. INTBIND > is supposed to write a 4 byte integer. Explaining what's going on > requires to understand how does variadic functions work and the > architecture you are using. > I cannot see the calloc call. > How is defined the int32? Usually DBINT is safer. > >> Any clue what's going on there? The dump ends: >> >> dblib.c:2031:dbnextrow(0x1afeb80) >> dblib.c:2043:dbnextrow() dbresults_state = 2 (_DB_RES_RESULTSET_ROWS) >> token.c:549:tds_process_tokens(0x1aff550, 0x7ffe79928be4, (nil), 0x1508) >> util.c:165:Changed query state from PENDING to READING >> token.c:564:processing result tokens. marker is d1(ROW) >> token.c:1951:tds_process_row(): reading column 0 >> data.c:534:tds_get_data: type 56, varint size 0 >> data.c:587:tds_get_data(): wire column size is 4 >> util.c:165:Changed query state from READING to PENDING >> buffering.h:305:buffer_transfer_bound_data(0x1afeb90 4040 -1 0x1afeb80 0) >> dblib.c:7210:copy_data_to_host_var(56 [SYBINT4] len 4 => 56 [SYBINT4] len 0) >> dblib.c:7252:copy_data_to_host_var() srctype == desttype >> dblib.c:2117:leaving dbnextrow() returning REG_ROW/MORE_ROWS >> >> - kv, Karen >> > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From jyan at tableau.com Tue Aug 9 18:28:30 2016 From: jyan at tableau.com (Johnny Yan) Date: Tue, 9 Aug 2016 22:28:30 +0000 Subject: [freetds] How does FreeTDS support bulk export Message-ID: Hi, We've observed, through the freetds.log, that when we try to bulk export multiple rows, what FreeTDS really does is replacing the ? placehold with the corresponding param value(s), then concatenating multiple "INSERT INTO..." statements into a single query, and finally sent it through the wire. Is this what we're supposed to expect? How does FreeTDS support bulk export? Thanks, Johnny From bill.d.thompson at baml.com Wed Aug 10 08:36:57 2016 From: bill.d.thompson at baml.com (Thompson, William) Date: Wed, 10 Aug 2016 12:36:57 +0000 Subject: [freetds] How does FreeTDS support bulk export In-Reply-To: References: Message-ID: <4A990489BF566041A7724DC577BB060417F44F8B@smtp_mail.bankofamerica.com> Hi Johnny, What is this "bulk export" you refer to? If there's INSERT statements going on, it sounds more like an import to me... What is wrapped around FreeTDS in your application? I think it's more likely that it's this that is deciding on the approach of generating multiple INSERT statements, rather than FreeTDS. Bill -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Johnny Yan Sent: 09 August 2016 23:29 To: freetds at lists.ibiblio.org Subject: [freetds] How does FreeTDS support bulk export Hi, We've observed, through the freetds.log, that when we try to bulk export multiple rows, what FreeTDS really does is replacing the ? placehold with the corresponding param value(s), then concatenating multiple "INSERT INTO..." statements into a single query, and finally sent it through the wire. Is this what we're supposed to expect? How does FreeTDS support bulk export? Thanks, Johnny _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. From sf at 4js.com Tue Aug 16 05:21:52 2016 From: sf at 4js.com (Sebastien FLAESCH) Date: Tue, 16 Aug 2016 11:21:52 +0200 Subject: [freetds] FreeTDS 1.00 connection problem In-Reply-To: <57A98AC7.60101@4js.com> References: <57A98AC7.60101@4js.com> Message-ID: <57B2DB30.8050505@4js.com> Hi all, I resend this in a dedicated discussion thread: We have reported this issue in the "SQL Server 2016 support" thread, but in fact, we experience the same connection problems with SQL Server 2014! So it's probably a bug in FreeTDS 1.00... We have never experienced such problem with prior versions. FYI: Our test program connects/disconnects in a loop. TDSDUMP provided in attachment. Seb -------------- next part -------------- A non-text attachment was scrubbed... Name: tdsdump.log Type: text/x-log Size: 106978 bytes Desc: not available URL: From john at capps.com Wed Aug 17 19:55:43 2016 From: john at capps.com (John Kendall) Date: Wed, 17 Aug 2016 23:55:43 +0000 Subject: [freetds] defncopy query "order by" different for ASE Message-ID: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> Hi, all. Line 224 of defncopy.c is: " order by c.number, c.colid" This is the correct for MS SQL, but not for ASE. For ASE it should be: " order by c.number, c.colid2, c.colid" Since most objects stored in syscomments are small, leaving out colid2 is not a problem. But very large objects will display incorrectly. As you might expect, I recently ran into this problem. :) It should be a quick patch, but I'm not sure the best way to determine if the server is ASE and MS SQL. Thanks, John From freddy77 at gmail.com Thu Aug 18 01:40:19 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 18 Aug 2016 06:40:19 +0100 Subject: [freetds] defncopy query "order by" different for ASE In-Reply-To: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> References: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> Message-ID: A query like select 1 from syscomments where colid2 = 0 and 0=1 could help. On 18 Aug 2016 01:55, "John Kendall" wrote: > Hi, all. > Line 224 of defncopy.c is: > > > " order by c.number, c.colid" > > This is the correct for MS SQL, but not for ASE. For ASE it should be: > > > " order by c.number, c.colid2, c.colid" > > > Since most objects stored in syscomments are small, leaving out colid2 is > not a problem. But very large objects will display incorrectly. As you > might expect, I recently ran into this problem. :) > > It should be a quick patch, but I'm not sure the best way to determine if > the server is ASE and MS SQL. > > Thanks, > John > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > From john at capps.com Thu Aug 18 12:38:57 2016 From: john at capps.com (John Kendall) Date: Thu, 18 Aug 2016 16:38:57 +0000 Subject: [freetds] [GRAYMAIL] defncopy query "order by" different for ASE In-Reply-To: References: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> Message-ID: On Aug 17, 2016, at 10:40 PM, Frediano Ziglio wrote: > A query like select 1 from syscomments where colid2 = 0 and 0=1 could help. MS SQL server does not have a colid2 column in syscomments, so this produces an error. I'm not sure how to make it work. > > On 18 Aug 2016 01:55, "John Kendall" wrote: > >> Hi, all. >> Line 224 of defncopy.c is: >> >> >> " order by c.number, c.colid" >> >> This is the correct for MS SQL, but not for ASE. For ASE it should be: >> >> >> " order by c.number, c.colid2, c.colid" >> >> >> Since most objects stored in syscomments are small, leaving out colid2 is >> not a problem. But very large objects will display incorrectly. As you >> might expect, I recently ran into this problem. :) >> >> It should be a quick patch, but I'm not sure the best way to determine if >> the server is ASE and MS SQL. >> >> Thanks, >> John >> >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From james.k.lowden at icloud.com Thu Aug 18 23:16:07 2016 From: james.k.lowden at icloud.com (James K. Lowden) Date: Thu, 18 Aug 2016 23:16:07 -0400 Subject: [freetds] defncopy query "order by" different for ASE In-Reply-To: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> References: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> Message-ID: <20160818231607.9356c0366ac5abe73afb5c08@icloud.com> On Wed, 17 Aug 2016 23:55:43 +0000 John Kendall wrote: > It should be a quick patch, but I'm not sure the best way to > determine if the server is ASE and MS SQL. Test for TDS version 5. --jkl From jyan at tableau.com Tue Aug 16 16:14:15 2016 From: jyan at tableau.com (Johnny Yan) Date: Tue, 16 Aug 2016 20:14:15 +0000 Subject: [freetds] How does FreeTDS support bulk export In-Reply-To: <4A990489BF566041A7724DC577BB060417F44F8B@smtp_mail.bankofamerica.com> References: <4A990489BF566041A7724DC577BB060417F44F8B@smtp_mail.bankofamerica.com> Message-ID: Hi Bill, So sorry about the delay. The "bulk export" is referred to insert multiple rows into a temp table which we just created. In terms of the ODBC API calls, the stack is roughly like this, SQLAllocHandle( SQL_HANDLE_STMT, ...) ); SQLExecDirectW(..., "CREATE TABLE [#temp_table_name] (columns)",...); SQLAllocHandle( SQL_HANDLE_STMT, ... ); SQLPrepare(..., "INSERT INTO [#temp_table_name] (columns) VALUES (?,...) ",...) SQLSetStmtAttrW(..., SQL_ATTR_PARAMSET_SIZE, num_rows_export, SQL_IS_UINTEGER ); SQLBindParameter(..., SQL_PARAM_INPUT, ...) SQLExecDirect(...,"INSERT INTO [#temp_table_name] (columns) VALUES (?,...) ",...) With MS Native Client on Windows and/or Simba driver on OSX, this is working just fine. But with FreeTDS, we found that the placeholds(?) in the prepared statement were replaced with the value of the params. I actually debugged a little bit of the FreeTDS code. In _SQLExecute(TDS_STMT * stmt):odbc.c(3270), it goes into the branch "else if (stmt->query)" and the following comments are confusing since we're passing in a prepared statement. Because of this, the code path then goes into tds_multiple_query -> tds_send_emulated_execute, which looks like really "emulating"(bulk export). I suspect the "stmt->query" condition might be misleading in the first place but not sure at all. What do you think? If you need more info, please let me know. Thanks, Johnny -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Thompson, William Sent: Wednesday, August 10, 2016 5:37 AM To: FreeTDS Development Group Subject: Re: [freetds] How does FreeTDS support bulk export Hi Johnny, What is this "bulk export" you refer to? If there's INSERT statements going on, it sounds more like an import to me... What is wrapped around FreeTDS in your application? I think it's more likely that it's this that is deciding on the approach of generating multiple INSERT statements, rather than FreeTDS. Bill -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Johnny Yan Sent: 09 August 2016 23:29 To: freetds at lists.ibiblio.org Subject: [freetds] How does FreeTDS support bulk export Hi, We've observed, through the freetds.log, that when we try to bulk export multiple rows, what FreeTDS really does is replacing the ? placehold with the corresponding param value(s), then concatenating multiple "INSERT INTO..." statements into a single query, and finally sent it through the wire. Is this what we're supposed to expect? How does FreeTDS support bulk export? Thanks, Johnny _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From Jos.van.Santen at rabobank.nl Thu Aug 18 02:28:04 2016 From: Jos.van.Santen at rabobank.nl (Santen van, JDG (Jos)) Date: Thu, 18 Aug 2016 06:28:04 +0000 Subject: [freetds] diacritics issue Message-ID: Hi I am facing an issue with diacritics. I am running MS SQL Enterprise x64 version 11.0.6523.0, created a table there with a colomn type varchar(100) and nvarchar(100) Stored the string: ??????????????????????????????????????????????????I? in both fields. Codepage is 1252 latin and server collation is Latin1_General_CI_AS The table is using the servers defaults. Using FreeTDS driver 0.91, defined protocol version 7.0 in the freetds config, the data retrieved by the client is corrupted, the ?? (9a 9e) and ?? (8a 8e) aren?t viewable in our client and returned ?blanks? (actually the 9a 9e and 8a 8e aren?t visible in our client), the ????I? is returned as gisGIS (67 69 73 47 49 53) The returned hex values of the complete string for both field types is the same: 63 9a 9e 43 8a 8e e0 e2 e7 e8 e9 ea eb ee ef f4 f9 fb fc c0 c2 c7 c8 c9 ca cb ce cf d4 d9 db dc e1 ed f3 fa f1 c1 cd d3 da d1 e4 f6 c4 d6 67 69 73 47 49 53 A part of the debug log related to character conversion: iconv.c:330:tds_iconv_open(0x1891400, UTF-8) iconv.c:187:local name for ISO-8859-1 is ISO-8859-1 iconv.c:187:local name for UTF-8 is UTF-8 iconv.c:187:local name for UCS-2LE is UCS-2LE iconv.c:187:local name for UCS-2BE is UCS-2BE iconv.c:349:setting up conversions for client charset "UTF-8" iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion iconv.c:391:preparing iconv for "ISO-8859-1" <-> "ISO-8859-1" conversion iconv.c:394:tds_iconv_open: done net.c:205:Connecting to x.x.x.x port 1433 (TDS version 4.2) (btw: Notice the TDS version used: 4.2 while we defined 7.0) Does anyone know how to solve this issue? BR Jos ====================================================== Rabobank disclaimer: http://www.rabobank.nl/disclaimer From freddy77 at gmail.com Sat Aug 20 04:26:24 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Sat, 20 Aug 2016 09:26:24 +0100 Subject: [freetds] diacritics issue In-Reply-To: References: Message-ID: 2016-08-18 7:28 GMT+01:00 Santen van, JDG (Jos) : > Hi > > I am facing an issue with diacritics. > I am running MS SQL Enterprise x64 version 11.0.6523.0, created a table there with a colomn type varchar(100) and nvarchar(100) > Stored the string: ??????????????????????????????????????????????????I? in both fields. > > Codepage is 1252 latin and server collation is Latin1_General_CI_AS > The table is using the servers defaults. > ? and ? are not available in Windows 1252 encoding. Same for ?, ?, ?, ? and ?. > Using FreeTDS driver 0.91, defined protocol version 7.0 in the freetds config, the data retrieved by the client is corrupted, the ?? (9a 9e) and ?? (8a 8e) aren?t viewable in our client and returned ?blanks? (actually the 9a 9e and 8a 8e aren?t visible in our client), the ????I? is returned as gisGIS (67 69 73 47 49 53) > Maybe your client is not correctly. 9a 9e is the right encoding for windows 1252. Which client encoding are you using? FreeTDS 0.91 is quite obsolete. Which library are you using? > The returned hex values of the complete string for both field types is the same: > 63 9a 9e 43 8a 8e e0 e2 e7 e8 e9 ea eb ee ef f4 f9 fb fc c0 c2 c7 c8 c9 ca cb ce cf d4 d9 db dc e1 ed f3 fa f1 c1 cd d3 da d1 e4 f6 c4 d6 67 69 73 47 49 53 > >From the log/server or from the library you are using? > A part of the debug log related to character conversion: > iconv.c:330:tds_iconv_open(0x1891400, UTF-8) > iconv.c:187:local name for ISO-8859-1 is ISO-8859-1 > iconv.c:187:local name for UTF-8 is UTF-8 > iconv.c:187:local name for UCS-2LE is UCS-2LE > iconv.c:187:local name for UCS-2BE is UCS-2BE > iconv.c:349:setting up conversions for client charset "UTF-8" > iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion > iconv.c:391:preparing iconv for "ISO-8859-1" <-> "ISO-8859-1" conversion > iconv.c:394:tds_iconv_open: done > net.c:205:Connecting to x.x.x.x port 1433 (TDS version 4.2) > > (btw: Notice the TDS version used: 4.2 while we defined 7.0) > It seems you are really using 4.2. How did you defined 7.0 ? > Does anyone know how to solve this issue? > > BR Jos Frediano From vasanth.sengunthar at accenture.com Sat Aug 20 13:47:42 2016 From: vasanth.sengunthar at accenture.com (vasanth.sengunthar at accenture.com) Date: Sat, 20 Aug 2016 17:47:42 +0000 Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Message-ID: Hi, Thank you all in advance, please help me with below issue. I have been working with fisql command lot lately and recently I came across this issue, where the fisql command does not give (return status=0) for some SQL execution. The Issues is not generic but specific to any such SQL store procedure which gives output in (results + message) format. And the approach I like to present to out client includes such scenario where they have multiple store procedure like above. Looking forward to your earliest response, Regards, Vasanth Sengunthar ________________________________ This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. ______________________________________________________________________________________ www.accenture.com From ikorot01 at gmail.com Sat Aug 20 21:32:54 2016 From: ikorot01 at gmail.com (Igor Korot) Date: Sat, 20 Aug 2016 21:32:54 -0400 Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) In-Reply-To: References: Message-ID: Hi. Do you have an example of one such SP? What is you DB (MS, Sybase) and what version? Which protocol version do you use? All in all - we need more info. Thank you. On Aug 20, 2016 11:01 AM, wrote: Hi, Thank you all in advance, please help me with below issue. I have been working with fisql command lot lately and recently I came across this issue, where the fisql command does not give (return status=0) for some SQL execution. The Issues is not generic but specific to any such SQL store procedure which gives output in (results + message) format. And the approach I like to present to out client includes such scenario where they have multiple store procedure like above. Looking forward to your earliest response, Regards, Vasanth Sengunthar ________________________________ This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. ____________________________________________________________ __________________________ www.accenture.com _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From john at capps.com Mon Aug 22 03:55:22 2016 From: john at capps.com (John Kendall) Date: Mon, 22 Aug 2016 07:55:22 +0000 Subject: [freetds] defncopy query "order by" different for ASE In-Reply-To: <20160818231607.9356c0366ac5abe73afb5c08@icloud.com> References: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> <20160818231607.9356c0366ac5abe73afb5c08@icloud.com> Message-ID: > On Aug 18, 2016, at 8:16 PM, James K. Lowden wrote: > > On Wed, 17 Aug 2016 23:55:43 +0000 > John Kendall wrote: > >> It should be a quick patch, but I'm not sure the best way to >> determine if the server is ASE and MS SQL. > > Test for TDS version 5. Excellent idea, thank you! However after trying for a few hours, I'm going to have to ask how to get the tds_version. I assume I get it from dbproc, but I never seem to have the right headers (or something). Thanks, anyone. John > --jkl > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From vasanth.sengunthar at accenture.com Mon Aug 22 05:39:06 2016 From: vasanth.sengunthar at accenture.com (vasanth.sengunthar at accenture.com) Date: Mon, 22 Aug 2016 09:39:06 +0000 Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) In-Reply-To: References: Message-ID: Hi, Please check below sample SP. Database : Microsoft SQL Server 2012 Protocol Version : tds_version = 7.0 [SP] --------- USE [TEST01] GO /****** Object: StoredProcedure [dbo].[tst_test_result_msg] Script Date: 8/22/2016 5:31:16 AM ******/ SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[tst_test_result_msg] @tst_flag varchar(1), @tst_desc varchar(40) AS BEGIN DECLARE @tst_activ_type varchar(5) SELECT cust_no, cust_name FROM dbo.customer IF @tst_flag = 'A' SELECT @tst_desc = 'Print A' ELSE IF @tst_flag = 'B' SELECT @tst_desc = 'Print B' ELSE IF @tst_flag = 'C' SELECT @tst_desc = 'Print C' ELSE IF @tst_flag = 'D' SELECT @tst_desc = 'Print D' PRINT @tst_desc END Regards, Vasanth -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Igor Korot Sent: Sunday, August 21, 2016 7:03 AM To: FreeTDS Development Group Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi. Do you have an example of one such SP? What is you DB (MS, Sybase) and what version? Which protocol version do you use? All in all - we need more info. Thank you. On Aug 20, 2016 11:01 AM, wrote: Hi, Thank you all in advance, please help me with below issue. I have been working with fisql command lot lately and recently I came across this issue, where the fisql command does not give (return status=0) for some SQL execution. The Issues is not generic but specific to any such SQL store procedure which gives output in (results + message) format. And the approach I like to present to out client includes such scenario where they have multiple store procedure like above. Looking forward to your earliest response, Regards, Vasanth Sengunthar ________________________________ This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. ____________________________________________________________ __________________________ www.accenture.com _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= From vasanth.sengunthar at accenture.com Mon Aug 22 05:40:20 2016 From: vasanth.sengunthar at accenture.com (vasanth.sengunthar at accenture.com) Date: Mon, 22 Aug 2016 09:40:20 +0000 Subject: [freetds] FreeTDS: Facing issue with Freebcp option -F Message-ID: <26f1deeebead457db9bfd7989bbe0a47@SN4PR4205MB0413.048d.mgd.msft.net> Hi, Please check below codes with error of freebcp -F option, which is not giving the desired results. In below example we are trying to restore the table of (MS SQL server 2012) from flat file as source. The said flat file is having two rows as header so we want to start from 3rd row, however the option fails to do so and considers the first two row while restoring. And these said columns are declared as money datatype in SQL, so due to unexpected text with header line its getting failed. freebcp dbo.dev01_temp in /test/data/fd/f1.dat -F2 -f/test/data/da_bcp.fmt -SSIMA -Ppsd -Utest -e /test/logs/bcp_error.txt Starting copy... Msg 20050, Level 4 Attempt to convert data stopped by syntax error in source field Msg 20050, Level 4 Attempt to convert data stopped by syntax error in source field Msg 20050, Level 4 Attempt to convert data stopped by syntax error in source field Msg 20050, Level 4 Attempt to convert data stopped by syntax error in source field Msg 20050, Level 4 Attempt to convert data stopped by syntax error in source field Msg 20050, Level 4 Attempt to convert data stopped by syntax error in source field Msg 20050, Level 4 Attempt to convert data stopped by syntax error in source field Msg 20050, Level 4 Attempt to convert data stopped by syntax error in source field Msg 20088, Level 3 I/O error while writing bcp error file 1672 rows copied. --------------------------------------------------------------- linux:white:/test/scripts> more /test/data/fd/f1.dat | wc -l 1674 linux:white:/test/scripts> more /test/logs/bcp_error.txt #@ data conversion error on host data file Row 1 Column 23 # #@ data conversion error on host data file Row 1 Column 27 # #@ data conversion error on host data file Row 1 Column 28 # #@ data conversion error on host data file Row 1 Column 31 # #@ data conversion error on host data file Row 1 Column 32 # Regards, Vasanth Sengunthar Accenture | India, Mumbai Delivery Centre M: +91 8655274310 ________________________________ This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. ______________________________________________________________________________________ www.accenture.com From Jos.van.Santen at rabobank.nl Mon Aug 22 06:43:41 2016 From: Jos.van.Santen at rabobank.nl (Santen van, JDG (Jos)) Date: Mon, 22 Aug 2016 10:43:41 +0000 Subject: [freetds] diacritics issue In-Reply-To: Message-ID: <051d80f5cccb4239aee256e91e717329@BSTS124014.eu.rabonet.com> > -----Oorspronkelijk bericht----- > Van: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] Namens Frediano > Ziglio > Verzonden: zaterdag 20 augustus 2016 10:26 > Aan: FreeTDS Development Group > Onderwerp: Re: [freetds] diacritics issue > > 2016-08-18 7:28 GMT+01:00 Santen van, JDG (Jos) > : > > Hi > > > > I am facing an issue with diacritics. > > I am running MS SQL Enterprise x64 version 11.0.6523.0, created a > > table there with a colomn type varchar(100) and nvarchar(100) Stored the > string: ??????????????????????????????????????????????????I? in both > fields. > > > > Codepage is 1252 latin and server collation is Latin1_General_CI_AS > > The table is using the servers defaults. > > > > ? and ? are not available in Windows 1252 encoding. > Same for ?, ?, ?, ? and ?. Correct, but they are perfectly converted to their ascii equivalent c, C, g, i G and S. > > > Using FreeTDS driver 0.91, defined protocol version 7.0 in the freetds > > config, the data retrieved by the client is corrupted, the ?? (9a 9e) > > and ?? (8a 8e) aren?t viewable in our client and returned ?blanks? > > (actually the 9a 9e and 8a 8e aren?t visible in our client), the > > ????I? is returned as gisGIS (67 69 73 47 49 53) > > > > Maybe your client is not correctly. 9a 9e is the right encoding for windows > 1252. > Which client encoding are you using? The client uses UCS2 encoding. > FreeTDS 0.91 is quite obsolete. > Which library are you using? Currently we use UnixODBC 2.2.14 > > > The returned hex values of the complete string for both field types is the > same: > > 63 9a 9e 43 8a 8e e0 e2 e7 e8 e9 ea eb ee ef f4 f9 fb fc c0 c2 c7 c8 > > c9 ca cb ce cf d4 d9 db dc e1 ed f3 fa f1 c1 cd d3 da d1 e4 f6 c4 d6 > > 67 69 73 47 49 53 > > > > From the log/server or from the library you are using? > > > A part of the debug log related to character conversion: > > iconv.c:330:tds_iconv_open(0x1891400, UTF-8) iconv.c:187:local name > > for ISO-8859-1 is ISO-8859-1 iconv.c:187:local name for UTF-8 is UTF-8 > > iconv.c:187:local name for UCS-2LE is UCS-2LE iconv.c:187:local name > > for UCS-2BE is UCS-2BE iconv.c:349:setting up conversions for client > > charset "UTF-8" > > iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion > > iconv.c:391:preparing iconv for "ISO-8859-1" <-> "ISO-8859-1" > > conversion > > iconv.c:394:tds_iconv_open: done > > net.c:205:Connecting to x.x.x.x port 1433 (TDS version 4.2) > > > > (btw: Notice the TDS version used: 4.2 while we defined 7.0) > > > > It seems you are really using 4.2. How did you defined 7.0 ? In the config file for this datasource we defined: tds version = 7.0 > > > Does anyone know how to solve this issue? > > > > BR Jos > > Frediano BR Jos ====================================================== Rabobank disclaimer: http://www.rabobank.nl/disclaimer From no-reply at appveyor.com Tue Aug 23 17:35:57 2016 From: no-reply at appveyor.com (AppVeyor) Date: Tue, 23 Aug 2016 21:35:57 +0000 Subject: [freetds] Build failed: freetds 647 Message-ID: <20160823212950.20426.50234.4EF39F0F@appveyor.com> From jonesd at xmission.com Tue Aug 23 11:25:11 2016 From: jonesd at xmission.com (Dominic Jones) Date: Tue, 23 Aug 2016 09:25:11 -0600 Subject: [freetds] Passing username and password to bsqldb other than by command line Message-ID: <20160823092511.b5858232f0e7a5b610b5d551@xmission.com> Is there a way to pass the database username and password to the bsqldb utility other than by using command line arguments? I have checked the documentation for environment variables and configuration file options without seeing anything relevant. A web search likewise didn't provide any leads. -- Dominic Jones From john at capps.com Tue Aug 23 21:38:25 2016 From: john at capps.com (John Kendall) Date: Wed, 24 Aug 2016 01:38:25 +0000 Subject: [freetds] defncopy query "order by" different for ASE In-Reply-To: References: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> <20160818231607.9356c0366ac5abe73afb5c08@icloud.com> Message-ID: <096FADC0-2D31-4A03-9734-2F954CCB9F5F@capps.com> I figured it out. Getting the right headers in the right order slowed me down. Here is my patch for consideration. Cheers, John *** src/apps/defncopy.c 2016-06-19 02:00:01.000000000 -0700 --- src/apps/defncopy.c-patch 2016-08-23 18:17:24.897056456 -0700 *************** int getopt(int argc, const char *argv[], *** 80,86 **** --- 80,88 ---- #include #endif + #include #include + #include #include #ifndef MicrosoftsDbLib #include "replacements.h" *************** main(int argc, char *argv[]) *** 220,232 **** " and o.name = '%s'" " and o.uid = user_id('%s')" " and o.type not in ('U', 'S')" /* no user or system tables */ ! " order by c.number, c.colid" ; static const char query_table[] = " execute sp_help '%s.%s' "; parse_argument(argv[i], &procedure); ! erc = dbfcmd(dbproc, query, procedure.name, procedure.owner); /* Send the query to the server (we could use dbsqlexec(), instead) */ erc = dbsqlsend(dbproc); --- 222,235 ---- " and o.name = '%s'" " and o.uid = user_id('%s')" " and o.type not in ('U', 'S')" /* no user or system tables */ ! " order by c.number, %s c.colid" ; static const char query_table[] = " execute sp_help '%s.%s' "; parse_argument(argv[i], &procedure); ! erc = dbfcmd(dbproc, query, procedure.name, procedure.owner, ! (dbproc->tds_socket->conn->tds_version == 0x500) ? "c.colid2, ":""); /* Send the query to the server (we could use dbsqlexec(), instead) */ erc = dbsqlsend(dbproc); > On Aug 22, 2016, at 12:55 AM, John Kendall wrote: > > >> On Aug 18, 2016, at 8:16 PM, James K. Lowden wrote: >> >> On Wed, 17 Aug 2016 23:55:43 +0000 >> John Kendall wrote: >> >>> It should be a quick patch, but I'm not sure the best way to >>> determine if the server is ASE and MS SQL. >> >> Test for TDS version 5. > > Excellent idea, thank you! > > However after trying for a few hours, I'm going to have to ask how to get the tds_version. > I assume I get it from dbproc, but I never seem to have the right headers (or something). > > Thanks, anyone. > > John > > > >> --jkl >> >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds > From james.k.lowden at icloud.com Wed Aug 24 01:41:20 2016 From: james.k.lowden at icloud.com (James K. Lowden) Date: Wed, 24 Aug 2016 01:41:20 -0400 Subject: [freetds] Passing username and password to bsqldb other than by command line In-Reply-To: <20160823092511.b5858232f0e7a5b610b5d551@xmission.com> References: <20160823092511.b5858232f0e7a5b610b5d551@xmission.com> Message-ID: <20160824014120.d6357152242a33e648afbd15@icloud.com> On Tue, 23 Aug 2016 09:25:11 -0600 Dominic Jones wrote: > Is there a way to pass the database username and password to the > bsqldb utility other than by using command line arguments? If Kerberos or similar is configured, any FreeTDS application can take advantage of it. It's documented for tsql. Glancing at the code, it looks like it's meant to work in bsqldb. --jkl From james.k.lowden at icloud.com Wed Aug 24 01:41:12 2016 From: james.k.lowden at icloud.com (James K. Lowden) Date: Wed, 24 Aug 2016 01:41:12 -0400 Subject: [freetds] defncopy query "order by" different for ASE In-Reply-To: <096FADC0-2D31-4A03-9734-2F954CCB9F5F@capps.com> References: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> <20160818231607.9356c0366ac5abe73afb5c08@icloud.com> <096FADC0-2D31-4A03-9734-2F954CCB9F5F@capps.com> Message-ID: <20160824014112.7375a923110e8ddd63f19974@icloud.com> On Wed, 24 Aug 2016 01:38:25 +0000 John Kendall wrote: > I figured it out. Getting the right headers in the right order > slowed me down. Here is my patch for consideration. John, I think all you need is a call to the public function const char *dbversion(void); HTH. --jkl From john at capps.com Wed Aug 24 02:25:47 2016 From: john at capps.com (John Kendall) Date: Wed, 24 Aug 2016 06:25:47 +0000 Subject: [freetds] defncopy query "order by" different for ASE In-Reply-To: <20160824014112.7375a923110e8ddd63f19974@icloud.com> References: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> <20160818231607.9356c0366ac5abe73afb5c08@icloud.com> <096FADC0-2D31-4A03-9734-2F954CCB9F5F@capps.com> <20160824014112.7375a923110e8ddd63f19974@icloud.com> Message-ID: <296DBA89-42A5-4C51-BB6C-E0EA393090CC@capps.com> > On Aug 23, 2016, at 10:41 PM, James K. Lowden wrote: > > On Wed, 24 Aug 2016 01:38:25 +0000 > John Kendall wrote: > >> I figured it out. Getting the right headers in the right order >> slowed me down. Here is my patch for consideration. > > John, I think all you need is a call to the public function > > const char *dbversion(void); > It looks like dbversion() returns the FreeTDS version number, currently "freetds v1.00.13." The patch is working for me, but if there is a better way... John > HTH. > > --jkl > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From james.k.lowden at icloud.com Wed Aug 24 13:50:24 2016 From: james.k.lowden at icloud.com (James K. Lowden) Date: Wed, 24 Aug 2016 13:50:24 -0400 Subject: [freetds] defncopy query "order by" different for ASE In-Reply-To: <296DBA89-42A5-4C51-BB6C-E0EA393090CC@capps.com> References: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> <20160818231607.9356c0366ac5abe73afb5c08@icloud.com> <096FADC0-2D31-4A03-9734-2F954CCB9F5F@capps.com> <20160824014112.7375a923110e8ddd63f19974@icloud.com> <296DBA89-42A5-4C51-BB6C-E0EA393090CC@capps.com> Message-ID: <20160824135024.f24a36ecb5495ef0641cc597@icloud.com> On Wed, 24 Aug 2016 06:25:47 +0000 John Kendall wrote: > > > On Aug 23, 2016, at 10:41 PM, James K. Lowden > > wrote: > > > > On Wed, 24 Aug 2016 01:38:25 +0000 > > John Kendall wrote: > > > >> I figured it out. Getting the right headers in the right order > >> slowed me down. Here is my patch for consideration. > > > > John, I think all you need is a call to the public function > > > > const char *dbversion(void); > > > > It looks like dbversion() returns the FreeTDS version number, > currently "freetds v1.00.13." The patch is working for me, but if > there is a better way... John Sorry, late night. The macro you want is DBTDS(). It returns an integer for which symbolic constants are defined in sybdb.h. --jkl From john at capps.com Wed Aug 24 14:20:31 2016 From: john at capps.com (John Kendall) Date: Wed, 24 Aug 2016 18:20:31 +0000 Subject: [freetds] defncopy query "order by" different for ASE In-Reply-To: <20160824135024.f24a36ecb5495ef0641cc597@icloud.com> References: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> <20160818231607.9356c0366ac5abe73afb5c08@icloud.com> <096FADC0-2D31-4A03-9734-2F954CCB9F5F@capps.com> <20160824014112.7375a923110e8ddd63f19974@icloud.com> <296DBA89-42A5-4C51-BB6C-E0EA393090CC@capps.com> <20160824135024.f24a36ecb5495ef0641cc597@icloud.com> Message-ID: <90A627EE-7DFD-4760-8913-4BAAB115EE3D@capps.com> > On Aug 24, 2016, at 10:50 AM, James K. Lowden wrote: > > On Wed, 24 Aug 2016 06:25:47 +0000 > John Kendall wrote: > >> >>> On Aug 23, 2016, at 10:41 PM, James K. Lowden >>> wrote: >>> >>> On Wed, 24 Aug 2016 01:38:25 +0000 >>> John Kendall wrote: >>> >>>> I figured it out. Getting the right headers in the right order >>>> slowed me down. Here is my patch for consideration. >>> >>> John, I think all you need is a call to the public function >>> >>> const char *dbversion(void); >>> >> >> It looks like dbversion() returns the FreeTDS version number, >> currently "freetds v1.00.13." The patch is working for me, but if >> there is a better way... John > > Sorry, late night. The macro you want is DBTDS(). It returns an > integer for which symbolic constants are defined in sybdb.h. > > --jkl That's the ticket! Many thanks. New, simpler patch for consideration: *** defncopy.c 2016-06-19 02:00:01.000000000 -0700 --- defncopy.c-patch 2016-08-24 11:13:30.883345277 -0700 *************** main(int argc, char *argv[]) *** 220,232 **** " and o.name = '%s'" " and o.uid = user_id('%s')" " and o.type not in ('U', 'S')" /* no user or system tables */ ! " order by c.number, c.colid" ; static const char query_table[] = " execute sp_help '%s.%s' "; parse_argument(argv[i], &procedure); ! erc = dbfcmd(dbproc, query, procedure.name, procedure.owner); /* Send the query to the server (we could use dbsqlexec(), instead) */ erc = dbsqlsend(dbproc); --- 220,233 ---- " and o.name = '%s'" " and o.uid = user_id('%s')" " and o.type not in ('U', 'S')" /* no user or system tables */ ! " order by c.number, %s c.colid" ; static const char query_table[] = " execute sp_help '%s.%s' "; parse_argument(argv[i], &procedure); ! erc = dbfcmd(dbproc, query, procedure.name, procedure.owner, ! (DBTDS(dbproc) == DBTDS_5_0) ? "c.colid2, ":""); /* Send the query to the server (we could use dbsqlexec(), instead) */ erc = dbsqlsend(dbproc); From freddy77 at gmail.com Thu Aug 25 07:34:45 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 25 Aug 2016 12:34:45 +0100 Subject: [freetds] defncopy query "order by" different for ASE In-Reply-To: <90A627EE-7DFD-4760-8913-4BAAB115EE3D@capps.com> References: <4DAFB67C-1DCB-4B89-8992-AA070C432BCB@capps.com> <20160818231607.9356c0366ac5abe73afb5c08@icloud.com> <096FADC0-2D31-4A03-9734-2F954CCB9F5F@capps.com> <20160824014112.7375a923110e8ddd63f19974@icloud.com> <296DBA89-42A5-4C51-BB6C-E0EA393090CC@capps.com> <20160824135024.f24a36ecb5495ef0641cc597@icloud.com> <90A627EE-7DFD-4760-8913-4BAAB115EE3D@capps.com> Message-ID: 2016-08-24 19:20 GMT+01:00 John Kendall : > >> On Aug 24, 2016, at 10:50 AM, James K. Lowden wrote: >> >> On Wed, 24 Aug 2016 06:25:47 +0000 >> John Kendall wrote: >> >>> >>>> On Aug 23, 2016, at 10:41 PM, James K. Lowden >>>> wrote: >>>> >>>> On Wed, 24 Aug 2016 01:38:25 +0000 >>>> John Kendall wrote: >>>> >>>>> I figured it out. Getting the right headers in the right order >>>>> slowed me down. Here is my patch for consideration. >>>> >>>> John, I think all you need is a call to the public function >>>> >>>> const char *dbversion(void); >>>> >>> >>> It looks like dbversion() returns the FreeTDS version number, >>> currently "freetds v1.00.13." The patch is working for me, but if >>> there is a better way... John >> >> Sorry, late night. The macro you want is DBTDS(). It returns an >> integer for which symbolic constants are defined in sybdb.h. >> >> --jkl > > That's the ticket! Many thanks. > New, simpler patch for consideration: > > *** defncopy.c 2016-06-19 02:00:01.000000000 -0700 > --- defncopy.c-patch 2016-08-24 11:13:30.883345277 -0700 > *************** main(int argc, char *argv[]) > *** 220,232 **** > " and o.name = '%s'" > " and o.uid = user_id('%s')" > " and o.type not in ('U', 'S')" /* no user or system tables */ > ! " order by c.number, c.colid" > ; > static const char query_table[] = " execute sp_help '%s.%s' "; > > parse_argument(argv[i], &procedure); > > ! erc = dbfcmd(dbproc, query, procedure.name, procedure.owner); > > /* Send the query to the server (we could use dbsqlexec(), instead) */ > erc = dbsqlsend(dbproc); > --- 220,233 ---- > " and o.name = '%s'" > " and o.uid = user_id('%s')" > " and o.type not in ('U', 'S')" /* no user or system tables */ > ! " order by c.number, %s c.colid" > ; > static const char query_table[] = " execute sp_help '%s.%s' "; > > parse_argument(argv[i], &procedure); > > ! erc = dbfcmd(dbproc, query, procedure.name, procedure.owner, > ! (DBTDS(dbproc) == DBTDS_5_0) ? "c.colid2, ":""); > > /* Send the query to the server (we could use dbsqlexec(), instead) */ > erc = dbsqlsend(dbproc); > Hi, converted to a patch and applied. Both master and 1.0. Thanks, Frediano From freddy77 at gmail.com Fri Aug 26 10:18:41 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 26 Aug 2016 15:18:41 +0100 Subject: [freetds] Passing username and password to bsqldb other than by command line In-Reply-To: <20160824014120.d6357152242a33e648afbd15@icloud.com> References: <20160823092511.b5858232f0e7a5b610b5d551@xmission.com> <20160824014120.d6357152242a33e648afbd15@icloud.com> Message-ID: 2016-08-24 6:41 GMT+01:00 James K. Lowden : > On Tue, 23 Aug 2016 09:25:11 -0600 > Dominic Jones wrote: > >> Is there a way to pass the database username and password to the >> bsqldb utility other than by using command line arguments? > > If Kerberos or similar is configured, any FreeTDS application can > take advantage of it. It's documented for tsql. Glancing at the > code, it looks like it's meant to work in bsqldb. > Another option to avoid clear text password in the command line is to pass "-" in the command line and provide password as the first line of input. Frediano From john at capps.com Fri Aug 26 19:26:17 2016 From: john at capps.com (John Kendall) Date: Fri, 26 Aug 2016 23:26:17 +0000 Subject: [freetds] ct_results handles DONEPROC and/or DONEINPROC differently than Sybase Client Lib Message-ID: Bear with me on this one. I've built sqsh with both freetds and sybase ct libs. Output from them differs when stored procedures are called. It isn't terribly different, but I would like it to be the same. I spent a few hours on it and determined that I don't have what it takes to fix it. Here's the setup for the tests I use to reproduce the issue. create procedure proc1 as print "This is proc1" go create procedure proc2 as declare @i int select @i=123 print "This is proc2" go create procedure proc3 as exec proc1 print "This is proc3" go create procedure proc4 as declare @i int select @i=123 exec proc1 print "This is proc4" go create procedure proc5 as declare @i int select @i=123 exec proc1 print "This is proc5" select @i union select 456 go If you exec each of the stored procedure, you will see that the first three produce the same output whether using sybase or freetds libs. However, proc4's output looks like this using sybase libs: This is proc1 This is proc4 (return status = 0) and it looks like this using freetds This is proc1 This is proc4 (1 row affected, return status = 0) Not a big deal, but where did that "1 row affected" come from. It seems to be left over from the select @i=123 which would normally not show up, because variable assignments in procs are not considered rows affected. Indeed, if proc2 is run, which has that same "select @i=123" line, it produces no rows affected line, no matter which library is used. Then if we run proc5 using sybase libs we get: This is proc1 This is proc5 ----------- 123 456 (2 rows affected, return status = 0) The "2 rows affected" comes from the final select, which makes sense. Procedures in client lib are supposed to report the rows affected by the last select/update/delete/insert. Running proc5 using freetds libs, however, we get: This is proc1 This is proc5 (1 row affected) ----------- 123 456 (2 rows affected, return status = 0) The "1 row affected" really wants to be heard. Since proc2 never mentions this variable assignment and proc4 does, I am assuming that the calling of proc1 within proc4 causes a reporting of rows affected information that should not have been reported. If you've read this far, bless you. Any ideas? Thanks, John From manu.reddy52 at gmail.com Tue Aug 30 00:53:03 2016 From: manu.reddy52 at gmail.com (Manohar Reddy) Date: Tue, 30 Aug 2016 10:23:03 +0530 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package Message-ID: Hi, Can anyone guide me how to connect the Microsoft Sql server 2012/14 from R studio using freeTDS package instead of RODBC ,I can able to connect the MS Sql server from R studio using RODBC. Actually my requirement is I have developed webpage/report using Shiny package then I was deployed it on Shinyapps.io ,but after deploying I?m encountering error like ??ERROR:*first argument is not an open RODBC channel*? ,based on this error message I did searched in google and found that we need to use freeTDS drivers instead of RODBC but I found some articles regarding freeTDS but it?s not useful for me. I was eagerly waiting for solution from someone since last month, but not yet and this issue is not allowing me to further .Can anyone please help me out me(how to install freeTDS and how to configure it) on same. My environment details : Os : windows 8 R version 3.3.1 (2016-06-21) Thanks in Advance . Manu. From ikorot01 at gmail.com Tue Aug 30 10:46:17 2016 From: ikorot01 at gmail.com (Igor Korot) Date: Tue, 30 Aug 2016 10:46:17 -0400 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: Hi, On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy wrote: > Hi, > > > > Can anyone guide me how to connect the Microsoft Sql server 2012/14 from > R studio using freeTDS package instead of RODBC ,I can able to connect the > MS Sql server from R studio using RODBC. > > Actually my requirement is I have developed webpage/report using Shiny > package then I was deployed it on Shinyapps.io ,but after deploying I?m > encountering error like ??ERROR:*first argument is not an open RODBC > channel*? ,based on this error message I did searched in google and found > that we need to use freeTDS drivers instead of RODBC but I found some > articles regarding freeTDS but it?s not useful for me. > > > > I was eagerly waiting for solution from someone since last month, but not > yet and this issue is not allowing me to further .Can anyone please help me > out me(how to install freeTDS and how to configure it) on same. What did you try > > > > My environment details : > > > > Os : windows 8 > > R version 3.3.1 (2016-06-21) > > > > Thanks in Advance . > > Manu. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From ikorot01 at gmail.com Tue Aug 30 10:51:23 2016 From: ikorot01 at gmail.com (Igor Korot) Date: Tue, 30 Aug 2016 10:51:23 -0400 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: Hi, On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy wrote: > Hi, > > > > Can anyone guide me how to connect the Microsoft Sql server 2012/14 from > R studio using freeTDS package instead of RODBC ,I can able to connect the > MS Sql server from R studio using RODBC. > > Actually my requirement is I have developed webpage/report using Shiny > package then I was deployed it on Shinyapps.io ,but after deploying I?m > encountering error like ??ERROR:*first argument is not an open RODBC > channel*? ,based on this error message I did searched in google and found > that we need to use freeTDS drivers instead of RODBC but I found some > articles regarding freeTDS but it?s not useful for me. > > > > I was eagerly waiting for solution from someone since last month, but not > yet and this issue is not allowing me to further .Can anyone please help me > out me(how to install freeTDS and how to configure it) on same. What did you try and what doesn't work? Which freeTDS version do you have? Thank you. > > > > My environment details : > > > > Os : windows 8 > > R version 3.3.1 (2016-06-21) > > > > Thanks in Advance . > > Manu. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From vasanth.sengunthar at accenture.com Tue Aug 30 10:59:30 2016 From: vasanth.sengunthar at accenture.com (vasanth.sengunthar at accenture.com) Date: Tue, 30 Aug 2016 14:59:30 +0000 Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) References: Message-ID: <918604ed0e77419e8aace5487faba8a3@SN4PR4205MB0413.048d.mgd.msft.net> Hi All, Please help with below Issue. Looking forward to hearing a positive response from you. Regards, Vasanth -----Original Message----- From: Sengunthar, Vasanth Sent: Monday, August 22, 2016 3:09 PM To: FreeTDS Development Group Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi, Please check below sample SP. Database : Microsoft SQL Server 2012 Protocol Version : tds_version = 7.0 [SP] --------- USE [TEST01] GO /****** Object: StoredProcedure [dbo].[tst_test_result_msg] Script Date: 8/22/2016 5:31:16 AM ******/ SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[tst_test_result_msg] @tst_flag varchar(1), @tst_desc varchar(40) AS BEGIN DECLARE @tst_activ_type varchar(5) SELECT cust_no, cust_name FROM dbo.customer IF @tst_flag = 'A' SELECT @tst_desc = 'Print A' ELSE IF @tst_flag = 'B' SELECT @tst_desc = 'Print B' ELSE IF @tst_flag = 'C' SELECT @tst_desc = 'Print C' ELSE IF @tst_flag = 'D' SELECT @tst_desc = 'Print D' PRINT @tst_desc END Regards, Vasanth -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Igor Korot Sent: Sunday, August 21, 2016 7:03 AM To: FreeTDS Development Group Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi. Do you have an example of one such SP? What is you DB (MS, Sybase) and what version? Which protocol version do you use? All in all - we need more info. Thank you. On Aug 20, 2016 11:01 AM, wrote: Hi, Thank you all in advance, please help me with below issue. I have been working with fisql command lot lately and recently I came across this issue, where the fisql command does not give (return status=0) for some SQL execution. The Issues is not generic but specific to any such SQL store procedure which gives output in (results + message) format. And the approach I like to present to out client includes such scenario where they have multiple store procedure like above. Looking forward to your earliest response, Regards, Vasanth Sengunthar ________________________________ This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. ____________________________________________________________ __________________________ www.accenture.com _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= From manu.reddy52 at gmail.com Tue Aug 30 11:55:33 2016 From: manu.reddy52 at gmail.com (Manohar Reddy) Date: Tue, 30 Aug 2016 21:25:33 +0530 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: Hi , Thanks for looking into my request,based on available information freeTDS is also part of RODBC but in connection string we need to use driver name as freeTDS instead of sql server ,i tried this way only but no luck.I'm suspecting that the way that i did is not correct ,i may need to install freeTDS separately and need to configure it on my machine. Attached is the screen shot for your reference,can you please help me to how to install and how to configure it on my machine(i'm running with windows 8). Thanks in advance .. Manu. On Tue, Aug 30, 2016 at 8:21 PM, Igor Korot wrote: > Hi, > > On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy > wrote: > > Hi, > > > > > > > > Can anyone guide me how to connect the Microsoft Sql server 2012/14 > from > > R studio using freeTDS package instead of RODBC ,I can able to connect > the > > MS Sql server from R studio using RODBC. > > > > Actually my requirement is I have developed webpage/report using Shiny > > package then I was deployed it on Shinyapps.io ,but after deploying I?m > > encountering error like ??ERROR:*first argument is not an open RODBC > > channel*? ,based on this error message I did searched in google and found > > that we need to use freeTDS drivers instead of RODBC but I found some > > articles regarding freeTDS but it?s not useful for me. > > > > > > > > I was eagerly waiting for solution from someone since last month, but > not > > yet and this issue is not allowing me to further .Can anyone please help > me > > out me(how to install freeTDS and how to configure it) on same. > > What did you try and what doesn't work? > Which freeTDS version do you have? > > Thank you. > > > > > > > > > My environment details : > > > > > > > > Os : windows 8 > > > > R version 3.3.1 (2016-06-21) > > > > > > > > Thanks in Advance . > > > > Manu. > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > -- Thanks, Manohar Reddy P +91-9705302062. -------------- next part -------------- A non-text attachment was scrubbed... Name: FreeTDS_Error_message.PNG Type: image/png Size: 37135 bytes Desc: not available URL: From freddy77 at gmail.com Tue Aug 30 16:50:48 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Tue, 30 Aug 2016 21:50:48 +0100 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: Hi, some considerations: - TDS_Version 9.0 was never implemented, see http://www.freetds.org/userguide/choosingtdsprotocol.htm; - the "Data source name not found and no default driver specified" in this case means that the driver ("FreeTDS") is not installed correctly. It could mean that you install the wrong bit version or that you don't install it correctly. Where did you download/how do you compile and install? Does it happen also with "SQL Server" driver? - the "\n" before "Database" is an error, there should be no such character before "Database" option; - the "first argument is not an open RODBC channel" just indicate that connection before failed; - there are some not implemented option in the connection string, see http://www.freetds.org/userguide/odbcconnattr.htm. Frediano 2016-08-30 16:55 GMT+01:00 Manohar Reddy : > Hi , > > Thanks for looking into my request,based on available information freeTDS > is also part of RODBC but in connection string we need to use driver name > as freeTDS instead of sql server ,i tried this way only but no luck.I'm > suspecting that the way that i did is not correct ,i may need to install > freeTDS separately and need to configure it on my machine. > Attached is the screen shot for your reference,can you please help me > to how to install and how to configure it on my machine(i'm running with > windows 8). > > Thanks in advance .. > > Manu. > > > On Tue, Aug 30, 2016 at 8:21 PM, Igor Korot wrote: > >> Hi, >> >> On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy >> wrote: >> > Hi, >> > >> > >> > >> > Can anyone guide me how to connect the Microsoft Sql server 2012/14 >> from >> > R studio using freeTDS package instead of RODBC ,I can able to connect >> the >> > MS Sql server from R studio using RODBC. >> > >> > Actually my requirement is I have developed webpage/report using Shiny >> > package then I was deployed it on Shinyapps.io ,but after deploying I?m >> > encountering error like ??ERROR:*first argument is not an open RODBC >> > channel*? ,based on this error message I did searched in google and found >> > that we need to use freeTDS drivers instead of RODBC but I found some >> > articles regarding freeTDS but it?s not useful for me. >> > >> > >> > >> > I was eagerly waiting for solution from someone since last month, but >> not >> > yet and this issue is not allowing me to further .Can anyone please help >> me >> > out me(how to install freeTDS and how to configure it) on same. >> >> What did you try and what doesn't work? >> Which freeTDS version do you have? >> >> Thank you. >> >> > >> > >> > >> > My environment details : >> > >> > >> > >> > Os : windows 8 >> > >> > R version 3.3.1 (2016-06-21) >> > >> > >> > >> > Thanks in Advance . >> > >> > Manu. From xiaobiaoyin at outlook.com Tue Aug 30 18:15:42 2016 From: xiaobiaoyin at outlook.com (Xiaobiao Yin) Date: Tue, 30 Aug 2016 22:15:42 +0000 Subject: [freetds] How to subscribe Microsoft Sql server In-Reply-To: References: , Message-ID: Hi Experts I am very new to FreeTDS and SQL server. so far I can connect the MS SQL server 2005 from CentOS 7.2 using C program. My requirement is that if the SQL database changed (such as insert ,delete or update some items), is there a way to know this change? After looking through the APIs, I found there is no such APIs to subscribe specified SQL database table. Generally, I need to polling this specified table and see if the return results is the same as the last query, but it seems a little bit complex and no efficiency. So my question is: Is there an API to subscribe specified table in SQL server database. Any comment and hint is welcome. Thanks in advance. Eric From manu.reddy52 at gmail.com Wed Aug 31 02:38:49 2016 From: manu.reddy52 at gmail.com (Manohar Reddy) Date: Wed, 31 Aug 2016 12:08:49 +0530 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: Hi , As per your suggestion i have made changes and ran it ,still i'm getting same error message,can you please guide me how to install freeTDS and how to configure it on windows 8 ,may be i will make a successful connection once if i have done with these changes. Thanks in advance.. Manohar. On Wed, Aug 31, 2016 at 2:20 AM, Frediano Ziglio wrote: > Hi, > some considerations: > - TDS_Version 9.0 was never implemented, see > http://www.freetds.org/userguide/choosingtdsprotocol.htm; > - the "Data source name not found and no default driver specified" in > this case means that the driver ("FreeTDS") is not installed > correctly. It could mean that you install the wrong bit version or > that you don't install it correctly. Where did you download/how do you > compile and install? Does it happen also with "SQL Server" driver? > - the "\n" before "Database" is an error, there should be no such > character before "Database" option; > - the "first argument is not an open RODBC channel" just indicate that > connection before failed; > - there are some not implemented option in the connection string, see > http://www.freetds.org/userguide/odbcconnattr.htm. > > Frediano > > > 2016-08-30 16:55 GMT+01:00 Manohar Reddy : > > Hi , > > > > Thanks for looking into my request,based on available information freeTDS > > is also part of RODBC but in connection string we need to use driver name > > as freeTDS instead of sql server ,i tried this way only but no luck.I'm > > suspecting that the way that i did is not correct ,i may need to install > > freeTDS separately and need to configure it on my machine. > > Attached is the screen shot for your reference,can you please help me > > to how to install and how to configure it on my machine(i'm running with > > windows 8). > > > > Thanks in advance .. > > > > Manu. > > > > > > On Tue, Aug 30, 2016 at 8:21 PM, Igor Korot wrote: > > > >> Hi, > >> > >> On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy > > >> wrote: > >> > Hi, > >> > > >> > > >> > > >> > Can anyone guide me how to connect the Microsoft Sql server 2012/14 > >> from > >> > R studio using freeTDS package instead of RODBC ,I can able to connect > >> the > >> > MS Sql server from R studio using RODBC. > >> > > >> > Actually my requirement is I have developed webpage/report using > Shiny > >> > package then I was deployed it on Shinyapps.io ,but after deploying > I?m > >> > encountering error like ??ERROR:*first argument is not an open RODBC > >> > channel*? ,based on this error message I did searched in google and > found > >> > that we need to use freeTDS drivers instead of RODBC but I found some > >> > articles regarding freeTDS but it?s not useful for me. > >> > > >> > > >> > > >> > I was eagerly waiting for solution from someone since last month, but > >> not > >> > yet and this issue is not allowing me to further .Can anyone please > help > >> me > >> > out me(how to install freeTDS and how to configure it) on same. > >> > >> What did you try and what doesn't work? > >> Which freeTDS version do you have? > >> > >> Thank you. > >> > >> > > >> > > >> > > >> > My environment details : > >> > > >> > > >> > > >> > Os : windows 8 > >> > > >> > R version 3.3.1 (2016-06-21) > >> > > >> > > >> > > >> > Thanks in Advance . > >> > > >> > Manu. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > -- Thanks, Manohar Reddy P +91-9705302062. From freddy77 at gmail.com Wed Aug 31 04:39:43 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Wed, 31 Aug 2016 09:39:43 +0100 Subject: [freetds] How to subscribe Microsoft Sql server In-Reply-To: References: Message-ID: 2016-08-30 23:15 GMT+01:00 Xiaobiao Yin : > Hi Experts > > > I am very new to FreeTDS and SQL server. > > so far I can connect the MS SQL server 2005 from CentOS 7.2 using C program. > > > My requirement is that if the SQL database changed (such as insert ,delete or update some items), > > is there a way to know this change? > > > After looking through the APIs, I found there is no such APIs to subscribe specified SQL database table. > > Generally, I need to polling this specified table and see if the return results is the same as the last query, but it > > seems a little bit complex and no efficiency. > > > So my question is: > > Is there an API to subscribe specified table in SQL server database. > > > Any comment and hint is welcome. > > Thanks in advance. > > Eric > One option is query notifications, for instance see http://www.easysoft.com/support/kb/kb01069.html. The other option is triggers, see https://msdn.microsoft.com/en-us/library/ms189799.aspx. Frediano From xiaobiaoyin at outlook.com Wed Aug 31 06:22:23 2016 From: xiaobiaoyin at outlook.com (Xiaobiao Yin) Date: Wed, 31 Aug 2016 10:22:23 +0000 Subject: [freetds] How to subscribe Microsoft Sql server In-Reply-To: References: , Message-ID: Hi Frediano Thank your for timely reply. For query notifications, it depends a SQL Server ODBC driver which is not free. For trigger, I need to implement a program in windows to subscribe the notification and then transform this information to Linux. This might be a backup method. Is there a way to use open source to implement this requirement? Thank ________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Wednesday, August 31, 2016 4:39 PM To: FreeTDS Development Group Subject: Re: [freetds] How to subscribe Microsoft Sql server 2016-08-30 23:15 GMT+01:00 Xiaobiao Yin : > Hi Experts > > > I am very new to FreeTDS and SQL server. > > so far I can connect the MS SQL server 2005 from CentOS 7.2 using C program. > > > My requirement is that if the SQL database changed (such as insert ,delete or update some items), > > is there a way to know this change? > > > After looking through the APIs, I found there is no such APIs to subscribe specified SQL database table. > > Generally, I need to polling this specified table and see if the return results is the same as the last query, but it > > seems a little bit complex and no efficiency. > > > So my question is: > > Is there an API to subscribe specified table in SQL server database. > > > Any comment and hint is welcome. > > Thanks in advance. > > Eric > One option is query notifications, for instance see http://www.easysoft.com/support/kb/kb01069.html. How do I use SQL Server Query Notifications from Linux and ... www.easysoft.com Query notifications, introduced in SQL Server 2005, allow an application to request a notification from SQL Server when the results of query change. The other option is triggers, see https://msdn.microsoft.com/en-us/library/ms189799.aspx. Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Wed Aug 31 06:29:12 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Wed, 31 Aug 2016 11:29:12 +0100 Subject: [freetds] How to subscribe Microsoft Sql server In-Reply-To: References: Message-ID: FreeTDS supports query nofitications for ODBC. Just use a recent version. Frediano 2016-08-31 11:22 GMT+01:00 Xiaobiao Yin : > Hi Frediano > > > Thank your for timely reply. > > For query notifications, it depends a SQL Server ODBC driver which is not free. > > For trigger, I need to implement a program in windows to subscribe the notification > > and then transform this information to Linux. This might be a backup method. > > > Is there a way to use open source to implement this requirement? > > > Thank > > ________________________________ > From: FreeTDS on behalf of Frediano Ziglio > Sent: Wednesday, August 31, 2016 4:39 PM > To: FreeTDS Development Group > Subject: Re: [freetds] How to subscribe Microsoft Sql server > > 2016-08-30 23:15 GMT+01:00 Xiaobiao Yin : >> Hi Experts >> >> >> I am very new to FreeTDS and SQL server. >> >> so far I can connect the MS SQL server 2005 from CentOS 7.2 using C program. >> >> >> My requirement is that if the SQL database changed (such as insert ,delete or update some items), >> >> is there a way to know this change? >> >> >> After looking through the APIs, I found there is no such APIs to subscribe specified SQL database table. >> >> Generally, I need to polling this specified table and see if the return results is the same as the last query, but it >> >> seems a little bit complex and no efficiency. >> >> >> So my question is: >> >> Is there an API to subscribe specified table in SQL server database. >> >> >> Any comment and hint is welcome. >> >> Thanks in advance. >> >> Eric >> > > > One option is query notifications, for instance see > http://www.easysoft.com/support/kb/kb01069.html. > How do I use SQL Server Query Notifications from Linux and ... > www.easysoft.com > Query notifications, introduced in SQL Server 2005, allow an application to request a notification from SQL Server when the results of query change. > > > > The other option is triggers, see > https://msdn.microsoft.com/en-us/library/ms189799.aspx. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From xiaobiaoyin at outlook.com Wed Aug 31 06:35:30 2016 From: xiaobiaoyin at outlook.com (Xiaobiao Yin) Date: Wed, 31 Aug 2016 10:35:30 +0000 Subject: [freetds] [FreeTDS] connection pool Message-ID: Hi Experts I use FreeTDS (linux) to communicate with a SQL server 2005 in Windows, and tried to use [dbcmd() and dbsqlexec()] 100 times to insert 1 item to database tables. The performance is that one insert statement consumes about 2~3ms. I know there is a so called Connection pool, but it only support TDS 4.2 while SQL server need TDS 7.2. So in order to optimize the performance, I may need to open 2 or more connections, it is a little hard to control these connections. My question is that are there some ways to optimize the performace. The target should be 1ms per 1 insert statement. Any suggetions are welcome. Thanks Eric From xiaobiaoyin at outlook.com Wed Aug 31 06:38:00 2016 From: xiaobiaoyin at outlook.com (Xiaobiao Yin) Date: Wed, 31 Aug 2016 10:38:00 +0000 Subject: [freetds] How to subscribe Microsoft Sql server In-Reply-To: References: , Message-ID: Great! I will have a try. ________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Wednesday, August 31, 2016 6:29 PM To: FreeTDS Development Group Subject: Re: [freetds] How to subscribe Microsoft Sql server FreeTDS supports query nofitications for ODBC. Just use a recent version. Frediano 2016-08-31 11:22 GMT+01:00 Xiaobiao Yin : > Hi Frediano > > > Thank your for timely reply. > > For query notifications, it depends a SQL Server ODBC driver which is not free. [http://www.easysoft.com/images/easysoft/partners/hp/business-partner.jpg] SQL Server ODBC Driver - Easysoft www.easysoft.com SQL Server ODBC driver for Microsoft SQL Server 7.0, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2012, SQL Server 2014, SQL Server 2016 and SQL ... > > For trigger, I need to implement a program in windows to subscribe the notification > > and then transform this information to Linux. This might be a backup method. > > > Is there a way to use open source to implement this requirement? > > > Thank > > ________________________________ > From: FreeTDS on behalf of Frediano Ziglio > Sent: Wednesday, August 31, 2016 4:39 PM > To: FreeTDS Development Group > Subject: Re: [freetds] How to subscribe Microsoft Sql server > > 2016-08-30 23:15 GMT+01:00 Xiaobiao Yin : >> Hi Experts >> >> >> I am very new to FreeTDS and SQL server. >> >> so far I can connect the MS SQL server 2005 from CentOS 7.2 using C program. >> >> >> My requirement is that if the SQL database changed (such as insert ,delete or update some items), >> >> is there a way to know this change? >> >> >> After looking through the APIs, I found there is no such APIs to subscribe specified SQL database table. >> >> Generally, I need to polling this specified table and see if the return results is the same as the last query, but it >> >> seems a little bit complex and no efficiency. >> >> >> So my question is: >> >> Is there an API to subscribe specified table in SQL server database. >> >> >> Any comment and hint is welcome. >> >> Thanks in advance. >> >> Eric >> > > > One option is query notifications, for instance see > http://www.easysoft.com/support/kb/kb01069.html. > How do I use SQL Server Query Notifications from Linux and ... > www.easysoft.com > Query notifications, introduced in SQL Server 2005, allow an application to request a notification from SQL Server when the results of query change. > > > > The other option is triggers, see > https://msdn.microsoft.com/en-us/library/ms189799.aspx. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From ikorot01 at gmail.com Wed Aug 31 07:55:29 2016 From: ikorot01 at gmail.com (Igor Korot) Date: Wed, 31 Aug 2016 07:55:29 -0400 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: Hi, On Wed, Aug 31, 2016 at 2:38 AM, Manohar Reddy wrote: > Hi , > > As per your suggestion i have made changes and ran it ,still i'm getting > same error message,can you please guide me how to install freeTDS and how > to configure it on windows 8 ,may be i will make a successful connection > once if i have done with these changes. You didn't answer Frediano' questions: Where did you get the freeTDS driver? How did you compile and install it? And one more: What happen if you try the Microsoft ODBC driver? It should be installed by default If not just go to microsoft.com and grab one. Thank you. > > Thanks in advance.. > > Manohar. > > On Wed, Aug 31, 2016 at 2:20 AM, Frediano Ziglio wrote: > >> Hi, >> some considerations: >> - TDS_Version 9.0 was never implemented, see >> http://www.freetds.org/userguide/choosingtdsprotocol.htm; >> - the "Data source name not found and no default driver specified" in >> this case means that the driver ("FreeTDS") is not installed >> correctly. It could mean that you install the wrong bit version or >> that you don't install it correctly. Where did you download/how do you >> compile and install? Does it happen also with "SQL Server" driver? >> - the "\n" before "Database" is an error, there should be no such >> character before "Database" option; >> - the "first argument is not an open RODBC channel" just indicate that >> connection before failed; >> - there are some not implemented option in the connection string, see >> http://www.freetds.org/userguide/odbcconnattr.htm. >> >> Frediano >> >> >> 2016-08-30 16:55 GMT+01:00 Manohar Reddy : >> > Hi , >> > >> > Thanks for looking into my request,based on available information freeTDS >> > is also part of RODBC but in connection string we need to use driver name >> > as freeTDS instead of sql server ,i tried this way only but no luck.I'm >> > suspecting that the way that i did is not correct ,i may need to install >> > freeTDS separately and need to configure it on my machine. >> > Attached is the screen shot for your reference,can you please help me >> > to how to install and how to configure it on my machine(i'm running with >> > windows 8). >> > >> > Thanks in advance .. >> > >> > Manu. >> > >> > >> > On Tue, Aug 30, 2016 at 8:21 PM, Igor Korot wrote: >> > >> >> Hi, >> >> >> >> On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy > > >> >> wrote: >> >> > Hi, >> >> > >> >> > >> >> > >> >> > Can anyone guide me how to connect the Microsoft Sql server 2012/14 >> >> from >> >> > R studio using freeTDS package instead of RODBC ,I can able to connect >> >> the >> >> > MS Sql server from R studio using RODBC. >> >> > >> >> > Actually my requirement is I have developed webpage/report using >> Shiny >> >> > package then I was deployed it on Shinyapps.io ,but after deploying >> I?m >> >> > encountering error like ??ERROR:*first argument is not an open RODBC >> >> > channel*? ,based on this error message I did searched in google and >> found >> >> > that we need to use freeTDS drivers instead of RODBC but I found some >> >> > articles regarding freeTDS but it?s not useful for me. >> >> > >> >> > >> >> > >> >> > I was eagerly waiting for solution from someone since last month, but >> >> not >> >> > yet and this issue is not allowing me to further .Can anyone please >> help >> >> me >> >> > out me(how to install freeTDS and how to configure it) on same. >> >> >> >> What did you try and what doesn't work? >> >> Which freeTDS version do you have? >> >> >> >> Thank you. >> >> >> >> > >> >> > >> >> > >> >> > My environment details : >> >> > >> >> > >> >> > >> >> > Os : windows 8 >> >> > >> >> > R version 3.3.1 (2016-06-21) >> >> > >> >> > >> >> > >> >> > Thanks in Advance . >> >> > >> >> > Manu. >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> > > > > -- > > > Thanks, > Manohar Reddy P > +91-9705302062. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From manu.reddy52 at gmail.com Wed Aug 31 08:30:24 2016 From: manu.reddy52 at gmail.com (Manohar Reddy) Date: Wed, 31 Aug 2016 18:00:24 +0530 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: Hi , Just I want to clarify my requirement before seeking someone help on my issue. *Requirement* : I need to develop the webpage/Report using shinypackages then I need to host it on shinyapps.io (shinyapps.io hosted on *Linux*)for that I?m using RODBC package to connect my MS Sql server ,but when I deployed it on shinyapps.io ,I have encountered this (first argument is not an open RODBC channel) error, based on this error message I googled and found that I need to use freeTDS drivers instead of sql server and I have cheeked with ?R professional help? and they guide me like I don?t need to install freeTDS separately just I need to use freeTDS drivers instead of sql server but I couldn?t able to make a successful connection. I?m suspecting that I may need to install freeTDS and need to configure it on my machine which has been running with Windows 8. *Help* : Now I?m seeking a help like how to install freeTDS and how to configure it on windows 8 ,so that I can make a successful connection to my MS Sql server from R studio/Shinyapps.io FYI? https://groups.google.com/forum/#!topic/shinyapps-users/hs4bQHsk9JU Thanks,Manu. On Wed, Aug 31, 2016 at 5:25 PM, Igor Korot wrote: > Hi, > > On Wed, Aug 31, 2016 at 2:38 AM, Manohar Reddy > wrote: > > Hi , > > > > As per your suggestion i have made changes and ran it ,still i'm > getting > > same error message,can you please guide me how to install freeTDS and how > > to configure it on windows 8 ,may be i will make a successful connection > > once if i have done with these changes. > > You didn't answer Frediano' questions: > > Where did you get the freeTDS driver? > How did you compile and install it? > > And one more: > What happen if you try the Microsoft ODBC driver? It should be > installed by default > If not just go to microsoft.com and grab one. > > Thank you. > > > > > Thanks in advance.. > > > > Manohar. > > > > On Wed, Aug 31, 2016 at 2:20 AM, Frediano Ziglio > wrote: > > > >> Hi, > >> some considerations: > >> - TDS_Version 9.0 was never implemented, see > >> http://www.freetds.org/userguide/choosingtdsprotocol.htm; > >> - the "Data source name not found and no default driver specified" in > >> this case means that the driver ("FreeTDS") is not installed > >> correctly. It could mean that you install the wrong bit version or > >> that you don't install it correctly. Where did you download/how do you > >> compile and install? Does it happen also with "SQL Server" driver? > >> - the "\n" before "Database" is an error, there should be no such > >> character before "Database" option; > >> - the "first argument is not an open RODBC channel" just indicate that > >> connection before failed; > >> - there are some not implemented option in the connection string, see > >> http://www.freetds.org/userguide/odbcconnattr.htm. > >> > >> Frediano > >> > >> > >> 2016-08-30 16:55 GMT+01:00 Manohar Reddy : > >> > Hi , > >> > > >> > Thanks for looking into my request,based on available information > freeTDS > >> > is also part of RODBC but in connection string we need to use driver > name > >> > as freeTDS instead of sql server ,i tried this way only but no > luck.I'm > >> > suspecting that the way that i did is not correct ,i may need to > install > >> > freeTDS separately and need to configure it on my machine. > >> > Attached is the screen shot for your reference,can you please > help me > >> > to how to install and how to configure it on my machine(i'm running > with > >> > windows 8). > >> > > >> > Thanks in advance .. > >> > > >> > Manu. > >> > > >> > > >> > On Tue, Aug 30, 2016 at 8:21 PM, Igor Korot > wrote: > >> > > >> >> Hi, > >> >> > >> >> On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy < > manu.reddy52 at gmail.com > >> > > >> >> wrote: > >> >> > Hi, > >> >> > > >> >> > > >> >> > > >> >> > Can anyone guide me how to connect the Microsoft Sql server > 2012/14 > >> >> from > >> >> > R studio using freeTDS package instead of RODBC ,I can able to > connect > >> >> the > >> >> > MS Sql server from R studio using RODBC. > >> >> > > >> >> > Actually my requirement is I have developed webpage/report using > >> Shiny > >> >> > package then I was deployed it on Shinyapps.io ,but after deploying > >> I?m > >> >> > encountering error like ??ERROR:*first argument is not an open > RODBC > >> >> > channel*? ,based on this error message I did searched in google and > >> found > >> >> > that we need to use freeTDS drivers instead of RODBC but I found > some > >> >> > articles regarding freeTDS but it?s not useful for me. > >> >> > > >> >> > > >> >> > > >> >> > I was eagerly waiting for solution from someone since last month, > but > >> >> not > >> >> > yet and this issue is not allowing me to further .Can anyone please > >> help > >> >> me > >> >> > out me(how to install freeTDS and how to configure it) on same. > >> >> > >> >> What did you try and what doesn't work? > >> >> Which freeTDS version do you have? > >> >> > >> >> Thank you. > >> >> > >> >> > > >> >> > > >> >> > > >> >> > My environment details : > >> >> > > >> >> > > >> >> > > >> >> > Os : windows 8 > >> >> > > >> >> > R version 3.3.1 (2016-06-21) > >> >> > > >> >> > > >> >> > > >> >> > Thanks in Advance . > >> >> > > >> >> > Manu. > >> _______________________________________________ > >> FreeTDS mailing list > >> FreeTDS at lists.ibiblio.org > >> http://lists.ibiblio.org/mailman/listinfo/freetds > >> > > > > > > > > -- > > > > > > Thanks, > > Manohar Reddy P > > +91-9705302062. > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > -- Thanks, Manohar Reddy P +91-9705302062. From freddy77 at gmail.com Wed Aug 31 09:18:02 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Wed, 31 Aug 2016 14:18:02 +0100 Subject: [freetds] [FreeTDS] connection pool In-Reply-To: References: Message-ID: 2016-08-31 11:35 GMT+01:00 Xiaobiao Yin : > Hi Experts > > > I use FreeTDS (linux) to communicate with a SQL server 2005 in Windows, > > and tried to use [dbcmd() and dbsqlexec()] 100 times to insert 1 item to database tables. > > The performance is that one insert statement consumes about 2~3ms. > > > I know there is a so called Connection pool, but it only support TDS 4.2 while SQL server need TDS 7.2. > > > So in order to optimize the performance, I may need to open 2 or more connections, it is a little hard to > > control these connections. > > > My question is that are there some ways to optimize the performace. > > The target should be 1ms per 1 insert statement. > > > Any suggetions are welcome. > > > Thanks > > Eric > It's not clear if the problem is application or connections. If you have one application that needs to insert rows into a table it's better to batch the inserts instead of using a query for each row. If you have multiple process each needing to connect to database and insert a row then would be better to use a connection pooling. The connection pooling included in FreeTDS 1.0 supports protocol 7.2 with some limitations. Frediano From freddy77 at gmail.com Wed Aug 31 09:29:18 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Wed, 31 Aug 2016 14:29:18 +0100 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: Hi, I don't know Shiny however if I understood: - you have a R application running inside this cloud; - the application should use RODBC to connect to some SQL Server database using ODBC. Now I know ODBC. ODBC mainly use drivers (dynamic modules) to connect to different database types. As you said that Shiny run on Linux you need a driver for Linux that is able to connect to SQL Server, FreeTDS is one of them! However the "SQL Server"/"FreeTDS" string after the "Driver=" in the connection string is not just a simple string, it's a reference to an installed driver. So you have to install the driver and configure in the DM (Driver Manager, the ODBC library that RODBC is linked to) installed in the Shiny cloud machine. Here we can't help much unless you have some direct/standard access (like ssh) to this machine. About the connection. Where do the SQL Server is running? Inside the cloud? On your machine? Is your machine connected and opened (firewall speaking) to this Shiny cloud machine(s) ? Are you trying to install FreeTDS also on your machine where you are testing how your R application is running (I don't know R environment) ? To install FreeTDS on Windows you can see http://www.freetds.org/userguide/osissues.htm. Frediano 2016-08-31 13:30 GMT+01:00 Manohar Reddy : > Hi , > > > > Just I want to clarify my requirement before seeking someone help on my > issue. > > > > *Requirement* : > > > > I need to develop the webpage/Report using shinypackages then I need to > host it on shinyapps.io (shinyapps.io hosted on *Linux*)for that I?m using > RODBC package to connect my MS Sql server ,but when I deployed it on > shinyapps.io ,I have encountered this (first argument is not an open RODBC > channel) error, based on this error message I googled and found that I need > to use freeTDS drivers instead of sql server and I have cheeked with ?R > professional help? and they guide me like I don?t need to install freeTDS > separately just I need to use freeTDS drivers instead of sql server but I > couldn?t able to make a successful connection. I?m suspecting that I may > need to install freeTDS and need to configure it on my machine which has > been running with Windows 8. > > > > *Help* : > > > > Now I?m seeking a help like how to install freeTDS and how to configure > it on windows 8 ,so that I can make a successful connection to my MS Sql > server from R studio/Shinyapps.io > > > FYI? https://groups.google.com/forum/#!topic/shinyapps-users/hs4bQHsk9JU > > > > Thanks,Manu. > > On Wed, Aug 31, 2016 at 5:25 PM, Igor Korot wrote: > >> Hi, >> >> On Wed, Aug 31, 2016 at 2:38 AM, Manohar Reddy >> wrote: >> > Hi , >> > >> > As per your suggestion i have made changes and ran it ,still i'm >> getting >> > same error message,can you please guide me how to install freeTDS and how >> > to configure it on windows 8 ,may be i will make a successful connection >> > once if i have done with these changes. >> >> You didn't answer Frediano' questions: >> >> Where did you get the freeTDS driver? >> How did you compile and install it? >> >> And one more: >> What happen if you try the Microsoft ODBC driver? It should be >> installed by default >> If not just go to microsoft.com and grab one. >> >> Thank you. >> >> > >> > Thanks in advance.. >> > >> > Manohar. >> > >> > On Wed, Aug 31, 2016 at 2:20 AM, Frediano Ziglio >> wrote: >> > >> >> Hi, >> >> some considerations: >> >> - TDS_Version 9.0 was never implemented, see >> >> http://www.freetds.org/userguide/choosingtdsprotocol.htm; >> >> - the "Data source name not found and no default driver specified" in >> >> this case means that the driver ("FreeTDS") is not installed >> >> correctly. It could mean that you install the wrong bit version or >> >> that you don't install it correctly. Where did you download/how do you >> >> compile and install? Does it happen also with "SQL Server" driver? >> >> - the "\n" before "Database" is an error, there should be no such >> >> character before "Database" option; >> >> - the "first argument is not an open RODBC channel" just indicate that >> >> connection before failed; >> >> - there are some not implemented option in the connection string, see >> >> http://www.freetds.org/userguide/odbcconnattr.htm. >> >> >> >> Frediano >> >> >> >> >> >> 2016-08-30 16:55 GMT+01:00 Manohar Reddy : >> >> > Hi , >> >> > >> >> > Thanks for looking into my request,based on available information >> freeTDS >> >> > is also part of RODBC but in connection string we need to use driver >> name >> >> > as freeTDS instead of sql server ,i tried this way only but no >> luck.I'm >> >> > suspecting that the way that i did is not correct ,i may need to >> install >> >> > freeTDS separately and need to configure it on my machine. >> >> > Attached is the screen shot for your reference,can you please >> help me >> >> > to how to install and how to configure it on my machine(i'm running >> with >> >> > windows 8). >> >> > >> >> > Thanks in advance .. >> >> > >> >> > Manu. >> >> > >> >> > >> >> > On Tue, Aug 30, 2016 at 8:21 PM, Igor Korot >> wrote: >> >> > >> >> >> Hi, >> >> >> >> >> >> On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy < >> manu.reddy52 at gmail.com >> >> > >> >> >> wrote: >> >> >> > Hi, >> >> >> > >> >> >> > >> >> >> > >> >> >> > Can anyone guide me how to connect the Microsoft Sql server >> 2012/14 >> >> >> from >> >> >> > R studio using freeTDS package instead of RODBC ,I can able to >> connect >> >> >> the >> >> >> > MS Sql server from R studio using RODBC. >> >> >> > >> >> >> > Actually my requirement is I have developed webpage/report using >> >> Shiny >> >> >> > package then I was deployed it on Shinyapps.io ,but after deploying >> >> I?m >> >> >> > encountering error like ??ERROR:*first argument is not an open >> RODBC >> >> >> > channel*? ,based on this error message I did searched in google and >> >> found >> >> >> > that we need to use freeTDS drivers instead of RODBC but I found >> some >> >> >> > articles regarding freeTDS but it?s not useful for me. >> >> >> > >> >> >> > >> >> >> > >> >> >> > I was eagerly waiting for solution from someone since last month, >> but >> >> >> not >> >> >> > yet and this issue is not allowing me to further .Can anyone please >> >> help >> >> >> me >> >> >> > out me(how to install freeTDS and how to configure it) on same. >> >> >> >> >> >> What did you try and what doesn't work? >> >> >> Which freeTDS version do you have? >> >> >> >> >> >> Thank you. >> >> >> >> >> >> > >> >> >> > >> >> >> > >> >> >> > My environment details : >> >> >> > >> >> >> > >> >> >> > >> >> >> > Os : windows 8 >> >> >> > >> >> >> > R version 3.3.1 (2016-06-21) >> >> >> > >> >> >> > >> >> >> > >> >> >> > Thanks in Advance . >> >> >> > >> >> >> > Manu. >> >> _______________________________________________ >> >> FreeTDS mailing list >> >> FreeTDS at lists.ibiblio.org >> >> http://lists.ibiblio.org/mailman/listinfo/freetds >> >> >> > >> > >> > >> > -- >> > >> > >> > Thanks, >> > Manohar Reddy P >> > +91-9705302062. >> > _______________________________________________ >> > FreeTDS mailing list >> > FreeTDS at lists.ibiblio.org >> > http://lists.ibiblio.org/mailman/listinfo/freetds >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> > > > > -- > > > Thanks, > Manohar Reddy P > +91-9705302062. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From no-reply at appveyor.com Wed Aug 31 10:56:39 2016 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 31 Aug 2016 14:56:39 +0000 Subject: [freetds] Build failed: freetds 655 Message-ID: <20160831145635.2663.94558.03278FDB@appveyor.com> From manu.reddy52 at gmail.com Wed Aug 31 11:59:56 2016 From: manu.reddy52 at gmail.com (Manohar Reddy) Date: Wed, 31 Aug 2016 21:29:56 +0530 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: Hi, My MS sql server and R environment running on my local machine and the respective port was opened, from this link (http://www.freetds.org/ userguide/osissues.htm.) i didn't get much information ,can you please help out me is there any way that can i download it and configured it on widnows 8. Thanks,Manu. On Wed, Aug 31, 2016 at 6:59 PM, Frediano Ziglio wrote: > Hi, > I don't know Shiny however if I understood: > - you have a R application running inside this cloud; > - the application should use RODBC to connect to some SQL Server > database using ODBC. > Now I know ODBC. ODBC mainly use drivers (dynamic modules) to connect > to different database types. As you said that Shiny run on Linux you > need a driver for Linux that is able to connect to SQL Server, FreeTDS > is one of them! However the "SQL Server"/"FreeTDS" string after the > "Driver=" in the connection string is not just a simple string, it's a > reference to an installed driver. So you have to install the driver > and configure in the DM (Driver Manager, the ODBC library that RODBC > is linked to) installed in the Shiny cloud machine. Here we can't help > much unless you have some direct/standard access (like ssh) to this > machine. > About the connection. Where do the SQL Server is running? Inside the > cloud? On your machine? Is your machine connected and opened (firewall > speaking) to this Shiny cloud machine(s) ? > Are you trying to install FreeTDS also on your machine where you are > testing how your R application is running (I don't know R environment) > ? > To install FreeTDS on Windows you can see > http://www.freetds.org/userguide/osissues.htm. > > Frediano > > > 2016-08-31 13:30 GMT+01:00 Manohar Reddy : > > Hi , > > > > > > > > Just I want to clarify my requirement before seeking someone help on my > > issue. > > > > > > > > *Requirement* : > > > > > > > > I need to develop the webpage/Report using shinypackages then I need > to > > host it on shinyapps.io (shinyapps.io hosted on *Linux*)for that I?m > using > > RODBC package to connect my MS Sql server ,but when I deployed it on > > shinyapps.io ,I have encountered this (first argument is not an open > RODBC > > channel) error, based on this error message I googled and found that I > need > > to use freeTDS drivers instead of sql server and I have cheeked with ?R > > professional help? and they guide me like I don?t need to install > freeTDS > > separately just I need to use freeTDS drivers instead of sql server but > I > > couldn?t able to make a successful connection. I?m suspecting that I may > > need to install freeTDS and need to configure it on my machine which has > > been running with Windows 8. > > > > > > > > *Help* : > > > > > > > > Now I?m seeking a help like how to install freeTDS and how to configure > > it on windows 8 ,so that I can make a successful connection to my MS Sql > > server from R studio/Shinyapps.io > > > > > > FYI? https://groups.google.com/forum/#!topic/shinyapps-users/ > hs4bQHsk9JU > > > > > > > > Thanks,Manu. > > > > On Wed, Aug 31, 2016 at 5:25 PM, Igor Korot wrote: > > > >> Hi, > >> > >> On Wed, Aug 31, 2016 at 2:38 AM, Manohar Reddy > >> wrote: > >> > Hi , > >> > > >> > As per your suggestion i have made changes and ran it ,still i'm > >> getting > >> > same error message,can you please guide me how to install freeTDS and > how > >> > to configure it on windows 8 ,may be i will make a successful > connection > >> > once if i have done with these changes. > >> > >> You didn't answer Frediano' questions: > >> > >> Where did you get the freeTDS driver? > >> How did you compile and install it? > >> > >> And one more: > >> What happen if you try the Microsoft ODBC driver? It should be > >> installed by default > >> If not just go to microsoft.com and grab one. > >> > >> Thank you. > >> > >> > > >> > Thanks in advance.. > >> > > >> > Manohar. > >> > > >> > On Wed, Aug 31, 2016 at 2:20 AM, Frediano Ziglio > >> wrote: > >> > > >> >> Hi, > >> >> some considerations: > >> >> - TDS_Version 9.0 was never implemented, see > >> >> http://www.freetds.org/userguide/choosingtdsprotocol.htm; > >> >> - the "Data source name not found and no default driver specified" in > >> >> this case means that the driver ("FreeTDS") is not installed > >> >> correctly. It could mean that you install the wrong bit version or > >> >> that you don't install it correctly. Where did you download/how do > you > >> >> compile and install? Does it happen also with "SQL Server" driver? > >> >> - the "\n" before "Database" is an error, there should be no such > >> >> character before "Database" option; > >> >> - the "first argument is not an open RODBC channel" just indicate > that > >> >> connection before failed; > >> >> - there are some not implemented option in the connection string, see > >> >> http://www.freetds.org/userguide/odbcconnattr.htm. > >> >> > >> >> Frediano > >> >> > >> >> > >> >> 2016-08-30 16:55 GMT+01:00 Manohar Reddy : > >> >> > Hi , > >> >> > > >> >> > Thanks for looking into my request,based on available information > >> freeTDS > >> >> > is also part of RODBC but in connection string we need to use > driver > >> name > >> >> > as freeTDS instead of sql server ,i tried this way only but no > >> luck.I'm > >> >> > suspecting that the way that i did is not correct ,i may need to > >> install > >> >> > freeTDS separately and need to configure it on my machine. > >> >> > Attached is the screen shot for your reference,can you please > >> help me > >> >> > to how to install and how to configure it on my machine(i'm running > >> with > >> >> > windows 8). > >> >> > > >> >> > Thanks in advance .. > >> >> > > >> >> > Manu. > >> >> > > >> >> > > >> >> > On Tue, Aug 30, 2016 at 8:21 PM, Igor Korot > >> wrote: > >> >> > > >> >> >> Hi, > >> >> >> > >> >> >> On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy < > >> manu.reddy52 at gmail.com > >> >> > > >> >> >> wrote: > >> >> >> > Hi, > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > Can anyone guide me how to connect the Microsoft Sql server > >> 2012/14 > >> >> >> from > >> >> >> > R studio using freeTDS package instead of RODBC ,I can able to > >> connect > >> >> >> the > >> >> >> > MS Sql server from R studio using RODBC. > >> >> >> > > >> >> >> > Actually my requirement is I have developed webpage/report > using > >> >> Shiny > >> >> >> > package then I was deployed it on Shinyapps.io ,but after > deploying > >> >> I?m > >> >> >> > encountering error like ??ERROR:*first argument is not an open > >> RODBC > >> >> >> > channel*? ,based on this error message I did searched in google > and > >> >> found > >> >> >> > that we need to use freeTDS drivers instead of RODBC but I found > >> some > >> >> >> > articles regarding freeTDS but it?s not useful for me. > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > I was eagerly waiting for solution from someone since last > month, > >> but > >> >> >> not > >> >> >> > yet and this issue is not allowing me to further .Can anyone > please > >> >> help > >> >> >> me > >> >> >> > out me(how to install freeTDS and how to configure it) on same. > >> >> >> > >> >> >> What did you try and what doesn't work? > >> >> >> Which freeTDS version do you have? > >> >> >> > >> >> >> Thank you. > >> >> >> > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > My environment details : > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > Os : windows 8 > >> >> >> > > >> >> >> > R version 3.3.1 (2016-06-21) > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > Thanks in Advance . > >> >> >> > > >> >> >> > Manu. > >> >> _______________________________________________ > >> >> FreeTDS mailing list > >> >> FreeTDS at lists.ibiblio.org > >> >> http://lists.ibiblio.org/mailman/listinfo/freetds > >> >> > >> > > >> > > >> > > >> > -- > >> > > >> > > >> > Thanks, > >> > Manohar Reddy P > >> > +91-9705302062. > >> > _______________________________________________ > >> > FreeTDS mailing list > >> > FreeTDS at lists.ibiblio.org > >> > http://lists.ibiblio.org/mailman/listinfo/freetds > >> _______________________________________________ > >> FreeTDS mailing list > >> FreeTDS at lists.ibiblio.org > >> http://lists.ibiblio.org/mailman/listinfo/freetds > >> > > > > > > > > -- > > > > > > Thanks, > > Manohar Reddy P > > +91-9705302062. > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > -- Thanks, Manohar Reddy P +91-9705302062. From ikorot01 at gmail.com Wed Aug 31 13:51:06 2016 From: ikorot01 at gmail.com (Igor Korot) Date: Wed, 31 Aug 2016 13:51:06 -0400 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: Hi, On Wed, Aug 31, 2016 at 11:59 AM, Manohar Reddy wrote: > Hi, > > My MS sql server and R environment running on my local machine and the > respective port was opened, from this link (http://www.freetds.org/ > userguide/osissues.htm.) i didn't get much information ,can you please help > out me is there any way that can i download it and configured it on > widnows 8. Frediano will correct me if I'm wrong, but I don't think there is a binary distribution file you can just download and install. You need to grab the source code, get either MSVC or MinGW compiler and compile the software yourself. Then just place the resulting binary in the Windows folder somewhere and create the DSN. Thank you. P.S.: Of course if you get any issues don't hesitate to post again... > > Thanks,Manu. > > On Wed, Aug 31, 2016 at 6:59 PM, Frediano Ziglio wrote: > >> Hi, >> I don't know Shiny however if I understood: >> - you have a R application running inside this cloud; >> - the application should use RODBC to connect to some SQL Server >> database using ODBC. >> Now I know ODBC. ODBC mainly use drivers (dynamic modules) to connect >> to different database types. As you said that Shiny run on Linux you >> need a driver for Linux that is able to connect to SQL Server, FreeTDS >> is one of them! However the "SQL Server"/"FreeTDS" string after the >> "Driver=" in the connection string is not just a simple string, it's a >> reference to an installed driver. So you have to install the driver >> and configure in the DM (Driver Manager, the ODBC library that RODBC >> is linked to) installed in the Shiny cloud machine. Here we can't help >> much unless you have some direct/standard access (like ssh) to this >> machine. >> About the connection. Where do the SQL Server is running? Inside the >> cloud? On your machine? Is your machine connected and opened (firewall >> speaking) to this Shiny cloud machine(s) ? >> Are you trying to install FreeTDS also on your machine where you are >> testing how your R application is running (I don't know R environment) >> ? >> To install FreeTDS on Windows you can see >> http://www.freetds.org/userguide/osissues.htm. >> >> Frediano >> >> >> 2016-08-31 13:30 GMT+01:00 Manohar Reddy : >> > Hi , >> > >> > >> > >> > Just I want to clarify my requirement before seeking someone help on my >> > issue. >> > >> > >> > >> > *Requirement* : >> > >> > >> > >> > I need to develop the webpage/Report using shinypackages then I need >> to >> > host it on shinyapps.io (shinyapps.io hosted on *Linux*)for that I?m >> using >> > RODBC package to connect my MS Sql server ,but when I deployed it on >> > shinyapps.io ,I have encountered this (first argument is not an open >> RODBC >> > channel) error, based on this error message I googled and found that I >> need >> > to use freeTDS drivers instead of sql server and I have cheeked with ?R >> > professional help? and they guide me like I don?t need to install >> freeTDS >> > separately just I need to use freeTDS drivers instead of sql server but >> I >> > couldn?t able to make a successful connection. I?m suspecting that I may >> > need to install freeTDS and need to configure it on my machine which has >> > been running with Windows 8. >> > >> > >> > >> > *Help* : >> > >> > >> > >> > Now I?m seeking a help like how to install freeTDS and how to configure >> > it on windows 8 ,so that I can make a successful connection to my MS Sql >> > server from R studio/Shinyapps.io >> > >> > >> > FYI? https://groups.google.com/forum/#!topic/shinyapps-users/ >> hs4bQHsk9JU >> > >> > >> > >> > Thanks,Manu. >> > >> > On Wed, Aug 31, 2016 at 5:25 PM, Igor Korot wrote: >> > >> >> Hi, >> >> >> >> On Wed, Aug 31, 2016 at 2:38 AM, Manohar Reddy >> >> wrote: >> >> > Hi , >> >> > >> >> > As per your suggestion i have made changes and ran it ,still i'm >> >> getting >> >> > same error message,can you please guide me how to install freeTDS and >> how >> >> > to configure it on windows 8 ,may be i will make a successful >> connection >> >> > once if i have done with these changes. >> >> >> >> You didn't answer Frediano' questions: >> >> >> >> Where did you get the freeTDS driver? >> >> How did you compile and install it? >> >> >> >> And one more: >> >> What happen if you try the Microsoft ODBC driver? It should be >> >> installed by default >> >> If not just go to microsoft.com and grab one. >> >> >> >> Thank you. >> >> >> >> > >> >> > Thanks in advance.. >> >> > >> >> > Manohar. >> >> > >> >> > On Wed, Aug 31, 2016 at 2:20 AM, Frediano Ziglio >> >> wrote: >> >> > >> >> >> Hi, >> >> >> some considerations: >> >> >> - TDS_Version 9.0 was never implemented, see >> >> >> http://www.freetds.org/userguide/choosingtdsprotocol.htm; >> >> >> - the "Data source name not found and no default driver specified" in >> >> >> this case means that the driver ("FreeTDS") is not installed >> >> >> correctly. It could mean that you install the wrong bit version or >> >> >> that you don't install it correctly. Where did you download/how do >> you >> >> >> compile and install? Does it happen also with "SQL Server" driver? >> >> >> - the "\n" before "Database" is an error, there should be no such >> >> >> character before "Database" option; >> >> >> - the "first argument is not an open RODBC channel" just indicate >> that >> >> >> connection before failed; >> >> >> - there are some not implemented option in the connection string, see >> >> >> http://www.freetds.org/userguide/odbcconnattr.htm. >> >> >> >> >> >> Frediano >> >> >> >> >> >> >> >> >> 2016-08-30 16:55 GMT+01:00 Manohar Reddy : >> >> >> > Hi , >> >> >> > >> >> >> > Thanks for looking into my request,based on available information >> >> freeTDS >> >> >> > is also part of RODBC but in connection string we need to use >> driver >> >> name >> >> >> > as freeTDS instead of sql server ,i tried this way only but no >> >> luck.I'm >> >> >> > suspecting that the way that i did is not correct ,i may need to >> >> install >> >> >> > freeTDS separately and need to configure it on my machine. >> >> >> > Attached is the screen shot for your reference,can you please >> >> help me >> >> >> > to how to install and how to configure it on my machine(i'm running >> >> with >> >> >> > windows 8). >> >> >> > >> >> >> > Thanks in advance .. >> >> >> > >> >> >> > Manu. >> >> >> > >> >> >> > >> >> >> > On Tue, Aug 30, 2016 at 8:21 PM, Igor Korot >> >> wrote: >> >> >> > >> >> >> >> Hi, >> >> >> >> >> >> >> >> On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy < >> >> manu.reddy52 at gmail.com >> >> >> > >> >> >> >> wrote: >> >> >> >> > Hi, >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > Can anyone guide me how to connect the Microsoft Sql server >> >> 2012/14 >> >> >> >> from >> >> >> >> > R studio using freeTDS package instead of RODBC ,I can able to >> >> connect >> >> >> >> the >> >> >> >> > MS Sql server from R studio using RODBC. >> >> >> >> > >> >> >> >> > Actually my requirement is I have developed webpage/report >> using >> >> >> Shiny >> >> >> >> > package then I was deployed it on Shinyapps.io ,but after >> deploying >> >> >> I?m >> >> >> >> > encountering error like ??ERROR:*first argument is not an open >> >> RODBC >> >> >> >> > channel*? ,based on this error message I did searched in google >> and >> >> >> found >> >> >> >> > that we need to use freeTDS drivers instead of RODBC but I found >> >> some >> >> >> >> > articles regarding freeTDS but it?s not useful for me. >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > I was eagerly waiting for solution from someone since last >> month, >> >> but >> >> >> >> not >> >> >> >> > yet and this issue is not allowing me to further .Can anyone >> please >> >> >> help >> >> >> >> me >> >> >> >> > out me(how to install freeTDS and how to configure it) on same. >> >> >> >> >> >> >> >> What did you try and what doesn't work? >> >> >> >> Which freeTDS version do you have? >> >> >> >> >> >> >> >> Thank you. >> >> >> >> >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > My environment details : >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > Os : windows 8 >> >> >> >> > >> >> >> >> > R version 3.3.1 (2016-06-21) >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > Thanks in Advance . >> >> >> >> > >> >> >> >> > Manu. >> >> >> _______________________________________________ >> >> >> FreeTDS mailing list >> >> >> FreeTDS at lists.ibiblio.org >> >> >> http://lists.ibiblio.org/mailman/listinfo/freetds >> >> >> >> >> > >> >> > >> >> > >> >> > -- >> >> > >> >> > >> >> > Thanks, >> >> > Manohar Reddy P >> >> > +91-9705302062. >> >> > _______________________________________________ >> >> > FreeTDS mailing list >> >> > FreeTDS at lists.ibiblio.org >> >> > http://lists.ibiblio.org/mailman/listinfo/freetds >> >> _______________________________________________ >> >> FreeTDS mailing list >> >> FreeTDS at lists.ibiblio.org >> >> http://lists.ibiblio.org/mailman/listinfo/freetds >> >> >> > >> > >> > >> > -- >> > >> > >> > Thanks, >> > Manohar Reddy P >> > +91-9705302062. >> > _______________________________________________ >> > FreeTDS mailing list >> > FreeTDS at lists.ibiblio.org >> > http://lists.ibiblio.org/mailman/listinfo/freetds >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds >> > > > > -- > > > Thanks, > Manohar Reddy P > +91-9705302062. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From sfhacker at hotmail.com Wed Aug 31 17:55:02 2016 From: sfhacker at hotmail.com (Sergio NNX) Date: Thu, 1 Sep 2016 07:55:02 +1000 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: , , , , , , , , , Message-ID: > > My MS sql server and R environment running on my local machine and the > > respective port was opened, from this link (http://www.freetds.org/ > > userguide/osissues.htm.) i didn't get much information ,can you please help > > out me is there any way that can i download it and configured it on > > widnows 8. We are happy to assist you but unfortunately we don't have any Windows 8 as to test your requirement(s). Can we use another Windows version? > Frediano will correct me if I'm wrong, but I don't think there is a > binary distribution file > you can just download and install. There are plenty of binary distributions you could try. > >> I don't know Shiny however if I understood: > >> - you have a R application running inside this cloud; > >> - the application should use RODBC to connect to some SQL Server > >> database using ODBC. > >> Now I know ODBC. ODBC mainly use drivers (dynamic modules) to connect > >> to different database types. ............. It seems to me that we haven't done much (if any at all) reading about ODBC and the like. There are many tutorials online you could have a look at. Cheers. From xiaobiaoyin at outlook.com Wed Aug 31 20:53:08 2016 From: xiaobiaoyin at outlook.com (Xiaobiao Yin) Date: Thu, 1 Sep 2016 00:53:08 +0000 Subject: [freetds] [FreeTDS] connection pool In-Reply-To: References: , Message-ID: Hi Frediano Thank you really. In my case, I have to insert the rows to table one by one. For the connection pooling, I got the information from the User Guide. http://www.freetds.org/userguide/tdspool.htm, The FreeTDS connection pool currently only supports TDS version 4.2. If FreeTDS 1.0 supports protocol 7.2 with some limitations, where can I find the limitation's description, so that I can identify if it will affect my case. BTW, is there any sample code for connection pooling? Thanks in advance Eric ________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Wednesday, August 31, 2016 9:18 PM To: FreeTDS Development Group Subject: Re: [freetds] [FreeTDS] connection pool 2016-08-31 11:35 GMT+01:00 Xiaobiao Yin : > Hi Experts > > > I use FreeTDS (linux) to communicate with a SQL server 2005 in Windows, > > and tried to use [dbcmd() and dbsqlexec()] 100 times to insert 1 item to database tables. > > The performance is that one insert statement consumes about 2~3ms. > > > I know there is a so called Connection pool, but it only support TDS 4.2 while SQL server need TDS 7.2. > > > So in order to optimize the performance, I may need to open 2 or more connections, it is a little hard to > > control these connections. > > > My question is that are there some ways to optimize the performace. > > The target should be 1ms per 1 insert statement. > > > Any suggetions are welcome. > > > Thanks > > Eric > It's not clear if the problem is application or connections. If you have one application that needs to insert rows into a table it's better to batch the inserts instead of using a query for each row. If you have multiple process each needing to connect to database and insert a row then would be better to use a connection pooling. The connection pooling included in FreeTDS 1.0 supports protocol 7.2 with some limitations. Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds FreeTDS Info Page - ibiblio lists.ibiblio.org The FreeTDS mailing list hosts discussions of all things FreeTDS. That includes help of all kinds, as well as development issues. This is list recommended reading for ... From Jos.van.Santen at rabobank.nl Thu Sep 1 01:36:32 2016 From: Jos.van.Santen at rabobank.nl (Jos.van.Santen at rabobank.nl) Date: Thu, 1 Sep 2016 05:36:32 +0000 Subject: [freetds] diacritics issue In-Reply-To: <051d80f5cccb4239aee256e91e717329@BSTS124014.eu.rabonet.com> Message-ID: Hi community, I kindly call upon your knowledge about the issue we are facing and mentioned below. Does anyone have a clue? Thanks in advance. Jos > -----Oorspronkelijk bericht----- > Van: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] Namens Santen van, > JDG (Jos) > Verzonden: maandag 22 augustus 2016 12:44 > Aan: FreeTDS Development Group > Onderwerp: Re: [freetds] diacritics issue > > > > > -----Oorspronkelijk bericht----- > > Van: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] Namens > > Frediano Ziglio > > Verzonden: zaterdag 20 augustus 2016 10:26 > > Aan: FreeTDS Development Group > > Onderwerp: Re: [freetds] diacritics issue > > > > 2016-08-18 7:28 GMT+01:00 Santen van, JDG (Jos) > > : > > > Hi > > > > > > I am facing an issue with diacritics. > > > I am running MS SQL Enterprise x64 version 11.0.6523.0, created a > > > table there with a colomn type varchar(100) and nvarchar(100) Stored > > > the > > string: ??????????????????????????????????????????????????I? in > both > > fields. > > > > > > Codepage is 1252 latin and server collation is Latin1_General_CI_AS > > > The table is using the servers defaults. > > > > > > > ? and ? are not available in Windows 1252 encoding. > > Same for ?, ?, ?, ? and ?. > > Correct, but they are perfectly converted to their ascii equivalent c, C, g, i G > and S. > > > > > > Using FreeTDS driver 0.91, defined protocol version 7.0 in the > > > freetds config, the data retrieved by the client is corrupted, the > > > ?? (9a 9e) and ?? (8a 8e) aren?t viewable in our client and returned > ?blanks? > > > (actually the 9a 9e and 8a 8e aren?t visible in our client), the > > > ????I? is returned as gisGIS (67 69 73 47 49 53) > > > > > > > Maybe your client is not correctly. 9a 9e is the right encoding for > > windows 1252. > > Which client encoding are you using? > > The client uses UCS2 encoding. > > > FreeTDS 0.91 is quite obsolete. > > Which library are you using? > > Currently we use UnixODBC 2.2.14 > > > > > > The returned hex values of the complete string for both field types > > > is the > > same: > > > 63 9a 9e 43 8a 8e e0 e2 e7 e8 e9 ea eb ee ef f4 f9 fb fc c0 c2 c7 c8 > > > c9 ca cb ce cf d4 d9 db dc e1 ed f3 fa f1 c1 cd d3 da d1 e4 f6 c4 d6 > > > 67 69 73 47 49 53 > > > > > > > From the log/server or from the library you are using? > > > > > A part of the debug log related to character conversion: > > > iconv.c:330:tds_iconv_open(0x1891400, UTF-8) iconv.c:187:local name > > > for ISO-8859-1 is ISO-8859-1 iconv.c:187:local name for UTF-8 is > > > UTF-8 iconv.c:187:local name for UCS-2LE is UCS-2LE > > > iconv.c:187:local name for UCS-2BE is UCS-2BE iconv.c:349:setting up > > > conversions for client charset "UTF-8" > > > iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion > > > iconv.c:391:preparing iconv for "ISO-8859-1" <-> "ISO-8859-1" > > > conversion > > > iconv.c:394:tds_iconv_open: done > > > net.c:205:Connecting to x.x.x.x port 1433 (TDS version 4.2) > > > > > > (btw: Notice the TDS version used: 4.2 while we defined 7.0) > > > > > > > It seems you are really using 4.2. How did you defined 7.0 ? > > In the config file for this datasource we defined: tds version = 7.0 > > > > > > Does anyone know how to solve this issue? > > > > > > BR Jos > > > > Frediano > > BR Jos > ====================================================== > Rabobank disclaimer: http://www.rabobank.nl/disclaimer > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds ====================================================== Rabobank disclaimer: http://www.rabobank.nl/disclaimer From bill.d.thompson at baml.com Thu Sep 1 05:35:44 2016 From: bill.d.thompson at baml.com (Thompson, William) Date: Thu, 01 Sep 2016 09:35:44 +0000 Subject: [freetds] [FreeTDS] connection pool In-Reply-To: References: Message-ID: <4A990489BF566041A7724DC577BB060417F55118@smtp_mail.bankofamerica.com> Hi Eric, Your original question was how to insert data into a database table as quickly as possible. You said that you'd tried individual inserts using dbcmd() and dbsqlexec(), which are part of the db-library API. You should use the "bcp" api that is part of db-library. This is the quickest way to insert data into a database table. The api is described here, in the Sybase documentation. FreeTDS implements these functions too. http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ocs_12.5.1.dblib/html/dblib/X40041.htm It will require a little more programming than using dbsqlexec(), but if speed is your requirement, this is the way forward. Regards, Bill -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Xiaobiao Yin Sent: 01 September 2016 01:53 To: FreeTDS Development Group Subject: Re: [freetds] [FreeTDS] connection pool Hi Frediano Thank you really. In my case, I have to insert the rows to table one by one. For the connection pooling, I got the information from the User Guide. http://www.freetds.org/userguide/tdspool.htm, The FreeTDS connection pool currently only supports TDS version 4.2. If FreeTDS 1.0 supports protocol 7.2 with some limitations, where can I find the limitation's description, so that I can identify if it will affect my case. BTW, is there any sample code for connection pooling? Thanks in advance Eric ________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Wednesday, August 31, 2016 9:18 PM To: FreeTDS Development Group Subject: Re: [freetds] [FreeTDS] connection pool 2016-08-31 11:35 GMT+01:00 Xiaobiao Yin : > Hi Experts > > > I use FreeTDS (linux) to communicate with a SQL server 2005 in > Windows, > > and tried to use [dbcmd() and dbsqlexec()] 100 times to insert 1 item to database tables. > > The performance is that one insert statement consumes about 2~3ms. > > > I know there is a so called Connection pool, but it only support TDS 4.2 while SQL server need TDS 7.2. > > > So in order to optimize the performance, I may need to open 2 or > more connections, it is a little hard to > > control these connections. > > > My question is that are there some ways to optimize the performace. > > The target should be 1ms per 1 insert statement. > > > Any suggetions are welcome. > > > Thanks > > Eric > It's not clear if the problem is application or connections. If you have one application that needs to insert rows into a table it's better to batch the inserts instead of using a query for each row. If you have multiple process each needing to connect to database and insert a row then would be better to use a connection pooling. The connection pooling included in FreeTDS 1.0 supports protocol 7.2 with some limitations. Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds FreeTDS Info Page - ibiblio lists.ibiblio.org The FreeTDS mailing list hosts discussions of all things FreeTDS. That includes help of all kinds, as well as development issues. This is list recommended reading for ... _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. From freddy77 at gmail.com Thu Sep 1 06:24:47 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 1 Sep 2016 11:24:47 +0100 Subject: [freetds] [FreeTDS] connection pool In-Reply-To: References: Message-ID: 2016-09-01 1:53 GMT+01:00 Xiaobiao Yin : > Hi Frediano > > Thank you really. > > In my case, I have to insert the rows to table one by one. > > For the connection pooling, I got the information from the User Guide. > > http://www.freetds.org/userguide/tdspool.htm, > > The FreeTDS connection pool currently only supports TDS version 4.2. > Oh... thanks to point it out, this page is out of date unfortunately. Basically no 5.0 (Sybase), no encryption, SQL username/passwords. > > If FreeTDS 1.0 supports protocol 7.2 with some limitations, where can I find the > > limitation's description, so that I can identify if it will affect my case. > > > BTW, is there any sample code for connection pooling? > Beside protocol version pool examples should work. > > Thanks in advance > > Eric > > ________________________________ > From: FreeTDS on behalf of Frediano Ziglio > Sent: Wednesday, August 31, 2016 9:18 PM > To: FreeTDS Development Group > Subject: Re: [freetds] [FreeTDS] connection pool > > 2016-08-31 11:35 GMT+01:00 Xiaobiao Yin : >> Hi Experts >> >> >> I use FreeTDS (linux) to communicate with a SQL server 2005 in Windows, >> >> and tried to use [dbcmd() and dbsqlexec()] 100 times to insert 1 item to database tables. >> >> The performance is that one insert statement consumes about 2~3ms. >> >> >> I know there is a so called Connection pool, but it only support TDS 4.2 while SQL server need TDS 7.2. >> >> >> So in order to optimize the performance, I may need to open 2 or more connections, it is a little hard to >> >> control these connections. >> >> >> My question is that are there some ways to optimize the performace. >> >> The target should be 1ms per 1 insert statement. >> >> >> Any suggetions are welcome. >> >> >> Thanks >> >> Eric >> > > > It's not clear if the problem is application or connections. > If you have one application that needs to insert rows into a table > it's better to batch the inserts instead of using a query for each > row. > If you have multiple process each needing to connect to database and > insert a row then would be better to use a connection pooling. The > connection pooling included in FreeTDS 1.0 supports protocol 7.2 with > some limitations. > Frediano From freddy77 at gmail.com Thu Sep 1 06:39:54 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 1 Sep 2016 11:39:54 +0100 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: 2016-08-31 18:51 GMT+01:00 Igor Korot : > Hi, > > On Wed, Aug 31, 2016 at 11:59 AM, Manohar Reddy wrote: >> Hi, >> >> My MS sql server and R environment running on my local machine and the >> respective port was opened, from this link (http://www.freetds.org/ >> userguide/osissues.htm.) i didn't get much information ,can you please help >> out me is there any way that can i download it and configured it on >> widnows 8. > > Frediano will correct me if I'm wrong, but I don't think there is a > binary distribution file > you can just download and install. > You need to grab the source code, get either MSVC or MinGW compiler and compile > the software yourself. > About installer you are right, about binaries I would download https://ci.appveyor.com/project/FreeTDS/freetds/build/643/job/ct9rf92mw0vcyv3l/artifacts or https://ci.appveyor.com/project/FreeTDS/freetds/build/643/job/h5h5h2oekntgaqg3/artifacts (32 or 64 bit) and register tdsodbc.dll with regsvr32 utility. You should download and install OpenSSL from https://slproweb.com/products/Win32OpenSSL.html before. In win32 directory there is an old source for a NSIS installer but probably would require some additional library (MSVC/OpenSSL). > Then just place the resulting binary in the Windows folder somewhere > and create the > DSN. > > Thank you. > > P.S.: Of course if you get any issues don't hesitate to post again... > Frediano >> >> Thanks,Manu. >> >> On Wed, Aug 31, 2016 at 6:59 PM, Frediano Ziglio wrote: >> >>> Hi, >>> I don't know Shiny however if I understood: >>> - you have a R application running inside this cloud; >>> - the application should use RODBC to connect to some SQL Server >>> database using ODBC. >>> Now I know ODBC. ODBC mainly use drivers (dynamic modules) to connect >>> to different database types. As you said that Shiny run on Linux you >>> need a driver for Linux that is able to connect to SQL Server, FreeTDS >>> is one of them! However the "SQL Server"/"FreeTDS" string after the >>> "Driver=" in the connection string is not just a simple string, it's a >>> reference to an installed driver. So you have to install the driver >>> and configure in the DM (Driver Manager, the ODBC library that RODBC >>> is linked to) installed in the Shiny cloud machine. Here we can't help >>> much unless you have some direct/standard access (like ssh) to this >>> machine. >>> About the connection. Where do the SQL Server is running? Inside the >>> cloud? On your machine? Is your machine connected and opened (firewall >>> speaking) to this Shiny cloud machine(s) ? >>> Are you trying to install FreeTDS also on your machine where you are >>> testing how your R application is running (I don't know R environment) >>> ? >>> To install FreeTDS on Windows you can see >>> http://www.freetds.org/userguide/osissues.htm. >>> >>> Frediano >>> >>> >>> 2016-08-31 13:30 GMT+01:00 Manohar Reddy : >>> > Hi , >>> > >>> > >>> > >>> > Just I want to clarify my requirement before seeking someone help on my >>> > issue. >>> > >>> > >>> > >>> > *Requirement* : >>> > >>> > >>> > >>> > I need to develop the webpage/Report using shinypackages then I need >>> to >>> > host it on shinyapps.io (shinyapps.io hosted on *Linux*)for that I?m >>> using >>> > RODBC package to connect my MS Sql server ,but when I deployed it on >>> > shinyapps.io ,I have encountered this (first argument is not an open >>> RODBC >>> > channel) error, based on this error message I googled and found that I >>> need >>> > to use freeTDS drivers instead of sql server and I have cheeked with ?R >>> > professional help? and they guide me like I don?t need to install >>> freeTDS >>> > separately just I need to use freeTDS drivers instead of sql server but >>> I >>> > couldn?t able to make a successful connection. I?m suspecting that I may >>> > need to install freeTDS and need to configure it on my machine which has >>> > been running with Windows 8. >>> > >>> > >>> > >>> > *Help* : >>> > >>> > >>> > >>> > Now I?m seeking a help like how to install freeTDS and how to configure >>> > it on windows 8 ,so that I can make a successful connection to my MS Sql >>> > server from R studio/Shinyapps.io >>> > >>> > >>> > FYI? https://groups.google.com/forum/#!topic/shinyapps-users/ >>> hs4bQHsk9JU >>> > >>> > >>> > >>> > Thanks,Manu. >>> > >>> > On Wed, Aug 31, 2016 at 5:25 PM, Igor Korot wrote: >>> > >>> >> Hi, >>> >> >>> >> On Wed, Aug 31, 2016 at 2:38 AM, Manohar Reddy >>> >> wrote: >>> >> > Hi , >>> >> > >>> >> > As per your suggestion i have made changes and ran it ,still i'm >>> >> getting >>> >> > same error message,can you please guide me how to install freeTDS and >>> how >>> >> > to configure it on windows 8 ,may be i will make a successful >>> connection >>> >> > once if i have done with these changes. >>> >> >>> >> You didn't answer Frediano' questions: >>> >> >>> >> Where did you get the freeTDS driver? >>> >> How did you compile and install it? >>> >> >>> >> And one more: >>> >> What happen if you try the Microsoft ODBC driver? It should be >>> >> installed by default >>> >> If not just go to microsoft.com and grab one. >>> >> >>> >> Thank you. >>> >> >>> >> > >>> >> > Thanks in advance.. >>> >> > >>> >> > Manohar. >>> >> > >>> >> > On Wed, Aug 31, 2016 at 2:20 AM, Frediano Ziglio >>> >> wrote: >>> >> > >>> >> >> Hi, >>> >> >> some considerations: >>> >> >> - TDS_Version 9.0 was never implemented, see >>> >> >> http://www.freetds.org/userguide/choosingtdsprotocol.htm; >>> >> >> - the "Data source name not found and no default driver specified" in >>> >> >> this case means that the driver ("FreeTDS") is not installed >>> >> >> correctly. It could mean that you install the wrong bit version or >>> >> >> that you don't install it correctly. Where did you download/how do >>> you >>> >> >> compile and install? Does it happen also with "SQL Server" driver? >>> >> >> - the "\n" before "Database" is an error, there should be no such >>> >> >> character before "Database" option; >>> >> >> - the "first argument is not an open RODBC channel" just indicate >>> that >>> >> >> connection before failed; >>> >> >> - there are some not implemented option in the connection string, see >>> >> >> http://www.freetds.org/userguide/odbcconnattr.htm. >>> >> >> >>> >> >> Frediano >>> >> >> >>> >> >> >>> >> >> 2016-08-30 16:55 GMT+01:00 Manohar Reddy : >>> >> >> > Hi , >>> >> >> > >>> >> >> > Thanks for looking into my request,based on available information >>> >> freeTDS >>> >> >> > is also part of RODBC but in connection string we need to use >>> driver >>> >> name >>> >> >> > as freeTDS instead of sql server ,i tried this way only but no >>> >> luck.I'm >>> >> >> > suspecting that the way that i did is not correct ,i may need to >>> >> install >>> >> >> > freeTDS separately and need to configure it on my machine. >>> >> >> > Attached is the screen shot for your reference,can you please >>> >> help me >>> >> >> > to how to install and how to configure it on my machine(i'm running >>> >> with >>> >> >> > windows 8). >>> >> >> > >>> >> >> > Thanks in advance .. >>> >> >> > >>> >> >> > Manu. >>> >> >> > >>> >> >> > >>> >> >> > On Tue, Aug 30, 2016 at 8:21 PM, Igor Korot >>> >> wrote: >>> >> >> > >>> >> >> >> Hi, >>> >> >> >> >>> >> >> >> On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy < >>> >> manu.reddy52 at gmail.com >>> >> >> > >>> >> >> >> wrote: >>> >> >> >> > Hi, >>> >> >> >> > >>> >> >> >> > >>> >> >> >> > >>> >> >> >> > Can anyone guide me how to connect the Microsoft Sql server >>> >> 2012/14 >>> >> >> >> from >>> >> >> >> > R studio using freeTDS package instead of RODBC ,I can able to >>> >> connect >>> >> >> >> the >>> >> >> >> > MS Sql server from R studio using RODBC. >>> >> >> >> > >>> >> >> >> > Actually my requirement is I have developed webpage/report >>> using >>> >> >> Shiny >>> >> >> >> > package then I was deployed it on Shinyapps.io ,but after >>> deploying >>> >> >> I?m >>> >> >> >> > encountering error like ??ERROR:*first argument is not an open >>> >> RODBC >>> >> >> >> > channel*? ,based on this error message I did searched in google >>> and >>> >> >> found >>> >> >> >> > that we need to use freeTDS drivers instead of RODBC but I found >>> >> some >>> >> >> >> > articles regarding freeTDS but it?s not useful for me. >>> >> >> >> > >>> >> >> >> > >>> >> >> >> > >>> >> >> >> > I was eagerly waiting for solution from someone since last >>> month, >>> >> but >>> >> >> >> not >>> >> >> >> > yet and this issue is not allowing me to further .Can anyone >>> please >>> >> >> help >>> >> >> >> me >>> >> >> >> > out me(how to install freeTDS and how to configure it) on same. >>> >> >> >> >>> >> >> >> What did you try and what doesn't work? >>> >> >> >> Which freeTDS version do you have? >>> >> >> >> >>> >> >> >> Thank you. >>> >> >> >> >>> >> >> >> > >>> >> >> >> > >>> >> >> >> > >>> >> >> >> > My environment details : >>> >> >> >> > >>> >> >> >> > >>> >> >> >> > >>> >> >> >> > Os : windows 8 >>> >> >> >> > >>> >> >> >> > R version 3.3.1 (2016-06-21) >>> >> >> >> > >>> >> >> >> > >>> >> >> >> > >>> >> >> >> > Thanks in Advance . >>> >> >> >> > >>> >> >> >> > Manu. >>> >> >> _______________________________________________ >>> >> >> FreeTDS mailing list >>> >> >> FreeTDS at lists.ibiblio.org >>> >> >> http://lists.ibiblio.org/mailman/listinfo/freetds >>> >> >> >>> >> > >>> >> > >>> >> > >>> >> > -- >>> >> > >>> >> > >>> >> > Thanks, >>> >> > Manohar Reddy P >>> >> > +91-9705302062. >>> >> > _______________________________________________ >>> >> > FreeTDS mailing list >>> >> > FreeTDS at lists.ibiblio.org >>> >> > http://lists.ibiblio.org/mailman/listinfo/freetds >>> >> _______________________________________________ >>> >> FreeTDS mailing list >>> >> FreeTDS at lists.ibiblio.org >>> >> http://lists.ibiblio.org/mailman/listinfo/freetds >>> >> >>> > >>> > >>> > >>> > -- >>> > >>> > >>> > Thanks, >>> > Manohar Reddy P >>> > +91-9705302062. >>> > _______________________________________________ >>> > FreeTDS mailing list >>> > FreeTDS at lists.ibiblio.org >>> > http://lists.ibiblio.org/mailman/listinfo/freetds >>> _______________________________________________ >>> FreeTDS mailing list >>> FreeTDS at lists.ibiblio.org >>> http://lists.ibiblio.org/mailman/listinfo/freetds >>> >> >> >> >> -- >> >> >> Thanks, >> Manohar Reddy P >> +91-9705302062. >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From manu.reddy52 at gmail.com Thu Sep 1 12:44:32 2016 From: manu.reddy52 at gmail.com (Manohar Reddy) Date: Thu, 1 Sep 2016 22:14:32 +0530 Subject: [freetds] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package In-Reply-To: References: Message-ID: Thank you for sharing binaries files ,now i can able to make the connection . Manu. On Thu, Sep 1, 2016 at 4:09 PM, Frediano Ziglio wrote: > 2016-08-31 18:51 GMT+01:00 Igor Korot : > > Hi, > > > > On Wed, Aug 31, 2016 at 11:59 AM, Manohar Reddy > wrote: > >> Hi, > >> > >> My MS sql server and R environment running on my local machine and > the > >> respective port was opened, from this link (http://www.freetds.org/ > >> userguide/osissues.htm.) i didn't get much information ,can you please > help > >> out me is there any way that can i download it and configured it on > >> widnows 8. > > > > Frediano will correct me if I'm wrong, but I don't think there is a > > binary distribution file > > you can just download and install. > > You need to grab the source code, get either MSVC or MinGW compiler and > compile > > the software yourself. > > > > About installer you are right, about binaries I would download > https://ci.appveyor.com/project/FreeTDS/freetds/build/ > 643/job/ct9rf92mw0vcyv3l/artifacts > or > https://ci.appveyor.com/project/FreeTDS/freetds/build/ > 643/job/h5h5h2oekntgaqg3/artifacts > (32 or 64 bit) and register tdsodbc.dll with regsvr32 utility. > You should download and install OpenSSL from > https://slproweb.com/products/Win32OpenSSL.html before. > > In win32 directory there is an old source for a NSIS installer but > probably would require some additional library (MSVC/OpenSSL). > > > Then just place the resulting binary in the Windows folder somewhere > > and create the > > DSN. > > > > Thank you. > > > > P.S.: Of course if you get any issues don't hesitate to post again... > > > > Frediano > > >> > >> Thanks,Manu. > >> > >> On Wed, Aug 31, 2016 at 6:59 PM, Frediano Ziglio > wrote: > >> > >>> Hi, > >>> I don't know Shiny however if I understood: > >>> - you have a R application running inside this cloud; > >>> - the application should use RODBC to connect to some SQL Server > >>> database using ODBC. > >>> Now I know ODBC. ODBC mainly use drivers (dynamic modules) to connect > >>> to different database types. As you said that Shiny run on Linux you > >>> need a driver for Linux that is able to connect to SQL Server, FreeTDS > >>> is one of them! However the "SQL Server"/"FreeTDS" string after the > >>> "Driver=" in the connection string is not just a simple string, it's a > >>> reference to an installed driver. So you have to install the driver > >>> and configure in the DM (Driver Manager, the ODBC library that RODBC > >>> is linked to) installed in the Shiny cloud machine. Here we can't help > >>> much unless you have some direct/standard access (like ssh) to this > >>> machine. > >>> About the connection. Where do the SQL Server is running? Inside the > >>> cloud? On your machine? Is your machine connected and opened (firewall > >>> speaking) to this Shiny cloud machine(s) ? > >>> Are you trying to install FreeTDS also on your machine where you are > >>> testing how your R application is running (I don't know R environment) > >>> ? > >>> To install FreeTDS on Windows you can see > >>> http://www.freetds.org/userguide/osissues.htm. > >>> > >>> Frediano > >>> > >>> > >>> 2016-08-31 13:30 GMT+01:00 Manohar Reddy : > >>> > Hi , > >>> > > >>> > > >>> > > >>> > Just I want to clarify my requirement before seeking someone help > on my > >>> > issue. > >>> > > >>> > > >>> > > >>> > *Requirement* : > >>> > > >>> > > >>> > > >>> > I need to develop the webpage/Report using shinypackages then I > need > >>> to > >>> > host it on shinyapps.io (shinyapps.io hosted on *Linux*)for that I?m > >>> using > >>> > RODBC package to connect my MS Sql server ,but when I deployed it on > >>> > shinyapps.io ,I have encountered this (first argument is not an open > >>> RODBC > >>> > channel) error, based on this error message I googled and found that > I > >>> need > >>> > to use freeTDS drivers instead of sql server and I have cheeked with > ?R > >>> > professional help? and they guide me like I don?t need to install > >>> freeTDS > >>> > separately just I need to use freeTDS drivers instead of sql server > but > >>> I > >>> > couldn?t able to make a successful connection. I?m suspecting that I > may > >>> > need to install freeTDS and need to configure it on my machine which > has > >>> > been running with Windows 8. > >>> > > >>> > > >>> > > >>> > *Help* : > >>> > > >>> > > >>> > > >>> > Now I?m seeking a help like how to install freeTDS and how to > configure > >>> > it on windows 8 ,so that I can make a successful connection to my MS > Sql > >>> > server from R studio/Shinyapps.io > >>> > > >>> > > >>> > FYI? https://groups.google.com/forum/#!topic/shinyapps-users/ > >>> hs4bQHsk9JU > >>> > > >>> > > >>> > > >>> > Thanks,Manu. > >>> > > >>> > On Wed, Aug 31, 2016 at 5:25 PM, Igor Korot > wrote: > >>> > > >>> >> Hi, > >>> >> > >>> >> On Wed, Aug 31, 2016 at 2:38 AM, Manohar Reddy < > manu.reddy52 at gmail.com> > >>> >> wrote: > >>> >> > Hi , > >>> >> > > >>> >> > As per your suggestion i have made changes and ran it ,still i'm > >>> >> getting > >>> >> > same error message,can you please guide me how to install freeTDS > and > >>> how > >>> >> > to configure it on windows 8 ,may be i will make a successful > >>> connection > >>> >> > once if i have done with these changes. > >>> >> > >>> >> You didn't answer Frediano' questions: > >>> >> > >>> >> Where did you get the freeTDS driver? > >>> >> How did you compile and install it? > >>> >> > >>> >> And one more: > >>> >> What happen if you try the Microsoft ODBC driver? It should be > >>> >> installed by default > >>> >> If not just go to microsoft.com and grab one. > >>> >> > >>> >> Thank you. > >>> >> > >>> >> > > >>> >> > Thanks in advance.. > >>> >> > > >>> >> > Manohar. > >>> >> > > >>> >> > On Wed, Aug 31, 2016 at 2:20 AM, Frediano Ziglio < > freddy77 at gmail.com> > >>> >> wrote: > >>> >> > > >>> >> >> Hi, > >>> >> >> some considerations: > >>> >> >> - TDS_Version 9.0 was never implemented, see > >>> >> >> http://www.freetds.org/userguide/choosingtdsprotocol.htm; > >>> >> >> - the "Data source name not found and no default driver > specified" in > >>> >> >> this case means that the driver ("FreeTDS") is not installed > >>> >> >> correctly. It could mean that you install the wrong bit version > or > >>> >> >> that you don't install it correctly. Where did you download/how > do > >>> you > >>> >> >> compile and install? Does it happen also with "SQL Server" > driver? > >>> >> >> - the "\n" before "Database" is an error, there should be no such > >>> >> >> character before "Database" option; > >>> >> >> - the "first argument is not an open RODBC channel" just indicate > >>> that > >>> >> >> connection before failed; > >>> >> >> - there are some not implemented option in the connection > string, see > >>> >> >> http://www.freetds.org/userguide/odbcconnattr.htm. > >>> >> >> > >>> >> >> Frediano > >>> >> >> > >>> >> >> > >>> >> >> 2016-08-30 16:55 GMT+01:00 Manohar Reddy >: > >>> >> >> > Hi , > >>> >> >> > > >>> >> >> > Thanks for looking into my request,based on available > information > >>> >> freeTDS > >>> >> >> > is also part of RODBC but in connection string we need to use > >>> driver > >>> >> name > >>> >> >> > as freeTDS instead of sql server ,i tried this way only but no > >>> >> luck.I'm > >>> >> >> > suspecting that the way that i did is not correct ,i may need > to > >>> >> install > >>> >> >> > freeTDS separately and need to configure it on my machine. > >>> >> >> > Attached is the screen shot for your reference,can you > please > >>> >> help me > >>> >> >> > to how to install and how to configure it on my machine(i'm > running > >>> >> with > >>> >> >> > windows 8). > >>> >> >> > > >>> >> >> > Thanks in advance .. > >>> >> >> > > >>> >> >> > Manu. > >>> >> >> > > >>> >> >> > > >>> >> >> > On Tue, Aug 30, 2016 at 8:21 PM, Igor Korot < > ikorot01 at gmail.com> > >>> >> wrote: > >>> >> >> > > >>> >> >> >> Hi, > >>> >> >> >> > >>> >> >> >> On Tue, Aug 30, 2016 at 12:53 AM, Manohar Reddy < > >>> >> manu.reddy52 at gmail.com > >>> >> >> > > >>> >> >> >> wrote: > >>> >> >> >> > Hi, > >>> >> >> >> > > >>> >> >> >> > > >>> >> >> >> > > >>> >> >> >> > Can anyone guide me how to connect the Microsoft Sql > server > >>> >> 2012/14 > >>> >> >> >> from > >>> >> >> >> > R studio using freeTDS package instead of RODBC ,I can able > to > >>> >> connect > >>> >> >> >> the > >>> >> >> >> > MS Sql server from R studio using RODBC. > >>> >> >> >> > > >>> >> >> >> > Actually my requirement is I have developed webpage/report > >>> using > >>> >> >> Shiny > >>> >> >> >> > package then I was deployed it on Shinyapps.io ,but after > >>> deploying > >>> >> >> I?m > >>> >> >> >> > encountering error like ??ERROR:*first argument is not an > open > >>> >> RODBC > >>> >> >> >> > channel*? ,based on this error message I did searched in > google > >>> and > >>> >> >> found > >>> >> >> >> > that we need to use freeTDS drivers instead of RODBC but I > found > >>> >> some > >>> >> >> >> > articles regarding freeTDS but it?s not useful for me. > >>> >> >> >> > > >>> >> >> >> > > >>> >> >> >> > > >>> >> >> >> > I was eagerly waiting for solution from someone since last > >>> month, > >>> >> but > >>> >> >> >> not > >>> >> >> >> > yet and this issue is not allowing me to further .Can anyone > >>> please > >>> >> >> help > >>> >> >> >> me > >>> >> >> >> > out me(how to install freeTDS and how to configure it) on > same. > >>> >> >> >> > >>> >> >> >> What did you try and what doesn't work? > >>> >> >> >> Which freeTDS version do you have? > >>> >> >> >> > >>> >> >> >> Thank you. > >>> >> >> >> > >>> >> >> >> > > >>> >> >> >> > > >>> >> >> >> > > >>> >> >> >> > My environment details : > >>> >> >> >> > > >>> >> >> >> > > >>> >> >> >> > > >>> >> >> >> > Os : windows 8 > >>> >> >> >> > > >>> >> >> >> > R version 3.3.1 (2016-06-21) > >>> >> >> >> > > >>> >> >> >> > > >>> >> >> >> > > >>> >> >> >> > Thanks in Advance . > >>> >> >> >> > > >>> >> >> >> > Manu. > >>> >> >> _______________________________________________ > >>> >> >> FreeTDS mailing list > >>> >> >> FreeTDS at lists.ibiblio.org > >>> >> >> http://lists.ibiblio.org/mailman/listinfo/freetds > >>> >> >> > >>> >> > > >>> >> > > >>> >> > > >>> >> > -- > >>> >> > > >>> >> > > >>> >> > Thanks, > >>> >> > Manohar Reddy P > >>> >> > +91-9705302062. > >>> >> > _______________________________________________ > >>> >> > FreeTDS mailing list > >>> >> > FreeTDS at lists.ibiblio.org > >>> >> > http://lists.ibiblio.org/mailman/listinfo/freetds > >>> >> _______________________________________________ > >>> >> FreeTDS mailing list > >>> >> FreeTDS at lists.ibiblio.org > >>> >> http://lists.ibiblio.org/mailman/listinfo/freetds > >>> >> > >>> > > >>> > > >>> > > >>> > -- > >>> > > >>> > > >>> > Thanks, > >>> > Manohar Reddy P > >>> > +91-9705302062. > >>> > _______________________________________________ > >>> > FreeTDS mailing list > >>> > FreeTDS at lists.ibiblio.org > >>> > http://lists.ibiblio.org/mailman/listinfo/freetds > >>> _______________________________________________ > >>> FreeTDS mailing list > >>> FreeTDS at lists.ibiblio.org > >>> http://lists.ibiblio.org/mailman/listinfo/freetds > >>> > >> > >> > >> > >> -- > >> > >> > >> Thanks, > >> Manohar Reddy P > >> +91-9705302062. > >> _______________________________________________ > >> FreeTDS mailing list > >> FreeTDS at lists.ibiblio.org > >> http://lists.ibiblio.org/mailman/listinfo/freetds > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > -- Thanks, Manohar Reddy P +91-9705302062. From no-reply at appveyor.com Thu Sep 1 18:10:03 2016 From: no-reply at appveyor.com (AppVeyor) Date: Thu, 01 Sep 2016 22:10:03 +0000 Subject: [freetds] Build completed: freetds 657 Message-ID: <20160901221003.12996.74203.10F59050@appveyor.com> From xiaobiaoyin at outlook.com Thu Sep 1 21:59:28 2016 From: xiaobiaoyin at outlook.com (Xiaobiao Yin) Date: Fri, 2 Sep 2016 01:59:28 +0000 Subject: [freetds] [FreeTDS] connection pool In-Reply-To: References: , Message-ID: Hi Thank you for the information. I will have a try. Brs Eric ________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Thursday, September 1, 2016 6:24 PM To: FreeTDS Development Group Subject: Re: [freetds] [FreeTDS] connection pool 2016-09-01 1:53 GMT+01:00 Xiaobiao Yin : > Hi Frediano > > Thank you really. > > In my case, I have to insert the rows to table one by one. > > For the connection pooling, I got the information from the User Guide. > > http://www.freetds.org/userguide/tdspool.htm, TDS Connection Pooling - FreeTDS.org www.freetds.org TDS Connection Pooling. The Connection Pooling server swims in the src/pool directory. The FreeTDS connection pool is a server process; it emulates a SQL Server. > > The FreeTDS connection pool currently only supports TDS version 4.2. > Oh... thanks to point it out, this page is out of date unfortunately. Basically no 5.0 (Sybase), no encryption, SQL username/passwords. > > If FreeTDS 1.0 supports protocol 7.2 with some limitations, where can I find the > > limitation's description, so that I can identify if it will affect my case. > > > BTW, is there any sample code for connection pooling? > Beside protocol version pool examples should work. > > Thanks in advance > > Eric > > ________________________________ > From: FreeTDS on behalf of Frediano Ziglio > Sent: Wednesday, August 31, 2016 9:18 PM > To: FreeTDS Development Group > Subject: Re: [freetds] [FreeTDS] connection pool > > 2016-08-31 11:35 GMT+01:00 Xiaobiao Yin : >> Hi Experts >> >> >> I use FreeTDS (linux) to communicate with a SQL server 2005 in Windows, >> >> and tried to use [dbcmd() and dbsqlexec()] 100 times to insert 1 item to database tables. >> >> The performance is that one insert statement consumes about 2~3ms. >> >> >> I know there is a so called Connection pool, but it only support TDS 4.2 while SQL server need TDS 7.2. >> >> >> So in order to optimize the performance, I may need to open 2 or more connections, it is a little hard to >> >> control these connections. >> >> >> My question is that are there some ways to optimize the performace. >> >> The target should be 1ms per 1 insert statement. >> >> >> Any suggetions are welcome. >> >> >> Thanks >> >> Eric >> > > > It's not clear if the problem is application or connections. > If you have one application that needs to insert rows into a table > it's better to batch the inserts instead of using a query for each > row. > If you have multiple process each needing to connect to database and > insert a row then would be better to use a connection pooling. The > connection pooling included in FreeTDS 1.0 supports protocol 7.2 with > some limitations. > Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From xiaobiaoyin at outlook.com Thu Sep 1 22:07:31 2016 From: xiaobiaoyin at outlook.com (Xiaobiao Yin) Date: Fri, 2 Sep 2016 02:07:31 +0000 Subject: [freetds] [FreeTDS] connection pool In-Reply-To: <4A990489BF566041A7724DC577BB060417F55118@smtp_mail.bankofamerica.com> References: , <4A990489BF566041A7724DC577BB060417F55118@smtp_mail.bankofamerica.com> Message-ID: Hi Bill Thanks so much. Yes, the speed is my target. These "bcp" APIs also works for MS SQL server 2005, right? ________________________________ From: FreeTDS on behalf of Thompson, William Sent: Thursday, September 1, 2016 5:35 PM To: FreeTDS Development Group Subject: Re: [freetds] [FreeTDS] connection pool Hi Eric, Your original question was how to insert data into a database table as quickly as possible. You said that you'd tried individual inserts using dbcmd() and dbsqlexec(), which are part of the db-library API. You should use the "bcp" api that is part of db-library. This is the quickest way to insert data into a database table. The api is described here, in the Sybase documentation. FreeTDS implements these functions too. http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ocs_12.5.1.dblib/html/dblib/X40041.htm It will require a little more programming than using dbsqlexec(), but if speed is your requirement, this is the way forward. Regards, Bill -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Xiaobiao Yin Sent: 01 September 2016 01:53 To: FreeTDS Development Group Subject: Re: [freetds] [FreeTDS] connection pool Hi Frediano Thank you really. In my case, I have to insert the rows to table one by one. For the connection pooling, I got the information from the User Guide. http://www.freetds.org/userguide/tdspool.htm, The FreeTDS connection pool currently only supports TDS version 4.2. If FreeTDS 1.0 supports protocol 7.2 with some limitations, where can I find the limitation's description, so that I can identify if it will affect my case. BTW, is there any sample code for connection pooling? Thanks in advance Eric ________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Wednesday, August 31, 2016 9:18 PM To: FreeTDS Development Group Subject: Re: [freetds] [FreeTDS] connection pool 2016-08-31 11:35 GMT+01:00 Xiaobiao Yin : > Hi Experts > > > I use FreeTDS (linux) to communicate with a SQL server 2005 in > Windows, > > and tried to use [dbcmd() and dbsqlexec()] 100 times to insert 1 item to database tables. > > The performance is that one insert statement consumes about 2~3ms. > > > I know there is a so called Connection pool, but it only support TDS 4.2 while SQL server need TDS 7.2. > > > So in order to optimize the performance, I may need to open 2 or > more connections, it is a little hard to > > control these connections. > > > My question is that are there some ways to optimize the performace. > > The target should be 1ms per 1 insert statement. > > > Any suggetions are welcome. > > > Thanks > > Eric > It's not clear if the problem is application or connections. If you have one application that needs to insert rows into a table it's better to batch the inserts instead of using a query for each row. If you have multiple process each needing to connect to database and insert a row then would be better to use a connection pooling. The connection pooling included in FreeTDS 1.0 supports protocol 7.2 with some limitations. Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds FreeTDS Info Page - ibiblio lists.ibiblio.org The FreeTDS mailing list hosts discussions of all things FreeTDS. That includes help of all kinds, as well as development issues. This is list recommended reading for ... _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From xiaobiaoyin at outlook.com Fri Sep 2 03:20:21 2016 From: xiaobiaoyin at outlook.com (Xiaobiao Yin) Date: Fri, 2 Sep 2016 07:20:21 +0000 Subject: [freetds] [FreeTDS] connection pool In-Reply-To: <4A990489BF566041A7724DC577BB060417F55118@smtp_mail.bankofamerica.com> References: , <4A990489BF566041A7724DC577BB060417F55118@smtp_mail.bankofamerica.com> Message-ID: Hi Bill Thanks so much. It is more fast when I use the freebcp tool to send 10,000 rows to SQL server. Just one more question, When freebcp output the following log: Starting copy... 1000 rows sent to SQL Server ...... 10000 rows sent to SQL Server Does these logs means the rows are really insert to SQL server or Just sent the rows to SQL server? ________________________________ From: FreeTDS on behalf of Thompson, William Sent: Thursday, September 1, 2016 5:35 PM To: FreeTDS Development Group Subject: Re: [freetds] [FreeTDS] connection pool Hi Eric, Your original question was how to insert data into a database table as quickly as possible. You said that you'd tried individual inserts using dbcmd() and dbsqlexec(), which are part of the db-library API. You should use the "bcp" api that is part of db-library. This is the quickest way to insert data into a database table. The api is described here, in the Sybase documentation. FreeTDS implements these functions too. http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ocs_12.5.1.dblib/html/dblib/X40041.htm It will require a little more programming than using dbsqlexec(), but if speed is your requirement, this is the way forward. Regards, Bill -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Xiaobiao Yin Sent: 01 September 2016 01:53 To: FreeTDS Development Group Subject: Re: [freetds] [FreeTDS] connection pool Hi Frediano Thank you really. In my case, I have to insert the rows to table one by one. For the connection pooling, I got the information from the User Guide. http://www.freetds.org/userguide/tdspool.htm, The FreeTDS connection pool currently only supports TDS version 4.2. If FreeTDS 1.0 supports protocol 7.2 with some limitations, where can I find the limitation's description, so that I can identify if it will affect my case. BTW, is there any sample code for connection pooling? Thanks in advance Eric ________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Wednesday, August 31, 2016 9:18 PM To: FreeTDS Development Group Subject: Re: [freetds] [FreeTDS] connection pool 2016-08-31 11:35 GMT+01:00 Xiaobiao Yin : > Hi Experts > > > I use FreeTDS (linux) to communicate with a SQL server 2005 in > Windows, > > and tried to use [dbcmd() and dbsqlexec()] 100 times to insert 1 item to database tables. > > The performance is that one insert statement consumes about 2~3ms. > > > I know there is a so called Connection pool, but it only support TDS 4.2 while SQL server need TDS 7.2. > > > So in order to optimize the performance, I may need to open 2 or > more connections, it is a little hard to > > control these connections. > > > My question is that are there some ways to optimize the performace. > > The target should be 1ms per 1 insert statement. > > > Any suggetions are welcome. > > > Thanks > > Eric > It's not clear if the problem is application or connections. If you have one application that needs to insert rows into a table it's better to batch the inserts instead of using a query for each row. If you have multiple process each needing to connect to database and insert a row then would be better to use a connection pooling. The connection pooling included in FreeTDS 1.0 supports protocol 7.2 with some limitations. Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds FreeTDS Info Page - ibiblio lists.ibiblio.org The FreeTDS mailing list hosts discussions of all things FreeTDS. That includes help of all kinds, as well as development issues. This is list recommended reading for ... _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From matthew.green at datamartcomputing.com Fri Sep 2 04:03:35 2016 From: matthew.green at datamartcomputing.com (matthew.green at datamartcomputing.com) Date: Fri, 02 Sep 2016 08:03:35 +0000 Subject: [freetds] [FreeTDS] connection pool In-Reply-To: References: , <4A990489BF566041A7724DC577BB060417F55118@smtp_mail.bankofamerica.com> Message-ID: <3ad3a6468016292807dce0bf3aa2c752@datamartcomputing.com> My understanding is that the rows have been acknowledged by SQL server. If you haven't set a batch size (-b option) then it is only when the command finishes successfully that the rows are committed and you can rely on them being on SQL server. If you set a batch size then the commit happens after every -b number of rows. Any failure will leave all rows copied up until and including the last successful batch. Cheers, Matthew. September 2 2016 9:52 AM, "Xiaobiao Yin" wrote: > Hi Bill > > Thanks so much. > > It is more fast when I use the freebcp tool to send 10,000 rows to SQL server. > > Just one more question, When freebcp output the following log: > Starting copy... > 1000 rows sent to SQL Server > ...... > 10000 rows sent to SQL Server > > Does these logs means the rows are really insert to SQL server or Just sent the rows to SQL server? > > ________________________________ > From: FreeTDS on behalf of Thompson, William > > Sent: Thursday, September 1, 2016 5:35 PM > To: FreeTDS Development Group > Subject: Re: [freetds] [FreeTDS] connection pool > > Hi Eric, > > Your original question was how to insert data into a database table as quickly as possible. > You said that you'd tried individual inserts using dbcmd() and dbsqlexec(), which are part of the > db-library API. > You should use the "bcp" api that is part of db-library. This is the quickest way to insert data > into a database table. > The api is described here, in the Sybase documentation. FreeTDS implements these functions too. > > http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ocs_12.5.1.dblib/html/dblib/X4004 > .htm > > It will require a little more programming than using dbsqlexec(), but if speed is your requirement, > this is the way forward. > > Regards, > > Bill > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Xiaobiao Yin > Sent: 01 September 2016 01:53 > To: FreeTDS Development Group > Subject: Re: [freetds] [FreeTDS] connection pool > > Hi Frediano > > Thank you really. > > In my case, I have to insert the rows to table one by one. > > For the connection pooling, I got the information from the User Guide. > > http://www.freetds.org/userguide/tdspool.htm, > > The FreeTDS connection pool currently only supports TDS version 4.2. > > If FreeTDS 1.0 supports protocol 7.2 with some limitations, where can I find the > > limitation's description, so that I can identify if it will affect my case. > > BTW, is there any sample code for connection pooling? > > Thanks in advance > > Eric > > ________________________________ > From: FreeTDS on behalf of Frediano Ziglio > Sent: Wednesday, August 31, 2016 9:18 PM > To: FreeTDS Development Group > Subject: Re: [freetds] [FreeTDS] connection pool > > 2016-08-31 11:35 GMT+01:00 Xiaobiao Yin : > >> Hi Experts >> >> I use FreeTDS (linux) to communicate with a SQL server 2005 in >> Windows, >> >> and tried to use [dbcmd() and dbsqlexec()] 100 times to insert 1 item to database tables. >> >> The performance is that one insert statement consumes about 2~3ms. >> >> I know there is a so called Connection pool, but it only support TDS 4.2 while SQL server need > TDS >> 7.2. >> >> So in order to optimize the performance, I may need to open 2 or >> more connections, it is a little hard to >> >> control these connections. >> >> My question is that are there some ways to optimize the performace. >> >> The target should be 1ms per 1 insert statement. >> >> Any suggetions are welcome. >> >> Thanks >> >> Eric > > It's not clear if the problem is application or connections. > If you have one application that needs to insert rows into a table it's better to batch the inserts > instead of using a query for each row. > If you have multiple process each needing to connect to database and insert a row then would be > better to use a connection pooling. The connection pooling included in FreeTDS 1.0 supports > protocol 7.2 with some limitations. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > FreeTDS Info Page - ibiblio > lists.ibiblio.org > The FreeTDS mailing list hosts discussions of all things FreeTDS. That includes help of all kinds, > as well as development issues. This is list recommended reading for ... > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > > ---------------------------------------------------------------------- > This message, and any attachments, is for the intended recipient(s) only, may contain information > that is privileged, confidential and/or proprietary and subject to important terms and conditions > available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, > please delete this message. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Fri Sep 2 05:12:03 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 2 Sep 2016 10:12:03 +0100 Subject: [freetds] OpenSSL and SChannel compatibility issue Message-ID: Hi, yesterday I updated OpenSSL cipher list to improve security and compatibility. If you experience some intermittent connection failure this can be the cause. Apparently using one specific cipher (I didn't dig enough) implementation have some compatibility issue between OpenSSL and SChannel (very recent updates so I suspect this last component). You can download version 1.00.15 (or newer) from ftp://ftp.freetds.org/pub/freetds/stable/ which contains the update. Regards, Frediano From no-reply at appveyor.com Fri Sep 2 16:17:43 2016 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 02 Sep 2016 20:17:43 +0000 Subject: [freetds] Build failed: freetds 659 Message-ID: <20160902201743.26485.17729.CBB9F001@appveyor.com> From no-reply at appveyor.com Fri Sep 2 16:30:47 2016 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 02 Sep 2016 20:30:47 +0000 Subject: [freetds] Build completed: freetds 660 Message-ID: <20160902203047.16068.75795.5A0271DC@appveyor.com> From no-reply at appveyor.com Fri Sep 2 16:31:22 2016 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 02 Sep 2016 20:31:22 +0000 Subject: [freetds] Build failed: freetds 661 Message-ID: <20160902203121.2979.19592.1760A39A@appveyor.com> From no-reply at appveyor.com Fri Sep 2 16:54:43 2016 From: no-reply at appveyor.com (AppVeyor) Date: Fri, 02 Sep 2016 20:54:43 +0000 Subject: [freetds] Build completed: freetds 669 Message-ID: <20160902205443.25329.16182.14D51B87@appveyor.com> From no-reply at appveyor.com Sun Sep 4 06:13:58 2016 From: no-reply at appveyor.com (AppVeyor) Date: Sun, 04 Sep 2016 10:13:58 +0000 Subject: [freetds] Build failed: freetds 671 Message-ID: <20160904101358.6805.71333.51FA1B33@appveyor.com> From no-reply at appveyor.com Sun Sep 4 06:25:07 2016 From: no-reply at appveyor.com (AppVeyor) Date: Sun, 04 Sep 2016 10:25:07 +0000 Subject: [freetds] Build completed: freetds 672 Message-ID: <20160904102507.9788.48427.07B951DE@appveyor.com> From freddy77 at gmail.com Sun Sep 4 08:41:53 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Sun, 4 Sep 2016 13:41:53 +0100 Subject: [freetds] freebcp fails on identity column on MS SQL In-Reply-To: <4B238E45-1C36-4FFB-8F42-CFB5E31D8F94@capps.com> References: <4DD72274-7D03-42D8-9BA3-4DF694D0E8C4@capps.com> <4B238E45-1C36-4FFB-8F42-CFB5E31D8F94@capps.com> Message-ID: 2016-07-21 16:03 GMT+01:00 John Kendall : > Frediano, > Thanks for the fix to freebcp for Sybase identity columns. I finally had a > chance to do more tests and freebcp (1.0.11) has a problem with identity > columns on MS SQL: > > select id_col=identity(int) into tempdb..tbl > > $ freebcp tempdb..tbl out tbl.bcp -S $DSQUERY -U usr -P pw -c > > Starting copy... > 1 rows copied. > > $ freebcp tempdb..tbl in tbl.bcp -S $DSQUERY -U usr -P pw -c > > Starting copy... > Msg 102, Level 15, State 1 > Server 'ATHENA', Line 1 > Incorrect syntax near ')'. > Msg 20018, Level 15 > General SQL Server error: Check messages from the SQL Server > > bcp copy in failed > > The same error occurs when using the -n or -c. > There is no error when adding the -E option. > > Thanks. > John > Hi, can you try this change? diff --git a/src/tds/bulk.c b/src/tds/bulk.c index ffd7fc1..a9baa17 100644 --- a/src/tds/bulk.c +++ b/src/tds/bulk.c @@ -301,7 +301,10 @@ tds_bcp_start_insert_stmt(TDSSOCKET * tds, TDSBCPINFO * bcpinfo) return TDS_FAIL; } - erc = asprintf(&query, "insert bulk %s (%s)%s", tds_dstr_cstr(&bcpinfo->tablename), colclause.pb, hint); + if (firstcol) + erc = asprintf(&query, "insert bulk %s (%s)%s", tds_dstr_cstr(&bcpinfo->tablename), colclause.pb, hint); + else + erc = asprintf(&query, "insert bulk %s%s", tds_dstr_cstr(&bcpinfo->tablename), hint); free(hint); if (colclause.from_malloc) Frediano > >> On Jun 27, 2016, at 5:12 AM, Frediano Ziglio wrote: >> >> Fixed >> >> Frediano >> >> >> 2016-06-26 9:39 GMT+01:00 John Kendall : >>> >>>> On Jun 26, 2016, at 12:34 AM, Frediano Ziglio wrote: >>>> >>>> 2016-06-22 16:01 GMT+01:00 John Kendall : >>>>> My last attempt to report this was a bit muddled. Here's another try. >>>>> Using version 1.00.6. >>>>> >>>>> Using the bcp -n (native file format) and -E (retain identity values) options together produces: >>>>> >>>>> Msg 20060, Level 11 >>>>> Unknown datatype encountered >>>>> >>>>> Error in bcp_colfmt col 1 >>>>> >>>>> >>>>> I see this happening on Sybase (11 & 16) and MS SQL 2008. >>>>> >>>>> >>>>> Test to reproduce: >>>>> >>>>> select id_col=identity(5) into tempdb..tbl -- Sybase >>>>> select id_col=identity(int) into tempdb..tbl -- MS SQL >>>>> >>>>> $ freebcp tempdb..tbl out tbl.bcp -S $DSQUERY -U usr -P pw -n -E >>>>> Msg 20060, Level 11 >>>>> Unknown datatype encountered >>>>> >>>>> Error in bcp_colfmt col 1 >>>>> >>>>> datacopy also has a problem with the -E option, I assume the problems are related. >>>>> >>>>> John >>>>> >>>> >>>> Hi, >>>> finally found some time to look at this issue. >>>> >>>> Basically the sequence become: >>>> 1- do a query to get row format >>>> 2- initialize bcp >>>> 3- do a query for identity inserts >>>> 4- fill the bcp columns information with information from step 1. >>>> The problem is that the step 3 clear the information needed in step 4. >>>> Moving the query at step 1 after 3 (I put after bcp_control and before >>>> bcp_columns) fix the issue. Not sure about datacopy. >>>> >>>> Can you test master (or tomorrow nightly snapshot) ? >>>> >>>> Frediano >>> >>> That fixed the bcp out, but if I then truncate the table and try to copy back into it I get (with Sybase 11 & 16): >>> >>> freebcp tempdb..tbl in tbl.bcp -S $DSQUERY -U usr -P pw -n -E >>> >>> Starting copy... >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> Msg 20219, Level 4 >>> Internal Conversion error >>> >>> bcp copy in failed >>> >>> >>> _______________________________________________ >>> FreeTDS mailing list >>> FreeTDS at lists.ibiblio.org >>> http://lists.ibiblio.org/mailman/listinfo/freetds >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From john at capps.com Sun Sep 4 11:47:33 2016 From: john at capps.com (John Kendall) Date: Sun, 4 Sep 2016 15:47:33 +0000 Subject: [freetds] [GRAYMAIL] freebcp fails on identity column on MS SQL In-Reply-To: References: <4DD72274-7D03-42D8-9BA3-4DF694D0E8C4@capps.com> <4B238E45-1C36-4FFB-8F42-CFB5E31D8F94@capps.com> Message-ID: <9B4BBE99-59CF-4153-AFE9-E6488C74EA9D@capps.com> > On Sep 4, 2016, at 5:41 AM, Frediano Ziglio wrote: > > 2016-07-21 16:03 GMT+01:00 John Kendall : >> Frediano, >> Thanks for the fix to freebcp for Sybase identity columns. I finally had a >> chance to do more tests and freebcp (1.0.11) has a problem with identity >> columns on MS SQL: >> >> select id_col=identity(int) into tempdb..tbl >> >> $ freebcp tempdb..tbl out tbl.bcp -S $DSQUERY -U usr -P pw -c >> >> Starting copy... >> 1 rows copied. >> >> $ freebcp tempdb..tbl in tbl.bcp -S $DSQUERY -U usr -P pw -c >> >> Starting copy... >> Msg 102, Level 15, State 1 >> Server 'ATHENA', Line 1 >> Incorrect syntax near ')'. >> Msg 20018, Level 15 >> General SQL Server error: Check messages from the SQL Server >> >> bcp copy in failed >> >> The same error occurs when using the -n or -c. >> There is no error when adding the -E option. >> >> Thanks. >> John >> > > Hi, > can you try this change? > I seem to get the exact same error. > > diff --git a/src/tds/bulk.c b/src/tds/bulk.c > index ffd7fc1..a9baa17 100644 > --- a/src/tds/bulk.c > +++ b/src/tds/bulk.c > @@ -301,7 +301,10 @@ tds_bcp_start_insert_stmt(TDSSOCKET * tds, > TDSBCPINFO * bcpinfo) > return TDS_FAIL; > } > > - erc = asprintf(&query, "insert bulk %s (%s)%s", > tds_dstr_cstr(&bcpinfo->tablename), colclause.pb, hint); > + if (firstcol) > + erc = asprintf(&query, "insert bulk %s > (%s)%s", tds_dstr_cstr(&bcpinfo->tablename), colclause.pb, hint); > + else > + erc = asprintf(&query, "insert bulk %s%s", > tds_dstr_cstr(&bcpinfo->tablename), hint); > > free(hint); > if (colclause.from_malloc) > > > Frediano > >> >>> On Jun 27, 2016, at 5:12 AM, Frediano Ziglio wrote: >>> >>> Fixed >>> >>> Frediano >>> >>> >>> 2016-06-26 9:39 GMT+01:00 John Kendall : >>>> >>>>> On Jun 26, 2016, at 12:34 AM, Frediano Ziglio wrote: >>>>> >>>>> 2016-06-22 16:01 GMT+01:00 John Kendall : >>>>>> My last attempt to report this was a bit muddled. Here's another try. >>>>>> Using version 1.00.6. >>>>>> >>>>>> Using the bcp -n (native file format) and -E (retain identity values) options together produces: >>>>>> >>>>>> Msg 20060, Level 11 >>>>>> Unknown datatype encountered >>>>>> >>>>>> Error in bcp_colfmt col 1 >>>>>> >>>>>> >>>>>> I see this happening on Sybase (11 & 16) and MS SQL 2008. >>>>>> >>>>>> >>>>>> Test to reproduce: >>>>>> >>>>>> select id_col=identity(5) into tempdb..tbl -- Sybase >>>>>> select id_col=identity(int) into tempdb..tbl -- MS SQL >>>>>> >>>>>> $ freebcp tempdb..tbl out tbl.bcp -S $DSQUERY -U usr -P pw -n -E >>>>>> Msg 20060, Level 11 >>>>>> Unknown datatype encountered >>>>>> >>>>>> Error in bcp_colfmt col 1 >>>>>> >>>>>> datacopy also has a problem with the -E option, I assume the problems are related. >>>>>> >>>>>> John >>>>>> >>>>> >>>>> Hi, >>>>> finally found some time to look at this issue. >>>>> >>>>> Basically the sequence become: >>>>> 1- do a query to get row format >>>>> 2- initialize bcp >>>>> 3- do a query for identity inserts >>>>> 4- fill the bcp columns information with information from step 1. >>>>> The problem is that the step 3 clear the information needed in step 4. >>>>> Moving the query at step 1 after 3 (I put after bcp_control and before >>>>> bcp_columns) fix the issue. Not sure about datacopy. >>>>> >>>>> Can you test master (or tomorrow nightly snapshot) ? >>>>> >>>>> Frediano >>>> >>>> That fixed the bcp out, but if I then truncate the table and try to copy back into it I get (with Sybase 11 & 16): >>>> >>>> freebcp tempdb..tbl in tbl.bcp -S $DSQUERY -U usr -P pw -n -E >>>> >>>> Starting copy... >>>> >>>> Msg 20219, Level 4 >>>> Internal Conversion error >>>> >>>> Msg 20219, Level 4 >>>> Internal Conversion error >>>> >>>> Msg 20219, Level 4 >>>> Internal Conversion error >>>> >>>> Msg 20219, Level 4 >>>> Internal Conversion error >>>> >>>> Msg 20219, Level 4 >>>> Internal Conversion error >>>> >>>> Msg 20219, Level 4 >>>> Internal Conversion error >>>> >>>> Msg 20219, Level 4 >>>> Internal Conversion error >>>> >>>> Msg 20219, Level 4 >>>> Internal Conversion error >>>> >>>> Msg 20219, Level 4 >>>> Internal Conversion error >>>> >>>> Msg 20219, Level 4 >>>> Internal Conversion error >>>> >>>> Msg 20219, Level 4 >>>> Internal Conversion error >>>> >>>> bcp copy in failed >>>> >>>> >>>> _______________________________________________ >>>> FreeTDS mailing list >>>> FreeTDS at lists.ibiblio.org >>>> http://lists.ibiblio.org/mailman/listinfo/freetds >>> _______________________________________________ >>> FreeTDS mailing list >>> FreeTDS at lists.ibiblio.org >>> http://lists.ibiblio.org/mailman/listinfo/freetds >> >> _______________________________________________ >> FreeTDS mailing list >> FreeTDS at lists.ibiblio.org >> http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From xiaobiaoyin at outlook.com Sun Sep 4 20:43:51 2016 From: xiaobiaoyin at outlook.com (Eric Yin) Date: Mon, 5 Sep 2016 00:43:51 +0000 Subject: [freetds] [FreeTDS] connection pool In-Reply-To: <3ad3a6468016292807dce0bf3aa2c752@datamartcomputing.com> References: , <4A990489BF566041A7724DC577BB060417F55118@smtp_mail.bankofamerica.com>, <3ad3a6468016292807dce0bf3aa2c752@datamartcomputing.com> Message-ID: Hi Matthew Thanks so much. This behavior is what I want. Cheers Eric ________________________________ From: FreeTDS on behalf of matthew.green at datamartcomputing.com Sent: Friday, September 2, 2016 4:03 PM To: FreeTDS Development Group Subject: Re: [freetds] [FreeTDS] connection pool My understanding is that the rows have been acknowledged by SQL server. If you haven't set a batch size (-b option) then it is only when the command finishes successfully that the rows are committed and you can rely on them being on SQL server. If you set a batch size then the commit happens after every -b number of rows. Any failure will leave all rows copied up until and including the last successful batch. Cheers, Matthew. September 2 2016 9:52 AM, "Xiaobiao Yin" wrote: > Hi Bill > > Thanks so much. > > It is more fast when I use the freebcp tool to send 10,000 rows to SQL server. > > Just one more question, When freebcp output the following log: > Starting copy... > 1000 rows sent to SQL Server > ...... > 10000 rows sent to SQL Server > > Does these logs means the rows are really insert to SQL server or Just sent the rows to SQL server? > > ________________________________ > From: FreeTDS on behalf of Thompson, William > > Sent: Thursday, September 1, 2016 5:35 PM > To: FreeTDS Development Group > Subject: Re: [freetds] [FreeTDS] connection pool > > Hi Eric, > > Your original question was how to insert data into a database table as quickly as possible. > You said that you'd tried individual inserts using dbcmd() and dbsqlexec(), which are part of the > db-library API. > You should use the "bcp" api that is part of db-library. This is the quickest way to insert data > into a database table. > The api is described here, in the Sybase documentation. FreeTDS implements these functions too. > > http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ocs_12.5.1.dblib/html/dblib/X4004 > .htm > > It will require a little more programming than using dbsqlexec(), but if speed is your requirement, > this is the way forward. > > Regards, > > Bill > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Xiaobiao Yin > Sent: 01 September 2016 01:53 > To: FreeTDS Development Group > Subject: Re: [freetds] [FreeTDS] connection pool > > Hi Frediano > > Thank you really. > > In my case, I have to insert the rows to table one by one. > > For the connection pooling, I got the information from the User Guide. > > http://www.freetds.org/userguide/tdspool.htm, > > The FreeTDS connection pool currently only supports TDS version 4.2. > > If FreeTDS 1.0 supports protocol 7.2 with some limitations, where can I find the > > limitation's description, so that I can identify if it will affect my case. > > BTW, is there any sample code for connection pooling? > > Thanks in advance > > Eric > > ________________________________ > From: FreeTDS on behalf of Frediano Ziglio > Sent: Wednesday, August 31, 2016 9:18 PM > To: FreeTDS Development Group > Subject: Re: [freetds] [FreeTDS] connection pool > > 2016-08-31 11:35 GMT+01:00 Xiaobiao Yin : > >> Hi Experts >> >> I use FreeTDS (linux) to communicate with a SQL server 2005 in >> Windows, >> >> and tried to use [dbcmd() and dbsqlexec()] 100 times to insert 1 item to database tables. >> >> The performance is that one insert statement consumes about 2~3ms. >> >> I know there is a so called Connection pool, but it only support TDS 4.2 while SQL server need > TDS >> 7.2. >> >> So in order to optimize the performance, I may need to open 2 or >> more connections, it is a little hard to >> >> control these connections. >> >> My question is that are there some ways to optimize the performace. >> >> The target should be 1ms per 1 insert statement. >> >> Any suggetions are welcome. >> >> Thanks >> >> Eric > > It's not clear if the problem is application or connections. > If you have one application that needs to insert rows into a table it's better to batch the inserts > instead of using a query for each row. > If you have multiple process each needing to connect to database and insert a row then would be > better to use a connection pooling. The connection pooling included in FreeTDS 1.0 supports > protocol 7.2 with some limitations. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > FreeTDS Info Page - ibiblio > lists.ibiblio.org > The FreeTDS mailing list hosts discussions of all things FreeTDS. That includes help of all kinds, > as well as development issues. This is list recommended reading for ... > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > > ---------------------------------------------------------------------- > This message, and any attachments, is for the intended recipient(s) only, may contain information > that is privileged, confidential and/or proprietary and subject to important terms and conditions > available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, > please delete this message. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From xiaobiaoyin at outlook.com Mon Sep 5 06:23:48 2016 From: xiaobiaoyin at outlook.com (Eric Yin) Date: Mon, 5 Sep 2016 10:23:48 +0000 Subject: [freetds] How to subscribe Microsoft Sql server In-Reply-To: References: , Message-ID: Hi Frediano Thanks for pointing out that FreeTDS supports query notification for ODBC. But now, I just use the DB-Library example to query MS SQL server. (http://www.freetds.org/userguide/samplecode.htm) So my question is: Does DB-Library APIs support query notification? or is there a workaround way to subscribe MS SQL server using DB-Library APIs. Any suggestions are welcome. Thanks in advance Cheers Eric DB-Library for the Tenderfoot - FreeTDS.org www.freetds.org Example 11-3. Sample Code: DB-Library prolog. extern char *optarg; extern int optind; const static char syntax[] = "syntax: example -S server -D db -U user -P passwd ... ________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Wednesday, August 31, 2016 6:29 PM To: FreeTDS Development Group Subject: Re: [freetds] How to subscribe Microsoft Sql server FreeTDS supports query nofitications for ODBC. Just use a recent version. Frediano 2016-08-31 11:22 GMT+01:00 Xiaobiao Yin : > Hi Frediano > > > Thank your for timely reply. > > For query notifications, it depends a SQL Server ODBC driver which is not free. [http://www.easysoft.com/images/easysoft/partners/hp/business-partner.jpg] SQL Server ODBC Driver - Easysoft www.easysoft.com SQL Server ODBC driver for Microsoft SQL Server 7.0, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2012, SQL Server 2014, SQL Server 2016 and SQL ... > > For trigger, I need to implement a program in windows to subscribe the notification > > and then transform this information to Linux. This might be a backup method. > > > Is there a way to use open source to implement this requirement? > > > Thank > > ________________________________ > From: FreeTDS on behalf of Frediano Ziglio > Sent: Wednesday, August 31, 2016 4:39 PM > To: FreeTDS Development Group > Subject: Re: [freetds] How to subscribe Microsoft Sql server > > 2016-08-30 23:15 GMT+01:00 Xiaobiao Yin : >> Hi Experts >> >> >> I am very new to FreeTDS and SQL server. >> >> so far I can connect the MS SQL server 2005 from CentOS 7.2 using C program. >> >> >> My requirement is that if the SQL database changed (such as insert ,delete or update some items), >> >> is there a way to know this change? >> >> >> After looking through the APIs, I found there is no such APIs to subscribe specified SQL database table. >> >> Generally, I need to polling this specified table and see if the return results is the same as the last query, but it >> >> seems a little bit complex and no efficiency. >> >> >> So my question is: >> >> Is there an API to subscribe specified table in SQL server database. >> >> >> Any comment and hint is welcome. >> >> Thanks in advance. >> >> Eric >> > > > One option is query notifications, for instance see > http://www.easysoft.com/support/kb/kb01069.html. > How do I use SQL Server Query Notifications from Linux and ... > www.easysoft.com > Query notifications, introduced in SQL Server 2005, allow an application to request a notification from SQL Server when the results of query change. > > > > The other option is triggers, see > https://msdn.microsoft.com/en-us/library/ms189799.aspx. > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds From no-reply at appveyor.com Wed Sep 7 03:27:00 2016 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 07 Sep 2016 07:27:00 +0000 Subject: [freetds] Build failed: freetds 679 Message-ID: <20160907072316.31427.38964.6D9D05FE@appveyor.com> From no-reply at appveyor.com Wed Sep 7 07:23:21 2016 From: no-reply at appveyor.com (AppVeyor) Date: Wed, 07 Sep 2016 11:23:21 +0000 Subject: [freetds] Build completed: freetds 683 Message-ID: <20160907112320.22677.6222.4EDF917B@appveyor.com> From vasanth.sengunthar at accenture.com Thu Sep 8 02:27:55 2016 From: vasanth.sengunthar at accenture.com (vasanth.sengunthar at accenture.com) Date: Thu, 8 Sep 2016 06:27:55 +0000 Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) References: Message-ID: <90978bdf96d94a52bc7d2a658bea4501@SN4PR4205MB0413.048d.mgd.msft.net> Hi, Please help with missing (return status=0) with fisql command for MS SQL Server 2012 -output from Linux OS. Check trail mail for more reference. Regards, Vasanth -----Original Message----- From: Sengunthar, Vasanth Sent: Tuesday, August 30, 2016 8:29 PM To: 'FreeTDS Development Group' Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi All, Please help with below Issue. Looking forward to hearing a positive response from you. Regards, Vasanth -----Original Message----- From: Sengunthar, Vasanth Sent: Monday, August 22, 2016 3:09 PM To: FreeTDS Development Group Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi, Please check below sample SP. Database : Microsoft SQL Server 2012 Protocol Version : tds_version = 7.0 [SP] --------- USE [TEST01] GO /****** Object: StoredProcedure [dbo].[tst_test_result_msg] Script Date: 8/22/2016 5:31:16 AM ******/ SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[tst_test_result_msg] @tst_flag varchar(1), @tst_desc varchar(40) AS BEGIN DECLARE @tst_activ_type varchar(5) SELECT cust_no, cust_name FROM dbo.customer IF @tst_flag = 'A' SELECT @tst_desc = 'Print A' ELSE IF @tst_flag = 'B' SELECT @tst_desc = 'Print B' ELSE IF @tst_flag = 'C' SELECT @tst_desc = 'Print C' ELSE IF @tst_flag = 'D' SELECT @tst_desc = 'Print D' PRINT @tst_desc END Regards, Vasanth -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Igor Korot Sent: Sunday, August 21, 2016 7:03 AM To: FreeTDS Development Group Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi. Do you have an example of one such SP? What is you DB (MS, Sybase) and what version? Which protocol version do you use? All in all - we need more info. Thank you. On Aug 20, 2016 11:01 AM, wrote: Hi, Thank you all in advance, please help me with below issue. I have been working with fisql command lot lately and recently I came across this issue, where the fisql command does not give (return status=0) for some SQL execution. The Issues is not generic but specific to any such SQL store procedure which gives output in (results + message) format. And the approach I like to present to out client includes such scenario where they have multiple store procedure like above. Looking forward to your earliest response, Regards, Vasanth Sengunthar ________________________________ This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. ____________________________________________________________ __________________________ www.accenture.com _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= From bill.d.thompson at baml.com Thu Sep 8 08:57:01 2016 From: bill.d.thompson at baml.com (Thompson, William) Date: Thu, 08 Sep 2016 12:57:01 +0000 Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) In-Reply-To: <90978bdf96d94a52bc7d2a658bea4501@SN4PR4205MB0413.048d.mgd.msft.net> References: <90978bdf96d94a52bc7d2a658bea4501@SN4PR4205MB0413.048d.mgd.msft.net> Message-ID: <4A990489BF566041A7724DC577BB060417F56BD8@smtp_mail.bankofamerica.com> Hi, There's a bug, if you want to call it that, in the fisql program that means that the "return status = n" message is not printed in this case. One solution would be to use the "tsql" program rather than "fisql", if you like. I've checked, and it works as you would want. If for some reason, you're especially fond of fisql, then it could be fixed. Are you prepared to fix it yourself and try it out? If so, I'll give you a suggested code change... Cheers, Bill -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of vasanth.sengunthar at accenture.com Sent: 08 September 2016 07:28 To: freetds at lists.ibiblio.org Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi, Please help with missing (return status=0) with fisql command for MS SQL Server 2012 -output from Linux OS. Check trail mail for more reference. Regards, Vasanth -----Original Message----- From: Sengunthar, Vasanth Sent: Tuesday, August 30, 2016 8:29 PM To: 'FreeTDS Development Group' Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi All, Please help with below Issue. Looking forward to hearing a positive response from you. Regards, Vasanth -----Original Message----- From: Sengunthar, Vasanth Sent: Monday, August 22, 2016 3:09 PM To: FreeTDS Development Group Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi, Please check below sample SP. Database : Microsoft SQL Server 2012 Protocol Version : tds_version = 7.0 [SP] --------- USE [TEST01] GO /****** Object: StoredProcedure [dbo].[tst_test_result_msg] Script Date: 8/22/2016 5:31:16 AM ******/ SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[tst_test_result_msg] @tst_flag varchar(1), @tst_desc varchar(40) AS BEGIN DECLARE @tst_activ_type varchar(5) SELECT cust_no, cust_name FROM dbo.customer IF @tst_flag = 'A' SELECT @tst_desc = 'Print A' ELSE IF @tst_flag = 'B' SELECT @tst_desc = 'Print B' ELSE IF @tst_flag = 'C' SELECT @tst_desc = 'Print C' ELSE IF @tst_flag = 'D' SELECT @tst_desc = 'Print D' PRINT @tst_desc END Regards, Vasanth -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Igor Korot Sent: Sunday, August 21, 2016 7:03 AM To: FreeTDS Development Group Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi. Do you have an example of one such SP? What is you DB (MS, Sybase) and what version? Which protocol version do you use? All in all - we need more info. Thank you. On Aug 20, 2016 11:01 AM, wrote: Hi, Thank you all in advance, please help me with below issue. I have been working with fisql command lot lately and recently I came across this issue, where the fisql command does not give (return status=0) for some SQL execution. The Issues is not generic but specific to any such SQL store procedure which gives output in (results + message) format. And the approach I like to present to out client includes such scenario where they have multiple store procedure like above. Looking forward to your earliest response, Regards, Vasanth Sengunthar ________________________________ This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. ____________________________________________________________ __________________________ www.accenture.com _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. From vasanth.sengunthar at accenture.com Fri Sep 9 10:05:12 2016 From: vasanth.sengunthar at accenture.com (vasanth.sengunthar at accenture.com) Date: Fri, 9 Sep 2016 14:05:12 +0000 Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) In-Reply-To: <4A990489BF566041A7724DC577BB060417F56BD8@smtp_mail.bankofamerica.com> References: <90978bdf96d94a52bc7d2a658bea4501@SN4PR4205MB0413.048d.mgd.msft.net> <4A990489BF566041A7724DC577BB060417F56BD8@smtp_mail.bankofamerica.com> Message-ID: Hi Bill, Thank you for prompt response and yes, please help us with required code to fix the fisql Issue. We tried to solve the issue via 'tsql' program but with given such scenario, tsql fails to capture both (results + messages) with output file. It fetch only results to output file not the messages rather prints the same in command prompt itself. Thanks, -Vasanth -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Thompson, William Sent: Thursday, September 08, 2016 6:27 PM To: FreeTDS Development Group Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi, There's a bug, if you want to call it that, in the fisql program that means that the "return status = n" message is not printed in this case. One solution would be to use the "tsql" program rather than "fisql", if you like. I've checked, and it works as you would want. If for some reason, you're especially fond of fisql, then it could be fixed. Are you prepared to fix it yourself and try it out? If so, I'll give you a suggested code change... Cheers, Bill -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of vasanth.sengunthar at accenture.com Sent: 08 September 2016 07:28 To: freetds at lists.ibiblio.org Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi, Please help with missing (return status=0) with fisql command for MS SQL Server 2012 -output from Linux OS. Check trail mail for more reference. Regards, Vasanth -----Original Message----- From: Sengunthar, Vasanth Sent: Tuesday, August 30, 2016 8:29 PM To: 'FreeTDS Development Group' Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi All, Please help with below Issue. Looking forward to hearing a positive response from you. Regards, Vasanth -----Original Message----- From: Sengunthar, Vasanth Sent: Monday, August 22, 2016 3:09 PM To: FreeTDS Development Group Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi, Please check below sample SP. Database : Microsoft SQL Server 2012 Protocol Version : tds_version = 7.0 [SP] --------- USE [TEST01] GO /****** Object: StoredProcedure [dbo].[tst_test_result_msg] Script Date: 8/22/2016 5:31:16 AM ******/ SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[tst_test_result_msg] @tst_flag varchar(1), @tst_desc varchar(40) AS BEGIN DECLARE @tst_activ_type varchar(5) SELECT cust_no, cust_name FROM dbo.customer IF @tst_flag = 'A' SELECT @tst_desc = 'Print A' ELSE IF @tst_flag = 'B' SELECT @tst_desc = 'Print B' ELSE IF @tst_flag = 'C' SELECT @tst_desc = 'Print C' ELSE IF @tst_flag = 'D' SELECT @tst_desc = 'Print D' PRINT @tst_desc END Regards, Vasanth -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Igor Korot Sent: Sunday, August 21, 2016 7:03 AM To: FreeTDS Development Group Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) Hi. Do you have an example of one such SP? What is you DB (MS, Sybase) and what version? Which protocol version do you use? All in all - we need more info. Thank you. On Aug 20, 2016 11:01 AM, wrote: Hi, Thank you all in advance, please help me with below issue. I have been working with fisql command lot lately and recently I came across this issue, where the fisql command does not give (return status=0) for some SQL execution. The Issues is not generic but specific to any such SQL store procedure which gives output in (results + message) format. And the approach I like to present to out client includes such scenario where they have multiple store procedure like above. Looking forward to your earliest response, Regards, Vasanth Sengunthar ________________________________ This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. ____________________________________________________________ __________________________ www.accenture.com _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=YeeQpC5oh2O1h9ftbdVpH6iIE20ltx2edLYOiJ7Piyg&e= ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.bankofamerica.com_emaildisclaimer&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=IxXw3jX5aMlcnYvBOGeU3od1dXPXg8zb-yd9JzTJdow&e= . If you are not the intended recipient, please delete this message. _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=YeeQpC5oh2O1h9ftbdVpH6iIE20ltx2edLYOiJ7Piyg&e= From john at capps.com Fri Sep 9 11:51:35 2016 From: john at capps.com (John Kendall) Date: Fri, 9 Sep 2016 15:51:35 +0000 Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) In-Reply-To: References: <90978bdf96d94a52bc7d2a658bea4501@SN4PR4205MB0413.048d.mgd.msft.net> <4A990489BF566041A7724DC577BB060417F56BD8@smtp_mail.bankofamerica.com> Message-ID: On Sep 9, 2016, at 7:05 AM, wrote: > Hi Bill, > > Thank you for prompt response and yes, please help us with required code to fix the fisql Issue. > > We tried to solve the issue via 'tsql' program but with given such scenario, tsql fails to capture both (results + messages) with output file. It fetch only results to output file not the messages rather prints the same in command prompt itself. You might try this to get both messages and output into the same outfile: unix/linux/Macos tsql >outfile 2>&1 Windows tsql 1>outfile 2>&1 John > > Thanks, > -Vasanth > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Thompson, William > Sent: Thursday, September 08, 2016 6:27 PM > To: FreeTDS Development Group > Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi, > > There's a bug, if you want to call it that, in the fisql program that means that the "return status = n" message is not printed in this case. > > One solution would be to use the "tsql" program rather than "fisql", if you like. I've checked, and it works as you would want. > > If for some reason, you're especially fond of fisql, then it could be fixed. > Are you prepared to fix it yourself and try it out? If so, I'll give you a suggested code change... > > Cheers, > > Bill > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of vasanth.sengunthar at accenture.com > Sent: 08 September 2016 07:28 > To: freetds at lists.ibiblio.org > Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi, > > Please help with missing (return status=0) with fisql command for MS SQL Server 2012 -output from Linux OS. > Check trail mail for more reference. > > Regards, > Vasanth > > -----Original Message----- > From: Sengunthar, Vasanth > Sent: Tuesday, August 30, 2016 8:29 PM > To: 'FreeTDS Development Group' > Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi All, > > Please help with below Issue. > Looking forward to hearing a positive response from you. > > Regards, > Vasanth > > > -----Original Message----- > From: Sengunthar, Vasanth > Sent: Monday, August 22, 2016 3:09 PM > To: FreeTDS Development Group > Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi, > > Please check below sample SP. > > Database : Microsoft SQL Server 2012 > Protocol Version : tds_version = 7.0 > > [SP] > --------- > USE [TEST01] > GO > /****** Object: StoredProcedure [dbo].[tst_test_result_msg] Script Date: 8/22/2016 5:31:16 AM ******/ > SET ANSI_NULLS OFF > GO > SET QUOTED_IDENTIFIER ON > GO > > ALTER PROCEDURE [dbo].[tst_test_result_msg] > @tst_flag varchar(1), > @tst_desc varchar(40) > AS > BEGIN > DECLARE > @tst_activ_type varchar(5) > > SELECT cust_no, cust_name > FROM dbo.customer > > IF @tst_flag = 'A' > SELECT @tst_desc = 'Print A' > ELSE > IF @tst_flag = 'B' > SELECT @tst_desc = 'Print B' > ELSE > IF @tst_flag = 'C' > SELECT @tst_desc = 'Print C' > ELSE > IF @tst_flag = 'D' > SELECT @tst_desc = 'Print D' > > PRINT @tst_desc > END > > > Regards, > Vasanth > > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Igor Korot > Sent: Sunday, August 21, 2016 7:03 AM > To: FreeTDS Development Group > Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi. > Do you have an example of one such SP? > What is you DB (MS, Sybase) and what version? > Which protocol version do you use? > > All in all - we need more info. > > Thank you. > > On Aug 20, 2016 11:01 AM, wrote: > > > Hi, > > > > Thank you all in advance, please help me with below issue. > > > > I have been working with fisql command lot lately and recently I came across this issue, where the fisql command does not give (return status=0) for some SQL execution. > > > > The Issues is not generic but specific to any such SQL store procedure which gives output in (results + message) format. > > > > And the approach I like to present to out client includes such scenario where they have multiple store procedure like above. > > > > Looking forward to your earliest response, > > Regards, > Vasanth Sengunthar > > ________________________________ > > This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. > ____________________________________________________________ > __________________________ > > www.accenture.com > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=YeeQpC5oh2O1h9ftbdVpH6iIE20ltx2edLYOiJ7Piyg&e= > > ---------------------------------------------------------------------- > This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.bankofamerica.com_emaildisclaimer&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=IxXw3jX5aMlcnYvBOGeU3od1dXPXg8zb-yd9JzTJdow&e= . If you are not the intended recipient, please delete this message. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=YeeQpC5oh2O1h9ftbdVpH6iIE20ltx2edLYOiJ7Piyg&e= > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Fri Sep 9 11:53:57 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 9 Sep 2016 16:53:57 +0100 Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) In-Reply-To: References: <90978bdf96d94a52bc7d2a658bea4501@SN4PR4205MB0413.048d.mgd.msft.net> <4A990489BF566041A7724DC577BB060417F56BD8@smtp_mail.bankofamerica.com> Message-ID: 2016-09-09 15:05 GMT+01:00 : > Hi Bill, > > Thank you for prompt response and yes, please help us with required code to fix the fisql Issue. > > We tried to solve the issue via 'tsql' program but with given such scenario, tsql fails to capture both (results + messages) with output file. It fetch only results to output file not the messages rather prints the same in command prompt itself. > > Thanks, > -Vasanth > Can you try this change? diff --git a/src/apps/fisql/fisql.c b/src/apps/fisql/fisql.c index 0396920..67aa850 100644 --- a/src/apps/fisql/fisql.c +++ b/src/apps/fisql/fisql.c @@ -683,6 +683,8 @@ main(int argc, char *argv[]) signal(SIGINT, active_interrupt_handler); dbsetinterrupt(dbproc, (void *) active_interrupt_pending, (void *) active_interrupt_servhandler); if (dbsqlexec(dbproc) == SUCCEED) { + int status_printed = 0; + maybe_handle_active_interrupt(); while ((dbrc = dbresults(dbproc)) != NO_MORE_RESULTS) { printedlines = 0; @@ -802,12 +804,14 @@ main(int argc, char *argv[]) if (DBCOUNT(dbproc) >= 0) { fprintf(stdout, "(%d rows affected", (int) DBCOUNT(dbproc)); if (dbhasretstat(dbproc)) { + status_printed = 1; dbrc = dbretstatus(dbproc); fprintf(stdout, ", return status = %d", dbrc); } fprintf(stdout, ")\n"); } else { if (dbhasretstat(dbproc)) { + status_printed = 1; dbrc = dbretstatus(dbproc); fprintf(stdout, "(return status = %d)\n", dbrc); } @@ -815,6 +819,10 @@ main(int argc, char *argv[]) } } } + if (!status_printed && dbhasretstat(dbproc)) { + dbrc = dbretstatus(dbproc); + fprintf(stdout, "(return status = %d)\n", dbrc); + } } else { /* Something failed, so change the default * exit status to reflect that. Frediano > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Thompson, William > Sent: Thursday, September 08, 2016 6:27 PM > To: FreeTDS Development Group > Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi, > > There's a bug, if you want to call it that, in the fisql program that means that the "return status = n" message is not printed in this case. > > One solution would be to use the "tsql" program rather than "fisql", if you like. I've checked, and it works as you would want. > > If for some reason, you're especially fond of fisql, then it could be fixed. > Are you prepared to fix it yourself and try it out? If so, I'll give you a suggested code change... > > Cheers, > > Bill > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of vasanth.sengunthar at accenture.com > Sent: 08 September 2016 07:28 > To: freetds at lists.ibiblio.org > Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi, > > Please help with missing (return status=0) with fisql command for MS SQL Server 2012 -output from Linux OS. > Check trail mail for more reference. > > Regards, > Vasanth > > -----Original Message----- > From: Sengunthar, Vasanth > Sent: Tuesday, August 30, 2016 8:29 PM > To: 'FreeTDS Development Group' > Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi All, > > Please help with below Issue. > Looking forward to hearing a positive response from you. > > Regards, > Vasanth > > > -----Original Message----- > From: Sengunthar, Vasanth > Sent: Monday, August 22, 2016 3:09 PM > To: FreeTDS Development Group > Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi, > > Please check below sample SP. > > Database : Microsoft SQL Server 2012 > Protocol Version : tds_version = 7.0 > > [SP] > --------- > USE [TEST01] > GO > /****** Object: StoredProcedure [dbo].[tst_test_result_msg] Script Date: 8/22/2016 5:31:16 AM ******/ > SET ANSI_NULLS OFF > GO > SET QUOTED_IDENTIFIER ON > GO > > ALTER PROCEDURE [dbo].[tst_test_result_msg] > @tst_flag varchar(1), > @tst_desc varchar(40) > AS > BEGIN > DECLARE > @tst_activ_type varchar(5) > > SELECT cust_no, cust_name > FROM dbo.customer > > IF @tst_flag = 'A' > SELECT @tst_desc = 'Print A' > ELSE > IF @tst_flag = 'B' > SELECT @tst_desc = 'Print B' > ELSE > IF @tst_flag = 'C' > SELECT @tst_desc = 'Print C' > ELSE > IF @tst_flag = 'D' > SELECT @tst_desc = 'Print D' > > PRINT @tst_desc > END > > > Regards, > Vasanth > > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Igor Korot > Sent: Sunday, August 21, 2016 7:03 AM > To: FreeTDS Development Group > Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi. > Do you have an example of one such SP? > What is you DB (MS, Sybase) and what version? > Which protocol version do you use? > > All in all - we need more info. > > Thank you. > > On Aug 20, 2016 11:01 AM, wrote: > > > Hi, > > > > Thank you all in advance, please help me with below issue. > > > > I have been working with fisql command lot lately and recently I came across this issue, where the fisql command does not give (return status=0) for some SQL execution. > > > > The Issues is not generic but specific to any such SQL store procedure which gives output in (results + message) format. > > > > And the approach I like to present to out client includes such scenario where they have multiple store procedure like above. > > > > Looking forward to your earliest response, > > Regards, > Vasanth Sengunthar > > ________________________________ > > This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. > ____________________________________________________________ > __________________________ > > www.accenture.com > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=YeeQpC5oh2O1h9ftbdVpH6iIE20ltx2edLYOiJ7Piyg&e= > > ---------------------------------------------------------------------- > This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.bankofamerica.com_emaildisclaimer&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=IxXw3jX5aMlcnYvBOGeU3od1dXPXg8zb-yd9JzTJdow&e= . If you are not the intended recipient, please delete this message. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=YeeQpC5oh2O1h9ftbdVpH6iIE20ltx2edLYOiJ7Piyg&e= > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Sun Sep 11 10:27:42 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Sun, 11 Sep 2016 15:27:42 +0100 Subject: [freetds] How to subscribe Microsoft Sql server In-Reply-To: References: Message-ID: On 5 Sep 2016 11:24, "Eric Yin" wrote: > > Hi Frediano > > > Thanks for pointing out that FreeTDS supports query notification for ODBC. > > But now, I just use the DB-Library example to query MS SQL server. > > (http://www.freetds.org/userguide/samplecode.htm) > > So my question is: > > Does DB-Library APIs support query notification? > > or is there a workaround way to subscribe MS SQL server using DB-Library APIs. > Currently there is no way using dblib however being open source patches are welcome. Frediano > Any suggestions are welcome. > > > Thanks in advance > > > Cheers > > Eric > > DB-Library for the Tenderfoot - FreeTDS.org< http://www.freetds.org/userguide/samplecode.htm> > www.freetds.org > Example 11-3. Sample Code: DB-Library prolog. extern char *optarg; extern int optind; const static char syntax[] = "syntax: example -S server -D db -U user -P passwd ... > > > > > > ________________________________ > From: FreeTDS on behalf of Frediano Ziglio > Sent: Wednesday, August 31, 2016 6:29 PM > To: FreeTDS Development Group > Subject: Re: [freetds] How to subscribe Microsoft Sql server > > FreeTDS supports query nofitications for ODBC. Just use a recent version. > > Frediano > > > 2016-08-31 11:22 GMT+01:00 Xiaobiao Yin : > > Hi Frediano > > > > > > Thank your for timely reply. > > > > For query notifications, it depends a SQL Server ODBC driver< http://www.easysoft.com/products/data_access/odbc-sql-server-driver/index.html> which is not free. > [http://www.easysoft.com/images/easysoft/partners/hp/business-partner.jpg ]< http://www.easysoft.com/products/data_access/odbc-sql-server-driver/index.html > > > SQL Server ODBC Driver - Easysoft< http://www.easysoft.com/products/data_access/odbc-sql-server-driver/index.html > > www.easysoft.com > SQL Server ODBC driver for Microsoft SQL Server 7.0, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2012, SQL Server 2014, SQL Server 2016 and SQL ... > > > > > > > For trigger, I need to implement a program in windows to subscribe the notification > > > > and then transform this information to Linux. This might be a backup method. > > > > > > Is there a way to use open source to implement this requirement? > > > > > > Thank > > > > ________________________________ > > From: FreeTDS on behalf of Frediano Ziglio > > Sent: Wednesday, August 31, 2016 4:39 PM > > To: FreeTDS Development Group > > Subject: Re: [freetds] How to subscribe Microsoft Sql server > > > > 2016-08-30 23:15 GMT+01:00 Xiaobiao Yin : > >> Hi Experts > >> > >> > >> I am very new to FreeTDS and SQL server. > >> > >> so far I can connect the MS SQL server 2005 from CentOS 7.2 using C program. > >> > >> > >> My requirement is that if the SQL database changed (such as insert ,delete or update some items), > >> > >> is there a way to know this change? > >> > >> > >> After looking through the APIs, I found there is no such APIs to subscribe specified SQL database table. > >> > >> Generally, I need to polling this specified table and see if the return results is the same as the last query, but it > >> > >> seems a little bit complex and no efficiency. > >> > >> > >> So my question is: > >> > >> Is there an API to subscribe specified table in SQL server database. > >> > >> > >> Any comment and hint is welcome. > >> > >> Thanks in advance. > >> > >> Eric > >> > > > > > > One option is query notifications, for instance see > > http://www.easysoft.com/support/kb/kb01069.html. > > How do I use SQL Server Query Notifications from Linux and ...< http://www.easysoft.com/support/kb/kb01069.html> > > www.easysoft.com > > Query notifications, introduced in SQL Server 2005, allow an application to request a notification from SQL Server when the results of query change. > > > > > > > > The other option is triggers, see > > https://msdn.microsoft.com/en-us/library/ms189799.aspx. > > > > Frediano > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From adam.baratz at gmail.com Wed Sep 14 16:50:08 2016 From: adam.baratz at gmail.com (Adam Baratz) Date: Wed, 14 Sep 2016 16:50:08 -0400 Subject: [freetds] missing divide by zero error Message-ID: I'm running into an issue where a "SELECT 1/0" query returns a NULL result instead of an error. I attached the relevant snippet from the TDSDUMP output (the packet continues with some host information). The result is coming back as TDS7_RESULT instead of ERROR, but part of it includes the error message. I took a look at the appropriate spec[1], but I'm having trouble understanding the format. Does anyone have thoughts on what's going on? I'm using MSSQL with TDS 7.2. Thanks, Adam --- [1] http://www.freetds.org/tds.html#t129 -------------- next part -------------- A non-text attachment was scrubbed... Name: div0.log Type: application/octet-stream Size: 1037 bytes Desc: not available URL: From bill.d.thompson at baml.com Fri Sep 16 03:45:24 2016 From: bill.d.thompson at baml.com (Thompson, William) Date: Fri, 16 Sep 2016 07:45:24 +0000 Subject: [freetds] missing divide by zero error In-Reply-To: References: Message-ID: <4A990489BF566041A7724DC577BB060417F58903@smtp_mail.bankofamerica.com> Hi Adam, I see from the log that you are using the db-library API. If you want to handle error messages from the server using db-library you will have to define a message handler, using the db-library function dbmsghandle() Here's a link to a (Sybase) resource describing the function. A search on dbmsghandle will point you to much more. http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ocs_12.5.1.dblib/html/dblib/CBAJCDEA.htm HTH, Bill -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Adam Baratz Sent: 14 September 2016 21:50 To: FreeTDS Development Group Subject: [freetds] missing divide by zero error I'm running into an issue where a "SELECT 1/0" query returns a NULL result instead of an error. I attached the relevant snippet from the TDSDUMP output (the packet continues with some host information). The result is coming back as TDS7_RESULT instead of ERROR, but part of it includes the error message. I took a look at the appropriate spec[1], but I'm having trouble understanding the format. Does anyone have thoughts on what's going on? I'm using MSSQL with TDS 7.2. Thanks, Adam --- [1] http://www.freetds.org/tds.html#t129 ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. From vasanth.sengunthar at accenture.com Fri Sep 16 06:35:11 2016 From: vasanth.sengunthar at accenture.com (vasanth.sengunthar at accenture.com) Date: Fri, 16 Sep 2016 10:35:11 +0000 Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) In-Reply-To: References: <90978bdf96d94a52bc7d2a658bea4501@SN4PR4205MB0413.048d.mgd.msft.net> <4A990489BF566041A7724DC577BB060417F56BD8@smtp_mail.bankofamerica.com> , Message-ID: Frediano, Thank you for prompt response. As of now we are working with tsql instead of fisql. And we are trying to locate fisql source code for suggested changes. -Vasanth ________________________________ From: FreeTDS on behalf of Frediano Ziglio Sent: Friday, September 9, 2016 9:23 PM To: FreeTDS Development Group Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) 2016-09-09 15:05 GMT+01:00 : > Hi Bill, > > Thank you for prompt response and yes, please help us with required code to fix the fisql Issue. > > We tried to solve the issue via 'tsql' program but with given such scenario, tsql fails to capture both (results + messages) with output file. It fetch only results to output file not the messages rather prints the same in command prompt itself. > > Thanks, > -Vasanth > Can you try this change? diff --git a/src/apps/fisql/fisql.c b/src/apps/fisql/fisql.c index 0396920..67aa850 100644 --- a/src/apps/fisql/fisql.c +++ b/src/apps/fisql/fisql.c @@ -683,6 +683,8 @@ main(int argc, char *argv[]) signal(SIGINT, active_interrupt_handler); dbsetinterrupt(dbproc, (void *) active_interrupt_pending, (void *) active_interrupt_servhandler); if (dbsqlexec(dbproc) == SUCCEED) { + int status_printed = 0; + maybe_handle_active_interrupt(); while ((dbrc = dbresults(dbproc)) != NO_MORE_RESULTS) { printedlines = 0; @@ -802,12 +804,14 @@ main(int argc, char *argv[]) if (DBCOUNT(dbproc) >= 0) { fprintf(stdout, "(%d rows affected", (int) DBCOUNT(dbproc)); if (dbhasretstat(dbproc)) { + status_printed = 1; dbrc = dbretstatus(dbproc); fprintf(stdout, ", return status = %d", dbrc); } fprintf(stdout, ")\n"); } else { if (dbhasretstat(dbproc)) { + status_printed = 1; dbrc = dbretstatus(dbproc); fprintf(stdout, "(return status = %d)\n", dbrc); } @@ -815,6 +819,10 @@ main(int argc, char *argv[]) } } } + if (!status_printed && dbhasretstat(dbproc)) { + dbrc = dbretstatus(dbproc); + fprintf(stdout, "(return status = %d)\n", dbrc); + } } else { /* Something failed, so change the default * exit status to reflect that. Frediano > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Thompson, William > Sent: Thursday, September 08, 2016 6:27 PM > To: FreeTDS Development Group > Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi, > > There's a bug, if you want to call it that, in the fisql program that means that the "return status = n" message is not printed in this case. > > One solution would be to use the "tsql" program rather than "fisql", if you like. I've checked, and it works as you would want. > > If for some reason, you're especially fond of fisql, then it could be fixed. > Are you prepared to fix it yourself and try it out? If so, I'll give you a suggested code change... > > Cheers, > > Bill > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of vasanth.sengunthar at accenture.com > Sent: 08 September 2016 07:28 > To: freetds at lists.ibiblio.org > Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi, > > Please help with missing (return status=0) with fisql command for MS SQL Server 2012 -output from Linux OS. > Check trail mail for more reference. > > Regards, > Vasanth > > -----Original Message----- > From: Sengunthar, Vasanth > Sent: Tuesday, August 30, 2016 8:29 PM > To: 'FreeTDS Development Group' > Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi All, > > Please help with below Issue. > Looking forward to hearing a positive response from you. > > Regards, > Vasanth > > > -----Original Message----- > From: Sengunthar, Vasanth > Sent: Monday, August 22, 2016 3:09 PM > To: FreeTDS Development Group > Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi, > > Please check below sample SP. > > Database : Microsoft SQL Server 2012 > Protocol Version : tds_version = 7.0 > > [SP] > --------- > USE [TEST01] > GO > /****** Object: StoredProcedure [dbo].[tst_test_result_msg] Script Date: 8/22/2016 5:31:16 AM ******/ > SET ANSI_NULLS OFF > GO > SET QUOTED_IDENTIFIER ON > GO > > ALTER PROCEDURE [dbo].[tst_test_result_msg] > @tst_flag varchar(1), > @tst_desc varchar(40) > AS > BEGIN > DECLARE > @tst_activ_type varchar(5) > > SELECT cust_no, cust_name > FROM dbo.customer > > IF @tst_flag = 'A' > SELECT @tst_desc = 'Print A' > ELSE > IF @tst_flag = 'B' > SELECT @tst_desc = 'Print B' > ELSE > IF @tst_flag = 'C' > SELECT @tst_desc = 'Print C' > ELSE > IF @tst_flag = 'D' > SELECT @tst_desc = 'Print D' > > PRINT @tst_desc > END > > > Regards, > Vasanth > > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Igor Korot > Sent: Sunday, August 21, 2016 7:03 AM > To: FreeTDS Development Group > Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) > > Hi. > Do you have an example of one such SP? > What is you DB (MS, Sybase) and what version? > Which protocol version do you use? > > All in all - we need more info. > > Thank you. > > On Aug 20, 2016 11:01 AM, wrote: > > > Hi, > > > > Thank you all in advance, please help me with below issue. > > > > I have been working with fisql command lot lately and recently I came across this issue, where the fisql command does not give (return status=0) for some SQL execution. > > > > The Issues is not generic but specific to any such SQL store procedure which gives output in (results + message) format. > > > > And the approach I like to present to out client includes such scenario where they have multiple store procedure like above. > > > > Looking forward to your earliest response, > > Regards, > Vasanth Sengunthar > > ________________________________ > > This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. > ____________________________________________________________ > __________________________ > > www.accenture.com > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQKJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsrfVFYXsM&e= > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=YeeQpC5oh2O1h9ftbdVpH6iIE20ltx2edLYOiJ7Piyg&e= > > ---------------------------------------------------------------------- > This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.bankofamerica.com_emaildisclaimer&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=IxXw3jX5aMlcnYvBOGeU3od1dXPXg8zb-yd9JzTJdow&e= . If you are not the intended recipient, please delete this message. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=YeeQpC5oh2O1h9ftbdVpH6iIE20ltx2edLYOiJ7Piyg&e= > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=GNTsBwEbcY2obS4bVAuzFww9dn49u_BxiAVXKl7KxPk&s=AVRSYbUmxsdQextK9H6Z-z57BFTjPCciULFz5CxdjLA&e= _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=GNTsBwEbcY2obS4bVAuzFww9dn49u_BxiAVXKl7KxPk&s=AVRSYbUmxsdQextK9H6Z-z57BFTjPCciULFz5CxdjLA&e= From vasanth.sengunthar at accenture.com Fri Sep 16 06:39:02 2016 From: vasanth.sengunthar at accenture.com (vasanth.sengunthar at accenture.com) Date: Fri, 16 Sep 2016 10:39:02 +0000 Subject: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) In-Reply-To: References: <90978bdf96d94a52bc7d2a658bea4501@SN4PR4205MB0413.048d.mgd.msft.net> <4A990489BF566041A7724DC577BB060417F56BD8@smtp_mail.bankofamerica.com> Message-ID: <1f1dda2f4c854ab9aed0b463d3105675@SN4PR4205MB0413.048d.mgd.msft.net> John, Thank you for given fix with tsql, It works as expected and giving desired results. Regards, Vasanth -----Original Message----- From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of John Kendall Sent: Friday, September 09, 2016 9:22 PM To: FreeTDS Group Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give (return status=0) for SQL Store proc with multiple output Tabs (Results+Messages) On Sep 9, 2016, at 7:05 AM, wrote: > Hi Bill, > > Thank you for prompt response and yes, please help us with required code to fix the fisql Issue. > > We tried to solve the issue via 'tsql' program but with given such scenario, tsql fails to capture both (results + messages) with output file. It fetch only results to output file not the messages rather prints the same in command prompt itself. You might try this to get both messages and output into the same outfile: unix/linux/Macos tsql >outfile 2>&1 Windows tsql 1>outfile 2>&1 John > > Thanks, > -Vasanth > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of > Thompson, William > Sent: Thursday, September 08, 2016 6:27 PM > To: FreeTDS Development Group > Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give > (return status=0) for SQL Store proc with multiple output Tabs > (Results+Messages) > > Hi, > > There's a bug, if you want to call it that, in the fisql program that means that the "return status = n" message is not printed in this case. > > One solution would be to use the "tsql" program rather than "fisql", if you like. I've checked, and it works as you would want. > > If for some reason, you're especially fond of fisql, then it could be fixed. > Are you prepared to fix it yourself and try it out? If so, I'll give you a suggested code change... > > Cheers, > > Bill > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of > vasanth.sengunthar at accenture.com > Sent: 08 September 2016 07:28 > To: freetds at lists.ibiblio.org > Subject: [freetds] FreeTDS: Fisql utility command fails to give > (return status=0) for SQL Store proc with multiple output Tabs > (Results+Messages) > > Hi, > > Please help with missing (return status=0) with fisql command for MS SQL Server 2012 -output from Linux OS. > Check trail mail for more reference. > > Regards, > Vasanth > > -----Original Message----- > From: Sengunthar, Vasanth > Sent: Tuesday, August 30, 2016 8:29 PM > To: 'FreeTDS Development Group' > Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give > (return status=0) for SQL Store proc with multiple output Tabs > (Results+Messages) > > Hi All, > > Please help with below Issue. > Looking forward to hearing a positive response from you. > > Regards, > Vasanth > > > -----Original Message----- > From: Sengunthar, Vasanth > Sent: Monday, August 22, 2016 3:09 PM > To: FreeTDS Development Group > Subject: RE: [freetds] FreeTDS: Fisql utility command fails to give > (return status=0) for SQL Store proc with multiple output Tabs > (Results+Messages) > > Hi, > > Please check below sample SP. > > Database : Microsoft SQL Server 2012 > Protocol Version : tds_version = 7.0 > > [SP] > --------- > USE [TEST01] > GO > /****** Object: StoredProcedure [dbo].[tst_test_result_msg] Script Date: 8/22/2016 5:31:16 AM ******/ > SET ANSI_NULLS OFF > GO > SET QUOTED_IDENTIFIER ON > GO > > ALTER PROCEDURE [dbo].[tst_test_result_msg] > @tst_flag varchar(1), > @tst_desc varchar(40) > AS > BEGIN > DECLARE > @tst_activ_type varchar(5) > > SELECT cust_no, cust_name > FROM dbo.customer > > IF @tst_flag = 'A' > SELECT @tst_desc = 'Print A' > ELSE > IF @tst_flag = 'B' > SELECT @tst_desc = 'Print B' > ELSE > IF @tst_flag = 'C' > SELECT @tst_desc = 'Print C' > ELSE > IF @tst_flag = 'D' > SELECT @tst_desc = 'Print D' > > PRINT @tst_desc > END > > > Regards, > Vasanth > > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of > Igor Korot > Sent: Sunday, August 21, 2016 7:03 AM > To: FreeTDS Development Group > Subject: Re: [freetds] FreeTDS: Fisql utility command fails to give > (return status=0) for SQL Store proc with multiple output Tabs > (Results+Messages) > > Hi. > Do you have an example of one such SP? > What is you DB (MS, Sybase) and what version? > Which protocol version do you use? > > All in all - we need more info. > > Thank you. > > On Aug 20, 2016 11:01 AM, wrote: > > > Hi, > > > > Thank you all in advance, please help me with below issue. > > > > I have been working with fisql command lot lately and recently I came across this issue, where the fisql command does not give (return status=0) for some SQL execution. > > > > The Issues is not generic but specific to any such SQL store procedure which gives output in (results + message) format. > > > > And the approach I like to present to out client includes such scenario where they have multiple store procedure like above. > > > > Looking forward to your earliest response, > > Regards, > Vasanth Sengunthar > > ________________________________ > > This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. > ____________________________________________________________ > __________________________ > > www.accenture.com > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_ > mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8I > rwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQ > KJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsr > fVFYXsM&e= _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_ > mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8I > rwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=IodVUj5zMfeQ > KJDmDX80aFnfyn9y4W4EpZ5OBAzYolQ&s=aGO9gO5yFlXxuEHx6iLcCyFGQDh_XC5h1qsr > fVFYXsM&e= _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_ > mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8I > rwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhc > DkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=YeeQpC5oh2O1h9ftbdVpH6iIE20ltx2edLYO > iJ7Piyg&e= > > ---------------------------------------------------------------------- > This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.bankofamerica.com_emaildisclaimer&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhcDkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=IxXw3jX5aMlcnYvBOGeU3od1dXPXg8zb-yd9JzTJdow&e= . If you are not the intended recipient, please delete this message. > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_ > mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8I > rwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=kiLkyqyKTjhc > DkCkKEW_pwbkNHFdvDtZj6mbcor2fMQ&s=YeeQpC5oh2O1h9ftbdVpH6iIE20ltx2edLYO > iJ7Piyg&e= _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_ > mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8I > rwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=Zu5HUBmAokfv > w8V4y27tjG8HszOkzkeD3e7063EYAbU&s=qqDDKr2PTG6-I_vJM2ei3si50CncNYl_nYQk > L1DxRHA&e= _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ibiblio.org_mailman_listinfo_freetds&d=DQICAg&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=vQqnb-FGv_1Cq8lIuKD95mRfUO0gBovRe0eqdms7a5s&m=Zu5HUBmAokfvw8V4y27tjG8HszOkzkeD3e7063EYAbU&s=qqDDKr2PTG6-I_vJM2ei3si50CncNYl_nYQkL1DxRHA&e= From david at qore.org Fri Sep 16 10:24:24 2016 From: david at qore.org (David Nichols) Date: Fri, 16 Sep 2016 16:24:24 +0200 Subject: [freetds] ctlib timeout functionality Message-ID: Hi, I made a pull request adding support for ctlib timeouts with ct_con_props() with CS_SET and CS_GET and CS_TIMEOUT & CS_LOGIN_TIMEOUT. The pull request is here: https://github.com/FreeTDS/freetds/pull/78 I?m not sure if it?s correct (although it works in my tests) - not sure what the process is, but if someone would review it and let me know if any changes are necessary, I?ll be glad to make them so that it can be merged to master. thx David From scott.morken at phoenixcollege.edu Fri Sep 16 10:54:15 2016 From: scott.morken at phoenixcollege.edu (Scott Morken) Date: Fri, 16 Sep 2016 07:54:15 -0700 Subject: [freetds] intermittent TLS packet with unexpected length error Message-ID: I've recently (around the first part of August) starting getting random " SQLSTATE[01002] Adaptive Server connection failed" errors from FreeTDS. It seems to be related to the TLS handshake. It doesn't happen every time... it took me about 45 minutes of clicking around to get the attached failure log but the next time only took a couple of minutes to get another. It happens from multiple Ubuntu 14.04.5 LTS servers connecting to the same MS SQL Server. These are mostly PHP web apps but Python also has the same issue - naturally since it's the same backend library :) MS SQL Server 2012 (11.0.6020) on Windows Server 2008 R2 SP1 The error on SQL Server isn't super helpful but it gave me a starting point to look into the TLS connection: 36888 0 2 0 0 0x8000000000000000 81739 System xxxx 20 960 I'm connecting from multiple Ubuntu 14.04.5 LTS servers. gnutls26 is installed (2.12.23-12ubuntu2.5) freetds 0.91-5 I'm at a loss as to what would cause these errors. I've spent a lot of time searching for an answer but haven't found anything that really fits. Our server admins tried uninstalling the Microsoft TLS 1.2 patch that apparently broke a few things but that didn't help: http://www.infoworld.com/article/2848574/operating-systems/microsoft-botches-kb-2992611-schannel-patch-tls-alert-code-40-slow-sql-server-block-iis-sites.html I've tried encryption = off but it seems it still tries to negotiate it and fails. I've attached a log of the debug output from freeTDS for a failure and a success. Any thoughts or obvious things I've missed would be greatly appreciated. I've run out of ideas. Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: freetds_failure.log Type: text/x-log Size: 29812 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: freetds_success.log Type: text/x-log Size: 31078 bytes Desc: not available URL: From cramm0 at gmail.com Fri Sep 16 11:02:49 2016 From: cramm0 at gmail.com (Ramiro Morales) Date: Fri, 16 Sep 2016 12:02:49 -0300 Subject: [freetds] intermittent TLS packet with unexpected length error In-Reply-To: References: Message-ID: On Fri, Sep 16, 2016 at 11:54 AM, Scott Morken < scott.morken at phoenixcollege.edu> wrote: > I've recently (around the first part of August) starting getting random " > SQLSTATE[01002] Adaptive Server connection failed" errors from FreeTDS. It > seems to be related to the TLS handshake. It doesn't happen every time... > it took me about 45 minutes of clicking around to get the attached failure > log but the next time only took a couple of minutes to get another. It > happens from multiple Ubuntu 14.04.5 LTS servers connecting to the same MS > SQL Server. These are mostly PHP web apps but Python also has the same > issue - naturally since it's the same backend library :) > > MS SQL Server 2012 (11.0.6020) on Windows Server 2008 R2 SP1 > > The error on SQL Server isn't super helpful but it gave me a starting point > to look into the TLS connection: > > > > 36888 > 0 > 2 > 0 > 0 > 0x8000000000000000 > > 81739 > > > System > xxxx > > > > 20 > 960 > > > > I'm connecting from multiple Ubuntu 14.04.5 LTS servers. > gnutls26 is installed (2.12.23-12ubuntu2.5) > freetds 0.91-5 > > I'm at a loss as to what would cause these errors. I've spent a lot of > time searching for an answer but haven't found anything that really fits. > Our server admins tried uninstalling the Microsoft TLS 1.2 patch that > apparently broke a few things but that didn't help: > http://www.infoworld.com/article/2848574/operating- > systems/microsoft-botches-kb-2992611-schannel-patch-tls- > alert-code-40-slow-sql-server-block-iis-sites.html > > I've tried encryption = off but it seems it still tries to negotiate it and > fails. > > I've attached a log of the debug output from freeTDS for a failure and a > success. Any thoughts or obvious things I've missed would be greatly > appreciated. I've run out of ideas. > > Scott, Take a look at the FreeTDS GitHub repo commit history for the master branch and for the 1.0.x maintenance branch for the last month or so and verify if it could be related. It might be your copy of FreeTDS is too old. Regards, -- Ramiro Morales @ramiromorales From freddy77 at gmail.com Fri Sep 16 11:23:46 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 16 Sep 2016 16:23:46 +0100 Subject: [freetds] intermittent TLS packet with unexpected length error In-Reply-To: References: Message-ID: 2016-09-16 16:02 GMT+01:00 Ramiro Morales : > On Fri, Sep 16, 2016 at 11:54 AM, Scott Morken < > scott.morken at phoenixcollege.edu> wrote: > >> I've recently (around the first part of August) starting getting random " >> SQLSTATE[01002] Adaptive Server connection failed" errors from FreeTDS. It >> seems to be related to the TLS handshake. It doesn't happen every time... >> it took me about 45 minutes of clicking around to get the attached failure >> log but the next time only took a couple of minutes to get another. It >> happens from multiple Ubuntu 14.04.5 LTS servers connecting to the same MS >> SQL Server. These are mostly PHP web apps but Python also has the same >> issue - naturally since it's the same backend library :) >> >> MS SQL Server 2012 (11.0.6020) on Windows Server 2008 R2 SP1 >> >> The error on SQL Server isn't super helpful but it gave me a starting point >> to look into the TLS connection: >> >> >> >> 36888 >> 0 >> 2 >> 0 >> 0 >> 0x8000000000000000 >> >> 81739 >> >> >> System >> xxxx >> >> >> >> 20 >> 960 >> >> >> >> I'm connecting from multiple Ubuntu 14.04.5 LTS servers. >> gnutls26 is installed (2.12.23-12ubuntu2.5) >> freetds 0.91-5 >> >> I'm at a loss as to what would cause these errors. I've spent a lot of >> time searching for an answer but haven't found anything that really fits. >> Our server admins tried uninstalling the Microsoft TLS 1.2 patch that >> apparently broke a few things but that didn't help: >> http://www.infoworld.com/article/2848574/operating- >> systems/microsoft-botches-kb-2992611-schannel-patch-tls- >> alert-code-40-slow-sql-server-block-iis-sites.html >> >> I've tried encryption = off but it seems it still tries to negotiate it and >> fails. >> >> I've attached a log of the debug output from freeTDS for a failure and a >> success. Any thoughts or obvious things I've missed would be greatly >> appreciated. I've run out of ideas. >> >> Scott, > > Take a look at the FreeTDS GitHub repo commit history for the master branch > and for the 1.0.x maintenance branch for the last month or so and verify > if it could be related. > > It might be your copy of FreeTDS is too old. > > Regards, > > -- > Ramiro Morales > @ramiromorales I confirmed what Ramiro said. Unfortunately we seem we should try to push some new version to Debian. We don't release very often but 0.91 is 2 main release ago that is years ago, many changes were introduced since. We try very hard to maintain ABI so you should have not much issues updating from sources. We are a really small group nowadays and we cannot effort to maintain much old releases (actually we maintain the last). A very recent patch was introduced to fix a problem with OpenSSL but probably 0.91 contains some old setting even using GnuTLS (from https://packages.debian.org/jessie/freetds-bin or Ubuntu package you can see GnuTLS is used). Frediano From scott.morken at phoenixcollege.edu Fri Sep 16 11:28:47 2016 From: scott.morken at phoenixcollege.edu (Scott Morken) Date: Fri, 16 Sep 2016 08:28:47 -0700 Subject: [freetds] intermittent TLS packet with unexpected length error In-Reply-To: References: Message-ID: I think you guys are correct. I looked at the updated cipher list and it looks like the one that is getting picked is in the removed list. Since I'm sure our server admins won't want to install freetds from source on multiple servers, is there a way to pass an allowed cipher list/suite to freetds? Either through the config or environment? If I could find a workable one, I could probably limp along until we get to a new version... Although 16.04LTS is still 0.91-6.1build1. Not very up to date :( On Fri, Sep 16, 2016 at 8:23 AM, Frediano Ziglio wrote: > 2016-09-16 16:02 GMT+01:00 Ramiro Morales : > > On Fri, Sep 16, 2016 at 11:54 AM, Scott Morken < > > scott.morken at phoenixcollege.edu> wrote: > > > >> I've recently (around the first part of August) starting getting random > " > >> SQLSTATE[01002] Adaptive Server connection failed" errors from > FreeTDS. It > >> seems to be related to the TLS handshake. It doesn't happen every > time... > >> it took me about 45 minutes of clicking around to get the attached > failure > >> log but the next time only took a couple of minutes to get another. It > >> happens from multiple Ubuntu 14.04.5 LTS servers connecting to the same > MS > >> SQL Server. These are mostly PHP web apps but Python also has the same > >> issue - naturally since it's the same backend library :) > >> > >> MS SQL Server 2012 (11.0.6020) on Windows Server 2008 R2 SP1 > >> > >> The error on SQL Server isn't super helpful but it gave me a starting > point > >> to look into the TLS connection: > >> > >> > >> /> > >> 36888 > >> 0 > >> 2 > >> 0 > >> 0 > >> 0x8000000000000000 > >> > >> 81739 > >> > >> > >> System > >> xxxx > >> > >> > >> > >> 20 > >> 960 > >> > >> > >> > >> I'm connecting from multiple Ubuntu 14.04.5 LTS servers. > >> gnutls26 is installed (2.12.23-12ubuntu2.5) > >> freetds 0.91-5 > >> > >> I'm at a loss as to what would cause these errors. I've spent a lot of > >> time searching for an answer but haven't found anything that really > fits. > >> Our server admins tried uninstalling the Microsoft TLS 1.2 patch that > >> apparently broke a few things but that didn't help: > >> http://www.infoworld.com/article/2848574/operating- > >> systems/microsoft-botches-kb-2992611-schannel-patch-tls- > >> alert-code-40-slow-sql-server-block-iis-sites.html > >> > >> I've tried encryption = off but it seems it still tries to negotiate it > and > >> fails. > >> > >> I've attached a log of the debug output from freeTDS for a failure and a > >> success. Any thoughts or obvious things I've missed would be greatly > >> appreciated. I've run out of ideas. > >> > >> Scott, > > > > Take a look at the FreeTDS GitHub repo commit history for the master > branch > > and for the 1.0.x maintenance branch for the last month or so and verify > > if it could be related. > > > > It might be your copy of FreeTDS is too old. > > > > Regards, > > > > -- > > Ramiro Morales > > @ramiromorales > > I confirmed what Ramiro said. > Unfortunately we seem we should try to push some new version to Debian. > We don't release very often but 0.91 is 2 main release ago that is years > ago, > many changes were introduced since. > We try very hard to maintain ABI so you should have not much issues > updating from sources. > We are a really small group nowadays and we cannot effort to maintain much > old releases (actually we maintain the last). A very recent patch was > introduced > to fix a problem with OpenSSL but probably 0.91 contains some old setting > even > using GnuTLS (from https://packages.debian.org/jessie/freetds-bin or > Ubuntu > package you can see GnuTLS is used). > > Frediano > -- *Scott Morken* Programmer Phoenix College - Information Technology 602.285.7554 scott.morken at phoenixcollege.edu From freddy77 at gmail.com Fri Sep 16 11:44:31 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 16 Sep 2016 16:44:31 +0100 Subject: [freetds] intermittent TLS packet with unexpected length error In-Reply-To: References: Message-ID: 2016-09-16 16:28 GMT+01:00 Scott Morken : > I think you guys are correct. I looked at the updated cipher list and it > looks like the one that is getting picked is in the removed list. Since I'm > sure our server admins won't want to install freetds from source on multiple > servers, is there a way to pass an allowed cipher list/suite to freetds? > Either through the config or environment? If I could find a workable one, I > could probably limp along until we get to a new version... Although 16.04LTS > is still 0.91-6.1build1. Not very up to date :( > Looks like they (Debian and Ubuntu) has a patch for the ciphers, that is @@ -1280,25 +1282,6 @@ { gnutls_session session; gnutls_certificate_credentials xcred; - - static const int kx_priority[] = { - GNUTLS_KX_RSA_EXPORT, - GNUTLS_KX_RSA, GNUTLS_KX_DHE_DSS, GNUTLS_KX_DHE_RSA, - 0 - }; - static const int cipher_priority[] = { - GNUTLS_CIPHER_AES_256_CBC, GNUTLS_CIPHER_AES_128_CBC, - GNUTLS_CIPHER_3DES_CBC, GNUTLS_CIPHER_ARCFOUR_128, -#if 0 - GNUTLS_CIPHER_ARCFOUR_40, - GNUTLS_CIPHER_DES_CBC, -#endif - 0 - }; - static const int comp_priority[] = { GNUTLS_COMP_NULL, 0 }; - static const int mac_priority[] = { - GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0 - }; int ret; const char *tls_msg; @@ -1338,10 +1321,9 @@ gnutls_set_default_priority(session); /* ... but overwrite some */ - gnutls_cipher_set_priority(session, cipher_priority); - gnutls_compression_set_priority(session, comp_priority); - gnutls_kx_set_priority(session, kx_priority); - gnutls_mac_set_priority(session, mac_priority); + ret = gnutls_priority_set_direct (session, + "NORMAL:%COMPAT", NULL); + /* mssql does not like padding too much */ #ifdef HAVE_GNUTLS_RECORD_DISABLE_PADDING gnutls_record_disable_padding(session); Our current string is "NORMAL:%COMPAT:-VERS-SSL3.0". But these strings are by the way encoded inside the binaries so they require recompiling from sources. You could try downloading the Ubuntu sources and replace that string. If you looks on internet "rebuild debian packages" you can found lot of easy documents. If you are able to verify that changing that string is enough you should then open a bug to Ubuntu to get official packages. Another way would be to build your own personal repository which could be used in the future for events like this. Frediano > On Fri, Sep 16, 2016 at 8:23 AM, Frediano Ziglio wrote: >> >> 2016-09-16 16:02 GMT+01:00 Ramiro Morales : >> > On Fri, Sep 16, 2016 at 11:54 AM, Scott Morken < >> > scott.morken at phoenixcollege.edu> wrote: >> > >> >> I've recently (around the first part of August) starting getting random >> >> " >> >> SQLSTATE[01002] Adaptive Server connection failed" errors from FreeTDS. >> >> It >> >> seems to be related to the TLS handshake. It doesn't happen every >> >> time... >> >> it took me about 45 minutes of clicking around to get the attached >> >> failure >> >> log but the next time only took a couple of minutes to get another. It >> >> happens from multiple Ubuntu 14.04.5 LTS servers connecting to the same >> >> MS >> >> SQL Server. These are mostly PHP web apps but Python also has the same >> >> issue - naturally since it's the same backend library :) >> >> >> >> MS SQL Server 2012 (11.0.6020) on Windows Server 2008 R2 SP1 >> >> >> >> The error on SQL Server isn't super helpful but it gave me a starting >> >> point >> >> to look into the TLS connection: >> >> >> >> >> >> > >> /> >> >> 36888 >> >> 0 >> >> 2 >> >> 0 >> >> 0 >> >> 0x8000000000000000 >> >> >> >> 81739 >> >> >> >> >> >> System >> >> xxxx >> >> >> >> >> >> >> >> 20 >> >> 960 >> >> >> >> >> >> >> >> I'm connecting from multiple Ubuntu 14.04.5 LTS servers. >> >> gnutls26 is installed (2.12.23-12ubuntu2.5) >> >> freetds 0.91-5 >> >> >> >> I'm at a loss as to what would cause these errors. I've spent a lot of >> >> time searching for an answer but haven't found anything that really >> >> fits. >> >> Our server admins tried uninstalling the Microsoft TLS 1.2 patch that >> >> apparently broke a few things but that didn't help: >> >> http://www.infoworld.com/article/2848574/operating- >> >> systems/microsoft-botches-kb-2992611-schannel-patch-tls- >> >> alert-code-40-slow-sql-server-block-iis-sites.html >> >> >> >> I've tried encryption = off but it seems it still tries to negotiate it >> >> and >> >> fails. >> >> >> >> I've attached a log of the debug output from freeTDS for a failure and >> >> a >> >> success. Any thoughts or obvious things I've missed would be greatly >> >> appreciated. I've run out of ideas. >> >> >> >> Scott, >> > >> > Take a look at the FreeTDS GitHub repo commit history for the master >> > branch >> > and for the 1.0.x maintenance branch for the last month or so and >> > verify >> > if it could be related. >> > >> > It might be your copy of FreeTDS is too old. >> > >> > Regards, >> > >> > -- >> > Ramiro Morales >> > @ramiromorales >> >> I confirmed what Ramiro said. >> Unfortunately we seem we should try to push some new version to Debian. >> We don't release very often but 0.91 is 2 main release ago that is years >> ago, >> many changes were introduced since. >> We try very hard to maintain ABI so you should have not much issues >> updating from sources. >> We are a really small group nowadays and we cannot effort to maintain much >> old releases (actually we maintain the last). A very recent patch was >> introduced >> to fix a problem with OpenSSL but probably 0.91 contains some old setting >> even >> using GnuTLS (from https://packages.debian.org/jessie/freetds-bin or >> Ubuntu >> package you can see GnuTLS is used). >> >> Frediano > > > > > -- > Scott Morken > Programmer > Phoenix College - Information Technology > 602.285.7554 > scott.morken at phoenixcollege.edu From adam.baratz at gmail.com Fri Sep 16 17:39:47 2016 From: adam.baratz at gmail.com (Adam Baratz) Date: Fri, 16 Sep 2016 17:39:47 -0400 Subject: [freetds] missing divide by zero error In-Reply-To: <4A990489BF566041A7724DC577BB060417F58903@smtp_mail.bankofamerica.com> References: <4A990489BF566041A7724DC577BB060417F58903@smtp_mail.bankofamerica.com> Message-ID: > > If you want to handle error messages from the server using db-library you > will have to define a message handler, using the db-library function > dbmsghandle() > I'm using a handler. It works correctly when I query on an invalid column name ("SELECT asdf"). That query comes back with an error token, which causes tds_process_default_tokens() to call tds_process_info(), which in turn calls the handler. The divide by zero query comes back with a result token, which causes tds_process_default_tokens() to call tds7_process_result(), which doesn't lead to the handler being called. The "divide by zero occurred" message is in the packet with the result token (see previous attachment). I tried looking at the response spec to see what was done with that section, but it didn't appear to be there. I also stepped through the application with gdb and that message appears to be skipped over. The log for the divide by zero query continued like this: token.c:540:processing result tokens. marker is 81(TDS7_RESULT) token.c:1538:processing TDS7 result metadata. mem.c:644:tds_free_all_results() token.c:1563:set current_results (1 column) to tds->res_info token.c:1570:setting up 1 columns token.c:1507:tds7_get_data_info: colname = type = 38 (integer-null) server's type = 38 (integer-null) column_varint_size = 1 column_size = 4 (4 on server) token.c:1579: name size/wsize type/wtype utype token.c:1580: -------------------- --------------- --------------- ------- token.c:1585: 4/4 38/38 0 util.c:165:Changed query state from READING to PENDING dblib.c:4692:dbsqlok() found result token dblib.c:1700:dbresults(0x1e81e10) dblib.c:1705:dbresults: dbresults_state is 1 (_DB_RES_RESULTSET_EMPTY) token.c:525:tds_process_tokens(0x1e82690, 0x7fffffffa538, 0x7fffffffa53c, 0x6914) util.c:165:Changed query state from PENDING to READING token.c:540:processing result tokens. marker is d1(ROW) token.c:644:tds_process_tokens::SET_RETURN stopping on current token util.c:165:Changed query state from READING to PENDING dblib.c:1726:dbresults() tds_process_tokens returned 0 (TDS_SUCCESS), result_type TDS_ROW_RESULT dblib.c:1689:dbresults returning 1 (SUCCEED) dblib.c:2776:dbcount(0x1e81e10) dblib.c:1838:dbnumcols(0x1e81e10) dblib.c:2776:dbcount(0x1e81e10) dblib.c:1838:dbnumcols(0x1e81e10) dblib.c:1864:dbcolname(0x1e81e10, 1) dblib.c:3048:dbcollen(0x1e81e10, 1) dblib.c:1476:dbclose(0x1e81e10) dblib.c:241:dblib_del_connection(0x7fffebf5cb40, 0x1e82690) query.c:3796:tds_disconnect() util.c:165:Changed query state from PENDING to DEAD mem.c:644:tds_free_all_results() dblib.c:288:dblib_release_tds_ctx(1) dblib.c:5881:dbfreebuf(0x1e81e10) dblib.c:749:dbloginfree(0x1e21890) dblib.c:1543:dbexit(void) dblib.c:288:dblib_release_tds_ctx(1) Thanks, Adam From freddy77 at gmail.com Sat Sep 17 09:03:35 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Sat, 17 Sep 2016 14:03:35 +0100 Subject: [freetds] missing divide by zero error In-Reply-To: References: <4A990489BF566041A7724DC577BB060417F58903@smtp_mail.bankofamerica.com> Message-ID: 2016-09-16 22:39 GMT+01:00 Adam Baratz : >> >> If you want to handle error messages from the server using db-library you >> will have to define a message handler, using the db-library function >> dbmsghandle() >> > > I'm using a handler. It works correctly when I query on an invalid column > name ("SELECT asdf"). That query comes back with an error token, which > causes tds_process_default_tokens() to call tds_process_info(), which in > turn calls the handler. The divide by zero query comes back with a result > token, which causes tds_process_default_tokens() to call > tds7_process_result(), which doesn't lead to the handler being called. > The two queries are completely different. The SELECT missing_field is a syntax/compiler error, the server cannot generate/start a result and give the error. For SELECT 0/1 or like SELECT 0/field_name FROM table_name the server know that if has to generate a result and start a new table result > The "divide by zero occurred" message is in the packet with the result > token (see previous attachment). I tried looking at the response spec to > see what was done with that section, but it didn't appear to be there. I > also stepped through the application with gdb and that message appears to > be skipped over. > > The log for the divide by zero query continued like this: > > token.c:540:processing result tokens. marker is 81(TDS7_RESULT) > token.c:1538:processing TDS7 result metadata. > mem.c:644:tds_free_all_results() > token.c:1563:set current_results (1 column) to tds->res_info > token.c:1570:setting up 1 columns > token.c:1507:tds7_get_data_info: > colname = > type = 38 (integer-null) > server's type = 38 (integer-null) > column_varint_size = 1 > column_size = 4 (4 on server) > token.c:1579: name size/wsize type/wtype utype > token.c:1580: -------------------- --------------- --------------- ------- > token.c:1585: 4/4 38/38 0 > util.c:165:Changed query state from READING to PENDING > dblib.c:4692:dbsqlok() found result token > dblib.c:1700:dbresults(0x1e81e10) > dblib.c:1705:dbresults: dbresults_state is 1 (_DB_RES_RESULTSET_EMPTY) > token.c:525:tds_process_tokens(0x1e82690, 0x7fffffffa538, 0x7fffffffa53c, > 0x6914) > util.c:165:Changed query state from PENDING to READING > token.c:540:processing result tokens. marker is d1(ROW) > token.c:644:tds_process_tokens::SET_RETURN stopping on current token > util.c:165:Changed query state from READING to PENDING > dblib.c:1726:dbresults() tds_process_tokens returned 0 (TDS_SUCCESS), > result_type TDS_ROW_RESULT > dblib.c:1689:dbresults returning 1 (SUCCEED) > dblib.c:2776:dbcount(0x1e81e10) > dblib.c:1838:dbnumcols(0x1e81e10) > dblib.c:2776:dbcount(0x1e81e10) > dblib.c:1838:dbnumcols(0x1e81e10) > dblib.c:1864:dbcolname(0x1e81e10, 1) > dblib.c:3048:dbcollen(0x1e81e10, 1) > dblib.c:1476:dbclose(0x1e81e10) > dblib.c:241:dblib_del_connection(0x7fffebf5cb40, 0x1e82690) > query.c:3796:tds_disconnect() > util.c:165:Changed query state from PENDING to DEAD > mem.c:644:tds_free_all_results() > dblib.c:288:dblib_release_tds_ctx(1) > dblib.c:5881:dbfreebuf(0x1e81e10) > dblib.c:749:dbloginfree(0x1e21890) > dblib.c:1543:dbexit(void) > dblib.c:288:dblib_release_tds_ctx(1) > I don't see the issue. Would be worth seeing the server reply entirely (some rows above if enabled) but if I remember there should be the error inside the result. It surprise a bit to see the ROW instead of ERROR/MSG but probably there's a reason and surely the ROW came from the server. However as the error came with the row(s) in this case I don't see any dbnextrow call from the log. > Thanks, > Adam Regards, Frediano From lacak at zoznam.sk Mon Sep 19 08:44:32 2016 From: lacak at zoznam.sk (LacaK) Date: Mon, 19 Sep 2016 14:44:32 +0200 Subject: [freetds] 20047: DBPROCESS is dead or not enabled Message-ID: <28135bd8-feae-b995-3424-3d589d1eb7c3@zoznam.sk> Hi, I am using FreeTDS dblib as client library which connect to SQL Server 2012. I am using application which runs in background and sometimes queries SQL Server. But when computer where application runs comes into sleep mode, after wakeup next query fails with above mentioned error. It is expected, because SQL Server sends keep alive packet and client does not respond, so SQL Server resets connection. My question is if there is an elegant way how to handle this situation ? How to detect dead dbprocess (there is dbdead(), but I can use this function only after failed query; I can not check status of connection before I send query?) ? Or only way is catch exception, check if it is error 20047 and if yes, then connect again and send query again ? Thanks -Laco. From john at capps.com Mon Sep 19 12:00:44 2016 From: john at capps.com (John Kendall) Date: Mon, 19 Sep 2016 16:00:44 +0000 Subject: [freetds] 20047: DBPROCESS is dead or not enabled In-Reply-To: <28135bd8-feae-b995-3424-3d589d1eb7c3@zoznam.sk> References: <28135bd8-feae-b995-3424-3d589d1eb7c3@zoznam.sk> Message-ID: <82274413-A714-4A3A-9C43-E066ACAE9EFE@capps.com> > On Sep 19, 2016, at 5:44 AM, LacaK wrote: > > Hi, > > I am using FreeTDS dblib as client library which connect to SQL Server 2012. > I am using application which runs in background and sometimes queries SQL Server. > > But when computer where application runs comes into sleep mode, after wakeup next query fails with above mentioned error. > > It is expected, because SQL Server sends keep alive packet and client does not respond, so SQL Server resets connection. > > My question is if there is an elegant way how to handle this situation ? > How to detect dead dbprocess (there is dbdead(), but I can use this function only after failed query; I can not check status of connection before I send query?) ? > > Or only way is catch exception, check if it is error 20047 and if yes, then connect again and send query again ? This is what I did. Although it seemed like a distasteful solution initially, once implemented it worked so well, I got over it. :) > Thanks > > -Laco. > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From james.k.lowden at icloud.com Mon Sep 19 18:40:14 2016 From: james.k.lowden at icloud.com (James K. Lowden) Date: Mon, 19 Sep 2016 18:40:14 -0400 Subject: [freetds] 20047: DBPROCESS is dead or not enabled In-Reply-To: <82274413-A714-4A3A-9C43-E066ACAE9EFE@capps.com> References: <28135bd8-feae-b995-3424-3d589d1eb7c3@zoznam.sk> <82274413-A714-4A3A-9C43-E066ACAE9EFE@capps.com> Message-ID: <20160919184014.7f2ba1dafc4efa920c29b851@icloud.com> On Mon, 19 Sep 2016 14:44:32 +0200 LacaK wrote: > I can not check status of connection before I send query? You cannot check the status of the connect before you send the query because the status changes only when the connection is used. Consider what it looks like at the TCP/IP level. The client went to sleep, and then woke up. Meanwhile, the server disconnected. From the client's perspective, nothing has changed: errno is still the same, the TCP/IP socket still appears valid. There's no syscall to test whether a socket is (still) connected to its peer. The only way to find out is to try to *do* something, which means reading or writing. Actually, the "went to sleep" part is unnecessary. How does one terminate a connection? By closing the socket, right? Does that cause a message to be sent to the peer, interrupting it, saying "the other party just closed the connection"? No. The peer learns of the disconnection when it next tries to read or write to its end. There's no inconsequential "are you there?" message in TDS, either. DB-Library can't send a message on your behalf to determine the connection status, because the state of the TDS session is under the application's control. So the only possible solution is to learn by doing: call the next db-lib function, get the error, and test it with dbdead(). It seems clunky, but it has the distinct advantage of not relying on Action at a Distance. Hope that clarifies things a bit. --jkl From lacak at zoznam.sk Tue Sep 20 01:10:47 2016 From: lacak at zoznam.sk (LacaK) Date: Tue, 20 Sep 2016 07:10:47 +0200 Subject: [freetds] 20047: DBPROCESS is dead or not enabled In-Reply-To: <20160919184014.7f2ba1dafc4efa920c29b851@icloud.com> References: <28135bd8-feae-b995-3424-3d589d1eb7c3@zoznam.sk> <82274413-A714-4A3A-9C43-E066ACAE9EFE@capps.com> <20160919184014.7f2ba1dafc4efa920c29b851@icloud.com> Message-ID: >> I can not check status of connection before I send query? > You cannot check the status of the connect before you send the query > because the status changes only when the connection is used. > > Consider what it looks like at the TCP/IP level. The client went to > sleep, and then woke up. Meanwhile, the server disconnected. From the > client's perspective, nothing has changed: errno is still the same, the > TCP/IP socket still appears valid. There's no syscall to test whether > a socket is (still) connected to its peer. The only way to find out is > to try to *do* something, which means reading or writing. > > Actually, the "went to sleep" part is unnecessary. How does one > terminate a connection? By closing the socket, right? Does that cause > a message to be sent to the peer, interrupting it, saying "the > other party just closed the connection"? No. The peer learns of the > disconnection when it next tries to read or write to its end. > > There's no inconsequential "are you there?" message in TDS, either. > DB-Library can't send a message on your behalf to determine the > connection status, because the state of the TDS session is under the > application's control. > > So the only possible solution is to learn by doing: call the next > db-lib function, get the error, and test it with dbdead(). It seems > clunky, but it has the distinct advantage of not relying on Action at a > Distance. > > Hope that clarifies things a bit. Thank you guys very much for replies. I will try do it as you suggest ... -Laco. From adam.baratz at gmail.com Tue Sep 20 17:23:02 2016 From: adam.baratz at gmail.com (Adam Baratz) Date: Tue, 20 Sep 2016 17:23:02 -0400 Subject: [freetds] missing divide by zero error In-Reply-To: References: <4A990489BF566041A7724DC577BB060417F58903@smtp_mail.bankofamerica.com> Message-ID: > > I don't see the issue. Would be worth seeing the server reply > entirely (some rows above if enabled) but if I remember there > should be the error inside the result. > I attached the full log. I understand the two queries are different, but the div/0 query produces an error (and no results) in SSMS. I'd like to figure out how to get to the div/0 error message that's part of the NULL result to replicate that behavior with db-library. Thanks, Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: div0.log Type: application/octet-stream Size: 12798 bytes Desc: not available URL: From mlhjr61 at gmail.com Wed Sep 21 09:44:51 2016 From: mlhjr61 at gmail.com (mlhjr61 .) Date: Wed, 21 Sep 2016 09:44:51 -0400 Subject: [freetds] Version 1.00.15 select @@spid In-Reply-To: References: Message-ID: Hello Users group, I use freetds with perl DBI in scripts to connect to an application called IBM Tivoli Netcool/Omnibus (versions 7.3.1, 7.4, and 8.1) . Freetds version 0.91 works fine with all of them. I am installing new servers and downloaded the latest freetds version 1.00.15 and now am unable to run queries. Error is the following when I connect: "ERROR=Parse failure on line 1 of statement 'select @@spid ', at or near '@'" Connection (in freetds log) is successful, but the select statement above causes failure). Is this something that can be disabled? ./tsql -C Compile-time settings (established with the "configure" script) Version: freetds v1.00.15 freetds.conf directory: /usr/local/etc MS db-lib source compatibility: no Sybase binary compatibility: no Thread safety: yes iconv library: yes TDS version: auto iODBC: no unixodbc: yes SSPI "trusted" logins: no Kerberos: no OpenSSL: yes GnuTLS: no MARS: no Thanks, Mel From scott.morken at phoenixcollege.edu Wed Sep 21 17:18:33 2016 From: scott.morken at phoenixcollege.edu (Scott Morken) Date: Wed, 21 Sep 2016 14:18:33 -0700 Subject: [freetds] intermittent TLS packet with unexpected length error In-Reply-To: References: Message-ID: It looks like this *mostly* worked. I've had one schannel error in the last two days. Considerably better than the dozens I was getting before. Not perfect, but much much better. For the record, and for anyone else who might need to build this bailing wire and duct tape fix, here are the steps I took to make this work: Install build packages: $ sudo apt-get install build-essential dpatch fakeroot devscripts equivs lintian quilt Add/replace the deb src for main restricted to use Xenial?s repo in /etc/apt/sources.list - this gets you the latest 0.91-6.1build1 which has the *almost* necessary patches in place to work. Mine went from: deb-src http://us.archive.ubuntu.com/ubuntu/ trust main restricted To deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted Update package list $ apt-get update Make a work dir $ mkdir ~/src Install the source $ apt-get source freetds $ cd /freetds-0.91 Get build deps $ sudo mk-build-deps -i -r freetds Modify the src/tds/net.c for the allowed cipher suite (remove SSLV3) -------------------------------------------------------------------------------------------------- @@ -1322,7 +1322,7 @@ /* ... but overwrite some */ ret = gnutls_priority_set_direct (session, - "NORMAL:%COMPAT", NULL); + "NORMAL:%COMPAT:-VERS-SSL3.0", NULL); /* mssql does not like padding too much */ #ifdef HAVE_GNUTLS_RECORD_DISABLE_PADDING -------------------------------------------------------------------------------------------------- Build it $ fakeroot debian/rules binary Install dependencies libgnutls28 odbcinst1debian2 libodbc1 unixodbc Install all the pieces $ sudo dpkg -i ../libct4_0.91-6.1build1_amd64.deb $ sudo dpkg -i ../libsybdb5_0.91-6.1build1_amd64.deb $ sudo dpkg -i ../tdsodbc_0.91-6.1build1_amd64.deb $ sudo dpkg -i ../freetds-common_0.91-6.1build1_all.deb $ sudo dpkg -i ../freetds-bin_0.91-6.1build1_amd64.deb On Fri, Sep 16, 2016 at 8:44 AM, Frediano Ziglio wrote: > 2016-09-16 16:28 GMT+01:00 Scott Morken : > > I think you guys are correct. I looked at the updated cipher list and it > > looks like the one that is getting picked is in the removed list. Since > I'm > > sure our server admins won't want to install freetds from source on > multiple > > servers, is there a way to pass an allowed cipher list/suite to freetds? > > Either through the config or environment? If I could find a workable > one, I > > could probably limp along until we get to a new version... Although > 16.04LTS > > is still 0.91-6.1build1. Not very up to date :( > > > > Looks like they (Debian and Ubuntu) has a patch for the ciphers, that is > > @@ -1280,25 +1282,6 @@ > { > gnutls_session session; > gnutls_certificate_credentials xcred; > - > - static const int kx_priority[] = { > - GNUTLS_KX_RSA_EXPORT, > - GNUTLS_KX_RSA, GNUTLS_KX_DHE_DSS, GNUTLS_KX_DHE_RSA, > - 0 > - }; > - static const int cipher_priority[] = { > - GNUTLS_CIPHER_AES_256_CBC, GNUTLS_CIPHER_AES_128_CBC, > - GNUTLS_CIPHER_3DES_CBC, GNUTLS_CIPHER_ARCFOUR_128, > -#if 0 > - GNUTLS_CIPHER_ARCFOUR_40, > - GNUTLS_CIPHER_DES_CBC, > -#endif > - 0 > - }; > - static const int comp_priority[] = { GNUTLS_COMP_NULL, 0 }; > - static const int mac_priority[] = { > - GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0 > - }; > int ret; > const char *tls_msg; > > @@ -1338,10 +1321,9 @@ > gnutls_set_default_priority(session); > > /* ... but overwrite some */ > - gnutls_cipher_set_priority(session, cipher_priority); > - gnutls_compression_set_priority(session, comp_priority); > - gnutls_kx_set_priority(session, kx_priority); > - gnutls_mac_set_priority(session, mac_priority); > + ret = gnutls_priority_set_direct (session, > + "NORMAL:%COMPAT", NULL); > + > /* mssql does not like padding too much */ > #ifdef HAVE_GNUTLS_RECORD_DISABLE_PADDING > gnutls_record_disable_padding(session); > > Our current string is "NORMAL:%COMPAT:-VERS-SSL3.0". > But these strings are by the way encoded inside the binaries so they > require recompiling > from sources. You could try downloading the Ubuntu sources and replace > that string. > If you looks on internet "rebuild debian packages" you can found lot > of easy documents. > If you are able to verify that changing that string is enough you > should then open a bug to > Ubuntu to get official packages. > Another way would be to build your own personal repository which could > be used in > the future for events like this. > > Frediano > > > > > On Fri, Sep 16, 2016 at 8:23 AM, Frediano Ziglio > wrote: > >> > >> 2016-09-16 16:02 GMT+01:00 Ramiro Morales : > >> > On Fri, Sep 16, 2016 at 11:54 AM, Scott Morken < > >> > scott.morken at phoenixcollege.edu> wrote: > >> > > >> >> I've recently (around the first part of August) starting getting > random > >> >> " > >> >> SQLSTATE[01002] Adaptive Server connection failed" errors from > FreeTDS. > >> >> It > >> >> seems to be related to the TLS handshake. It doesn't happen every > >> >> time... > >> >> it took me about 45 minutes of clicking around to get the attached > >> >> failure > >> >> log but the next time only took a couple of minutes to get another. > It > >> >> happens from multiple Ubuntu 14.04.5 LTS servers connecting to the > same > >> >> MS > >> >> SQL Server. These are mostly PHP web apps but Python also has the > same > >> >> issue - naturally since it's the same backend library :) > >> >> > >> >> MS SQL Server 2012 (11.0.6020) on Windows Server 2008 R2 SP1 > >> >> > >> >> The error on SQL Server isn't super helpful but it gave me a starting > >> >> point > >> >> to look into the TLS connection: > >> >> > >> >> > >> >> >> >> /> > >> >> 36888 > >> >> 0 > >> >> 2 > >> >> 0 > >> >> 0 > >> >> 0x8000000000000000 > >> >> > >> >> 81739 > >> >> > >> >> > >> >> System > >> >> xxxx > >> >> > >> >> > >> >> > >> >> 20 > >> >> 960 > >> >> > >> >> > >> >> > >> >> I'm connecting from multiple Ubuntu 14.04.5 LTS servers. > >> >> gnutls26 is installed (2.12.23-12ubuntu2.5) > >> >> freetds 0.91-5 > >> >> > >> >> I'm at a loss as to what would cause these errors. I've spent a lot > of > >> >> time searching for an answer but haven't found anything that really > >> >> fits. > >> >> Our server admins tried uninstalling the Microsoft TLS 1.2 patch that > >> >> apparently broke a few things but that didn't help: > >> >> http://www.infoworld.com/article/2848574/operating- > >> >> systems/microsoft-botches-kb-2992611-schannel-patch-tls- > >> >> alert-code-40-slow-sql-server-block-iis-sites.html > >> >> > >> >> I've tried encryption = off but it seems it still tries to negotiate > it > >> >> and > >> >> fails. > >> >> > >> >> I've attached a log of the debug output from freeTDS for a failure > and > >> >> a > >> >> success. Any thoughts or obvious things I've missed would be greatly > >> >> appreciated. I've run out of ideas. > >> >> > >> >> Scott, > >> > > >> > Take a look at the FreeTDS GitHub repo commit history for the master > >> > branch > >> > and for the 1.0.x maintenance branch for the last month or so and > >> > verify > >> > if it could be related. > >> > > >> > It might be your copy of FreeTDS is too old. > >> > > >> > Regards, > >> > > >> > -- > >> > Ramiro Morales > >> > @ramiromorales > >> > >> I confirmed what Ramiro said. > >> Unfortunately we seem we should try to push some new version to Debian. > >> We don't release very often but 0.91 is 2 main release ago that is years > >> ago, > >> many changes were introduced since. > >> We try very hard to maintain ABI so you should have not much issues > >> updating from sources. > >> We are a really small group nowadays and we cannot effort to maintain > much > >> old releases (actually we maintain the last). A very recent patch was > >> introduced > >> to fix a problem with OpenSSL but probably 0.91 contains some old > setting > >> even > >> using GnuTLS (from https://packages.debian.org/jessie/freetds-bin or > >> Ubuntu > >> package you can see GnuTLS is used). > >> > >> Frediano > > > > > > > > > > -- > > Scott Morken > > Programmer > > Phoenix College - Information Technology > > 602.285.7554 > > scott.morken at phoenixcollege.edu > -- *Scott Morken* Programmer Phoenix College - Information Technology 602.285.7554 scott.morken at phoenixcollege.edu From freddy77 at gmail.com Fri Sep 23 03:38:13 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 23 Sep 2016 08:38:13 +0100 Subject: [freetds] Version 1.00.15 select @@spid In-Reply-To: References: Message-ID: 2016-09-21 14:44 GMT+01:00 mlhjr61 . : > Hello Users group, > > I use freetds with perl DBI in scripts to connect to an application called > IBM Tivoli Netcool/Omnibus (versions 7.3.1, 7.4, and 8.1) . Freetds > version 0.91 works fine with all of them. I am installing new servers and > downloaded the latest freetds version 1.00.15 and now am unable to run > queries. Error is the following when I connect: > > "ERROR=Parse failure on line 1 of statement 'select @@spid ', at or > near '@'" > > Connection (in freetds log) is successful, but the select statement above > causes failure). > > Is this something that can be disabled? > > ./tsql -C > Compile-time settings (established with the "configure" script) > Version: freetds v1.00.15 > freetds.conf directory: /usr/local/etc > MS db-lib source compatibility: no > Sybase binary compatibility: no > Thread safety: yes > iconv library: yes > TDS version: auto > iODBC: no > unixodbc: yes > SSPI "trusted" logins: no > Kerberos: no > OpenSSL: yes > GnuTLS: no > MARS: no > > Thanks, > Mel Looks like Tivoli is using TDS then but it's not a sql server. The "select @@spid" is a query accepted by any sql server and was introduced to get the SPID variable. Probably it would be possible to understand server type and avoid trying to get the SPID that way of just replace with a dummy value. Can you send the log (privately if you prefer) ? Frediano From freddy77 at gmail.com Fri Sep 23 03:44:30 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 23 Sep 2016 08:44:30 +0100 Subject: [freetds] intermittent TLS packet with unexpected length error In-Reply-To: References: Message-ID: Good, would be a great idea to open a bug to Debian and Ubuntu asking to change the string. Frediano 2016-09-21 22:18 GMT+01:00 Scott Morken : > It looks like this *mostly* worked. I've had one schannel error in the > last two days. Considerably better than the dozens I was getting before. > Not perfect, but much much better. For the record, and for anyone else who > might need to build this bailing wire and duct tape fix, here are the steps > I took to make this work: > > Install build packages: > > $ sudo apt-get install build-essential dpatch fakeroot devscripts equivs > lintian quilt > > Add/replace the deb src for main restricted to use Xenial?s repo in > /etc/apt/sources.list - this gets you the latest 0.91-6.1build1 which has > the *almost* necessary patches in place to work. > > Mine went from: > > deb-src http://us.archive.ubuntu.com/ubuntu/ trust main restricted > > To > > deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted > > Update package list > > $ apt-get update > > Make a work dir > > $ mkdir ~/src > > Install the source > > $ apt-get source freetds > > $ cd /freetds-0.91 > > Get build deps > > $ sudo mk-build-deps -i -r freetds > > Modify the src/tds/net.c for the allowed cipher suite (remove SSLV3) > > -------------------------------------------------------------------------------------------------- > > @@ -1322,7 +1322,7 @@ > > /* ... but overwrite some */ > > ret = gnutls_priority_set_direct (session, > > - "NORMAL:%COMPAT", NULL); > > + "NORMAL:%COMPAT:-VERS-SSL3.0", NULL); > > /* mssql does not like padding too much */ > > #ifdef HAVE_GNUTLS_RECORD_DISABLE_PADDING > -------------------------------------------------------------------------------------------------- > > Build it > > $ fakeroot debian/rules binary > > Install dependencies > > libgnutls28 odbcinst1debian2 libodbc1 unixodbc > > Install all the pieces > > $ sudo dpkg -i ../libct4_0.91-6.1build1_amd64.deb > > $ sudo dpkg -i ../libsybdb5_0.91-6.1build1_amd64.deb > > $ sudo dpkg -i ../tdsodbc_0.91-6.1build1_amd64.deb > > $ sudo dpkg -i ../freetds-common_0.91-6.1build1_all.deb > > $ sudo dpkg -i ../freetds-bin_0.91-6.1build1_amd64.deb > > > On Fri, Sep 16, 2016 at 8:44 AM, Frediano Ziglio wrote: > >> 2016-09-16 16:28 GMT+01:00 Scott Morken : >> > I think you guys are correct. I looked at the updated cipher list and it >> > looks like the one that is getting picked is in the removed list. Since >> I'm >> > sure our server admins won't want to install freetds from source on >> multiple >> > servers, is there a way to pass an allowed cipher list/suite to freetds? >> > Either through the config or environment? If I could find a workable >> one, I >> > could probably limp along until we get to a new version... Although >> 16.04LTS >> > is still 0.91-6.1build1. Not very up to date :( >> > >> >> Looks like they (Debian and Ubuntu) has a patch for the ciphers, that is >> >> @@ -1280,25 +1282,6 @@ >> { >> gnutls_session session; >> gnutls_certificate_credentials xcred; >> - >> - static const int kx_priority[] = { >> - GNUTLS_KX_RSA_EXPORT, >> - GNUTLS_KX_RSA, GNUTLS_KX_DHE_DSS, GNUTLS_KX_DHE_RSA, >> - 0 >> - }; >> - static const int cipher_priority[] = { >> - GNUTLS_CIPHER_AES_256_CBC, GNUTLS_CIPHER_AES_128_CBC, >> - GNUTLS_CIPHER_3DES_CBC, GNUTLS_CIPHER_ARCFOUR_128, >> -#if 0 >> - GNUTLS_CIPHER_ARCFOUR_40, >> - GNUTLS_CIPHER_DES_CBC, >> -#endif >> - 0 >> - }; >> - static const int comp_priority[] = { GNUTLS_COMP_NULL, 0 }; >> - static const int mac_priority[] = { >> - GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0 >> - }; >> int ret; >> const char *tls_msg; >> >> @@ -1338,10 +1321,9 @@ >> gnutls_set_default_priority(session); >> >> /* ... but overwrite some */ >> - gnutls_cipher_set_priority(session, cipher_priority); >> - gnutls_compression_set_priority(session, comp_priority); >> - gnutls_kx_set_priority(session, kx_priority); >> - gnutls_mac_set_priority(session, mac_priority); >> + ret = gnutls_priority_set_direct (session, >> + "NORMAL:%COMPAT", NULL); >> + >> /* mssql does not like padding too much */ >> #ifdef HAVE_GNUTLS_RECORD_DISABLE_PADDING >> gnutls_record_disable_padding(session); >> >> Our current string is "NORMAL:%COMPAT:-VERS-SSL3.0". >> But these strings are by the way encoded inside the binaries so they >> require recompiling >> from sources. You could try downloading the Ubuntu sources and replace >> that string. >> If you looks on internet "rebuild debian packages" you can found lot >> of easy documents. >> If you are able to verify that changing that string is enough you >> should then open a bug to >> Ubuntu to get official packages. >> Another way would be to build your own personal repository which could >> be used in >> the future for events like this. >> >> Frediano >> >> >> >> > On Fri, Sep 16, 2016 at 8:23 AM, Frediano Ziglio >> wrote: >> >> >> >> 2016-09-16 16:02 GMT+01:00 Ramiro Morales : >> >> > On Fri, Sep 16, 2016 at 11:54 AM, Scott Morken < >> >> > scott.morken at phoenixcollege.edu> wrote: >> >> > >> >> >> I've recently (around the first part of August) starting getting >> random >> >> >> " >> >> >> SQLSTATE[01002] Adaptive Server connection failed" errors from >> FreeTDS. >> >> >> It >> >> >> seems to be related to the TLS handshake. It doesn't happen every >> >> >> time... >> >> >> it took me about 45 minutes of clicking around to get the attached >> >> >> failure >> >> >> log but the next time only took a couple of minutes to get another. >> It >> >> >> happens from multiple Ubuntu 14.04.5 LTS servers connecting to the >> same >> >> >> MS >> >> >> SQL Server. These are mostly PHP web apps but Python also has the >> same >> >> >> issue - naturally since it's the same backend library :) >> >> >> >> >> >> MS SQL Server 2012 (11.0.6020) on Windows Server 2008 R2 SP1 >> >> >> >> >> >> The error on SQL Server isn't super helpful but it gave me a starting >> >> >> point >> >> >> to look into the TLS connection: >> >> >> >> >> >> >> >> >> > >> >> /> >> >> >> 36888 >> >> >> 0 >> >> >> 2 >> >> >> 0 >> >> >> 0 >> >> >> 0x8000000000000000 >> >> >> >> >> >> 81739 >> >> >> >> >> >> >> >> >> System >> >> >> xxxx >> >> >> >> >> >> >> >> >> >> >> >> 20 >> >> >> 960 >> >> >> >> >> >> >> >> >> >> >> >> I'm connecting from multiple Ubuntu 14.04.5 LTS servers. >> >> >> gnutls26 is installed (2.12.23-12ubuntu2.5) >> >> >> freetds 0.91-5 >> >> >> >> >> >> I'm at a loss as to what would cause these errors. I've spent a lot >> of >> >> >> time searching for an answer but haven't found anything that really >> >> >> fits. >> >> >> Our server admins tried uninstalling the Microsoft TLS 1.2 patch that >> >> >> apparently broke a few things but that didn't help: >> >> >> http://www.infoworld.com/article/2848574/operating- >> >> >> systems/microsoft-botches-kb-2992611-schannel-patch-tls- >> >> >> alert-code-40-slow-sql-server-block-iis-sites.html >> >> >> >> >> >> I've tried encryption = off but it seems it still tries to negotiate >> it >> >> >> and >> >> >> fails. >> >> >> >> >> >> I've attached a log of the debug output from freeTDS for a failure >> and >> >> >> a >> >> >> success. Any thoughts or obvious things I've missed would be greatly >> >> >> appreciated. I've run out of ideas. >> >> >> >> >> >> Scott, >> >> > >> >> > Take a look at the FreeTDS GitHub repo commit history for the master >> >> > branch >> >> > and for the 1.0.x maintenance branch for the last month or so and >> >> > verify >> >> > if it could be related. >> >> > >> >> > It might be your copy of FreeTDS is too old. >> >> > >> >> > Regards, >> >> > >> >> > -- >> >> > Ramiro Morales >> >> > @ramiromorales >> >> >> >> I confirmed what Ramiro said. >> >> Unfortunately we seem we should try to push some new version to Debian. >> >> We don't release very often but 0.91 is 2 main release ago that is years >> >> ago, >> >> many changes were introduced since. >> >> We try very hard to maintain ABI so you should have not much issues >> >> updating from sources. >> >> We are a really small group nowadays and we cannot effort to maintain >> much >> >> old releases (actually we maintain the last). A very recent patch was >> >> introduced >> >> to fix a problem with OpenSSL but probably 0.91 contains some old >> setting >> >> even >> >> using GnuTLS (from https://packages.debian.org/jessie/freetds-bin or >> >> Ubuntu >> >> package you can see GnuTLS is used). >> >> >> >> Frediano >> > >> > >> > >> > >> > -- >> > Scott Morken >> > Programmer >> > Phoenix College - Information Technology >> > 602.285.7554 >> > scott.morken at phoenixcollege.edu >> > > > > -- > *Scott Morken* > Programmer > Phoenix College - Information Technology > 602.285.7554 > scott.morken at phoenixcollege.edu > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/freetds From scott.morken at phoenixcollege.edu Fri Sep 23 09:35:48 2016 From: scott.morken at phoenixcollege.edu (Scott Morken) Date: Fri, 23 Sep 2016 06:35:48 -0700 Subject: [freetds] intermittent TLS packet with unexpected length error In-Reply-To: References: Message-ID: I'll do that the end of next week. Thanks again for the help! On Sep 23, 2016 3:44 AM, "Frediano Ziglio" wrote: > Good, would be a great idea to open a bug to Debian and Ubuntu asking > to change the string. > > Frediano > > 2016-09-21 22:18 GMT+01:00 Scott Morken : > > It looks like this *mostly* worked. I've had one schannel error in the > > last two days. Considerably better than the dozens I was getting before. > > Not perfect, but much much better. For the record, and for anyone else > who > > might need to build this bailing wire and duct tape fix, here are the > steps > > I took to make this work: > > > > Install build packages: > > > > $ sudo apt-get install build-essential dpatch fakeroot devscripts equivs > > lintian quilt > > > > Add/replace the deb src for main restricted to use Xenial?s repo in > > /etc/apt/sources.list - this gets you the latest 0.91-6.1build1 which has > > the *almost* necessary patches in place to work. > > > > Mine went from: > > > > deb-src http://us.archive.ubuntu.com/ubuntu/ trust main restricted > > > > To > > > > deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted > > > > Update package list > > > > $ apt-get update > > > > Make a work dir > > > > $ mkdir ~/src > > > > Install the source > > > > $ apt-get source freetds > > > > $ cd /freetds-0.91 > > > > Get build deps > > > > $ sudo mk-build-deps -i -r freetds > > > > Modify the src/tds/net.c for the allowed cipher suite (remove SSLV3) > > > > ------------------------------------------------------------ > -------------------------------------- > > > > @@ -1322,7 +1322,7 @@ > > > > /* ... but overwrite some */ > > > > ret = gnutls_priority_set_direct (session, > > > > - "NORMAL:%COMPAT", NULL); > > > > + "NORMAL:%COMPAT:-VERS-SSL3.0", NULL); > > > > /* mssql does not like padding too much */ > > > > #ifdef HAVE_GNUTLS_RECORD_DISABLE_PADDING > > ------------------------------------------------------------ > -------------------------------------- > > > > Build it > > > > $ fakeroot debian/rules binary > > > > Install dependencies > > > > libgnutls28 odbcinst1debian2 libodbc1 unixodbc > > > > Install all the pieces > > > > $ sudo dpkg -i ../libct4_0.91-6.1build1_amd64.deb > > > > $ sudo dpkg -i ../libsybdb5_0.91-6.1build1_amd64.deb > > > > $ sudo dpkg -i ../tdsodbc_0.91-6.1build1_amd64.deb > > > > $ sudo dpkg -i ../freetds-common_0.91-6.1build1_all.deb > > > > $ sudo dpkg -i ../freetds-bin_0.91-6.1build1_amd64.deb > > > > > > On Fri, Sep 16, 2016 at 8:44 AM, Frediano Ziglio > wrote: > > > >> 2016-09-16 16:28 GMT+01:00 Scott Morken edu>: > >> > I think you guys are correct. I looked at the updated cipher list > and it > >> > looks like the one that is getting picked is in the removed list. > Since > >> I'm > >> > sure our server admins won't want to install freetds from source on > >> multiple > >> > servers, is there a way to pass an allowed cipher list/suite to > freetds? > >> > Either through the config or environment? If I could find a workable > >> one, I > >> > could probably limp along until we get to a new version... Although > >> 16.04LTS > >> > is still 0.91-6.1build1. Not very up to date :( > >> > > >> > >> Looks like they (Debian and Ubuntu) has a patch for the ciphers, that is > >> > >> @@ -1280,25 +1282,6 @@ > >> { > >> gnutls_session session; > >> gnutls_certificate_credentials xcred; > >> - > >> - static const int kx_priority[] = { > >> - GNUTLS_KX_RSA_EXPORT, > >> - GNUTLS_KX_RSA, GNUTLS_KX_DHE_DSS, GNUTLS_KX_DHE_RSA, > >> - 0 > >> - }; > >> - static const int cipher_priority[] = { > >> - GNUTLS_CIPHER_AES_256_CBC, GNUTLS_CIPHER_AES_128_CBC, > >> - GNUTLS_CIPHER_3DES_CBC, GNUTLS_CIPHER_ARCFOUR_128, > >> -#if 0 > >> - GNUTLS_CIPHER_ARCFOUR_40, > >> - GNUTLS_CIPHER_DES_CBC, > >> -#endif > >> - 0 > >> - }; > >> - static const int comp_priority[] = { GNUTLS_COMP_NULL, 0 }; > >> - static const int mac_priority[] = { > >> - GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0 > >> - }; > >> int ret; > >> const char *tls_msg; > >> > >> @@ -1338,10 +1321,9 @@ > >> gnutls_set_default_priority(session); > >> > >> /* ... but overwrite some */ > >> - gnutls_cipher_set_priority(session, cipher_priority); > >> - gnutls_compression_set_priority(session, > comp_priority); > >> - gnutls_kx_set_priority(session, kx_priority); > >> - gnutls_mac_set_priority(session, mac_priority); > >> + ret = gnutls_priority_set_direct (session, > >> + "NORMAL:%COMPAT", NULL); > >> + > >> /* mssql does not like padding too much */ > >> #ifdef HAVE_GNUTLS_RECORD_DISABLE_PADDING > >> gnutls_record_disable_padding(session); > >> > >> Our current string is "NORMAL:%COMPAT:-VERS-SSL3.0". > >> But these strings are by the way encoded inside the binaries so they > >> require recompiling > >> from sources. You could try downloading the Ubuntu sources and replace > >> that string. > >> If you looks on internet "rebuild debian packages" you can found lot > >> of easy documents. > >> If you are able to verify that changing that string is enough you > >> should then open a bug to > >> Ubuntu to get official packages. > >> Another way would be to build your own personal repository which could > >> be used in > >> the future for events like this. > >> > >> Frediano > >> > >> > >> > >> > On Fri, Sep 16, 2016 at 8:23 AM, Frediano Ziglio > >> wrote: > >> >> > >> >> 2016-09-16 16:02 GMT+01:00 Ramiro Morales : > >> >> > On Fri, Sep 16, 2016 at 11:54 AM, Scott Morken < > >> >> > scott.morken at phoenixcollege.edu> wrote: > >> >> > > >> >> >> I've recently (around the first part of August) starting getting > >> random > >> >> >> " > >> >> >> SQLSTATE[01002] Adaptive Server connection failed" errors from > >> FreeTDS. > >> >> >> It > >> >> >> seems to be related to the TLS handshake. It doesn't happen every > >> >> >> time... > >> >> >> it took me about 45 minutes of clicking around to get the attached > >> >> >> failure > >> >> >> log but the next time only took a couple of minutes to get > another. > >> It > >> >> >> happens from multiple Ubuntu 14.04.5 LTS servers connecting to the > >> same > >> >> >> MS > >> >> >> SQL Server. These are mostly PHP web apps but Python also has the > >> same > >> >> >> issue - naturally since it's the same backend library :) > >> >> >> > >> >> >> MS SQL Server 2012 (11.0.6020) on Windows Server 2008 R2 SP1 > >> >> >> > >> >> >> The error on SQL Server isn't super helpful but it gave me a > starting > >> >> >> point > >> >> >> to look into the TLS connection: > >> >> >> > >> >> >> > >> >> >> >> >> >> /> > >> >> >> 36888 > >> >> >> 0 > >> >> >> 2 > >> >> >> 0 > >> >> >> 0 > >> >> >> 0x8000000000000000 > >> >> >> > >> >> >> 81739 > >> >> >> > >> >> >> > >> >> >> System > >> >> >> xxxx > >> >> >> > >> >> >> > >> >> >> > >> >> >> 20 > >> >> >> 960 > >> >> >> > >> >> >> > >> >> >> > >> >> >> I'm connecting from multiple Ubuntu 14.04.5 LTS servers. > >> >> >> gnutls26 is installed (2.12.23-12ubuntu2.5) > >> >> >> freetds 0.91-5 > >> >> >> > >> >> >> I'm at a loss as to what would cause these errors. I've spent a > lot > >> of > >> >> >> time searching for an answer but haven't found anything that > really > >> >> >> fits. > >> >> >> Our server admins tried uninstalling the Microsoft TLS 1.2 patch > that > >> >> >> apparently broke a few things but that didn't help: > >> >> >> http://www.infoworld.com/article/2848574/operating- > >> >> >> systems/microsoft-botches-kb-2992611-schannel-patch-tls- > >> >> >> alert-code-40-slow-sql-server-block-iis-sites.html > >> >> >> > >> >> >> I've tried encryption = off but it seems it still tries to > negotiate > >> it > >> >> >> and > >> >> >> fails. > >> >> >> > >> >> >> I've attached a log of the debug output from freeTDS for a failure > >> and > >> >> >> a > >> >> >> success. Any thoughts or obvious things I've missed would be > greatly > >> >> >> appreciated. I've run out of ideas. > >> >> >> > >> >> >> Scott, > >> >> > > >> >> > Take a look at the FreeTDS GitHub repo commit history for the > master > >> >> > branch > >> >> > and for the 1.0.x maintenance branch for the last month or so and > >> >> > verify > >> >> > if it could be related. > >> >> > > >> >> > It might be your copy of FreeTDS is too old. > >> >> > > >> >> > Regards, > >> >> > > >> >> > -- > >> >> > Ramiro Morales > >> >> > @ramiromorales > >> >> > >> >> I confirmed what Ramiro said. > >> >> Unfortunately we seem we should try to push some new version to > Debian. > >> >> We don't release very often but 0.91 is 2 main release ago that is > years > >> >> ago, > >> >> many changes were introduced since. > >> >> We try very hard to maintain ABI so you should have not much issues > >> >> updating from sources. > >> >> We are a really small group nowadays and we cannot effort to maintain > >> much > >> >> old releases (actually we maintain the last). A very recent patch was > >> >> introduced > >> >> to fix a problem with OpenSSL but probably 0.91 contains some old > >> setting > >> >> even > >> >> using GnuTLS (from https://packages.debian.org/jessie/freetds-bin or > >> >> Ubuntu > >> >> package you can see GnuTLS is used). > >> >> > >> >> Frediano > >> > > >> > > >> > > >> > > >> > -- > >> > Scott Morken > >> > Programmer > >> > Phoenix College - Information Technology > >> > 602.285.7554 > >> > scott.morken at phoenixcollege.edu > >> > > > > > > > > -- > > *Scott Morken* > > Programmer > > Phoenix College - Information Technology > > 602.285.7554 > > scott.morken at phoenixcollege.edu > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > http://lists.ibiblio.org/mailman/listinfo/freetds > From freddy77 at gmail.com Wed Aug 10 12:23:05 2016 From: freddy77 at gmail.com (Frediano Ziglio) Date: Wed, 10 Aug 2016 16:23:05 -0000 Subject: [freetds] SQL Server 2016 support In-Reply-To: <57A9FB35.7020601@4js.com> References: <57A98AC7.60101@4js.com> <57A9FB35.7020601@4js.com> Message-ID: 2016-08-09 16:48 GMT+01:00 Sebastien FLAESCH : > In fact from time to time the connection to SQL Server 2016 fails. > > No idea if this is a server issue or FreeTDS bug, but it occurs only with > FreeTDS. > > We do the same tests with Easysoft's ODBC driver for SQL Server and no > problem with that one. > > Attached the TDSDUMP... hopefully this can help. > > Seb > Quite a mystery I would say. Looks like that during TLS initialization (just before saying ok) server drop the connection. The TLS packets looks the same, the content obviously is not as contains keys and encrypted data. Could be that the library (either OpenSSL or GnuTLS) you are using on the client craft some not so secure keys and server refuse them? Does the server report some error in the log? How often does this happen? I checked and the flag the client/server agree on is the same (0). Frediano > > On 08/09/2016 09:48 AM, Sebastien FLAESCH wrote: >> >> Hi all, >> >> What is the status of SQL Server 2016 support? >> >> I could not find any thread with "FreeTDS" + "SQL Server 2016" on the net. >> >> Is there any doc / howto available? >> >> For example, what is the TDS protocol version to be used? >> >> We have executed our SQL regressions tests. >> >> FreeTDS 1.0 seems to work fine with SQL Server 2016 using: >> >> TDS_Version = 7.3 >> >> Thanks, >> Seb