Subject | Anyone help me with a Delphi 7 & Firebird question? |
---|---|
Author | Myles Wakeham |
Post date | 2005-09-02T03:55:47Z |
I have what I think is a pretty simple question about how to call a Firebird
Stored Procedure and get back a result in Delphi. I wish to add a record to
a Firebird 1.5 database from a D7 application. I am using FIBPlus to
connect to the database.
I have a form that has a number of non-data aware component objects for the
field data entry, and the user simply fills out the form and clicks on a
SAVE button to save it to the database.
The stored procedure that is called returns back the unique record ID of the
newly created record after it creates the record through a generator.
What I'm not sure how to do is to structure the procedure that has to setup
the SQL and get the single result back from it. I believe I cannot use the
syntax EXECUTE PROCEDURE for this because it will only return back the no of
rows affected. I believe I have to use a SELECT * FROM SP_NAME(arg1, arg2)
type syntax, but I'm not sure how to structure the D7 code to setup the
transaction parameters for a write to the database, structure the SQL
statement, have it executed and handle a single result value coming back.
Can anyone give me a pointer or some example code that would get me moving
forward on this?
Thanks in advance for any assistance.
Regards,
Myles
===========================
Myles Wakeham
Director of Engineering
Tech Solutions Inc.
Scottsdale, Arizona USA
Phone (480) 451-7440
Web: www.techsol.org
Stored Procedure and get back a result in Delphi. I wish to add a record to
a Firebird 1.5 database from a D7 application. I am using FIBPlus to
connect to the database.
I have a form that has a number of non-data aware component objects for the
field data entry, and the user simply fills out the form and clicks on a
SAVE button to save it to the database.
The stored procedure that is called returns back the unique record ID of the
newly created record after it creates the record through a generator.
What I'm not sure how to do is to structure the procedure that has to setup
the SQL and get the single result back from it. I believe I cannot use the
syntax EXECUTE PROCEDURE for this because it will only return back the no of
rows affected. I believe I have to use a SELECT * FROM SP_NAME(arg1, arg2)
type syntax, but I'm not sure how to structure the D7 code to setup the
transaction parameters for a write to the database, structure the SQL
statement, have it executed and handle a single result value coming back.
Can anyone give me a pointer or some example code that would get me moving
forward on this?
Thanks in advance for any assistance.
Regards,
Myles
===========================
Myles Wakeham
Director of Engineering
Tech Solutions Inc.
Scottsdale, Arizona USA
Phone (480) 451-7440
Web: www.techsol.org