SQL & PL/SQL :: Take Schema Name From Procedure Argument?

Sep 15, 2011

following is my function,

which I need to pass parent_db_name as argument like schema name dynamically.

but i m unable to user it in cursor select query. Would any body tell me how will that be used in select query in cursor ?

create or replace procedure MyEvPro(new_court_code NUMBER, parent_db_name VARCHAR2) is
CURSOR c_evidence is SELECT GET_CASECODE(CASECODE,new_court_code) as NEW_CASECODE,COURT_CODE,EVIDENCE_NUM,ONDATE,REC_STATUS,UNITS_EARNED,CASECODE FROM parent_db_name.CASE_EVIDENCE_CHARGES WHERE GET_CASECODE(CASECODE,new_court_code) IS NOT NULL ORDER BY EC_CODE ASC;

[Code]....

View 6 Replies


ADVERTISEMENT

SQL & PL/SQL :: Create Procedure Have Month And Year As Argument

Aug 5, 2010

Need to create a procedure that will retrun me monthly count of records

create table sample ( S_name varchar2(20), S_Date Date);

insert into sample values('1','01-JAN-2005');
insert into sample values('1','1-JAN-2006');
insert into sample values('2','2-JAN-2007');
insert into sample values('3','4-JAN-2005');
insert into sample values('4','11-JAN-2004');
insert into sample values('3','2-JAN-2005');
insert into sample values('2','12-JAN-2006');
insert into sample values('1','21-JAN-2005');
insert into sample values('2','11-JAN-2005');
insert into sample values('7','01-JAN-2005');
[code]....

View 5 Replies View Related

DBMS_JOB.SUBMIT Can Pass Dynamic Argument Procedure

Aug 10, 2010

'Can we pass a dynamic collection variable to the procedure that is called from dbms_job.submit'

I have a package my_package with:

1. record type: ocv_rec

2. collection type: varr_ocv_rec varray(100) of ocv_rec

3. record type: ext_id_rec

4. collection type: varr_ext_id_rec table of ext_id_rec index by pls_integer

5. procedure: analyze_error_152_ll

6. procedure: get_ext_ids_152(
v_db_ssa_dtl in varr_ocv_rec,
ext_id_type in varchar2,
ext_ids out varr_ext_id_rec)

Now here is where the issue resides:Within the definition of analyze_error_152_ll (in body of my_package), I call get_ext_ids_152 using dbms_job.submit

procedure analyze_error_152_ll
is
vJob varchar2(400);
vJobNum binary_integer;
v_db_ssa_dtl2 varr_ocv_rec := varr_ocv_rec();
ext_ids varr_ext_id_rec;
ext_id_type varchar2(5) := '(1)';
/*OTHER DECLARATONS*/

[code]......

View 7 Replies View Related

SQL & PL/SQL :: Pass Object (or) Table As Argument To Remote Procedure?

Jul 18, 2012

Does it possible to pass object (or) table as an argument to a remote procedure?

View 2 Replies View Related

PL/SQL :: Procedure Access From One Schema To Another

Aug 2, 2013

I have created one procedure in SCOTT schema. just i need to see that same procedure information to TEST schema. how its possible.if im using

SELECT DBMS_METADATA.GET_DDL('PROCEDURE','PROC_NAME','SCOTT')

FROM DUAL in scott schema mean i can see that full procedure information,like wise i need to see in TEST schema mean what command i need to use.  

View 20 Replies View Related

SQL & PL/SQL :: Execute A Procedure Present In Different Schema?

Apr 27, 2010

I have two schema SCHEMA_A and SCHEMA_B in the same Database.

I want to execute a procedure UPDATE_CONTACT() which is present in SCHEMA_A from SCHEMA_B.

let me know whether the following SQL is correct:

BEGIN
SCHEM_A.UPDATE_CONTACT();
END;

View 4 Replies View Related

SQL & PL/SQL :: Procedure To Get Any DDL Done Against Sample HR Schema - Insufficient Privileges

Jul 8, 2012

I am new to Dynamic SQL..I create a procedure to get any DDL done against sample HR schema as follows.it goes well! Now when i try to test my procedure with some DDL command passing to the procedure i've created..strange! oracle throws an error as in the /*ERROR!!!!*/ block..

I don't understand why i am facing such an error..

/* Product an Version on my machine */
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
[code]...

View 7 Replies View Related

SQL & PL/SQL :: Procedure To Accept Schema And Produce CSV File For Table

Mar 23, 2012

