Subject | Re: [firebird-support] Re: generators |
---|---|
Author | Pavol STÁREK PSŽ |
Post date | 2004-05-17T15:48:32Z |
Alexandre Benson Smith wrote:
this feature will be great... For now i use SP to get generated number
and then insert it... Not very nice.
p.
>Luiz Rafael Culik Guimaraes wrote:Hi,
>
>
>
>>Dear Friends
>>
>>Complementing previus email;
>>Or an stored procedure would be better to get the last value generated by
>>an generator. this this is better, any one has such procedure to share
>>
>>Regards
>>Luiz
>>
>>
>>
>>
>
>Luiz,
>
>If you want a consistent value (I don't think a reason why you could
>want an inconsistent value) you should get the generator before you send
>the insert, and suplly the generator value on your insert, Or you could
>after the post search the Table on another unique column for the PK
>(feed by the Generator) value.
>
>The common aproach is, get the generator value and put it on your PK in
>your client application.
>
>As generator are outside transaction control, when you get the value you
>will perhaps get the value already changed by others.
>
>There is a feature that are being developed that will make it easier and
>avoid a two statments to be sent to the server, that is :
>
>insert into aTable (ColumnA, ColumnB, ColumnC) values (a, b, c) returns
>(or returning don't remember exactly) ColumnA
>
>see you !
>
>
>
this feature will be great... For now i use SP to get generated number
and then insert it... Not very nice.
p.