Subject | Re: [firebird-support] Two newbie questions |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2004-03-19T08:17:22Z |
On 18 Mar 2004 at 8:53, FrankE@... wrote:
constant? If you are writing a Stored Procedure, use assignment.
FOREIGN KEY (x, y) REFERENCES z (ID, OTHER_ID)?
SY, Dimitry Sibiryakov.
>1. How do you do a 'select 50 * 100'. Firebird seems to require a 'from'RDB$DATABASE usually is used. But why you want to select a
>clause. Is there some standard one row dummy table to use for this purpose?
constant? If you are writing a Stored Procedure, use assignment.
>I want to do an insert on a table that has a generator and I need to getThat's right way to go.
>the generated value back. I was going to do a 'select gen_id(some_gen, 1)'
>and then do the insert with the value that was returned.
>2. I would like to do a 'CONSTRAINT SOME_CONSTRAINT CHECK (x = (SELECTI'd use FOREIGN KEYs. Did you try CONSTRAINT SOME_CONSTRAINT
>z.ID FROM Z z WHERE z.OTHER_ID = y))' where x and y are columns from the
>row being inserted. Basically x and y have a 1..* relationship in a
>different table (Z) and I want to make sure that is enforced when adding to
>the table in question.I believe that I will have to use an insert trigger
>for this check instead.
FOREIGN KEY (x, y) REFERENCES z (ID, OTHER_ID)?
SY, Dimitry Sibiryakov.