Subject | Re: [firebird-support] PK and calculations on server side |
---|---|
Author | Ann W. Harrison |
Post date | 2004-11-22T19:21:41Z |
At 01:19 PM 11/22/2004, Gediminas wrote:
B and the primary key is defined as A,B.
error something like "attempt to store duplicate value visible
to active transaction"? If so, you've got another active
transaction. It can still see the records you deleted, so you
can't replace them yet.
input and return a single value. You can not, for example, create
a stddev UDF because a UDF can't take a record set as input. Depending
on the logic, you may need to implement some functions as UDF's and
call them from stored procedures.
Regards,
Ann
>have two questions:I hope you mean that you have a table with fields A and
>table has 2 columns and both them defined PK.
B and the primary key is defined as A,B.
>Everything is ok untilThat's unusual.
>table gets empty (removed all data) and insert is called - got error
>saying, that PK is violated & etc info.
> Is this caused by the fact,No, as far as I know there is no such requirement. Was the
>that PK consists of all (2) table columns?
error something like "attempt to store duplicate value visible
to active transaction"? If so, you've got another active
transaction. It can still see the records you deleted, so you
can't replace them yet.
>or it's strongly advised toNo.
>have additional ID column for the table? FB1.5.x
>need to implement computations on the server side - fear, that some ofStored procedures can work on selected data sets. UDF's take fixed
>them would require complex logic and work with the selected dataset's.
>How to implement them - use SQL in the SP's (when question, how to
>work with the selected dataset's - create internal views for them?) or
>to write UDF's? what about performance in both cases? any other
>underwater rocks?
input and return a single value. You can not, for example, create
a stddev UDF because a UDF can't take a record set as input. Depending
on the logic, you may need to implement some functions as UDF's and
call them from stored procedures.
Regards,
Ann