VISOCO Software  Home | Products | Services | Download | Order | Support | Forum | Resources | Search | About
  RSS feedRSS Feed  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  RegisterRegister   ProfileProfile    Log inLog in 
TSQLStoredProcedure

 
Post new topic   Reply to topic    VISOCO Software Forum Index -> VISOCO dbExpress driver for Sybase ASA
Author Message
SimonWilsher



Joined: 03 Aug 2005
Posts: 2

PostPosted: Wed Aug 03, 2005 6:49 pm    Post subject: TSQLStoredProcedure Reply with quote

Hi

We're current evaluating the VISOCO dbExpress driver for Sybase ASA with an established Sybase ASA 9.0.2 database.

The existing solution uses the standard BDE components (TDatabase, TQuery, TStoredProc etc.) to access the database successfully.

However, we're currently experiencing difficulties retrieving a result from a stored procedure in the database using the dbExpress driver.

The stored procedure looks something like this:

ALTER FUNCTION "DBA"."TotalReceipts"(IN CurTransID INTEGER)
RETURNS MONEY
BEGIN
DECLARE TotRec MONEY;
SELECT SUM(Pmt_Total) INTO TotRec FROM "DBA".Accts_Pmts
WHERE Accts_Pmts.Trans_ID=CurTransID;
IF TotRec IS NULL THEN
SET TotRec=0
END IF;
RETURN TotRec;
end

The Delphi 7 code using the dbExpress driver to access the stored procedure looks like this:

with spTotalReceipts do
begin
SQLConnection := dbSource;
ParamCheck := True;
StoredProcName := 'DBA.TotalReceipts';
ParamByName('CurTransID').AsInteger := CurTransID;
ExecProc;
PmtsRec := ParamByName('TotalReceipts').AsCurrency;
end;

However, the final line returns an error: Parameter "TotalReceipts" not found. How can we access the result of the stored procedure?

Our existing application using TStoredProcedure works just fine, and looks like this:

with spTotalReceipts do
begin
ParamByName('CurTransID').AsInteger := CurTransID;
Prepare;
ExecProc;
GetResults; {forces results from a Sybase server}
PmtsRec := ParamByName('TotalReceipts').AsCurrency;
UnPrepare;
end;

Can you advise where we're going wrong on this one!?

Thanks

Simon
Back to top
View user's profile Send private message
VISOCO Support
VISOCO Software Support


Joined: 16 Jul 2002
Posts: 96

PostPosted: Thu Aug 11, 2005 1:12 am    Post subject: Reply with quote

Hi there,

Unfortunately, there is an architectural drawback in the current version of the driver. It cannot obtain a result of the stored procedure. We hope, this will be fixed in the next major version.

Try to use out parameters instead.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    VISOCO Software Forum Index -> VISOCO dbExpress driver for Sybase ASA All times are GMT + 2 Hours
Page 1 of 1

 


©VISOCO Software. phpBB by phpBB Group