Board index » delphi » how to ... InsertSQL

how to ... InsertSQL


2004-11-29 05:23:35 AM
delphi138
Hi,
I'm tyr to use TIBDataSet instead of TIBTable.
I found something to use SelectSQL, ModifySQL, ...
but I can not use InsertSQL.
My code is as follows:
IBDataSet1->Close();
IBDataSet1->InsertSQL->Clear();
IBDataSet1->InsertSQL->Text = "Insert into... values ..";
IBDataSet1->Prepare();
IBDataSet1->Open();
IBDataSet1->Append();
IBDataSet1->Post();
This SQL statement works well in isql.
Plz help me to find my mistakes....
Thnx..
M.t.
 
 

Re:how to ... InsertSQL

What is your select SQL? InsertSQL et al are for telling IBDataset how to make
insert/update deletes to the result set returned in the select statement.
Matt writes:
Quote

Hi,
I'm tyr to use TIBDataSet instead of TIBTable.
I found something to use SelectSQL, ModifySQL, ...
but I can not use InsertSQL.
My code is as follows:
IBDataSet1->Close();
IBDataSet1->InsertSQL->Clear();
IBDataSet1->InsertSQL->Text = "Insert into... values ..";
IBDataSet1->Prepare();
IBDataSet1->Open();
IBDataSet1->Append();
IBDataSet1->Post();

This SQL statement works well in isql.
Plz help me to find my mistakes....
Thnx..
M.t.
--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts, build
a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act
alone, solve equations, analyze a new problem, pitch manure, program a computer,
cook a tasty meal, fight efficiently, die gallantly. Specialization is for
insects. (RAH)
 

Re:how to ... InsertSQL

Thank you fro your response.
My SelectSQL is "select * from TABDAILY".
And also can I use "selec MAX(DUM) into :test from TABDAILY"?
I want to use dynamic SQL.
Thanks again
M.t.
"Jeff Overcash (TeamB)" <XXXX@XXXXX.COM>writes
Quote
What is your select SQL? InsertSQL et al are for telling IBDataset how to
make
insert/update deletes to the result set returned in the select statement.

Matt writes:
>
>Hi,
>I'm tyr to use TIBDataSet instead of TIBTable.
>I found something to use SelectSQL, ModifySQL, ...
>but I can not use InsertSQL.
>My code is as follows:
>IBDataSet1->Close();
>IBDataSet1->InsertSQL->Clear();
>IBDataSet1->InsertSQL->Text = "Insert into... values ..";
>IBDataSet1->Prepare();
>IBDataSet1->Open();
>IBDataSet1->Append();
>IBDataSet1->Post();
>
>This SQL statement works well in isql.
>Plz help me to find my mistakes....
>Thnx..
>M.t.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts,
build
a wall, set a bone, comfort the dying, take orders, give orders,
cooperate, act
alone, solve equations, analyze a new problem, pitch manure, program a
computer,
cook a tasty meal, fight efficiently, die gallantly. Specialization is
for
insects. (RAH)
 

Re:how to ... InsertSQL

Thank you fro your response.
My SelectSQL is "select * from TABDAILY".
And also can I use "selec MAX(DUM) into :test from TABDAILY"?
I want to use dynamic SQL.
Thanks again
M.t.
"Jeff Overcash (TeamB)" <XXXX@XXXXX.COM>writes
Quote
What is your select SQL? InsertSQL et al are for telling IBDataset how to
make
insert/update deletes to the result set returned in the select statement.

Matt writes:
>
>Hi,
>I'm tyr to use TIBDataSet instead of TIBTable.
>I found something to use SelectSQL, ModifySQL, ...
>but I can not use InsertSQL.
>My code is as follows:
>IBDataSet1->Close();
>IBDataSet1->InsertSQL->Clear();
>IBDataSet1->InsertSQL->Text = "Insert into... values ..";
>IBDataSet1->Prepare();
>IBDataSet1->Open();
>IBDataSet1->Append();
>IBDataSet1->Post();
>
>This SQL statement works well in isql.
>Plz help me to find my mistakes....
>Thnx..
>M.t.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts,
build
a wall, set a bone, comfort the dying, take orders, give orders,
cooperate, act
alone, solve equations, analyze a new problem, pitch manure, program a
computer,
cook a tasty meal, fight efficiently, die gallantly. Specialization is
for
insects. (RAH)
 

Re:how to ... InsertSQL

"Matt" <XXXX@XXXXX.COM>writes:
Quote
Thank you fro your response.
My SelectSQL is "select * from TABDAILY".
Append followed by a post will do nothing and is the same as a
cancel unless somewhere you are making a change to at least onw
field.
Quote
And also can I use "selec MAX(DUM) into :test from TABDAILY"?
I want to use dynamic SQL.
No, that is not SQL. That is appropriate only in stored procedures.
 

Re:how to ... InsertSQL

Thank you so much
Matt
"Jeff Overcash (TeamB)" <XXXX@XXXXX.COM>writes
Quote

"Matt" <XXXX@XXXXX.COM>writes:
>Thank you fro your response.
>My SelectSQL is "select * from TABDAILY".

Append followed by a post will do nothing and is the same as a
cancel unless somewhere you are making a change to at least onw
field.

>And also can I use "selec MAX(DUM) into :test from TABDAILY"?
>I want to use dynamic SQL.

No, that is not SQL. That is appropriate only in stored procedures.


 

Re:how to ... InsertSQL

Thank you so much...
Then
can i use as followings:
IBDataSet1->Close();
IBDataSet1->InsertSQL->Clear();
IBDataSet1->InsertSQL->Text = "Insert into table1... values ...";
IBDataSet1->Open(); ???
Matt
"Jeff Overcash (TeamB)" <XXXX@XXXXX.COM>writes
Quote

"Matt" <XXXX@XXXXX.COM>writes:
>Thank you fro your response.
>My SelectSQL is "select * from TABDAILY".

Append followed by a post will do nothing and is the same as a
cancel unless somewhere you are making a change to at least onw
field.

>And also can I use "selec MAX(DUM) into :test from TABDAILY"?
>I want to use dynamic SQL.

No, that is not SQL. That is appropriate only in stored procedures.


 

Re:how to ... InsertSQL

Matt writes:
Quote

Thank you so much...

Then
can i use as followings:

IBDataSet1->Close();
IBDataSet1->InsertSQL->Clear();
IBDataSet1->InsertSQL->Text = "Insert into table1... values ...";
IBDataSet1->Open(); ???
No, you only open result sets. All InsertSQL should do is take a newly inserted
record in the local result set, copy the field values into the params of the
InsertSQL and execute that SQL on a post.
--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts, build
a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act
alone, solve equations, analyze a new problem, pitch manure, program a computer,
cook a tasty meal, fight efficiently, die gallantly. Specialization is for
insects. (RAH)