Subject Re: Re[2]: [IBO] Problem after upgrade to IBO 4.0
Author Geoff Worboys
> No answers... I'm sure it worked with 3.6Di.
<...>
> >> After I upgraded to IBO 4, I'm getting an error of "Invalid
> >> BLR blablabla" when IBO tries to get the value from a
> >> generator defined in the GeneratorLinks property.
> >>
> >> I found that if I write the GeneratorLinks contents all in
> >> UPPERCASE it solves the problem... anyway, it looks like a bug.
>
> GW> Did you get any response/resolution to this?
>
> GW> Are you sure the problem did not exist in IBO3?


Well I can see the difference in the code in IB_Schema.pas

In IBO4 the name is converted as...
IB_Connection.mkVARIdent(TrimRight( stLitCriteria( GeneratorName )))

In IBO3 the name was converted as...
mkIdent ( Cn.SQLDialect, GeneratorName )


From recent conversations with Jason...

mkVARIdent is used when the given name is expected to be already set
exactly as required (including case) but without quotes. It will
simply add double quotes where necessary.

mkIdent is used to allow for lazy input. If quotes are supplied the
name is left asis otherwise if there are special characters (spaces
etc) or the name is a reserved name then quotes will be added and case
left asis. If there are no special characters the name will be
converted to uppercase and no quotes added.


GetGeneratorValue is called from various places - in most of them the
interpretation on the generator name is done prior to (or with) the
call to GetGeneratorValue. This leads me to think the best fix is...


In IBA_Dataset.IMP - use the IB_Connection.mkIdent function to
translate the name most appropriately...

procedure TIB_Dataset.SysGetServerDefaults;
...
if tmpCol.IsNull and GetGeneratorValue( IB_Connection,
IB_Transaction,

IB_Connection.mkIdent(GenName),
1,
GenValue ) then
...
if GetGeneratorValue( IB_Connection,
IB_Transaction,
IB_Connection.mkIdent(GenName),
1,
GenValue ) then


then in IB_Schema.pas - change so that it does no translation on the
supplied generator name (relying on the caller to setup the name
approprately.

function GetGeneratorValue( Cn: TIB_Connection;
...
GeneratorSQL := 'SELECT GEN_ID ( ' +
GeneratorName + ', ' +
IntToStr( Increment ) + ' )'#13#10 +
'FROM RDB$DATABASE';



Hopefully you will still be able to understand this after the email
wraps the lines.


Jason, if you can confirm this as appropriate let me know if you want
me to send you updated files.


Geoff Worboys
Telesis Computing