Subject | REPLACE, again |
---|---|
Author | Adriano dos Santos Fernandes |
Post date | 2006-08-15T19:26:10Z |
Hi!
Last time we discussed REPLACE if fb-devel, one user suggested another
syntax that's looking better for me:
REPLACE INTO <table> [(<field_list>)] VALUES (<value_list>) MATCHING
(<field_list>) [RETURNING <value_list>]
This syntax make the statement not dependent on a PK and hence it could
update more than one row.
It will be usable with views too.
Not depending on a PK, it could be implemented in DSQL with existing BLR
verbs, equivalent to:
update ....
if (row_count = 0) then
insert ...
As we don't support RETURNING more than one row yet, the generated RSE
of the update will be a singleton (only when RETURNING is used?).
Comments?
Adriano
Last time we discussed REPLACE if fb-devel, one user suggested another
syntax that's looking better for me:
REPLACE INTO <table> [(<field_list>)] VALUES (<value_list>) MATCHING
(<field_list>) [RETURNING <value_list>]
This syntax make the statement not dependent on a PK and hence it could
update more than one row.
It will be usable with views too.
Not depending on a PK, it could be implemented in DSQL with existing BLR
verbs, equivalent to:
update ....
if (row_count = 0) then
insert ...
As we don't support RETURNING more than one row yet, the generated RSE
of the update will be a singleton (only when RETURNING is used?).
Comments?
Adriano