Thanks Zeljko, but I have some code which have a bit defferent than you. I'm adding SQL sintax on design time in Script property of TZSQLProcessor. By example I write the code like:
procedure MyDataInsert(myData: TRecSomeData; QRY: TZQuery); begin Qry.Params[0].AsInteger := myData.Index; Qry.Params[1].AsString := myData.Name; Qry.Params[2].AsFloat := myData.Value; Qry.Params[3].AsBoolean := myData.ItWorksForMe; try Qry.ExecSQL; Qry.Connection.Commit; except .... use your imagination end; end; Seems lazarus can't solve in design time. But my wrong or lazarus? On Fri, May 15, 2009 at 11:38 PM, zeljko <[email protected]> wrote: > On Friday 15 May 2009 10:32, dayat wrote: > > Hi, > > > > I'm using fpc 2.2.4, lazarus 0.9.26.2, zeosdbo 6.6.3-stable. I'm > executing > > sql commands in TZSQLProcessor using params for changing the values. The > > sql sintax like "INSERT INTO TABLE1 VALUES(:PAR1, :PAR2);". The property > of > > ParamCheck filled with the True value, and when I executing the sql I'm > got > > the error. After checking, I found that values in SQL sintax can't to > > change, the sql sintax still such "INSERT INTO TABLE1 VALUES(:PAR1, > > > > :PAR2);". Finally I must executing manually such "INSERT INTO TABLE1 > > > > VALUES(" + edit1.text +","+ edit2.text +");". > > > > Has anyone have a problem like me. > > no :) > > procedure MyDataInsert(myData: TRecSomeData; QRY: TZQuery); > begin > Qry.Sql.Clear; > Qry.Params.Clear; > Qry.Sql.Add('INSERT INTO mytable VALUES(:P1,:P2,:P3,:P4)'); > Qry.Params[0].AsInteger := myData.Index; > Qry.Params[1].AsString := myData.Name; > Qry.Params[2].AsFloat := myData.Value; > Qry.Params[3].AsBoolean := myData.ItWorksForMe; > try > Qry.ExecSQL; > Qry.Connection.Commit; > except > .... use your imagination > end; > end; > > > _______________________________________________ > Lazarus mailing list > [email protected] > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus >
_______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