The Utility should have a procedure that will be able to accept a schema and table name and produce CSV file for that table.

This is what i have so far:

CREATE OR REPLACE Procedure print_table (schema_name varchar2, tab_name varchar2) IS
BEGIN--begin procedure
DECLARE
vpath varchar2(100) := 'C:UsersUserDocumentsDocsDBAProject';
[code].....

It works outside of the procedure but the nature of the question requires a stored procedure.

View 26 Replies View Related

SQL & PL/SQL :: Writing Procedure In User 2 Schema Accessing Table Product - Not Compiled?

Dec 17, 2010

I have got 2 users as user1 and user2.I have used the following statements from user 'user1':

create role GENEVAOBJECTS;
grant select, insert, update, delete on PRODUCT to GENEVAOBJECTS;
grant GENEVAOBJECTS to user2;

In the above statements, product is a table. Now, I could able to access this table from user 'user2'. But however if I write a procedure in user2 schema accessing the table product, then the procedure is not getting compiled.

create or replace procedure test_prc as
v_test number(9);
begin
select product_id into v_test
from PRODUCT where rownum=1;

[code]...

why I cannot access that table from procedure?

View 8 Replies View Related

Server Utilities :: Import A Schema From One Database Schema To Another Schema B?

Aug 10, 2010

I want to import a schema from one database schema to another schema b from db STBTST to STATST and from schema CMSSTAGINGB to CMSSTAGINGA

I first want to test this to my own schema (mvanmannekes) CMSSTAGINGA is filled at the moment.

So i've created a dump from STBTST-CMSTAGINGB For importing im using this statement:

impdp mvanmannekes/password schemas=cmsstagingb remap_tablespace=cmsliveb_data:cmslivea_data
remap_tablespace=cmsliveb_index:cmslivea_index
remap_schema=cmsstagingb:mvanmannekes directory=expdp_dir dumpfile=cmstagingb.dmp

