plsql - How to call a sql function? -


i have written function minimum2 take 2 numbers arguments , returns minimum number. function compiles without error. when call function minimum(1,2); errors pls-00103. here function , function call:

create or replace function minimum2(v1 number, v2 number) return number      begin        if v1 < v2          return v1;        else          return v2;        end if;      end;       --i call function asl follow  minimum2(1,2); 

what did wrong? wrote code in sql developer

you need run select

select minimum2(1,2)  dual 

you need end function /:

enter image description here

for details on how , why use / see here


are aware there built-in function that?

select least(1,2)  dual 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

unity3d - Fatal error- Monodevelop-Unity failed to start -