Subject | Re: [IBO] Probably a stupid question |
---|---|
Author | Helen Borrie |
Post date | 2004-12-14T02:46:55Z |
At 02:08 PM 14/12/2004 +1300, you wrote:
//
Prepare; // !!!!!!! Otherwise IBO doesn't know about the metadata.
>Hi AllUpdateQuery.Keylinks.Add('WORKREF');
>
>This is probably a stupid question but. I have the following SQL that fails
>on execute with a primary key violation. Code snip follows.....
>
>
>UpdateQuery.GeneratorLinks.Add('WORKREF=WORKFILES_GEN');
>UpdateQuery.SQL.Text := 'INSERT INTO WorkGlTrans ' +
> '(WORKREF, CONTROLREF,
>TRANSDATE,.......) ' +
> 'VALUES (:WORKREF,
>:CONTROLREF, :TRANSDATE, .......); ';
//
Prepare; // !!!!!!! Otherwise IBO doesn't know about the metadata.
>// Set params (except workref)
>.....
>
>UpdateQuery.Exec;
>
>WorkRef is the PK for this table. UpdateQuery is an instance of an IBOQuery
>that is created in code.
>
>I have persistant IBOQuerys that have similar SQL and settings, they run
>fine. What have I missed here?
>
>Confused and feeling stupid :)
>
>Rob Martin
>Software Engineer