Board index » delphi » Error with IBX 4.6 and ClientDataset

Error with IBX 4.6 and ClientDataset

Ive got an error when trying to ApplyUpdates in aClientDataSet ->
CDS.ApplyUpdates(-1)

Exception class EIBClientError with Message 'SQL Parse Error: Parameter Name
Expected'

This only occurs with IBX 4.6

TIA
Roberto

 

Re:Error with IBX 4.6 and ClientDataset


Change in IBCustomDataSet the PSExecuteStatement to

function TIBCustomDataSet.PSExecuteStatement(const ASQL: string; AParams:
TParams;
  ResultSet: Pointer = nil): Integer;
var
  FQuery: TIBDataSet;
  i : Integer;
begin
  if Assigned(ResultSet) then
  begin
    TDataSet(ResultSet^) := TIBDataSet.Create(nil);
    with TIBDataSet(ResultSet^) do
    begin
      Database := Database;
      Transaction := Transaction;
      QSelect.GenerateParamNames := true;
      SelectSQL.Text := ASQL;
      for i := 0 to AParams.Count - 1 do
        Params[i].Value := AParams[i].Value;
      Open;
      Result := RowsAffected;
    end;
  end
  else
  begin
    FQuery := TIBDataSet.Create(nil);
    try
      FQuery.Database := Database;
      FQuery.Transaction := Transaction;
      FQuery.QSelect.GenerateParamNames := True;
      FQuery.SelectSQL.Text := ASQL;
      for i := 0 to AParams.Count - 1 do
        FQuery.Params[i].Value := AParams[i].Value;
      FQuery.ExecSQL;
      Result := FQuery.RowsAffected;
    finally
      FQuery.Free;
    end;
  end;
end;

and statically link.  This should solve the issue with the Parameter name error.

Quote
Roberto Manfroi wrote:

> Ive got an error when trying to ApplyUpdates in aClientDataSet ->
> CDS.ApplyUpdates(-1)

> Exception class EIBClientError with Message 'SQL Parse Error: Parameter Name
> Expected'

> This only occurs with IBX 4.6

> TIA
> Roberto

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:Error with IBX 4.6 and ClientDataset


Will this be fixed in the next release ?

So yes, When will it be released.

Regards,
Raf Schandevyl
"Jeff Overcash (TeamB)" <overc...@onramp.net> wrote in message
news:3B39F6AD.C56B2195@onramp.net...

Quote
> Change in IBCustomDataSet the PSExecuteStatement to

> function TIBCustomDataSet.PSExecuteStatement(const ASQL: string; AParams:
> TParams;
>   ResultSet: Pointer = nil): Integer;
> var
>   FQuery: TIBDataSet;
>   i : Integer;
> begin
>   if Assigned(ResultSet) then
>   begin
>     TDataSet(ResultSet^) := TIBDataSet.Create(nil);
>     with TIBDataSet(ResultSet^) do
>     begin
>       Database := Database;
>       Transaction := Transaction;
>       QSelect.GenerateParamNames := true;
>       SelectSQL.Text := ASQL;
>       for i := 0 to AParams.Count - 1 do
>         Params[i].Value := AParams[i].Value;
>       Open;
>       Result := RowsAffected;
>     end;
>   end
>   else
>   begin
>     FQuery := TIBDataSet.Create(nil);
>     try
>       FQuery.Database := Database;
>       FQuery.Transaction := Transaction;
>       FQuery.QSelect.GenerateParamNames := True;
>       FQuery.SelectSQL.Text := ASQL;
>       for i := 0 to AParams.Count - 1 do
>         FQuery.Params[i].Value := AParams[i].Value;
>       FQuery.ExecSQL;
>       Result := FQuery.RowsAffected;
>     finally
>       FQuery.Free;
>     end;
>   end;
> end;

> and statically link.  This should solve the issue with the Parameter name
error.

> Roberto Manfroi wrote:

> > Ive got an error when trying to ApplyUpdates in aClientDataSet ->
> > CDS.ApplyUpdates(-1)

