Re: [Firebird-devel] SET BIND OF NUMERIC TO LEGACY does not work with subtype 0

2020-08-05 Thread Ivan Přenosil
On 05.08.2020 v 11:19 Mark Rotteveel wrote: If you want to map that one as well, you will have to execute SET BIND OF INT128 TO LEGACY (which will also cover NUMERIC and DECIMAL) Thanks, now it works as I want. I have to say, I am a bit surprised that 5.5 * 6.6 leads to an INT128 with scale 2

Re: [Firebird-devel] SET BIND OF NUMERIC TO LEGACY does not work with subtype 0

2020-08-05 Thread peshkoff--- via Firebird-devel
Ivan please use for snapshot docs in ~/doc, not b2 RN. Sent from MailDroidFirebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel

Re: [Firebird-devel] SET BIND OF NUMERIC TO LEGACY does not work with subtype 0

2020-08-05 Thread Mark Rotteveel
On 05-08-2020 10:09, Ivan Přenosil wrote: I want numeric values returned as LEGACY, i.e. BIGINT instead of INT128. However SET BIND converts only NUMERIC or DECIMAL, not NUMERIC with subtype 0. (I tried with FB4 Beta 2 and snapshot Firebird-4.0.0.2126) I am not sure whether this is a bug or I a

[Firebird-devel] SET BIND OF NUMERIC TO LEGACY does not work with subtype 0

2020-08-05 Thread Ivan Přenosil
I want numeric values returned as LEGACY, i.e. BIGINT instead of INT128. However SET BIND converts only NUMERIC or DECIMAL, not NUMERIC with subtype 0. (I tried with FB4 Beta 2 and snapshot Firebird-4.0.0.2126) I am not sure whether this is a bug or I am just using SET BIND incorrectly? Here is

Re: [Firebird-devel] SET BIND OF TIME ZONE TO EXTENDED and Data Input

2020-04-30 Thread Alex Peshkoff via Firebird-devel
On 2020-04-30 12:12, Tony Whyman wrote: In the README.time_zone, the SET BIND OF TIME ZONE TO EXTENDED is described as being intended to "solve a problem of representing correct time on clients missing ICU library". All the text I can find, discusses how this is used when reading a TIMESTAMP

[Firebird-devel] SET BIND OF TIME ZONE TO EXTENDED and Data Input

2020-04-30 Thread Tony Whyman
In the README.time_zone, the SET BIND OF TIME ZONE TO EXTENDED is described as being intended to "solve a problem of representing correct time on clients missing ICU library". All the text I can find, discusses how this is used when reading a TIMESTAMP WITH TIME ZONE data type from a database,

Re: [Firebird-devel] SET BIND OF for NUMERIC / DECIMAL

