Board index » delphi » Is possible to use params in ModifySQL, InsertSQL,...of TIBDataset?

Is possible to use params in ModifySQL, InsertSQL,...of TIBDataset?


2004-08-06 09:21:55 PM
delphi232
I've seen use params in the Select clause of TIBDataSet.
I tryed the same in the properties: ModifySQL,InsertSQL, DeleteSQL,
RefreshSQL, but doesn't work
Any suggestion?
Thanks
 
 

Re:Is possible to use params in ModifySQL, InsertSQL,...of TIBDataset?

Bill Todd (TeamB) writes:
Quote
Create everything but the SELECT statement using the component editor
and you will see how parameters are used. IBDataSet creates the
statements with parameters and automatically assigns the parameters
when you post an insert, update or delete to the dataset. You should
never manipulate the parameters or the SQL statements directly.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
Therefore I suspose the answer is NOT.
¿The only way to change SQL statements is rewriting all the statements
and change them when the dataset is closed?
Thanks Bill
 

Re:Is possible to use params in ModifySQL, InsertSQL,...of TIBDataset?

Halfo writes:
Quote
Bill Todd (TeamB) writes:
>Create everything but the SELECT statement using the component editor
>and you will see how parameters are used. IBDataSet creates the
>statements with parameters and automatically assigns the parameters
>when you post an insert, update or delete to the dataset. You should
>never manipulate the parameters or the SQL statements directly.

Therefore I suspose the answer is NOT.
¿The only way to change SQL statements is rewriting all the statements
and change them when the dataset is closed?
It's not clear what it is you need to do here. The purpose of IBDataset is
to allow you to use the Insert/Edit/Delete functions rather than manually
executing the corresponding SQL statements. IBDataset will take care of
assigning the parameters for these statements. Using the IBDataset component
editor, you can generate - and customize - these statements. You *can*
assign the statements, complete with parameters, yourself at runtime too,
but you should not try to *execute* them directly, only via the
Insert/Edit/Delete functions.
If you want to execute SQL directly, use TIBSQL instead.
--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: www.logicfundamentals.com/RADBooks.html
Bandwagons are like streetcars, there'll be another along in a few
minutes.
 

Re:Is possible to use params in ModifySQL, InsertSQL,...of TIBDataset?

Bill Todd (TeamB) writes:
Quote
Please tell us why you want to change the SQL statements. I cannot
think of any reason you would need to.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
Well, I have an entity A and n Entities B, each Entity B can reference
once Entity A (and aggregation association between A and B).
When I make an insert of B in A (really it is a selection) it represents
an "update tabla_B set field_reference_A = id_A"
Id_A change every time Entity A change. that is the reason I must change
this sentence every time a change the entity A. Clear?
For now, I assign to InsertSQL property the new sentence update... when
I know the entity A and then open the dataset, it works, I am doing
anything wrong, there's better ways to do it?
sorry for my english