[DUG] Delphi SQL issue

Hayward, Phillip Phillip.Hayward at chh.co.nz
Fri Feb 23 17:13:04 NZDT 2007


I am using the following piece of code on a Test server and am trying to
install it on the Production server.

      with dm.qryUpdate do
      begin
        SQL.Clear;
        Sql.Add('Insert into EffluentLevels');
Sql.Add('(DT,EFFLUENT,EFFLUENTMULTIPLIER,SEWAGE,SEWAGEMULTIPLIER,FLUSH1,
FLUSH1MULTIPLIER,TOTALEFFLUENT,TOTALEFFLUENTMUILTIPLIER,TOTALCHIP,TOTALC
HIPMULTIPLIIER)');
        Sql.Add('Values
(:DT,:EFFLUENT,:EFFLUENTMULTIPLIER,:SEWAGE,:SEWAGEMULTIPLIER,:FLUSH1,:FL
USH1MULTIPLIER,:TOTALEFFLUENT,:TOTALEFFLUENTMUILTIPLIER,:TOTALCHIP,:TOTA
LCHIPMULTIPLIIER)');
        ParamByName('DT').AsDate := EffluentRec.DT;  //This works on
TestDB
        ParamByName('EFFLUENT').AsInteger := EffluentRec.effluent;
        ParamByName('EFFLUENTMULTIPLIER').AsInteger :=
EffluentRec.effluentMultiplier;
        ParamByName('SEWAGE').AsInteger := EffluentRec.sewage;
        ParamByName('SEWAGEMULTIPLIER').AsInteger :=
EffluentRec.sewageMultiplier;
        ParamByName('FLUSH1').AsInteger := EffluentRec.flush1;
        ParamByName('FLUSH1MULTIPLIER').AsInteger :=
EffluentRec.flush1Multiplier;
        ParamByName('TOTALEFFLUENT').AsInteger :=
EffluentRec.totalEffluent;
        ParamByName('TOTALEFFLUENTMUILTIPLIER').AsInteger :=
EffluentRec.totalEffluentMuiltiplier;
        ParamByName('TOTALCHIP').AsInteger := EffluentRec.totalChip;
        ParamByName('TOTALCHIPMULTIPLIIER').AsInteger :=
EffluentRec.totalChipMultipliier;
        ExecSQL;
      end;

It works in the test environment but not on the Production Database.
It gives an error 'Unassigned Code'.

I have tracked the error down to the line of code

        ParamByName('DT').AsDate := EffluentRec.DT;

Both databases would appear to be identical...

InterBase/x86/Windows NT (access method), version "WI-V7.5.1.162"
InterBase/x86/Windows NT (remote server), version "WI-V7.5.1.162/tcp
(rpnlrng12)/P14"
InterBase/x86/Windows NT (remote interface), version "WI-V7.5.0.174/tcp
(rngd99tta06)/P14"
on disk structure version 11.2

and both using dialect 1.

I believe this points to being a database setting yet all settings
appear to be identical in IBMonitor. 
Not sure what to look for now or where to look.

Anyone out there with any like experiences or ideas?		

Regards 
Phil Hayward

System Analyst 
Pinepanels Rangiora
ph  (64) 3 313-2764
fax (64) 3 313-2739
Ext 38824
Phillip.Hayward at chh.co.nz
DISCLAIMER: This electronic message together with any attachments is 
confidential. If you are not the intended recipient, do not copy, disclose or 
use the contents in any way. Please also advise us by return e-mail that you 
have received the message and then please destroy. Carter Holt Harvey is not 
responsible for any changes made to this message and / or any attachments after 
sending by Carter Holt Harvey. We use virus scanning software but exclude all 
liability for viruses or anything similar in this email or any attachment.



More information about the Delphi mailing list