[DUG] Delphi SQL issue
Hayward, Phillip
Phillip.Hayward at chh.co.nz
Mon Feb 26 11:49:08 NZDT 2007
Tried that on the test server this morning Edward. It loaded the data
but gave 3 records of 24,25 & 26 February all the same date of
26/02/2007. Time component was correct but not the date.
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
-----Original Message-----
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz]
On Behalf Of Edward Koryagin
Sent: Friday, 23 February 2007 10:33 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Delphi SQL issue
Try this one:
ParamByName('DT').AsTime := EffluentRec.DT;
Regards,
Edward.
--- "Hayward, Phillip" <Phillip.Hayward at chh.co.nz>
wrote:
> 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.
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
Edward Koryagin
Send instant messages to your online friends
http://au.messenger.yahoo.com
_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi
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