SQL & PL/SQL :: Difference Between Include Program Header Before CREATE OR REPLACE PACKAGE Statement

Mar 2, 2010

Is there any difference between include program header before CREATE OR REPLACE PACKAGE statement and program header after CREATE OR REPLACE PACKAGE statement

View 4 Replies


ADVERTISEMENT

SQL & PL/SQL :: Create Or Replace - Package Body Created With Compilation Errors

Mar 8, 2012

CREATE OR REPLACE PACKAGE pkg_mkt_hub_load_collection
AS
PROCEDURE sp_final_load_mkt_hub;
END pkg_mkt_hub_load_collection;
/
CREATE OR REPLACE PACKAGE BODY pkg_mkt_hub_load_collection
AS
c_default_limit CONSTANT PLS_INTEGER:=5000;

[code]....

show error

error code

SQL> @pkg_mkt_hub_load_collection.sql
Package created.
Warning: Package Body created with compilation errors.
Errors for PACKAGE BODY PKG_MKT_HUB_LOAD_COLLECTION:
LINE/COL ERROR
-------- -----------------------------------------------------------------
57/4 PL/SQL: Statement ignored
PLS-00306: wrong number or types of arguments in call to 'MULTISET_INTERSECT_ALL'
SQL>

View 11 Replies View Related

SQL & PL/SQL :: Include / Exclude In One Query Statement

Aug 31, 2011

how to write this query using all three tables in one query statement.

Result:

Input value of "GM" would return "GM@EMAIL.COM"

Input value of "GM" and "GMC" would return "GMC@EMAIL.COM"

If "GM" is supplied, then only return the "GM@EMAIL.COM" email.

If "GM" and "GMC" is supplied, then only return the "GMC@EMAIL.COM" email

Test Case : GM would return "GM@EMAIL.COM" email

Test Case : GM and GMC would return "GMC@EMAIL.COM" email

select email
from email a,
company b,
sub_company c
where (company = "GM" but no match found in sub_company)
(company = "GM" and sub_company_name = "GMC" match is found in sub_company)

[code]....

View 11 Replies View Related

SQL & PL/SQL :: Include Tablespace In Create Table Command

Oct 5, 2011

I want to creat a table using Execute Immediate that includes tablespace name in the create table command. But I don't know the tablespace name that the client is using. Can I incorporate in a script? If yes, then how?

I have written the following proc. While executing , it gives me the error:
ORA-00959: tablespace 'V_TABLESPACE_NAME' does not exist.

create or replace procedure pr_create_table as
v_tablespace_name varchar2(4000);
begin
select distinct tablespace_name into v_tablespace_name
from user_tables
where table_name like 'ABC%';
[code]....

View 20 Replies View Related

PL/SQL :: Date Difference - Include Both Start And End Date In Range

Aug 8, 2013

select to_date('28-FEB-2013') - TO_DATE('01-FEB-2013')  FROM DUAL 

gives me 27 days, what should I do to get 28 ? meaning include both the start and end dates in the range ?

View 3 Replies View Related

PL/SQL :: Difference Between Translate And Replace Function

Jan 6, 2013

Explain with the best example for difference between translate and replace function.

View 2 Replies View Related

Reports & Discoverer :: Difference Between Formula Column And Function In Program Unit?

May 24, 2013

know when to use a formula column and when to use a function in program unit in oracle reports.

View 1 Replies View Related

SQL & PL/SQL :: Difference Between Object Type And Package

Oct 11, 2011

understand between Oracle pl/sql object type and package!

View 3 Replies View Related

SQL & PL/SQL :: Difference Between Oracle Procedure And Package?

Jan 7, 2013

difference between oracle procedure & package.

View 1 Replies View Related

PL/SQL :: Create Or Replace View

Sep 11, 2012

I am about to pass 1Z0-051 and have been cramming. Ran across this scenario: Create or replace view. Correct answer: allows insert from view in multitable insert statement. Can I actually insert data from a view? My understanding is no data actually exists in a view. This has created a cavernous feeling of inadequacy.

