I created a stored procedure in db like:
CREATE PROCEDURE dbo.MySP
@name varchar(50),
@access_date datetime
AS
BEGIN
--insert data into a table
End
Then I create pb function to call this sp like( I use pb 11.5)
datetime ll_date
ll_date =datetime(today(), now())
DECLARE mytest PROCEDURE FOR MySP @objname = :is_name, @access_date = :ll_date USING is_tran;
IF is_tran.SQLCode <> 0 THEN
MessageBox ( "Error", "DECLARE failed" )
RETURN
END IF
EXECUTE mytest;
IF ( is_tran.SQLCode <> 0 ) and ( is_tran.SQLCode <> 100 ) THEN
MessageBox ( "Error", "EXECUTE failed" )
RETURN
END IF
Then I run the app, first time to call this function without any error, but no data inserted, no thing happen.
keep in the app and call the function again, give me error declare error.
debug give me SQLCode = 100.
SP is fine, I can insert data with isql like:
exec MySP 'name', '2014-06-18'
How to figure out the problem and fix it?