Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedures with DbExpress

Status
Not open for further replies.

Karen99

Programmer
Aug 5, 2003
113
ZA
Can somebody please explain to me how to use stored procedures with dbExpess.

I am obviously doing something wrong. I have used TSqlStoredProc and TSQLDataSet and nothing seems to work. Which is the best way to go ? Neither of them can see my parameters and even when I type the paramaters in myself it doesn't seem to work.

Can somebody please give me some code examples and how to work with the component itself.

I am using D7 and Sql Server 200. My store procedures work fine when I run it directly in SQL Server.

Thanks
Karen
 
Can you show us the code that you have tried so far?

I think the normal technique is to use the TSQLStoredProc component.

Andrew
Hampshire, UK
 
hi

I call a storedproc like this(written in Delphi 5):-

spEmptyDB.Params[1].asstring := TableName;
spEmptyDB.Prepare;
spEmptyDB.ExecProc;

Params[0] is actually RETURN_VALUE in my case. I'm using Sybase too which is similiar to SQL Server. spEmptyDB is a TStoredProc component.

Are you able to successfully call your stored proc from Database Explorer?

lou

 
My code are :

spProcCopyUserTables.Parambyname('userid').AsInteger :=
userid;
spProcCopyUserTables.prepared := true;
spProcCopyUserTables.ExecProc;

My previous problem is actually solved. I am using a Tsqlstoredproc and the component see the paramaters. So that all works fine. It does execute the store procedures and insert the neccasary records. I can see the changes in my db.

My problem now is although the sp does everything it is suppose to, it still gives me the following error :

Unspecified error.

Well, this does not mean anything to me! If I run my sp from sql server it work fine, without giving me any errors.

Has anybody encountered this before ? I don't know how to start debugging this.

Thanks
Karen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top