Re: [Firebird-devel] Named parameters in client libraries

2022-08-18 Thread Dimitry Sibiryakov
Mark Rotteveel wrote 18.08.2022 9:37: I'd suggest looking at what other database systems that do have named parameters currently do. My guess is that they either: 1) don't allow mixing types 2) use the most specific type that is compatible with all positions, otherwise error 3) use the

Re: [Firebird-devel] Named parameters in client libraries

2022-08-18 Thread Tony Whyman
IBX for Lazaus follows the original Deplhi IBX approach of adopting PSQL syntax for named parameters. For example:Select * From EMPLOYEE where EMP_NO = :KEYVALUE;It also allows for parameter names  that are case sensitive and which contain special characters by enclosing the parameter name in

Re: [Firebird-devel] Named parameters in client libraries

2022-08-18 Thread Adriano dos Santos Fernandes
On 18/08/2022 18:53, Tony Whyman wrote: > IBX for Lazaus follows the original Deplhi IBX approach of adopting PSQL > syntax for named parameters. Can a name be used more than once, and if yes, how is its type deduction? Adriano Firebird-Devel mailing list, web interface at

Re: [Firebird-devel] Named parameters in client libraries

2022-08-18 Thread Adriano dos Santos Fernandes
On 18/08/2022 04:37, Mark Rotteveel wrote: > My guess is that they either: > > 1) don't allow mixing types > 2) use the most specific type that is compatible with all positions, > otherwise error > 3) use the first position > 4) use the last position > > I think rule 2 is probably the best, but

Re: [Firebird-devel] Named parameters in client libraries

2022-08-18 Thread Adriano dos Santos Fernandes
On 18/08/2022 04:01, Mark Rotteveel wrote: > On 18-08-2022 04:02, Adriano dos Santos Fernandes wrote: >> How are client libraries (Jaybird, .NET Provider, Delphi ones) >> describing its named parameters to their users? >> >> I mean, given this SQL: >> >> select * >>    from rdb$database >>   

Re: [Firebird-devel] Named parameters in client libraries

2022-08-18 Thread Adriano dos Santos Fernandes
On 18/08/2022 04:42, Jiří Činčura wrote: > In .NET parameters are named `@param`, aka the delimiter is `@`. > >> I suppose you transform this to: >> >> select * >> from rdb$database >> where ? = 1 or ? = '2' > > Correct. > >> Which will map to two Firebird parameters with different types. >

Re: [Firebird-devel] Named parameters in client libraries

2022-08-18 Thread Mark Rotteveel
On 18-08-2022 04:02, Adriano dos Santos Fernandes wrote: How are client libraries (Jaybird, .NET Provider, Delphi ones) describing its named parameters to their users? I mean, given this SQL: select * from rdb$database where :param = 1 or :param = '2' We have here single name used in

Re: [Firebird-devel] Named parameters in client libraries

2022-08-18 Thread Mark Rotteveel
On 18-08-2022 04:02, Adriano dos Santos Fernandes wrote: And what type (and the deduction rules) this parameter will be described as? I'd suggest looking at what other database systems that do have named parameters currently do. My guess is that they either: 1) don't allow mixing types 2)

Re: [Firebird-devel] Named parameters in client libraries

2022-08-18 Thread Jiří Činčura
In .NET parameters are named `@param`, aka the delimiter is `@`. > I suppose you transform this to: > > select * > from rdb$database > where ? = 1 or ? = '2' Correct. > Which will map to two Firebird parameters with different types. Correct. > But for the user of the library, I suppose