Re: Base.HSQL: Reference, Call Identity
Wolfgang Schaible <[email protected]>
| Newsgroups | gmane.comp.openoffice.dba.user |
|---|---|
| Organization | atHome |
| Message-ID | <[email protected]> |
hi Drew, Am Sunday 21 May 2006 18:21 schrieb Andrew Jensen: <> > So for your > 1:n table, an insert of the 'n' record needs to happen BEFORE you > call identity(), which thtn tells you what the value just used > was. If I am reading your message correctly, that is not what you > are looking for. That's right. At the moment I use the DB as a thumb table. I was frustrated using 'Forms' und wrote the code in a very short time. The application is running, all are happy but now I want to learn, why it works. > But then if the primary key in te 'n' table is > of type IDENTITY, then you don't have to supply any value - the > engine is going to do that. ^^^^^^^^^^^^^^^^ With other words, all what I have to do is alter the 'n'-table with <ALTER TABLE 'n' ADD FOREIGN KEY refTo1 REFERENCES '1'(identityKey)> and remove my own solution? Does 'oStmt.executeUpdate(..)' allow the command above? Will <ADD FOREIGN KEY> destroy the current DBs (the field 'refTo1' exists)? > So I am not really sure I am reading > your message properly. Your interpretation of my english is good :-) Thanks Wolfgang