Re: [Firebird-devel] Set bind for numeric(38) for sum function

2020-09-02 Thread Jiří Činčura
> That's parser error. Dammit. I thought it's complaining about not knowing int128 (expecting numeric(38)). :o -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel

Re: [Firebird-devel] Set bind for numeric(38) for sum function

2020-09-02 Thread Alex Peshkoff via Firebird-devel
On 2020-09-02 15:51, Dimitry Sibiryakov wrote: 02.09.2020 14:49, Alex Peshkoff via Firebird-devel wrote: You've forgotten keyword OF in SET BIND statement   I wonder why parser don't throw error in this case... SQL> set bind int128 to legacy; Statement failed, SQLSTATE = 42000 Dynamic SQL

Re: [Firebird-devel] Set bind for numeric(38) for sum function

2020-09-02 Thread Dimitry Sibiryakov
02.09.2020 14:49, Alex Peshkoff via Firebird-devel wrote: You've forgotten keyword OF in SET BIND statement I wonder why parser don't throw error in this case... -- WBR, SD. Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel

Re: [Firebird-devel] Set bind for numeric(38) for sum function

2020-09-02 Thread Alex Peshkoff via Firebird-devel
On 2020-09-02 14:06, Jiří Činčura wrote: Nobody? Seems like a bug to me... You've forgotten keyword OF in SET BIND statement: SQL> set sqlda_display on; SQL> select sum(cast(1 as bigint)) from rdb$database; INPUT message field count: 0 OUTPUT message field count: 1 01: sqltype: 32752

Re: [Firebird-devel] Set bind for numeric(38) for sum function

2020-09-02 Thread Jiří Činčura
Nobody? Seems like a bug to me... -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel

Re: [Firebird-devel] Set bind for numeric(38) for sum function

2020-08-31 Thread Jiří Činčura
>Windows snapshot build seems to be broken for now, use artefacts from CI: SQL> select sum(cast(1 as bigint)) from rdb$database; INPUT message field count: 0 OUTPUT message field count: 1 01: sqltype: 32752 INT128 Nullable scale: 0 subtype: 0 len: 16 : name: SUM alias: SUM : table:

Re: [Firebird-devel] Set bind for numeric(38) for sum function

2020-08-31 Thread Dimitry Sibiryakov
31.08.2020 14:28, Jiří Činčura wrote: The firebirdsql.org show Beta 2:https://snipboard.io/Rbgm7L.jpg . Windows snapshot build seems to be broken for now, use artefacts from CI: https://github.com/FirebirdSQL/firebird/actions/runs/231772533 -- WBR, SD. Firebird-Devel mailing list, web

Re: [Firebird-devel] Set bind for numeric(38) for sum function

2020-08-31 Thread Jiří Činčura
>Current version is RC1. The firebirdsql.org show Beta 2: https://snipboard.io/Rbgm7L.jpg . -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel

Re: [Firebird-devel] Set bind for numeric(38) for sum function

2020-08-31 Thread Dimitry Sibiryakov
31.08.2020 14:14, Jiří Činčura wrote: SQL> show version; ISQL Version: WI-T4.0.0.1963 Firebird 4.0 Beta 2 Current version is RC1. -- WBR, SD. Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel

[Firebird-devel] Set bind for numeric(38) for sum function

2020-08-31 Thread Jiří Činčura
Hi, why is the result still numeric(38) and not numeric(18) (the "legacy" type)? SQL> set bind of numeric(38) to legacy; SQL> select sum(cast(1 as bigint)) from rdb$database; INPUT message field count: 0 OUTPUT message field count: 1 01: sqltype: 32752 NUMERIC(38) Nullable scale: 0 subtype: 0

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

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

[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

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

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

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

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

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

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

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: -

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

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

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

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

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)

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

[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