View 3 Replies View Related

SQL & PL/SQL :: Trigger Insert - Create Or Replace?

Jun 12, 2013

I have make a new trigger.Create a trigger that inserting a new job_id MAX_SALARY assigned as the employee's salary more than 80 departmental charges

I have that code, is that correct?

CREATE OR REPLACE
TRIGGER TR27
AFTER INSERT ON JOBS FOR EACH ROW
BEGIN
(SELECT MAX(SALARY) FROM EMPLOYEES WHERE DEPARMENT_ID=80);
:NEW.MAX_SALARY := :OLD.MAX_SALARY;
END;

What I need to complete it?

View 2 Replies View Related

Create Interactive Program To Add Numbers Between Two Given Digits Using SQL

Aug 11, 2008

How Do I Create An Interactive Program That Will Add Numbers Between Two Given Digits Using Sql. For Example:

Enter Start Num: 0
Enter End Num: 15
Then It Does 1+2+3+...........+14

View 2 Replies View Related

SQL & PL/SQL :: CREATE OR REPLACE - Error During Execution Of Trigger

Aug 9, 2011

I create this trigger:

CREATE OR REPLACE TRIGGER T_HST AFTER INSERT
On HST
FOR EACH ROW
DECLARE
Begin
INSERT INTO HST (EMP_NO, START_DATE )
SELECT EMP_NO, SYSDATE
FROM HST
WHERE EMP_NO = :NEW.EMP_NO;
End T_HRS_SAL_PERIOD_HSTY_UPD_PRI;
/

when I insert a new record in table HST I get this error:

ORA-04091: table HST is mutating, trigger/function may not see it
ORA-06512: at "T_HST", line 3
ORA-04088: error during execution of trigger 'T_HST'

What I wrong in this trigger?How can I modify it?

View 7 Replies View Related

SQL & PL/SQL :: Trigger To Execute Immediate Create Or Replace View?

Jan 30, 2013

i try to make trigger to execute immediate create or replace view

