BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to use TSQLStoredProc ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress)
View previous topic :: View next topic  
Author Message
kmaku
Guest





PostPosted: Mon Apr 19, 2004 7:02 am    Post subject: How to use TSQLStoredProc ? Reply with quote



---- stored procedure ---------------------------------

CREATE PROCEDURE FeeIncIns(pcardId CHAR(5), pcardId2 CHAR(2), pownCode
INTEGER, pasoCode CHAR(2), pPPLCODE INTEGER
,psChMon DATE, peChMon DATE, pchAmt INTEGER, pfeeType
SMALLINT, pempCode INTEGER,
pIncAmt INTEGER, pIncDate DATE, pTrsDate DATE,
pBookDate DATE, pIncPlc SMALLINT, pRcpNo INTEGER, FEE_TABLE CHAR(6)
, FEE_INC_TABLE CHAR(10))
AS
DECLARE VARIABLE feeNo INTEGER;
BEGIN
WHILE (psChmon<=peChMon) DO
BEGIN
feeNo = GEN_ID(GENFEENO,1);
INSERT INTO FEE_SL (fee_no,card_id, card_id2, aso_code, ppl_code,
ch_mon, ch_amt, fee_type, trt_code, emp_code)
VALUES(:feeNo, :pcardId, :pcardId2, :pasoCode, :pOWNCODE,
:psChMon, :pChAmt, :pFeeType, :pEmpCode, :pEmpCode);


IF (pIncAmt <> 0 ) THEN
BEGIN
INSERT INTO FEE_INC_SL (fee_no, card_id, card_id2, aso_code,
ppl_code, inc_amt, inc_date, trs_date, book_date
, inc_plc, rcp_no)
VALUES (:feeNo, :pcardId, :pcardId2, :pasoCode, :pOWNCODE,
:pIncAmt, :pIncDate, :pTrsDate, :pBookDate, :pIncPlc, :pRcpno);
END
EXECUTE PROCEDURE incMonth :psChMon RETURNING_VALUES :psChMon;
END
END

---- end stored procedure ---------------------------------


------ Use TSQLStroredProc in Del7----------------------------

SSPfeeincins.ParamByName('PCARDID').AsInteger :=
SDSfeeCARDCARD_ID.AsInteger;
SSPfeeincins.ParamByName('PCARDID2').AsInteger :=
SDSfeeCARDCARD_ID2.AsInteger;
SSPfeeincins.ParamByName('POWNCODE').AsInteger :=
SDSfeeCardOWN_CODE.AsInteger;
SSPfeeincins.ParamByName('PASOCODE').Value := DMmain.puAso;
SSPfeeincins.ParamByName('PSCHMON').Value := edtSmon.text +
'-01';
SSPfeeincins.ParamByName('PECHMON').Value := edtEmon.text +
'-01';
SSPfeeincins.ParamByName('PCHAMT').Value :=
KXedtChAmt.AsInteger;
SSPfeeincins.ParamByName('PFEETYPE').Value :=
DBCBfeeType.KeyValue;
SSPfeeincins.ParamByName('PEMPCODE').Value := DMmain.puEmp;
SSPfeeincins.ParamByName('PINCAMT').Value :=
edtIncAmt.AsInteger;
SSPfeeincins.ParamByName('PINCDATE').Value := edtIncDate.Text;
SSPfeeincins.ParamByName('PTRSDATE').Value := edtTrsDate.Text;
SSPfeeincins.ParamByName('PBOOKDATE').Value := edtBookDate.Text;
SSPfeeincins.ParamByName('PINCPLC').Value :=
DBCBIncPlc.KeyValue;
SSPfeeincins.ParamByName('PRCPNO').Value := edtRctNo.Text;

try
SSPfeeincins.ExecProc(); <---- this occur error! (Operation
Not Supported)
Action := caFree;
except
Application.MessageBox(' error
','error',MB_OK+MB_ICONERROR);
Action := caNone;
end; //try ... except
-----------------------------------------------------

I want to execute Stored Procedure using TSQLStoredProc Components.. but I
doesn't work well..
First of all, Because this stored procedure can not return anything, so I
did not use 'Action := True' OR 'Open' ...
As I know at this case must use ExecProc method... so I did.. but It also
occur error like "Operation not supported"
which I have seen when try to navigate with directional dataset.

What is the problem?

thanks ...


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.