--------------1184D48CF742D68D994F9B6B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Thanks to code insight I found this following command that I
was not aware of.
Here is what I changed the MyQueryApplyUpdates to
with MyUpdateSQL, Query[Updatekind] do
begin
SetParams(UpdateKind);
MyUpdateSQL.Query[UpdateKind].ParamByName('FIELD1').AsInteger
:= MySource.DataSet.FieldByName('FIELD1').AsInteger;
MyUpdateSQL.Query[UpdateKind].ParamByName('FIELD2').AsDate
:= MySource.DataSet.FieldByName('FIELD2').AsDateTime;
MyUpdateSQL.Query[UpdateKind].ParamByName('FIELD3').AsString
:= MySource.DataSet.FieldByName('FIELD3').AsString;
MyUpdateSQL.Query[UpdateKind].ParamByName('FIELD4').AsInteger
:= MySource.DataSet.FieldByName('FIELD4').AsInteger;
MyUpdateSQL.Query[UpdateKind].ParamByName('FIELD5').AsString
:= MySource.DataSet.FieldByName('FIELD5').AsString;
ExecSQL;
UpdateAction := uaApplied;
end;
Everything works.
So any TGurus out there that can explain to me why the field
values in the dataset are not understood and I had to
actually set things up this way instead of just calling
MyUpdateSQL.Apply(UpdateKind)?
Thanks for the explanation in advance
Barb ;)
Quote
da...@goodnet.com wrote:
> Here is what happens, everything appears to work fine
> until I apply updates. Then I get 'Update Failed' process
> stopped etc... then Table is read only error.
> Here is what the SQL Monitor shows
> 20283 11:47:52 SQL Data In: INTRBASE - Param = 1, Name
> = , Type = fldINT32, Precision
> = 0, Scale = 0, Data = 1
> 20284 11:47:52 SQL Data In: INTRBASE - Param = 2, Name
> = , Type = fldTIMESTAMP,
> Precision = 0, Scale = 0, Data = 11/8/1997 16:18:34:0
> 20285 11:47:52 SQL Data In: INTRBASE - Param = 3, Name
> = , Type = fldZSTRING,
> Precision = 3, Scale = 0, Data = 327
> 20286 11:47:52 SQL Data In: INTRBASE - Param = 4, Name
> = , Type = fldZSTRING,
> Precision = 2, Scale = 0, Data = F1
> 20287 11:47:52 SQL Data In: INTRBASE - Param = 5, Name
> = , Type = fldINT32, Precision
> = 0, Scale = 0, Data = 7788
> 20288 11:47:52 SQL Stmt: INTRBASE - Reset
> 20289 11:47:52 SQL Vendor: INTRBASE -
> isc_dsql_free_statement
> 20290 11:47:52 SQL Execute: INTRBASE - execute
> procedure my_information(?, ?, ?, ?,
> ?);
> 20291 11:47:52 SQL Vendor: INTRBASE - isc_dsql_execute
> 20291 11:47:52 SQL Vendor: INTRBASE - isc_dsql_execute
> 20292 11:47:52 SQL Data In: INTRBASE - Rows affected =
> 0
> To me this shows that the data is being properly stored in
> the dataset but not passed to the
> TUpdateSQL. Any ideas why?
> The delphi documentation eludes to the fact that any legal
> SQL can be used in the TUpdateSQL.
> Where have I gone astray?
> thanks again for your help
> Barb ;)
--------------1184D48CF742D68D994F9B6B
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
Thanks to code insight I found this following command that I was not aware
of.
<P>Here is what I changed the MyQueryApplyUpdates to
<BR> with MyUpdateSQL, Query[Updatekind]
do
<BR> begin
<BR> SetParams(UpdateKind);
<BR> MyUpdateSQL.Query[UpdateKind].ParamByName('FIELD1').AsInteger
:= MySource.DataSet.FieldByName('FIELD1').AsInteger;
<BR> MyUpdateSQL.Query[UpdateKind].ParamByName('FIELD2').AsDate
:= MySource.DataSet.FieldByName('FIELD2').AsDateTime;
<BR> MyUpdateSQL.Query[UpdateKind].ParamByName('FIELD3').AsString
:= MySource.DataSet.FieldByName('FIELD3').AsString;
<BR> MyUpdateSQL.Query[UpdateKind].ParamByName('FIELD4').AsInteger
:= MySource.DataSet.FieldByName('FIELD4').AsInteger;
<BR> MyUpdateSQL.Query[UpdateKind].ParamByName('FIELD5').AsString
:= MySource.DataSet.FieldByName('FIELD5').AsString;
<BR> ExecSQL;
<BR> UpdateAction := uaApplied;
<BR> end;
<P>Everything works.
<P>So any TGurus out there that can explain to me why the field values
in the dataset are not understood and I had to actually set things up this
way instead of just calling MyUpdateSQL.Apply(UpdateKind)?
<P>Thanks for the explanation in advance
<P>Barb ;)
<BR>
<BR>
Quote
<P>da...@goodnet.com wrote:
<BLOCKQUOTE TYPE=CITE>
<P>Here is what happens, everything appears to work fine until I apply
updates. Then I get 'Update Failed' process stopped etc... then Table
is read only error.
<P>Here is what the SQL Monitor shows
<BR>20283 11:47:52 SQL Data In: INTRBASE - Param = 1,
Name = , Type = fldINT32, Precision
<BR>= 0, Scale = 0, Data = <B>1</B>
<BR>20284 11:47:52 SQL Data In: INTRBASE - Param = 2,
Name = , Type = fldTIMESTAMP,
<BR>Precision = 0, Scale = 0, Data =<B> 11/8/1997 16:18:34:0</B>
<BR>20285 11:47:52 SQL Data In: INTRBASE - Param = 3,
Name = , Type = fldZSTRING,
<BR>Precision = 3, Scale = 0, Data = <B>327</B>
<BR>20286 11:47:52 SQL Data In: INTRBASE - Param = 4,
Name = , Type = fldZSTRING,
<BR>Precision = 2, Scale = 0, Data = <B>F1</B>
<BR>20287 11:47:52 SQL Data In: INTRBASE - Param = 5,
Name = , Type = fldINT32, Precision
<BR>= 0, Scale = 0, Data = <B>7788</B>
<BR>20288 11:47:52 SQL Stmt: INTRBASE - Reset
<BR>20289 11:47:52 SQL Vendor: INTRBASE - isc_dsql_free_statement
<BR>20290 11:47:52 SQL Execute: INTRBASE - <B>execute
procedure my_information(?, ?, ?, ?,</B>
<BR><B>?);</B>
<P>20291 11:47:52 SQL Vendor: INTRBASE - isc_dsql_execute
<BR>20291 11:47:52 SQL Vendor: INTRBASE - isc_dsql_execute
<BR>20292 11:47:52 SQL Data In: INTRBASE - Rows affected
= 0
<P>To me this shows that the data is being properly stored in the dataset
but not passed to the
<BR>TUpdateSQL. Any ideas why?
<P>The delphi documentation eludes to the fact that any legal SQL can be
used in the TUpdateSQL.
<BR>Where have I gone astray?
<P>thanks again for your help
<BR>Barb ;)</BLOCKQUOTE>
</HTML>
--------------1184D48CF742D68D994F9B6B--