I don't want to
 have separate insert statements for 5, 6, 7, more/less variiables
=========
Does it mean that not-assigned params will expect NULL values which
are the defaults thus don't need special care but assigning data type
?


2012/2/10, jPatrick <pgoup...@upmerchants.com>:
> I am developing an app the manipulates database data.
>
> I build sql statements depending on what the users is doing.
>
> How do you build an insert statement in program code?
>
> I do something like:
>
>
> with stmtUpdate
> do begin
>    sql.clear;
>    sql.add ('Insert into history (createdbyid, createts, userid, statusid, '
>       + 'statusdate, returndate, comment) '
>       + 'values (:createdbyid, :createts, :userid, :statusid, :statusdate, '
>       + ':returndate, :comment);';
>    params [0].asinteger := 123;               
>    params [1].asdatetime := now;
>    params [2].asinteger := 234;
>    params [3].asinteger := 345;
>    params [4].asdatetime := now;
>    params [5].asdatetime := emptydatetime;
>    params [6].asstring := 'my comment';
>    execute;
> end;
>       
> My problem is I have a changing number of fields to insert.  I don't want to
> have separate insert statements for 5, 6, 7, more/less variiables.  U want
> to set the params count, datatype, name, paramtype in program code.
>
> I tried manipulating the params.count field but get an error message
> "no member is provided to access property".
>
> Is my question clear or not?
>
>
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> mseide-msegui-talk mailing list
> mseide-msegui-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
>

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to