Search
 
SCRIPT & CODE EXAMPLE
 

SQL

alling a function from PL/SQL in a select statement in ORACLE

DECLARE
  em_sal NUMBER(20);
  em_comm employees.commission_pct%type;
  annual_salary NUMBER(10,4);
BEGIN
  SELECT salary INTO em_sal FROM employees WHERE employee_id=149;
  SELECT commission_pct INTO em_comm FROM employees WHERE employee_id=149;
  annual_salary := get_annual_comp(em_sal,em_comm);
  dbms_output.put_line('total salary '|| annual_salary);
  SELECT SUM(get_annual_comp(salary,commission_pct)) into annual_salary
  FROM employees
  WHERE department_id=90;
  dbms_output.put_line('department annual salary '|| annual_salary);
END;
/
Comment

PREVIOUS NEXT
Code Example
Sql :: Time difference in hh:mm:ss 
Sql :: restore backup 
Sql :: alter server set options dbserver oracle fdw 
Sql :: create table as select sql server error 
Sql :: download mysql database to excel in android studio 
Sql :: Creating a comment and reply system PHP and MySQL 
Sql :: function sum(text) does not exist postgres 
Sql :: sql implicit cursor 
Sql :: how to select only id where is not in column mysql 
Sql :: unable to open database database.db file is encrypted or is not a database 
Sql :: dynamic where clause in sql server stored procedure 
Sql :: case sensitive sql 
Sql :: dbms interview questions 
Sql :: how to make letter id primary key in mysql 
Sql :: pl sql fetch 
Sql :: sql promises req, res 
Sql :: for each row trigger postgresql 
Sql :: strftime format sqlite 
Sql :: Uncaught PDOException: SQLSTATE[HY000] [1698] 
Sql :: SOQL Parent to child 
Sql :: create sql server database 
Sql :: left join vs inner join performance 
Sql :: sql to move data from one table to another 
Sql :: show database size or specific database table size 
Sql :: select 1 from orders 
Sql :: plsql check for string in numeric 
Sql :: mysql configuration file storage location 
Sql :: create trigger in phpmyadmin 
Sql :: reading from right to left from string find first special characters in sql 
Sql :: in sql developer where equal queres 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =