[firebird-support] There is a verb to supply identity columns?

2017-01-11 Thread hamacker sirhamac...@gmail.com [firebird-support]
Hi, All.

Colums identity in FB3, I love it!

But there is one thing missing.

I would like to know, if exists a verb to supply identity value to not
assume a literal value. Ex:

create table test (
   id integer generated by default as identity primary key,
   name varchar(15) );

insert into test (id, name) values (default, 'test#1'); // default, any,...
is there a verb to suppy identity column?

I know that I need to hidden fields identity, but it exists a possibility
to keep identity fields in sql for documentation, I will prefer this way.

If not, Ok. but I will send a ticket request. We never know, if I am alone
in universe.

thx4all.


Re: [firebird-support] There is a verb to supply identity columns?

2017-01-11 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 11-1-2017 12:00, hamacker sirhamac...@gmail.com [firebird-support] wrote:
> Colums identity in FB3, I love it!
>
> But there is one thing missing.
>
> I would like to know, if exists a verb to supply identity value to not
> assume a literal value. Ex:
>
> create table test (
>id integer generated by default as identity primary key,
>name varchar(15) );
>
> insert into test (id, name) values (default, 'test#1'); // default,
> any,... is there a verb to suppy identity column?

No, you currently need to do:

insert into test (name) values ('test#1');

> I know that I need to hidden fields identity, but it exists a
> possibility to keep identity fields in sql for documentation, I will
> prefer this way.
>
> If not, Ok. but I will send a ticket request. We never know, if I am
> alone in universe.

The SQL standard does have a feature like that, the . I have created a ticket: 
http://tracker.firebirdsql.org/browse/CORE-5449. For insert, the SQL 
standard says:

"An  that specifies DEFAULT VALUES is 
implicitly replaced by an  that specifies a 
 of the form VALUES 
(DEFAULT, DEFAULT, ..., DEFAULT) where the number of instances of 
“DEFAULT” equal to the number of columns of T."

If you follow the definition of insert (and update, merge, etc), you'll 
see that DEFAULT is a contextual value similar to CURRENT_USER etc, and 
means "use the default, or null if there is no default".

Mark
-- 
Mark Rotteveel


Re: [firebird-support] There is a verb to supply identity columns?

2017-01-11 Thread hamacker sirhamac...@gmail.com [firebird-support]
I knew it!
Never alone :)

I´m following your ticket, Mark.

Thanks.

2017-01-11 10:35 GMT-02:00 Mark Rotteveel m...@lawinegevaar.nl
[firebird-support] :

>
>
> On 11-1-2017 12:00, hamacker sirhamac...@gmail.com [firebird-support]
> wrote:
> > Colums identity in FB3, I love it!
> >
> > But there is one thing missing.
> >
> > I would like to know, if exists a verb to supply identity value to not
> > assume a literal value. Ex:
> >
> > create table test (
> > id integer generated by default as identity primary key,
> > name varchar(15) );
> >
> > insert into test (id, name) values (default, 'test#1'); // default,
> > any,... is there a verb to suppy identity column?
>
> No, you currently need to do:
>
> insert into test (name) values ('test#1');
>
> > I know that I need to hidden fields identity, but it exists a
> > possibility to keep identity fields in sql for documentation, I will
> > prefer this way.
> >
> > If not, Ok. but I will send a ticket request. We never know, if I am
> > alone in universe.
>
> The SQL standard does have a feature like that, the  value specification>. I have created a ticket:
> http://tracker.firebirdsql.org/browse/CORE-5449. For insert, the SQL
> standard says:
>
> "An  that specifies DEFAULT VALUES is
> implicitly replaced by an  that specifies a
>  of the form VALUES
> (DEFAULT, DEFAULT, ..., DEFAULT) where the number of instances of
> “DEFAULT” equal to the number of columns of T."
>
> If you follow the definition of insert (and update, merge, etc), you'll
> see that DEFAULT is a contextual value similar to CURRENT_USER etc, and
> means "use the default, or null if there is no default".
>
> Mark
>


Re: [firebird-support] There is a verb to supply identity columns?

2017-02-06 Thread hamacker sirhamac...@gmail.com [firebird-support]
thx for Adriano.

http://tracker.firebirdsql.org/browse/CORE-5449

Any possibility to be fixed in FB3 too?

2017-01-11 11:18 GMT-02:00 hamacker :

> I knew it!
> Never alone :)
>
> I´m following your ticket, Mark.
>
> Thanks.
>
> 2017-01-11 10:35 GMT-02:00 Mark Rotteveel m...@lawinegevaar.nl
> [firebird-support] :
>
>>
>>
>> On 11-1-2017 12:00, hamacker sirhamac...@gmail.com [firebird-support]
>> wrote:
>> > Colums identity in FB3, I love it!
>> >
>> > But there is one thing missing.
>> >
>> > I would like to know, if exists a verb to supply identity value to not
>> > assume a literal value. Ex:
>> >
>> > create table test (
>> > id integer generated by default as identity primary key,
>> > name varchar(15) );
>> >
>> > insert into test (id, name) values (default, 'test#1'); // default,
>> > any,... is there a verb to suppy identity column?
>>
>> No, you currently need to do:
>>
>> insert into test (name) values ('test#1');
>>
>> > I know that I need to hidden fields identity, but it exists a
>> > possibility to keep identity fields in sql for documentation, I will
>> > prefer this way.
>> >
>> > If not, Ok. but I will send a ticket request. We never know, if I am
>> > alone in universe.
>>
>> The SQL standard does have a feature like that, the > value specification>. I have created a ticket:
>> http://tracker.firebirdsql.org/browse/CORE-5449. For insert, the SQL
>> standard says:
>>
>> "An  that specifies DEFAULT VALUES is
>> implicitly replaced by an  that specifies a
>>  of the form VALUES
>> (DEFAULT, DEFAULT, ..., DEFAULT) where the number of instances of
>> “DEFAULT” equal to the number of columns of T."
>>
>> If you follow the definition of insert (and update, merge, etc), you'll
>> see that DEFAULT is a contextual value similar to CURRENT_USER etc, and
>> means "use the default, or null if there is no default".
>>
>> Mark
>>
>