Subject | Re: [IBO] insertSQL |
---|---|
Author | jwharton@ibobjects.com |
Post date | 2004-03-28T05:34:15Z |
You simply use the column names of the query and IBO puts the parameter values in for you at the time of posting the
insert.
Jason
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Hi all,
Could someone please tell me how I should "hard code" these 4
parameters into my insertSQL? I tried paramByName and it does not
work with insertSql, How can I replace the parameters with variables
directly? How can I assign a value to the parameter?
Please someone can help me with this?
Daniel
with DataM.Spares do
begin
ReadOnly := False;
InsertSQL.Text := ' ';
InsertSQL.Append('execute procedure NewSpare');
InsertSQL.Append
('(:IDSPARE,:TRACKNO,:AXPOS,:IDVEH,:TIREPOS,:IDLOC,:IDINV,:INVNUM,:INV
TYPE ,:INVDATE,:IDREPS ,');
InsertSQL.Append
(':VEHCODE,:VEHMODEL, :LOCCODE , :LOCNAME ,:IDTIRE ,:MANCODE, :MANNAME
,');
InsertSQL.Append
(':MANMODEL,:TIRESIZE ,:TIREPLY ,:PATTERN ,:THREAD ,:DEPTH ,:ACDATE,:T
IRECOST , :SOLD,:JUNK ,:ITEM ,');
InsertSQL.Append
(':STATUS , :WARRANTY ,:WARSTART , :WAREND ,:WARTYPE, :COMMENTS, :NOTE
);');
if not prepared then prepare;
paramByName( ':INVNUM').AsInteger :=
DataM.InvoicesIDINV.AsInteger;
paramByName( ':INVNUM').Asstring :=
DataM.InvoicesINVNUM.AsString;
paramByName( ':INVTYPE').Asstring := 'Invoice';
paramByName( ':INVDATE').AsDateTime :=
DataM.InvoicesINVDATE.AsDateTime;
open;
insert;
end; // with dataM.Spares
insert.
Jason
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Hi all,
Could someone please tell me how I should "hard code" these 4
parameters into my insertSQL? I tried paramByName and it does not
work with insertSql, How can I replace the parameters with variables
directly? How can I assign a value to the parameter?
Please someone can help me with this?
Daniel
with DataM.Spares do
begin
ReadOnly := False;
InsertSQL.Text := ' ';
InsertSQL.Append('execute procedure NewSpare');
InsertSQL.Append
('(:IDSPARE,:TRACKNO,:AXPOS,:IDVEH,:TIREPOS,:IDLOC,:IDINV,:INVNUM,:INV
TYPE ,:INVDATE,:IDREPS ,');
InsertSQL.Append
(':VEHCODE,:VEHMODEL, :LOCCODE , :LOCNAME ,:IDTIRE ,:MANCODE, :MANNAME
,');
InsertSQL.Append
(':MANMODEL,:TIRESIZE ,:TIREPLY ,:PATTERN ,:THREAD ,:DEPTH ,:ACDATE,:T
IRECOST , :SOLD,:JUNK ,:ITEM ,');
InsertSQL.Append
(':STATUS , :WARRANTY ,:WARSTART , :WAREND ,:WARTYPE, :COMMENTS, :NOTE
);');
if not prepared then prepare;
paramByName( ':INVNUM').AsInteger :=
DataM.InvoicesIDINV.AsInteger;
paramByName( ':INVNUM').Asstring :=
DataM.InvoicesINVNUM.AsString;
paramByName( ':INVTYPE').Asstring := 'Invoice';
paramByName( ':INVDATE').AsDateTime :=
DataM.InvoicesINVDATE.AsDateTime;
open;
insert;
end; // with dataM.Spares