Hi !
I make some tests with DBPROC using the example in documentation:
CREATE DBPROC test (IN dateOfDay DATE, OUT avg FIXED(6,2))
AS VAR sum FIXED(10,2); price FIXED(6,2); hotels INTEGER;
TRY
SET sum = 0;
SET hotels = 0;
SELECT dblvalue FROM hotel WHERE dt = :dateOfDay;
WHILE $rc = 0 DO BEGIN
FETCH INTO :price;
SET sum = sum + price;
SET hotels = hotels + 1;
END;
CATCH
IF $rc <> 100 THEN STOP ($rc, 'unexpected error');
IF hotels > 0 THEN SET avg = sum / hotels
ELSE STOP (100, 'no hotel found');
1) How i call this Proc ???
> CALL test('2003-10-04')
not works... :-(
my test with date type is wrong ?
2) I need print the value in fetch execution... for tests, like this:
> dbms_output.put_line($rc.dblvalue) ???
is this possible ?
Thanks for answer !!!!!!!