(
CREATE OR REPLACE TRIGGER xxxx
BEFORE INSERT ON table1
REFERENCING NEW AS NEW OLD AS OLD

FOR EACH ROW
declare
l number ;
v_ddl varchar2(4000);
v_job number;
[code]....

it give me error for insuffition privilage in execute immediate and after i make GRANT CREATE ANY TRIGGER TO user give me error can't commit in trigger.

View 8 Replies View Related

SQL & PL/SQL :: Bind Variables - Create Or Replace Procedure

Jun 12, 2012

create or replace procedure my_proc(p_user in varchar2) is
l_cursor sys_refcursor;
l_query constant varchar2(1000) :=
'select a'
|| 'from ' || p_user || '.user_table'
|| 'where param0 = :x'
|| 'and param1 = :x'
|| 'and param2 = :x'

[Code]...

Suppose I execute my_proc many times and for multiple values of p_user. For performance reasons, will l_query be stored in the cache as I am using bind variables or it will not since I have the concatenation with p_user value ?

View 6 Replies View Related

PL/SQL :: Create Or Replace Trigger After Insert On Transfer?

Sep 1, 2013

create or replace trigger aifer_transfer after insert on transfer for each new row begin     

   UPDATE Account SET balance = balance-:new.amount        WHERE acc_id = from_acc_id;        UPDATE Account SET balance = balance+:new.amount        WHERE acc_id = to_acc_id;      end if; end;     create or replace trigger bifer_transfer before insert on transfer for each new row begin      if get_balance(:new.from_acc_id) < :new.amount  then        raise_application_error(-20001, 'Not enough money in account!');        end if; end;   create or replace function get_balance(p_acc_id in number) return number as v_balance account.balance%type; begin select balance into v_balance from account where acc_id = p_acc_id; return v_balance; end;    select get_balance(123) from dual..................................................i am geting this error when executing the trigger..................................................Error report:ORA-01912: ROW keyword expected01912. 00000 -  "ROW keyword expected"*Cause:    keyword missing*Action:  

View 12 Replies View Related

PL/SQL :: Can't Compile And Execute Function (Create Or Replace)

Jun 6, 2013

I cant compile & execute this function.

create or replace
FUNCTION get_branding_testing
RETURN r_brand
IS
BEGIN
CURSOR c1
IS
SELECT b.branding_code, c.name_desc     
[code]....

View 6 Replies View Related

SQL & PL/SQL :: Dynamic Statement In Database Package - Missing Expression

Feb 29, 2012

I have the following statement dynamic sql statement in a database package.

begin
EXECUTE IMMEDIATE 'SELECT REPLACE(SUBSTR('||V_WHERE_CLAUSE||',1,3, ''AND'', NULL) INTO V_WHERE_FILTER FROM DUAL';
EXCEPTION
NULL;
end;

When executed it gives following error.

ORA-20000: ORA-20000: ORA-00936: missing expression
### TRACE ### ORA-06512: at "NDSS.DUP_SRCH_PKG_MOD", line 931
### END TRACE ###
### TRACE ### ORA-06512: at "NDSS.DUP_SRCH_PKG_MOD", line 935
ORA-06512: at "NDSS.DUP_SRCH_PKG_MOD", line 164
### END TRACE ###
ORA-06512: at "NDSS.DUP_SRCH_PKG_MOD", line 184
ORA-06512: at line 9

View 4 Replies View Related

SQL & PL/SQL :: Add Difference Column In Select Statement

Aug 29, 2012

just i want add diiferece column in my select statement.For Example:-

select
Name,
Salary,
Designation,
date_first_payment,
date_last_payment,
(date_first_payment-date_last_payment) Datediff
from My_table

then its working

select *,(date_first_payment-date_last_payment) Datediff
from My_table

its not working..

View 7 Replies View Related

PL/SQL :: Merge Statement - Update Only When There Is Difference?

Feb 7, 2013

I have two tables have almost the same columns, how can I use merge statement to update the target table only when there is difference between source and target table. Is there any easier way not compare each column one by one? I am using Oracle 11.2

Here is the MERGE statement:

Merge into tb_trgt trgt using tb_src src
on (src.id = trgt.id)
when not matched then insert (trgt.id, trgt.nm, trgt.addr) values (src.id, src.nm, src.nm)
when matched then update set trgt.nm = src.nm, trgt.addr = src.addr
where trgt.nm <> src.nm or trgt.addr <> src.addr
;

Is there any easier way to specify the where clause in the NOT MATCHED? I don't want compare each column of the tables. Since I may have many columns in the tables.

View 3 Replies View Related

SQL & PL/SQL :: Difference Between After / Before Insert In Row Or Statement Level Trigger

Feb 8, 2012

what is the difference between after or before insert in row level trigger and statement level trigger.

View 3 Replies View Related

Reports & Discoverer :: Create A Procedure In Program Unit And Assign Output To A Field In Report?

May 8, 2013

i just want to know how can i create a procedure in the program unit and assign the output to a field in the report.

View 7 Replies View Related

SQL & PL/SQL :: Unable To Create DB Package?

Mar 1, 2012

I´m having a trouble creating a db package. I´ve changed my job and now i´m working full on DB instead of Forms Developer.

So my trouble is that i want to create some like a global cursor on DB package, i know you can create global variables and use it on all the procedures/function inside the package. But how about cursors?

My problem: I dont´know how to declare into the spec. I don´t know how to use it on body.

My actual

I have the structure below:

PackageSpec:
CREATE OR REPLACE PACKAGE [i]MyPackageName[/i]
IS
CURSOR [i]myGlobalCursor[/i](par1 IN VARCHAR2, par2 IN DATE)(
);
PROCEDURE [i]MyProcedure1[/i](par1 IN VARCHAR2, par2 VARCHAR2);

[code]....

View 13 Replies View Related

PL/SQL :: How To Create A Package With Procedures

Aug 15, 2013

By referring through net I have written the following PCK file. I have installed my Oracle 11g database in VirtualBox(Win XP). I can able to select the tables using query from the host(Windows 7) 

CREATE OR REPLACE PACKAGE APEX_SYS_PCK  AS    TYPE refcursortype IS REF cursor  PROCEDURE GET_USER_DETAILS(  D1 OUT refcursortype,  P_USER IN VARCHAR2,  P_PASS IN VARCHAR2);END APEX_SYS_PCK; / CREATE OR REPLACE PACKAGE BODY APEX_SYS_PCKAS PROCEDURE GET_USER_DETAILS(  D1 OUT refcursortype,  P_USER IN VARCHAR2,  P_PASS IN VARCHAR2) IS BEGIN   OPEN D1 FOR SELECT * FROM APEX.PERSONS; END GET_USER_DETAILS;  END APEX_SYS_PCK;/

 When I try to run the script I am getting the following error. How to solve this problem?

Project: sqldev.temp:/IdeConnections%23vAPEX.jprF:PACKAGESAPEX_SYS_PCK.sqlError: PL/SQL: Compilation unit analysis terminatedError(1,14): PLS-00905: object APEX.APEX_SYS_PCK is invalidError(1,14): PLS-00304: cannot compile body of 'APEX_SYS_PCK' without its specification

View 9 Replies View Related

Enterprise Manager :: What Is The Difference Between Create External Table Vs Create Table

Apr 29, 2011

What is the difference between CREATE EXTERNAL TABLE Vs CREATE TABLE .?

Is CREATE EXTERNAL TABLE included in CREATE TABLE?

View 3 Replies View Related

SQL & PL/SQL :: Create Pipeline Function In Package

Feb 13, 2013

Can we create a Pipelined function in A Package ? I know we can create it standalone function.

View 11 Replies View Related

To Use UTL_FILE Package To Create OS File

Apr 26, 2013

I want to use UTL_FILE package to create OS file. How to resolve this error. Oracle11g under XP.

SQL> create directory my_dir as 'c: emp';

Directory created.

1 create or replace procedure test_1(md in varchar2)
2 is
3 file utl_file.file_type;
4 begin
5 file := utl_file.fopen(md,'abc.log','w');
6 utl_file.put_line(file,'EMPLOYE REPORT');
7 utl_file.fclose(file);
8* end;
SQL> /

Procedure created.

SQL> execute test_1('MY_DIR');
BEGIN test_1('MY_DIR'); END;

RROR at line 1:
RA-06510: PL/SQL: unhandled user-defined exception
RA-06512: at "SYS.UTL_FILE", line 98
RA-06512: at "SYS.UTL_FILE", line 157
RA-06512: at "SCOTT.TEST_1", line 5
RA-06512: at line 1

View 2 Replies View Related

Precompilers, OCI & OCCI :: Cobol Program That Call C Program

Jan 28, 2011

I have a Cobol program that call C program above

#include stdlib

EXEC SQL INCLUDE SQLCA;
EXEC SQL BEGIN DECLARE SECTION;
char *uid = "puntos/puntos@cmrdesar";
[code]....

Are something wrong in C programm ? Pro*C code from vouters.dyndns.org/tima/OpenVMS-Cobol-C-Cobol_ passing_ variable_ number_ of_ arguments_to_C.html

View 1 Replies View Related

SQL & PL/SQL :: Difference Between Stand Alone Function And Function Declared In A Package?

Mar 11, 2010

What is the Difference between a Stand Alone Function/Procedure & a Function/Procedure declared in a Package.

View 2 Replies View Related

Windows :: Create BAT File With Query To Run A Package

Dec 14, 2010

I need to create a bat file which include a query to run a package. I use plsql developer to develop the package. its username,password and database is user,pswd,db1 respectively. the query to run the package is "SELECT

COLUMN1 AS "LAST NAME",
COLUMN2 AS "FIRST NAME",
COLUMN3 AS "LOCATION"

FROM TABLE(PKG.GET_SUM('09-NOV-2010','12-NOV-2010')) "

what code should I write to create a bat file.

View 13 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved