Subject | Re: [IBO] IBOQuery and Refresh |
---|---|
Author | Petr Hartman |
Post date | 2007-09-12T13:55:12Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
that the SQL statement is probably ok, IBOQuery is opened, but the
following Refresh causes the error.
Delphi's error message.
means that the behaviour was the same and the error after Refresh
also causes.
I noticed that in procedure GetSeekCursor (unit IB_Components,
function TIB_BDataset.SysLookupKeyForBufferFields) there is this
piece of code:
for ii := 0 to Params.PSQLDA.SQLn - 1 - tmpPrms - incAdj - SPrmCnt do
PSeekDA.SQLVAR[ii + tmpPrms + KeyFields.PSQLDA.SQLn] :=
Params.PSQLDA.SQLVAR[ii + tmpPrms];
If I set OldParameterOrdering = 1, Params[0].FieldName = 'DATUM',
Params[1].FieldName = 'TYP' and everything is ok.
If I set OldParameterOrdering = 0, the order of these parameters is
inverse (Params[0].FieldName = 'TYP', Params[1].FieldName = 'DATUM')
and Refresh causes the error.
Thanks
Petr
> So, start with the syntax. For future-proofing use either allI tried it, but the behaviour was the same. I'd like to emphasize,
> relation aliases or all table names for identifiers, since Fb 2 and
> above won't allow them to be intermixed.
>
> e.g., in this statement you need to qualify all of the fields:
> select
> TAB1.ID,
> TAB1.ZKR,
> TAB1.DATUM,
> (select TAB2.NAZ from TAB2
> where TAB2.ID = TAB1.ID and TAB2.TYP = :typ)
> as NAZ
> from TAB1
> WHERE TAB1.ID= :id
that the SQL statement is probably ok, IBOQuery is opened, but the
following Refresh causes the error.
> Now, double-check your metadata in TAB2, to make sure that TYP isTYP is really an INTEGER
> actually an integer.
> >/*---IB_Monitor uses FormatDateTime( 'dd mmm yyyy', ...) function for it.
> >EXECUTE STATEMENT
> >TR_HANDLE = 3830508
> >STMT_HANDLE = 3830660
> >PARAMS = [ Version 1 SQLd 2 SQLn 2
> > [TYP] = 2
> > [DATUM] = '12 IX 2007' ] <---- W H A T I S T H I S ? At
> > best, it is a string (not a date, not a date literal).
> Sorry, that's quite correct. Would you please test it with thesame
> triple-quoted value in the right side of the assignment, but useIt doesn't work (''1.1.2007'' is not a valid date and time). It's
> AsString instead?
Delphi's error message.
>I tried it with Date(). The behaviour was the same. "Without success"
> >I tried also
> > IBOQuery1.ParamByName('DATUM').AsDateTime := Date;
> >without success.
>
> Try it with the full function syntax, Date(). And please describe
> what "without success" means.
means that the behaviour was the same and the error after Refresh
also causes.
I noticed that in procedure GetSeekCursor (unit IB_Components,
function TIB_BDataset.SysLookupKeyForBufferFields) there is this
piece of code:
for ii := 0 to Params.PSQLDA.SQLn - 1 - tmpPrms - incAdj - SPrmCnt do
PSeekDA.SQLVAR[ii + tmpPrms + KeyFields.PSQLDA.SQLn] :=
Params.PSQLDA.SQLVAR[ii + tmpPrms];
If I set OldParameterOrdering = 1, Params[0].FieldName = 'DATUM',
Params[1].FieldName = 'TYP' and everything is ok.
If I set OldParameterOrdering = 0, the order of these parameters is
inverse (Params[0].FieldName = 'TYP', Params[1].FieldName = 'DATUM')
and Refresh causes the error.
Thanks
Petr