From Debrot at addsys.com Mon Jan 27 13:38:41 2020 From: Debrot at addsys.com (Debrot, Ed) Date: Mon, 27 Jan 2020 18:38:41 +0000 Subject: [freetds] Using a CS_NUMERIC type as a parameter to a stored procedure Message-ID: We are porting an application written using ctlib against Sybase ASE to one using freetds and working with SQL Server. The application has worked for many years in the old configuration (ctlib and Sybase ASE). In the application we call stored procedure using ct_command() and send in parameters using ct_param(). When using freetds and SQL Server we have found that we have not been able to pass a stored procedure parameter when that parameter is of type CS_NUMERIC. The parameter is passed successfully in the old configuration so I believe the mechanics are correct. When compiling and running the same code for use with freetds and SQL Server we get an error (below) that the first parameter is not passed but I know that it is. Is there a limitation in freetds having to with passing CS_NUMERIC types as stored procedure parameters using ct_param()? >>> >>> error message >>> message string is Procedure or function 'RECEIPT_FREIGHT_k0_ge_sp' expects parameter '@arg1', which was not supplied. error number=201, severity=16 state=4, line=0 Server='ADD-MSSQL-DEV' Procedure='RECEIPT_FREIGHT_k0_ge_sp' >>> >>> >>> stored procedure definition >>> create procedure dbo.RECEIPT_FREIGHT_k0_ge_sp @arg1 int, @arg2 numeric as select * from RECEIPT_FREIGHT with (index (RECEIPT_FREIGHT_KEY0)) where status="A" and receipt_id = @arg1 and internal_id >= @arg2 union all select * from RECEIPT_FREIGHT with (index (RECEIPT_FREIGHT_KEY0)) where status="A" and receipt_id > @arg1 >>> From freddy77 at gmail.com Wed Jan 29 06:30:11 2020 From: freddy77 at gmail.com (Frediano Ziglio) Date: Wed, 29 Jan 2020 11:30:11 +0000 Subject: [freetds] Using a CS_NUMERIC type as a parameter to a stored procedure In-Reply-To: References: Message-ID: Il giorno lun 27 gen 2020 alle ore 20:14 Debrot, Ed ha scritto: > > We are porting an application written using ctlib against Sybase ASE to one using freetds and working with SQL Server. The application has worked for many years in the old configuration (ctlib and Sybase ASE). In the application we call stored procedure using ct_command() and send in parameters using ct_param(). > > When using freetds and SQL Server we have found that we have not been able to pass a stored procedure parameter when that parameter is of type CS_NUMERIC. The parameter is passed successfully in the old configuration so I believe the mechanics are correct. > > When compiling and running the same code for use with freetds and SQL Server we get an error (below) that the first parameter is not passed but I know that it is. > > Is there a limitation in freetds having to with passing CS_NUMERIC types as stored procedure parameters using ct_param()? > > >>> > >>> error message > >>> > message string is > Procedure or function 'RECEIPT_FREIGHT_k0_ge_sp' expects parameter '@arg1', which was not supplied. > error number=201, severity=16 > state=4, line=0 > Server='ADD-MSSQL-DEV' > Procedure='RECEIPT_FREIGHT_k0_ge_sp' > >>> > Do you have a tds dump? The numeric should be @arg2 but the message is about @arg1. Did you try with a store procedure with just one parameter? Are you passing also @arg1 ? > >>> > >>> stored procedure definition > >>> > create procedure dbo.RECEIPT_FREIGHT_k0_ge_sp @arg1 int, @arg2 numeric > as > select * from RECEIPT_FREIGHT with (index (RECEIPT_FREIGHT_KEY0)) > where status="A" and receipt_id = @arg1 and internal_id >= @arg2 > union all > select * from RECEIPT_FREIGHT with (index (RECEIPT_FREIGHT_KEY0)) > where status="A" and receipt_id > @arg1 > >>> > Frediano From Debrot at addsys.com Wed Jan 29 12:39:43 2020 From: Debrot at addsys.com (Debrot, Ed) Date: Wed, 29 Jan 2020 17:39:43 +0000 Subject: [freetds] Using a CS_NUMERIC type as a parameter to a stored procedure Message-ID: In response to your questions; > Do you have a tds dump? No, I have not done the before. My initial hope in my question to see if CS_NUMERIC had a limitation that I was not aware of (like passing in as a parameter to a stored procedure using ct_param(). > The numeric should be @arg2 but the message is about @arg1. > Did you try with a store procedure with just one parameter? > Are you passing also @arg1 ? Yes, I know. But the error message is wrong, I believe. If I change the stored procedure to only accept arg1 and only pass arg1 the stored procedure accepts arg1 and all is ok. Somehow in passing the second parameter it gets confused. The fact that this works in Sybase ASE and their libraries makes me believe the mechanics are correct (my code..). -----Original Message----- From: FreeTDS [mailto:freetds-bounces+debrot=addsys.com at lists.ibiblio.org] On Behalf Of Frediano Ziglio Sent: Wednesday, January 29, 2020 6:30 AM To: FreeTDS Development Group Subject: [EXTERNAL] Re: [freetds] Using a CS_NUMERIC type as a parameter to a stored procedure Il giorno lun 27 gen 2020 alle ore 20:14 Debrot, Ed ha scritto: > > We are porting an application written using ctlib against Sybase ASE to one using freetds and working with SQL Server. The application has worked for many years in the old configuration (ctlib and Sybase ASE). In the application we call stored procedure using ct_command() and send in parameters using ct_param(). > > When using freetds and SQL Server we have found that we have not been able to pass a stored procedure parameter when that parameter is of type CS_NUMERIC. The parameter is passed successfully in the old configuration so I believe the mechanics are correct. > > When compiling and running the same code for use with freetds and SQL Server we get an error (below) that the first parameter is not passed but I know that it is. > > Is there a limitation in freetds having to with passing CS_NUMERIC types as stored procedure parameters using ct_param()? > > >>> > >>> error message > >>> > message string is > Procedure or function 'RECEIPT_FREIGHT_k0_ge_sp' expects parameter '@arg1', which was not supplied. > error number=201, severity=16 > state=4, line=0 > Server='ADD-MSSQL-DEV' > Procedure='RECEIPT_FREIGHT_k0_ge_sp' > >>> > Do you have a tds dump? The numeric should be @arg2 but the message is about @arg1. Did you try with a store procedure with just one parameter? Are you passing also @arg1 ? > >>> > >>> stored procedure definition > >>> > create procedure dbo.RECEIPT_FREIGHT_k0_ge_sp @arg1 int, @arg2 numeric > as > select * from RECEIPT_FREIGHT with (index (RECEIPT_FREIGHT_KEY0)) > where status="A" and receipt_id = @arg1 and internal_id >= @arg2 > union all > select * from RECEIPT_FREIGHT with (index (RECEIPT_FREIGHT_KEY0)) > where status="A" and receipt_id > @arg1 > >>> > Frediano _______________________________________________ FreeTDS mailing list FreeTDS at lists.ibiblio.org https://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Thu Jan 30 05:22:56 2020 From: freddy77 at gmail.com (Frediano Ziglio) Date: Thu, 30 Jan 2020 10:22:56 +0000 Subject: [freetds] Using a CS_NUMERIC type as a parameter to a stored procedure In-Reply-To: References: Message-ID: Il giorno mer 29 gen 2020 alle ore 18:13 Debrot, Ed ha scritto: > > In response to your questions; > > > Do you have a tds dump? > > No, I have not done the before. My initial hope in my question to see if CS_NUMERIC had a limitation that I was not aware of (like passing in as a parameter to a stored procedure using ct_param(). > As ct-library is only Sybase if the program works with sybase library should work even with FreeTDS. I tried to extend the test to pass an additional numeric value and works. > > The numeric should be @arg2 but the message is about @arg1. > > Did you try with a store procedure with just one parameter? > > Are you passing also @arg1 ? > > Yes, I know. But the error message is wrong, I believe. If I change the stored procedure to only accept arg1 and only pass arg1 the stored procedure accepts arg1 and all is ok. Somehow in passing the second parameter it gets confused. The fact that this works in Sybase ASE and their libraries makes me believe the mechanics are correct (my code..). > Are you passing both int and numeric using named parameters ? Are some values NULL ? It would be helpful to have ct_param argument values to understand. Maybe FreeTDS is more strict about precision/scale ? > > -----Original Message----- > From: FreeTDS [mailto:freetds-bounces+debrot=addsys.com at lists.ibiblio.org] On Behalf Of Frediano Ziglio > Sent: Wednesday, January 29, 2020 6:30 AM > To: FreeTDS Development Group > Subject: [EXTERNAL] Re: [freetds] Using a CS_NUMERIC type as a parameter to a stored procedure > > Il giorno lun 27 gen 2020 alle ore 20:14 Debrot, Ed ha scritto: > > > > We are porting an application written using ctlib against Sybase ASE to one using freetds and working with SQL Server. The application has worked for many years in the old configuration (ctlib and Sybase ASE). In the application we call stored procedure using ct_command() and send in parameters using ct_param(). > > > > When using freetds and SQL Server we have found that we have not been able to pass a stored procedure parameter when that parameter is of type CS_NUMERIC. The parameter is passed successfully in the old configuration so I believe the mechanics are correct. > > > > When compiling and running the same code for use with freetds and SQL Server we get an error (below) that the first parameter is not passed but I know that it is. > > > > Is there a limitation in freetds having to with passing CS_NUMERIC types as stored procedure parameters using ct_param()? > > > > >>> > > >>> error message > > >>> > > message string is > > Procedure or function 'RECEIPT_FREIGHT_k0_ge_sp' expects parameter '@arg1', which was not supplied. > > error number=201, severity=16 > > state=4, line=0 > > Server='ADD-MSSQL-DEV' > > Procedure='RECEIPT_FREIGHT_k0_ge_sp' > > >>> > > > > Do you have a tds dump? > The numeric should be @arg2 but the message is about @arg1. > Did you try with a store procedure with just one parameter? > Are you passing also @arg1 ? > > > >>> > > >>> stored procedure definition > > >>> > > create procedure dbo.RECEIPT_FREIGHT_k0_ge_sp @arg1 int, @arg2 numeric > > as > > select * from RECEIPT_FREIGHT with (index (RECEIPT_FREIGHT_KEY0)) > > where status="A" and receipt_id = @arg1 and internal_id >= @arg2 > > union all > > select * from RECEIPT_FREIGHT with (index (RECEIPT_FREIGHT_KEY0)) > > where status="A" and receipt_id > @arg1 > > >>> > > > > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://lists.ibiblio.org/mailman/listinfo/freetds > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://lists.ibiblio.org/mailman/listinfo/freetds From niklas at saers.com Wed Feb 26 11:16:47 2020 From: niklas at saers.com (Niklas Saers) Date: Wed, 26 Feb 2020 17:16:47 +0100 Subject: [freetds] Cross-compiling for Mac Catalyst Message-ID: <0DF8952A-13FC-4E31-964B-68D9E9AFDA3E@saers.com> Hi, First of all thanks for all the hard work that has been put into this project, and thank you very much for letting me join the list. I'm trying to cross-compile FreeTDS for the different iOS platforms and for Mac Catalyst. I've made a project with my scripts at https://github.com/niklassaers/freetds-ios If you clone it and run go.sh, it compiles iOS versions for arm64e, arm64, armv7s, armv7 and the simulator, plus a catalyst version. It goes seemingly fine for the iOS versions, but for Mac Catalyst, I get the following error: ld: building for Mac Catalyst, but linking in dylib built for macOS, file '../../dblib/.libs/libsybdb.dylib' for architecture x86_64h Any idea why I get this linker error, and how I can resolve it? My build script for the Mac Catalyst build by itself is here: https://raw.githubusercontent.com/niklassaers/freetds-ios/master/build-catalyst-2.sh Cheers Niklas From freddy77 at gmail.com Fri Mar 6 05:32:41 2020 From: freddy77 at gmail.com (Frediano Ziglio) Date: Fri, 6 Mar 2020 10:32:41 +0000 Subject: [freetds] Cross-compiling for Mac Catalyst In-Reply-To: <0DF8952A-13FC-4E31-964B-68D9E9AFDA3E@saers.com> References: <0DF8952A-13FC-4E31-964B-68D9E9AFDA3E@saers.com> Message-ID: Il giorno mer 26 feb 2020 alle ore 16:18 Niklas Saers ha scritto: > > Hi, > First of all thanks for all the hard work that has been put into this project, and thank you very much for letting me join the list. > > I'm trying to cross-compile FreeTDS for the different iOS platforms and for Mac Catalyst. I've made a project with my scripts at https://github.com/niklassaers/freetds-ios > > If you clone it and run go.sh, it compiles iOS versions for arm64e, arm64, armv7s, armv7 and the simulator, plus a catalyst version. It goes seemingly fine for the iOS versions, but for Mac Catalyst, I get the following error: > > ld: building for Mac Catalyst, but linking in dylib built for macOS, file '../../dblib/.libs/libsybdb.dylib' for architecture x86_64h > > Any idea why I get this linker error, and how I can resolve it? > > My build script for the Mac Catalyst build by itself is here: https://raw.githubusercontent.com/niklassaers/freetds-ios/master/build-catalyst-2.sh > > Cheers > > Niklas Hi, did you solve this? >From the message looks like some kind of leftover from an old build or picking up a library for another architecture. Unless for some reason you manage to compile for x86_64 and attempting linking with arm. Regards, Frediano From niklas at saers.com Fri Mar 6 10:16:04 2020 From: niklas at saers.com (Niklas Saers) Date: Fri, 6 Mar 2020 16:16:04 +0100 Subject: [freetds] Cross-compiling for Mac Catalyst In-Reply-To: References: <0DF8952A-13FC-4E31-964B-68D9E9AFDA3E@saers.com> Message-ID: <6A68D02D-02B3-4CC5-BD85-6271AEB51495@saers.com> Hi Frediano, No, I haven?t made any progress, and I?d really appreciate some help. :-) The build script go.sh in https://github.com/niklassaers/freetds-ios will download FreeDTS, and build it from clean. So unless I?ve done something odd, I don?t think there should be leftovers from an old build. I just verified it by downloading the repo to an clean dir and running it. I still get the same error: ld: building for Mac Catalyst, but linking in dylib built for macOS, file '../../dblib/.libs/libsybdb.dylib' for architecture x86_64h If you?re on a Mac running Catalina, would you mind downloading the repo and running go.sh ? I expect you?ll get the same error, but perhaps you?ll have a better understanding as to why it comes? PS, Mac Catalyst architecture is x86_64-apple-ios13.0-macabi - no arm involved Cheers Niklas > On 6 Mar 2020, at 11.32, Frediano Ziglio wrote: > > Il giorno mer 26 feb 2020 alle ore 16:18 Niklas Saers > ha scritto: >> >> Hi, >> First of all thanks for all the hard work that has been put into this project, and thank you very much for letting me join the list. >> >> I'm trying to cross-compile FreeTDS for the different iOS platforms and for Mac Catalyst. I've made a project with my scripts at https://github.com/niklassaers/freetds-ios >> >> If you clone it and run go.sh, it compiles iOS versions for arm64e, arm64, armv7s, armv7 and the simulator, plus a catalyst version. It goes seemingly fine for the iOS versions, but for Mac Catalyst, I get the following error: >> >> ld: building for Mac Catalyst, but linking in dylib built for macOS, file '../../dblib/.libs/libsybdb.dylib' for architecture x86_64h >> >> Any idea why I get this linker error, and how I can resolve it? >> >> My build script for the Mac Catalyst build by itself is here: https://raw.githubusercontent.com/niklassaers/freetds-ios/master/build-catalyst-2.sh >> >> Cheers >> >> Niklas > > Hi, > did you solve this? > > From the message looks like some kind of leftover from an old build or > picking up a library for another architecture. > Unless for some reason you manage to compile for x86_64 and attempting > linking with arm. > > Regards, > Frediano > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://lists.ibiblio.org/mailman/listinfo/freetds From freddy77 at gmail.com Mon Mar 9 04:49:00 2020 From: freddy77 at gmail.com (Frediano Ziglio) Date: Mon, 9 Mar 2020 08:49:00 +0000 Subject: [freetds] Cross-compiling for Mac Catalyst In-Reply-To: <6A68D02D-02B3-4CC5-BD85-6271AEB51495@saers.com> References: <0DF8952A-13FC-4E31-964B-68D9E9AFDA3E@saers.com> <6A68D02D-02B3-4CC5-BD85-6271AEB51495@saers.com> Message-ID: Hi, no much ideas, I would check the commands to see if there are some weird options. I usually do a clean and another "make V=1" to see the full commands. The important ones are a compile command and a final link one, with all options. Can you post them? I don't have a Mac to try myself. Regards, Frediano Il giorno ven 6 mar 2020 alle ore 15:17 Niklas Saers ha scritto: > > Hi Frediano, > No, I haven?t made any progress, and I?d really appreciate some help. :-) > > The build script go.sh in https://github.com/niklassaers/freetds-ios will download FreeDTS, and build it from clean. So unless I?ve done something odd, I don?t think there should be leftovers from an old build. I just verified it by downloading the repo to an clean dir and running it. I still get the same error: > > ld: building for Mac Catalyst, but linking in dylib built for macOS, file '../../dblib/.libs/libsybdb.dylib' for architecture x86_64h > > If you?re on a Mac running Catalina, would you mind downloading the repo and running go.sh ? I expect you?ll get the same error, but perhaps you?ll have a better understanding as to why it comes? > > PS, Mac Catalyst architecture is x86_64-apple-ios13.0-macabi - no arm involved > > Cheers > > Niklas > > > > On 6 Mar 2020, at 11.32, Frediano Ziglio wrote: > > > > Il giorno mer 26 feb 2020 alle ore 16:18 Niklas Saers > > ha scritto: > >> > >> Hi, > >> First of all thanks for all the hard work that has been put into this project, and thank you very much for letting me join the list. > >> > >> I'm trying to cross-compile FreeTDS for the different iOS platforms and for Mac Catalyst. I've made a project with my scripts at https://github.com/niklassaers/freetds-ios > >> > >> If you clone it and run go.sh, it compiles iOS versions for arm64e, arm64, armv7s, armv7 and the simulator, plus a catalyst version. It goes seemingly fine for the iOS versions, but for Mac Catalyst, I get the following error: > >> > >> ld: building for Mac Catalyst, but linking in dylib built for macOS, file '../../dblib/.libs/libsybdb.dylib' for architecture x86_64h > >> > >> Any idea why I get this linker error, and how I can resolve it? > >> > >> My build script for the Mac Catalyst build by itself is here: https://raw.githubusercontent.com/niklassaers/freetds-ios/master/build-catalyst-2.sh > >> > >> Cheers > >> > >> Niklas > > > > Hi, > > did you solve this? > > > > From the message looks like some kind of leftover from an old build or > > picking up a library for another architecture. > > Unless for some reason you manage to compile for x86_64 and attempting > > linking with arm. > > > > Regards, > > Frediano > > _______________________________________________ > > FreeTDS mailing list > > FreeTDS at lists.ibiblio.org > > https://lists.ibiblio.org/mailman/listinfo/freetds > > _______________________________________________ > FreeTDS mailing list > FreeTDS at lists.ibiblio.org > https://lists.ibiblio.org/mailman/listinfo/freetds