I'm getting this:

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "MVANMANNEKES"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
Starting "MVANMANNEKES"."SYS_IMPORT_SCHEMA_01": mvanmannekes/********
schemas=cmsstagingb remap_tablespace=cmsliveb_data:cmslivea_data

[code]....

View 4 Replies View Related

Forms :: Calling Reports 9i - Argument Can't Be Null

Oct 3, 2005

I am calling report9i from forms9i. i am getting following error

invalid report id

when i call a report from form in when button pressed trigger. And also giving the following error

argument(1) can't be null.

v_rep varchar2(100);
v_rep := run_report_object('report5',pl_id);

or

rep_object report_object;
v_rep varchar2(100);

rep_object := find_report('report5');
v_rep := run_report_object(rep_object,pl_id);

where pl_id is the parameter list.

View 34 Replies View Related

Forms :: FRM-40738 / Argument 1 To Builtin GO_RECORD Cannot Be Null

Jul 31, 2011

I got below error. I didnot use go_record.FRM-40738: Argument 1 to builtin GO_RECORD cannot be null.

View 1 Replies View Related

JDeveloper, Java & XML :: Pass Null As Argument In Any Method Parameter?

Feb 23, 2013

why we pass null as a argument in any method parameter....What is its use in method reference..

View 1 Replies View Related

SQL & PL/SQL :: CLOB Error ORA-21560 - Argument 2 Is Null / Invalid Or Out Of Range

Jul 31, 2013

I am receiving following error in the below provided procedure

Oracle Verion details: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for HPUX: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

Error:ORA-21560: argument 2 is null, invalid, or out of range

Anaysis :As per my analysis the procedure fetches a clob attachement as input while processing it using dbms_lob.read (inside this procedure) some intermediate buffer value has gone out of range and error is being thrown.As per me it is n_clob_pos variable value .detecting the correct variable causing this error.

PROCEDURE add_attachment_contents_test( p_in_smtp_connection IN UTL_SMTP.CONNECTION,
p_in_clob_attach IN CLOB,
p_out_status OUT NUMBER,
p_out_err_desc OUT VARCHAR2 )
[code].....

View 4 Replies View Related

Scheduler :: DBMS_SCHEDULER / Program Argument Not Generating Sysdate Value As Default

May 22, 2013

Recently we come across DBMS_SCHEDULER issue while passing SYSDATE as default value. Job executed with corect date value on creation time, but further schedule its not incrementing date value.

Snap of the Program

BEGIN
SYS.DBMS_SCHEDULER.CREATE_JOB (
job_name => '"OBIEE_ADM"."First_Job"',
job_type => 'STORED_PROCEDURE',
job_action => '"OBIEE_ADM"."SF_INTERFACE_PKG"."SF_EXTRACT"',
number_of_arguments => 1,
start_date => NULL,

[code]....

View 2 Replies View Related

Server Utilities :: ARGUMENT Segment Taken More Space Out Of Total System?

Jun 12, 2012

After importing my dump, i have noticed that ARGUMENT$ segment taken more than 9 GB out of my total SYSTEM table space.I belive ARGUMENT$ table is used only to store procedure/package parameter details. But I am not sure Why it has taken more space.

Is there any way we can reduce the SYSTEM table space? using with the below details?

Import Details:
--------------
1) Imported using IMP DP. List of parameters used are userid, logfile, dumpfile, directory, job_name and remap_schema.
2) Dump file size is 3GB
3) The below list will be no. of objects imported using my dump.

OBJECT_TYPE COUNT(1)
------------------- ----------
DATABASE LINK 1
FUNCTION 246
INDEX 4742

[code]...

4) The below list will be amount of space occupied by the segments in the SYSTEM.

col owner form a5 word wrap
col segment_name form a15 word wrap
col segment_type form a15 word wrap
select owner,segment_name,segment_type
,bytes/(1024*1024) size_m

[code]...

View 4 Replies View Related

PL/SQL :: PLS-00306 - Wrong Number Or Type Of Argument In Call To MULTISET_UNION_ALL

Sep 7, 2012

I'm trying to use MULTISET UNION to append several collections into a single recordset.The select queries shown for the CURSOR are simple beta versions of the real queries which have about 350 fields to each of them. I will be appending data from 15 of these queries which each will with no more than 20 records per query into a new single recordset (not sure if 'recordset' is the correct phrase or term for what I mean, it could be ARRAY, OBJECT, COLLECTION or something else all together).

Here is text of the ERROR message:

ORA-06550: line 63, column 1:
PLS-00306: wrong number or type of argument in call to 'MULTISET_UNION_ALL'

ORA-06550: line 62, column 1:
PL/SQL: Statement ignored

ORA-06550: line 71, column 36:
PLS-00487: Invalid reference to variable 'VARCHAR2'

ORA-06550: line 71, column 5:
PL/SQL: Statement ignored

I think the error has to do with some defect in my declare statements.

DECLARE
  MyTID varchar2(10);

  CURSOR Cursor_rst1 IS
      SELECT d_owner_internal_id,
             d_internal_id,
             d_tid,
             d_entity_name,
             d_form_seq
        FROM rtns.itas_rtn_ct_1120_cor tblRecords
       WHERE d_form_seq = '2710' --Tax Year =2003
         AND D_TID = MyTID;
[code]....

View 3 Replies View Related

Client Tools :: Sqlplus - Multiple Scripts In Argument (batch Execution)

Aug 13, 2008

I have two scripts (test1.sql and test2.sql) that need to be executed one after the other. I would like to call them both using a single command line:

sqlplus testuser/testpwd@testdb @c: est1.sql @c: est2.sql

This does not work

creating a test3.sql script that calls test1.sql and test2.sql is not an option.

View 22 Replies View Related

Server Utilities :: Error / Bad Dump File Specification / Invalid Argument Value

Nov 21, 2012

I restore Dump File in Oracle 10g .

my Command is :

impdp DUMPFILE=BAK910830.DMP NOLOGFILE=Y

An error message is as follows:

"Invalid argument value"

"Bad dump file specification"

"Dump File may ba an original export Dump file "

I think the dump File is in Oracle 11g Format .

View 8 Replies View Related

Server Administration :: Accessing Single Schema From Multiple Schema Logging?

May 16, 2011

A single master schema where many developers are accessing. all share same password.

now i would like to trace all the changes made by each users. so i create a individual users for all and grant permission to access that schema.do i have a possibility of auditing the changes did by each user for that particular schema

View 2 Replies View Related

Security :: Schema Consolidation And User Schema Mapping Based On Service

Jul 24, 2011

We have an application with many separate databases (one per customer). Given they share the same business requirements (service hours, change mgmt etc), we're interested in potentially consolidating the separate DBs (which are relatively small) into separate schemas within a fewer no of databases to reduce the overhead.

Our issue is that the application is hard-coded to use a specific administrator and application connection user name. Changing this is unfortunately not an option.

Given this limitation, is there any possibility to map a generic user into a customer-specific schema based on the database service that they connect to? Each customer connects to different database services but may use the same user name. We considered using private synonyms but this seems to acheive the opposite (i.e. many different users could connect and map to a single users schema). One thing to point out is that where there is a single user name, it is acceptable for a single password to be used across the different customer DBs as they will be a single admin/user.

View 5 Replies View Related

Client Tools :: How To Create A Table In Another Schema As In Existing Schema

Apr 26, 2010

I would like to create a table in another schema(CBF) as already exist in my schema(TLC) without data but related indexes,synonyms and grants should be include.

How could I do this without using export import. I am using TOAD 9.0.1.

View 10 Replies View Related

Server Utilities :: How To Take All Schema Metadata Export Except One Schema (scott)

Jul 5, 2012

how to take all schema metadata export except one schema (scott)

can i use like EXCLUDE=schema:"IN('SCOTT')

View 4 Replies View Related

Export/Import/SQL Loader :: Imp Records Of One Schema Into Another Schema Of Same Table

Nov 3, 2012

I had done following steps,

schemas(toy,toys)

1) i open the session of toy schema

First i taken backup of table

create table bck20121103_himan as select * from himan;

Backup table is created.

After taking the Backup table

delete himan;(deleting the records)

2) i log in to another session(toys)

exp toys/toys@orcl file=20121103TOYs.DMP TABLES=(HIMAN) /* Particular table is taken*/