2019-12-27 Thread Alex Peshkoff via Firebird-devel
On 2019-12-26 18:43, Mark Rotteveel wrote: 128-bit literal - is it Numeric or Decimal? Given the lack of an int128, we should consider it an exact numeric literal of either DECIMAL or NUMERIC. The standard says (5.3 ): """ 22) The declared type of an ENL is an implementation-defined exac

Re: [Firebird-devel] SET BIND OF for NUMERIC / DECIMAL

2019-12-26 Thread Alex Peshkoff via Firebird-devel
On 2019-12-26 19:01, Mark Rotteveel wrote: On 26/12/2019 16:43, Mark Rotteveel wrote: Formally, I take this to mean we should choose one type, eg DECIMAL, but that would probably not match people assuming that literal without decimal points are integral literals. We could consider a middle g

Re: [Firebird-devel] SET BIND OF for NUMERIC / DECIMAL

2019-12-26 Thread Mark Rotteveel
On 26/12/2019 16:43, Mark Rotteveel wrote: Formally, I take this to mean we should choose one type, eg DECIMAL, but that would probably not match people assuming that literal without decimal points are integral literals. We could consider a middle ground where literals without decimal point

Re: [Firebird-devel] SET BIND OF for NUMERIC / DECIMAL

2019-12-26 Thread Mark Rotteveel
On 26/12/2019 16:11, Alex Peshkoff via Firebird-devel wrote: On 2019-12-26 17:40, Mark Rotteveel wrote: On 25/12/2019 12:11, Alex Peshkoff via Firebird-devel wrote: On 2019-12-11 18:06, Mark Rotteveel wrote: In other words, it looks like the mapping: of INTEGER-backed types 1. ignores s

Re: [Firebird-devel] SET BIND OF for NUMERIC / DECIMAL

2019-12-26 Thread Alex Peshkoff via Firebird-devel
On 2019-12-26 17:40, Mark Rotteveel wrote: On 25/12/2019 12:11, Alex Peshkoff via Firebird-devel wrote: On 2019-12-11 18:06, Mark Rotteveel wrote: In other words, it looks like the mapping: of INTEGER-backed types 1. ignores subtype information and Ignoring subtype is as designed here.

Re: [Firebird-devel] SET BIND OF for NUMERIC / DECIMAL

2019-12-26 Thread Mark Rotteveel
On 25/12/2019 12:11, Alex Peshkoff via Firebird-devel wrote: On 2019-12-11 18:06, Mark Rotteveel wrote: In other words, it looks like the mapping: of INTEGER-backed types 1. ignores subtype information and Ignoring subtype is as designed here. The aim of SET BIND is to help client deal

Re: [Firebird-devel] SET BIND OF for NUMERIC / DECIMAL

2019-12-25 Thread Alex Peshkoff via Firebird-devel
On 2019-12-11 18:06, Mark Rotteveel wrote: In other words, it looks like the mapping: of INTEGER-backed types 1. ignores subtype information and Ignoring subtype is as designed here. The aim of SET BIND is to help client deal with fields values in cases when it for some reason can not

[Firebird-devel] SET BIND OF for NUMERIC / DECIMAL

2019-12-11 Thread Mark Rotteveel
The SET BIND OF (and isc_dpb_set_bind) behaviour for NUMERIC / DECIMAL is a bit odd to me: For example (using isc_dpb_set_bind) NUMERIC to VARCHAR will map: - NUMERIC(n, *) where 5 <= n <= 9 - DECIMAL(n, *) where n <= 9 - INTEGER Given the behaviour for other types, I would expect to map: - NUM

Re: [Firebird-devel] SET BIND OF

2019-12-09 Thread Alex Peshkoff via Firebird-devel
On 2019-12-08 19:57, Simonov Denis via Firebird-devel wrote: SQL> SET BIND OF DECFLOAT(16) TO CHAR; SQL> SQL> select CON>   NORMALIZE_DECFLOAT(4300) as n1, CON>   QUANTIZE(2, 9.9) as n2, CON>   COMPARE_DECFLOAT(2, 2) as n3, CON>   TOTALORDER(1.0, 1) as n4 CON> from rdb$database; N1 

Re: [Firebird-devel] SET BIND OF

2019-12-08 Thread Simonov Denis via Firebird-devel
Alex Peshkoff via Firebird-devel писал(а) в своём письме Sun, 08 Dec 2019 18:59:12 +0300: On 2019-12-08 16:39, Simonov Denis via Firebird-devel wrote: Alex Peshkoff via Firebird-devel wrote Sun, 08 Dec 2019 15:12:03 +0300: Thank you, not needed - fixed that. Fixed, but not completely

Re: [Firebird-devel] SET BIND OF

2019-12-08 Thread Alex Peshkoff via Firebird-devel
On 2019-12-08 16:56, Mark Rotteveel wrote: On 08/12/2019 14:39, Simonov Denis via Firebird-devel wrote: Alex Peshkoff via Firebird-devel wrote Sun, 08 Dec 2019 15:12:03 +0300: Thank you, not needed - fixed that. Fixed, but not completely. SET BIND OF DECFLOAT(16) NATIVE; -- work OK But

Re: [Firebird-devel] SET BIND OF

2019-12-08 Thread Alex Peshkoff via Firebird-devel
On 2019-12-08 16:39, Simonov Denis via Firebird-devel wrote: Alex Peshkoff via Firebird-devel wrote Sun, 08 Dec 2019 15:12:03 +0300: Thank you, not needed - fixed that. Fixed, but not completely. SET BIND OF DECFLOAT(16) NATIVE; -- work OK But SET BIND OF DECFLOAT(16) TO CHAR; select

Re: [Firebird-devel] SET BIND OF

2019-12-08 Thread Alex Peshkoff via Firebird-devel
On 2019-12-08 16:55, Mark Rotteveel wrote: On 08/12/2019 13:12, Alex Peshkoff via Firebird-devel wrote: On 2019-12-07 18:18, Simonov Denis via Firebird-devel wrote: I try snapshot 4.0.0.1683. Basically, the new SET BIND OF statement works as expected. But using a form to return a native type do

Re: [Firebird-devel] SET BIND OF

2019-12-08 Thread Mark Rotteveel
On 08/12/2019 14:39, Simonov Denis via Firebird-devel wrote: Alex Peshkoff via Firebird-devel wrote Sun, 08 Dec 2019 15:12:03 +0300: Thank you, not needed - fixed that. Fixed, but not completely. SET BIND OF DECFLOAT(16) NATIVE; -- work OK But SET BIND OF DECFLOAT(16) TO CHAR; When yo

Re: [Firebird-devel] SET BIND OF

2019-12-08 Thread Mark Rotteveel
On 08/12/2019 13:12, Alex Peshkoff via Firebird-devel wrote: On 2019-12-07 18:18, Simonov Denis via Firebird-devel wrote: I try snapshot 4.0.0.1683. Basically, the new SET BIND OF statement works as expected. But using a form to return a native type does not work. SET BIND OF DECFLOAT (34) TO

Re: [Firebird-devel] SET BIND OF

2019-12-08 Thread Simonov Denis via Firebird-devel
Alex Peshkoff via Firebird-devel wrote Sun, 08 Dec 2019 15:12:03 +0300: Thank you, not needed - fixed that. Fixed, but not completely. SET BIND OF DECFLOAT(16) NATIVE; -- work OK But SET BIND OF DECFLOAT(16) TO CHAR; select NORMALIZE_DECFLOAT(4300) as n1, QUANTIZE(2, 9.9) as n2,

Re: [Firebird-devel] SET BIND OF

2019-12-08 Thread Alex Peshkoff via Firebird-devel
On 2019-12-07 18:18, Simonov Denis via Firebird-devel wrote: I try snapshot 4.0.0.1683. Basically, the new SET BIND OF statement works as expected. But using a form to return a native type does not work. SET BIND OF DECFLOAT (34) TO CHAR (46); - OK SET BIND OF DECFLOAT (34) NATIVE; Can not co

[Firebird-devel] SET BIND OF

2019-12-07 Thread Simonov Denis via Firebird-devel
I try snapshot 4.0.0.1683. Basically, the new SET BIND OF statement works as expected. But using a form to return a native type does not work. SET BIND OF DECFLOAT (34) TO CHAR (46); - OK SET BIND OF DECFLOAT (34) NATIVE; Can not convert decfloat (34) to unknown. In addition, I did not see th