How to call Function(User Build-in Function) in Pro*C Program
We have developed the application used Pro*C Program.
TimesTen version is "TimesTen Release 11.2.1.5.0 (64 bit Linux/x86_64) (tt112150:53308) 2010-03-04T20:39:30Z".
We would like to develop Pro*C Program used PL/SQL.
We have some questions.
How to call Function(User Build-in Function) in Pro*C Program ?
#########
TEST
#########
ttisql :
Command> create or replace FUNCTION F_SAMPLE(i_str IN VARCHAR2)
> RETURN NUMBER IS
> o_number NUMBER;
> BEGIN
> select i_str
> into o_number
> from dual;
>
> RETURN o_number;
>
> EXCEPTION
> WHEN OTHERS THEN
> RETURN 0;
> END;
> /
show errors
Function created.
Command> show errors
No errors.
Command>
Command> set serveroutput on;
Command> declare
> num1 number;
> begin
> num1 := F_SAMPLE('A');
> DBMS_OUTPUT.PUT_LINE ('F_SAMPLE' || ' ' || num1);
> end;
> /
F_SAMPLE 0
PL/SQL procedure successfully completed.
Command>
Pro*C Case :
EXEC SQL BEGIN DECLARE SECTION;
num1 number;
EXEC SQL END DECLARE SECTION;
EXEC SQL EXECUTE
begin
:num1 := F_SAMPLE('A');
end;
END-EXEC;
make install :
Syntax error at line 146, column 3, file plsqlPROC.pc:
Error at line 146, column 3 in file plsqlPROC.pc
num1 number;
..1
PCC-S-02201, Encountered the symbol "num1" when expecting one of the following:
Thanks.
GooGyum