> > Exception class EIBClientError with Message 'SQL Parse Error: Parameter
Name
> > Expected'

> > This only occurs with IBX 4.6

> > TIA
> > Roberto

> --
> Jeff Overcash (TeamB)   I don't think there are any Russians
> (Please do not email    And there ain't no Yanks
>  me directly unless     Just corporate criminals
>  asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:Error with IBX 4.6 and ClientDataset


After doing this I get the error field not found.

"Jeff Overcash (TeamB)" <overc...@onramp.net> wrote in message
news:3B39F6AD.C56B2195@onramp.net...

Quote
> Change in IBCustomDataSet the PSExecuteStatement to

> function TIBCustomDataSet.PSExecuteStatement(const ASQL: string; AParams:
> TParams;
>   ResultSet: Pointer = nil): Integer;
> var
>   FQuery: TIBDataSet;
>   i : Integer;
> begin
>   if Assigned(ResultSet) then
>   begin
>     TDataSet(ResultSet^) := TIBDataSet.Create(nil);
>     with TIBDataSet(ResultSet^) do
>     begin
>       Database := Database;
>       Transaction := Transaction;
>       QSelect.GenerateParamNames := true;
>       SelectSQL.Text := ASQL;
>       for i := 0 to AParams.Count - 1 do
>         Params[i].Value := AParams[i].Value;
>       Open;
>       Result := RowsAffected;
>     end;
>   end
>   else
>   begin
>     FQuery := TIBDataSet.Create(nil);
>     try
>       FQuery.Database := Database;
>       FQuery.Transaction := Transaction;
>       FQuery.QSelect.GenerateParamNames := True;
>       FQuery.SelectSQL.Text := ASQL;
>       for i := 0 to AParams.Count - 1 do
>         FQuery.Params[i].Value := AParams[i].Value;
>       FQuery.ExecSQL;
>       Result := FQuery.RowsAffected;
>     finally
>       FQuery.Free;
>     end;
>   end;
> end;

> and statically link.  This should solve the issue with the Parameter name
error.

> Roberto Manfroi wrote:

> > Ive got an error when trying to ApplyUpdates in aClientDataSet ->
> > CDS.ApplyUpdates(-1)

> > Exception class EIBClientError with Message 'SQL Parse Error: Parameter
Name
> > Expected'

> > This only occurs with IBX 4.6

> > TIA
> > Roberto

> --
> Jeff Overcash (TeamB)   I don't think there are any Russians
> (Please do not email    And there ain't no Yanks
>  me directly unless     Just corporate criminals
>  asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:Error with IBX 4.6 and ClientDataset


What is the exact error?  Also have you watched with the SQLMonitor what is
being sent and how the SQL is being formed?  If you have any floating point
columns, you should be setting the Provider to update upWhereKey and on the
Dataset set the pfInKey to true for all the key fields.  Including a floating
point in the where clause can cause IB to not find something due to the natural
inaccuracies in representing floating point rational numbers in binary form.

Quote
Raf Schandevyl wrote:

> After doing this I get the error field not found.

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:Error with IBX 4.6 and ClientDataset


I will be probably releasing a 4.61 that addresses this in the next couple of
days.  I want to see if anything else falls out that requires a quick fix so I
don't have to do any others right away.

Quote
Raf Schandevyl wrote:

> Will this be fixed in the next release ?

> So yes, When will it be released.

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:Error with IBX 4.6 and ClientDataset


I had the same error in an app, and after the patch it seems to work fine.

Ernesto Cullen

"Roberto Manfroi" <rober...@italnet.com.br> escribi en el mensaje
news:3b39f16c_2@dnews...

Quote
> Ive got an error when trying to ApplyUpdates in aClientDataSet ->
> CDS.ApplyUpdates(-1)

> Exception class EIBClientError with Message 'SQL Parse Error: Parameter
Name
> Expected'

> This only occurs with IBX 4.6

> TIA
> Roberto

Other Threads