Subject | RE: [IBO] Using Params |
---|---|
Author | Dion Oliphant |
Post date | 2001-01-08T15:10:57Z |
Hi Helen,
I wanted to conserve memory I suppose. I thought that the TIB_Query
component would allow me to hold table information using the SQL text
'SELECT * FROM Grades', and at the same time update the table using the
EditSQL 'UPDATE Grades g SET
g.GradeName =:GradeName
WHERE g.GradeRef =:GradeRef'
assigning the params:-
with dmPupil.qryGrades do
begin
if not trnGrades.InTransaction then trnGrades.StartTransaction;
try
try
if Prepared then UnPrepare;
{ The tree is being edited. Try and update the record on the
database. }
EditSQL.IndexParamValue[1, 'GradeRef'] :=
inttostr(TNodeTypeData(Node.Data^).Ref);
EditSQL.IndexParamValue[0, 'GradeName'] := S;
Prepare;
Open;
if trnGrades.InTransaction then trnGrades.Commit;
except on e:EIB_ISCError do
{ Don't change the node value to the new value. }
abort;
end;
finally
Close;
end;
end;
Thanks,
Dion.
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: 08 January 2001 04:47
To: IBObjects@egroups.com
Subject: RE: [IBO] Using Params
At 03:11 PM 08-01-01 +0100, you wrote:
Also, you don't call Prepare after the dataset is opened.
H.
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
I wanted to conserve memory I suppose. I thought that the TIB_Query
component would allow me to hold table information using the SQL text
'SELECT * FROM Grades', and at the same time update the table using the
EditSQL 'UPDATE Grades g SET
g.GradeName =:GradeName
WHERE g.GradeRef =:GradeRef'
assigning the params:-
with dmPupil.qryGrades do
begin
if not trnGrades.InTransaction then trnGrades.StartTransaction;
try
try
if Prepared then UnPrepare;
{ The tree is being edited. Try and update the record on the
database. }
EditSQL.IndexParamValue[1, 'GradeRef'] :=
inttostr(TNodeTypeData(Node.Data^).Ref);
EditSQL.IndexParamValue[0, 'GradeName'] := S;
Prepare;
Open;
if trnGrades.InTransaction then trnGrades.Commit;
except on e:EIB_ISCError do
{ Don't change the node value to the new value. }
abort;
end;
finally
Close;
end;
end;
Thanks,
Dion.
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: 08 January 2001 04:47
To: IBObjects@egroups.com
Subject: RE: [IBO] Using Params
At 03:11 PM 08-01-01 +0100, you wrote:
>Hi,needs to be ParamByName('ID').AsInteger := xxx;
>
>one thing I would definitely try is using
>
>qryGrades.ParamByName('ID'):=xxx;
Also, you don't call Prepare after the dataset is opened.
H.
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________