3) i log in to toy schema

imp toy/toy@orcl file=<dump file name> TABLES=(HIMAN) INDEXES=N IGNORE=Y

i tried the above statement it taken so much of time..

Later i tried

I log in to toy session

i rename the table with other name.

later i imported

imp toy/toy@orcl file=<dump file name> TABLES=(HIMAN) IGNORE=Y FULL=Y

it's successfully imported.

View 3 Replies View Related

Server Utilities :: How To Move Schema To Another Schema In Same Database

Jan 5, 2009

move the tables with data present in the user scott(full) to another schema named test. In my case scott is in user tablespace and for test schema i have created different tablespace named test_tbs.

View 14 Replies View Related

Sequence Name In Oracle Database Schema As Well As Timesten Schema?

Jan 13, 2011

How to use same oracle sequence name in Oracle Database schema as well as timesten schema?

View 1 Replies View Related

Server Administration :: One Schema Versus Multiple Schema

Feb 1, 2010

single schema setup or multiple schema setups for an application development. Which option is recommended and pros and cons of these methods?

View 4 Replies View Related

SQL & PL/SQL :: Accessing Schema Object From Another Schema?

Apr 20, 2010

I have create one procedure under my user schema. In that procedure , I am selecting data from another schema's table.

While compiling that I am getting following error->

PL/SQL: ORA-00942: table or view does not exist
PL/SQL: Statement ignored

how I grant access of one schema object to another schema. Currently I am using oracle 10g

View 2 Replies View Related

How To Fire A Schema Trigger From Outside Schema

Sep 24, 2012

A user is using an ad hoc tool similar to SQL Developer called PeopleSoft Application Designer.

He creates a connection to the db, then issues an alter session set current_schema = 'restricted_schema'. The connected user does not have direct privileges on the "restricted_schema" which they call SYSADM.

After changing the schema context in that manner he creates objects in SYSADM. A schema trigger is then fired and grants privileges on the new objects created in SYSADM. Doing the same in either SQL Plus or SQL Developer does not fire the schema trigger.

I think SQL Plus and SQL Dev are working as they should. Altering the session like that does not change your identity - just the schema context. But, when you examine v_$session, the connection with this other tool looks exactly the same as one from SQL Plus or SQL Dev when changing the schema context in the session.

Instead of trying to figure out what this other tool is doing, is there any way for that schema trigger to fire when using this process from one of our tools?

View 6 Replies View Related

Server Utilities :: Compare Column Name Of Schema With Other Schema's Column Name

Dec 15, 2012

I have a standard schema named ABC and 600 more schema's over there in my database.They all has same table name and column name as on standard schema. But in some tables number of columns varying. So I need to compare all schemas with my standard schemas column name. I create below script but it is generating output in infinite loop.

SET SERVEROUTPUT ON
DECLARE
V_COLS VARCHAR2(20);

BEGIN
FOR CUR_CCD IN(SELECT DISTINCT TABLE_NAME,OWNER FROM ALL_TABLES
WHERE OWNER LIKE 'CCD_MAIN'
[code]....

View 16 Replies View Related







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