Subject | Re: [firebird-support] Getting number of records affected ... |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2003-12-18T07:20:30Z |
On 17 Dec 2003 at 4:34, Anand wrote:
Dmitri Popov:
DECLARE VARIABLE MY_PK_VALUE INTEGER;
.............
MY_PK_VALUE = NULL;
FOR SELECT PK FROM MY_TABLE WHERE ....
INTO :MY_PK_VALUE AS CURSOR TMPCURSOR
DO
UPDATE MY_TABLE SET ... WHERE CURRENT OF TMPCURSOR;
IF (MY_PK_VALUE IS NULL) THEN
INSERT INTO MY_TABLE .....
...........
This variant has proved itself as the fastest.
SY, Dimitry Sibiryakov.
>How do I find out the number of records affected by an actionBesides other suggestions, I must tell you another variant by
>query?
Dmitri Popov:
DECLARE VARIABLE MY_PK_VALUE INTEGER;
.............
MY_PK_VALUE = NULL;
FOR SELECT PK FROM MY_TABLE WHERE ....
INTO :MY_PK_VALUE AS CURSOR TMPCURSOR
DO
UPDATE MY_TABLE SET ... WHERE CURRENT OF TMPCURSOR;
IF (MY_PK_VALUE IS NULL) THEN
INSERT INTO MY_TABLE .....
...........
This variant has proved itself as the fastest.
SY, Dimitry Sibiryakov.