INSERT UPDATE
Posted: 04.03.2012, 22:57
When we insert a a row normaly we have a primarykey and most times is a sequencial number.
insert into table aa(autoinc integer) returning autoinc;
What im asking is when we insert or update it returns automatic the row, without using zupdatesql (zupdatesql is useful too).
This should be done because is useful.
( we avoid to move the cursor by refreshing atable.refresh, and when we use zupdatesql after insert we dont have the primarykey id any way so we cant refresh from an insert , or if we have a zquery like select * from (select *,sum(a+b) from table1) where date<=aDate) where Date=aDate we cant directly insert into the table1 using zupdate but we cant the use primarykey on refreshsql because it doesnt got it from server ....
and using zsequence if we use 10 call at same time it will return the same number so it does fix the problem.
Normaly autoinc are controled on server side on a triger so ... is the best way.
At least add to zupdatesql or even a descendant component the ability to do on insert update (insert into table aa(autoinc integer) returning autoinc;).
insert into table aa(autoinc integer) returning autoinc;
What im asking is when we insert or update it returns automatic the row, without using zupdatesql (zupdatesql is useful too).
This should be done because is useful.
( we avoid to move the cursor by refreshing atable.refresh, and when we use zupdatesql after insert we dont have the primarykey id any way so we cant refresh from an insert , or if we have a zquery like select * from (select *,sum(a+b) from table1) where date<=aDate) where Date=aDate we cant directly insert into the table1 using zupdate but we cant the use primarykey on refreshsql because it doesnt got it from server ....
and using zsequence if we use 10 call at same time it will return the same number so it does fix the problem.
Normaly autoinc are controled on server side on a triger so ... is the best way.
At least add to zupdatesql or even a descendant component the ability to do on insert update (insert into table aa(autoinc integer) returning autoinc;).