Overblog All blogs Top blogs Jobs, Education & Studies
Follow this blog Administration + Create my blog
MENU
Advertising

Merge table into another table

SQL> create table student_emails_ext 2 (firstname varchar(40), 3 lastname varchar(40), 4 email varchar(80) ); Table created. SQL> SQL> create table student_emails 2 as select * from student_emails_ext 3 where 0=1 4 / Table created. SQL> SQL> SQL> merge...

Read more

Advertising

Subquery

select emp_id, lastname from emp c where not exists (select * from gift o where o.emp_id = c.emp_id); SELECT e1.ename, d.dname FROM emp e1, dept d WHERE e1.deptno = d.deptno AND EXISTS (SELECT 'x' FROM emp e2 WHERE e2.ename = 'Smart' AND e2.deptno =...

Read more

Pass number value to function

  SQL> CREATE OR REPLACE FUNCTION celsius_to_fahrenheit (degree NUMBER) RETURN NUM BER IS 2 buffer NUMBER; 3 BEGIN 4 buffer := (degree * 9/5) + 32; 5 RETURN buffer; 6 END celsius_to_fahrenheit; 7 / Function created

Read more

Varray type parameter in Function

> create or replace type numberlist_t 2 as varray(4) of varchar2(20); 3 / Type created. SQL> SQL> column numlist format a60 SQL> SQL> alter table e add (numlist numberlist_t) SQL> create or replace function ext 2 (p_varray_in numberlist_t) 3 return varchar2...

Read more

Advertising

using aggragrate functions for reporting

Advanced Grouping in oracle, more helpful for report generate. SQL> SELECT * FROM EMP; -- GROUP BY CLAUSE SQL> SELECT deptno, SUM(sal) FROM emp WHERE sal <= 4000 GROUP BY deptno; -- ROLLUP SQL> SELECT deptno, SUM(sal) FROM emp WHERE sal <= 4000 GROUP...

Read more

SQL Query – Order of execution

When you execute a SQL Query, it will be executed in the following sequence. FROM ON JOIN WHERE GROUP BY HAVING SELECT DISTINCT ORDER BY TOP     When a query is submitted to the database, it is executed in the following order: FROM clause WHERE clause...

Read more

What is bulk collect?

What is bulk collect? This keyword ask the SQL engine to return all the rows in one or several collections before returning to the PL/SQL engine so, there is one single roundtrip for all the rows between SQL and PL/SQL engine. BULK COLLECT cannot be use...

Read more

Trigger Disadvantages

-->Not Compiled -->No SELECT Trigger Support -->Complete Trigger Failure -->Disabled Triggers -->No Version Control -->Update OF COLUMN -->No Support of SYS Table Triggers -->Mutating Triggers -->Hidden Behavior

Read more

Advertising

What are attributes of implict cursor?

What are attributes of cursor? · SQL%ROWCOUNT: Number of rows affected by most recent SQL statement. · SQL%FOUND: Boolean attribute that evaluates to TRUE if most recent SQL statement affects one or more rows. · SQL%NOTFOUND: Boolean attribute that evaluates...

Read more

<< < 1 2 3 4 5 6 7 > >>