Category: PL/SQL

PL/SQL Ceil

Oracle PL/SQL Ceil Function The Ceil function allows you to round up any number to the next integer. The Ceil Function syntax: ceil( number ) Example: Select ceil(99.34) From dual; 100 Select ceil(99) From dual; 99 Select ceil(-99.34) From dual; -99...

PL/SQL Bin_To_Num

Oracle PL/SQL Bin_To_Num Function The Bin_To_Num function converts a bit vector to a number. The Bin_To_Num Function syntax: bin_to_num( exp1, exp2, … exp_n) Example: select bin_to_num(1) from dual; would return 1 select bin_to_num(1,0) from dual; would return 2 select bin_to_num(1,1) from...

PL/SQL BFilename

Oracle PL/SQL BFilename Function The BFilename function returns a BFILE locator for a physical LOB binary file. The BFilename Function syntax: bfilename( ‘directory’, ‘filename’ ) Example: CREATE DIRECTORY files_dir AS '/path/media'; INSERT INTO media_table (id, name) VALUES (1000, BFILENAME('FILES_DIR', 'logo.jpg'));...

PL/SQL Avg

Oracle PL/SQL Avg Function The Avg function returns the average value of an expression. The Avg Function syntax: Select avg(exp) From table Where condition ; Example 1: Select avg(e.sal) From emp e Where e.job='CLERK' ; Example 2: Select e.deptno, avg(e.comm) From...

PL/SQL Ascii

Oracle PL/SQL Ascii Function The Ascii Function returns the NUMBER code that represents the specified character. The Ascii Function syntax: ascii ( character ) If more than one character is entered, the function acii will return only the value for the...