function sql_addToFavorite( pUser in varchar2, pID in number ) return number is iCount number; begin /* exists ? */ select count(*) into iCount from factory.cieb_an_sql_favorite where upper( c_user ) = upper( pUser ) and c_ID = pID; if iCount <> 0 then return( 1 ); end if; /* add */ insert into factory.cieb_an_sql_favorite ( c_user, c_id ) values ( upper( pUser ), pID ); commit; return( 0 ); end;
Microsoft AX 2012, X++, C#, SQL server, SSRS, Java, JavaFX, Oracle, PL/SQL, Delphi - codes examples, step-by-step tutorials, experiences.
Friday, December 1, 2017
ORACLE - example of pl/sql function (stored function)
Stored function takes two params and returns number value (0 when row is added):
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment