PL/SQL :: Display Output Of O_store_rec Object

May 11, 2013

while compiling this pl/sql block i am getting error ora-6531 :reference to uninitialized collection.

Declare
O_error_message RTK_ERRORS.RTK_TEXT%TYPE;
O_store_rec STORE_SQL.STORE_REC;
I_message RIB_XSTOREDESC_REC;
I_message_type VARCHAR2(50);
result boolean;
Begin
O_store_rec.loc_trait_tbl := ORGANIZATION_SQL.LOC_TRAIT_TBL();
O_store_rec.walk_through_tbl := STORE_SQL.WALK_THROUGH_STORE_TBL();
[code]........

View 4 Replies


ADVERTISEMENT

SQL & PL/SQL :: Output Layout And Display Changes?

Oct 11, 2011

SQL

SELECT ug_name, rss_user_name
FROM ru_ug
WHERE rss_name = 'EXAMPLE' AND ug_name LIKE 'cn=SNG-PWI11_%'
ORDER BY ug_name

Output

UG_NAMERSS_USER_NAME
cn=SNG-PWI11_DBE_TMM,ou=Netgroup,dc=TMM,dc=netopscn=hostname55,ou=Netgroup,dc=TMM,dc=netops
cn=SNG-PWI11_DBE_TMM,ou=Netgroup,dc=TMM,dc=netopscn=hostname49,ou=Netgroup,dc=TMM,dc=netops
cn=SNG-PWI11_DBE_TMM,ou=Netgroup,dc=TMM,dc=netopscn=hostname19,ou=Netgroup,dc=TMM,dc=netops
cn=SNG-PWI11_I_TMM,ou=Netgroup,dc=TMM,dc=netopscn=hostname932,ou=Netgroup,dc=TMM,dc=netops
cn=SNG-PWI11_I_TMM,ou=Netgroup,dc=TMM,dc=netopscn=hostname56,ou=Netgroup,dc=TMM,dc=netops
cn=SNG-PWI11_I_TMM,ou=Netgroup,dc=TMM,dc=netopscn=hostname77,ou=Netgroup,dc=TMM,dc=netops

But I wish other output:

UG_NAME1 UG_NAME2
RSS_USER_NAME1 RSS_USER_NAME3
RSS_USER_NAME2

Table:

CREATE TABLE RU_UG
(
RSS_USER_NAME VARCHAR2(255 BYTE) NOT NULL,
UG_NAME VARCHAR2(255 BYTE) NOT NULL,
RSS_NAME VARCHAR2(32 BYTE) NOT NULL,
RSS_TYPE VARCHAR2(12 BYTE) NOT NULL,

[code]....

View 1 Replies View Related

SQL & PL/SQL :: Display Output IDs Which Are Having Status Both Y And N?

May 11, 2012

CREATE TABLE stud(id number,Status CHAR(1))

INSERT INTO stud values(10,'Y')
INSERT INTO stud values(10,'Y')
INSERT INTO stud values(10,'Y')
INSERT INTO stud values(10,'N')

[code]...

ID STATUS

10 Y
10 Y
10 Y
10 N
20 Y

[code]...

I want to display the out put the IDs which are having the status both 'Y' and 'N'The output should be

ID STATUS

10 Y
10 Y
10 Y
10 N
20 Y
20 N
20 N

View 12 Replies View Related

SQL & PL/SQL :: Display In List Non-Existent Value In Output

Mar 6, 2012

I am not sure if this is even possible however I will give it a try here. is there a way to take a value from an In List that doesn't exist in the table and get SQL PLus to output that value with an assigned decode construct. example.

1 select decode(count(object_name),1,'EXIST',null,'NOT EXIST',0,'NOT EXIST'),
2 object_name, object_type
3 from dba_objects where object_name in (
4 'GV_$METRICNAME',
5 'GV$METRICNAME',
6 'GV_$METRICGROUP',
7 'GV$METRICGROUP',
8 'ABC'
9 )
10* group by object_name, object_type
SQL> /

DECODE(CO OBJECT_NAME OBJECT_TYPE
--------- ------------------------- -------------------
EXIST GV_$METRICNAME VIEW
EXIST GV_$METRICGROUP VIEW
EXIST GV$METRICNAME SYNONYM
EXIST GV$METRICGROUP SYNONYM

and have it look like this:

DECODE(CO OBJECT_NAME OBJECT_TYPE
--------- ------------------------- -------------------
EXIST GV_$METRICNAME VIEW
EXIST GV_$METRICGROUP VIEW
EXIST GV$METRICNAME SYNONYM
EXIST GV$METRICGROUP SYNONYM
NOT EXIST ABC

View 4 Replies View Related

SQL & PL/SQL :: Display Output For Null Column

Jul 24, 2012

I am having following table, and below are the out put and desired output.

CREATE TABLE tbl1
(
mon VARCHAR2(10)
, grp VARCHAR2(50)
, visits NUMBER
, redirect VARCHAR(50)
)
;

[Code]....

Query:

SELECT
mon
, grp
, SUM(visits)
FROM
tbl1
WHERE
redirect IS NOT NULL
GROUP BY mon, grp
;

Output:

May-12 Green 16
May-12 Blue 20
May-12 Yellow 13

Desired Output:

May-12 Green 16
May-12 Blue 20
May-12 Yellow 13
May-12 Red 0
May-12 Orange 0

How can this be acheived?

View 1 Replies View Related

Client Tools :: Display Output In Sql

May 15, 2010

having trouble displaying stuff on screen. It compiles the program successfully but just doesnt show any output Try using this (SET SERVEROUTPUT ON SIZE 4000) does nothing though. here my code

DECLARE
/*This program coverts a date from one fomat eg 1/31/10
into another format eg January 31,2010 */
/*declaring variables
assign a date that is in one format*/
EXAMPLE_DATE DATE := TO_DATE(' 1/31/06',' MM/DD/YY' );
/*finding the position of where the forward slash are*/
position_finder NUMBER := INSTR(EXAMPLE_DATE,'/');

[Code]....

View 2 Replies View Related

Sql To Display Output In Horizontal View?

Sep 8, 2012

I need to display the sql query output in horizontal manner. Below I have given the script.

create table TestTable (id number, name varchar2(10))
insert into TestTable values (1, 'John')
insert into TestTable values (2, 'Mckensy')
insert into TestTable values (3, 'Valneech')
insert into TestTable values (4, 'Zeebra')

[code]....

But for my requirement, I need to display in horizontal manner.

ID   1       2       3           4
Name John    Mckensy Valneech    Zeebra

View 3 Replies View Related

SQL & PL/SQL :: Display Grid Output Using Execute Immediate Or SysRefCursor Constructs?

Mar 21, 2011

I am in a state of confusion and requires a solution for this urgently:I used to use 'Execute Immediate' statement or 'Sys_RefCursor' for forming parts of query dynamically based on user inputs and then finally execute them at runtime for updating database / saving results into a variable etc.

But as per the latest requirement, I wanted to have the resultset of such a query displayed in the grid area / results area of a database tool; say, SQL Navigator, Toad or PL/SQL developer.; just like you see the results of a normal 'SELECT * FROM TABLE1'; Is this really possible ??

see the below examples:

Eg: for Execute Immediate:

declare
vtest VARCHAR2 := NULL;
vdisplay VARCHAR2;
begin
vtest := 'SELECT FIELD_1 INTO vdisplay FROM TABLE_A';
vtest := trim(vtest) || 'WHERE FIELD_2 = ''XYZ''';
execute immediate TRIM(vtest);
dbms_output.put_line(vdisplay);
end;

---> This would display output into the 'Output' tab of the database tool / editor;

Eg: for SysRefCursor:

declare
vCur SYS_REFCURSOR;
vdisplay VARCHAR2;
begin
OPEN vCur for 'SELECT NULL' || var1 || 'WHERE FIELD_1 = ' || Value1;
FETCH vCur INTO vdisplay;
dbms_output.put_line(vdisplay);
end;

---> Even this would display output only into the 'Output' tab of the database tool / editor;

===> But my requirement is: Different from these, is there any way to get this output displayed into the normal output grid / result area of a database tool ? just like you see the results of a normal 'SELECT * FROM TABLE1' query ?

View 5 Replies View Related

PL/SQL :: Error In Modifying Object Value In Triggers Defined On Object Tables

Sep 26, 2012

While practicing with Triggers, the following error was encountered. An Object Type and an object Table are created.

create or replace
type typPerson is object
(id number,
firstname varchar2(30),
lastname varchar2(30)
[code].........

I executed the below insert statement, and I got the following error.

SQL> insert into person_obj_tab values (10,'Object1','From Trigger');
insert into person_obj_tab values (10,'Object1','From Trigger')
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 4153
Session ID: 136 Serial number: 305
[code]......

SQL> insert into person_obj_tab values (10,'Object','Original');

1 row created.Question:

1) Trigger of version 1 did not report any error during compilation, but during DML execution, hangs for sometime and gives the above error.
2) Whether direct assignment of Objects of greater size is possible inside triggers built on object Tables?
3) Suppose an object contain multiple attributes (say more than 20), then how to assign them inside a trigger?

View 1 Replies View Related

TimesTen In-Memory :: OracleDataReader - Object Reference Not Set To Instance Of Object

Jan 25, 2013

I have a problem with executing oracleCommand.ExecuteReader() method. Whatever I try it always returns null and it won't create OracleData reader object. I'm using ODAC 1120320_x64 for .net 4.0 and timesten112241.win64. Don't sure what to do. Debugger is showing strange thing in OracleConnection object : ConnectionState = Closed, but output of ttStatus shows connection to TimesTen data store and ExecuteNonQuery() command works just fine with or without (in or out) parameters. But when I try to execute some query with multile output such as select *, I can't get any result.

I also have a strange problem with connection.Open() When I execute Open() i throws AccessViolationException that can be handled with [Handle ProcessCorruptedStateExceptions] attribute, but connection is established after that and my application works fine until I try to instance OracleDataReader object.

Here is the code:
OracleCommand select = null;
OracleDataReader reader = null;

select = new OracleCommand(selectStmt, connection);
select.CommandType = CommandType.Text;
try
{
reader = select.ExecuteReader(); // this line throws NullReferenceException
if (reader.HasRows)
{
[code]....

Just to mention, I tried it with different queries (pl/sql, plane sql, stored procedure) and all of them works fine in SQL Developer, but not in app.

View 10 Replies View Related

Find Dependent Object Details For Any Object

Dec 24, 2012

Is there any query to find the dependent object details for any object. Like if mview is built on a table, then i should be able to find the table name with out checking code of the mview. similar way for view and functions or procedures etc...

View 5 Replies View Related

SQL & PL/SQL :: How To Print The Multiple Output Statements In Single Output

Jul 1, 2013

DECLARE
JOBSFILE UTL_FILE.FILE_TYPE;
-- TAKE ALL JOB TITLES FROM JOBS
CURSOR JOBSCUR IS
SELECT *
-- DDOCNAME,DDOCTITLE,DSECURITYGROUP,DDOCAUTHOR,DDOCTYPE,DINDATE,PRIMARYFILE,EXTRACTIONDATE,BATCH_ID
FROM TARGET_UCM ;
[code].......

this is my plsql here to print table values i am using many utl_file.put_line statements is there any way to print all table values in a single utl_file.put_line.

View 2 Replies View Related

PL/SQL :: How To Access Type Object Variable Declared Inside Another Type Object

Mar 29, 2013

I have an Type-object typeObj1 that consists another Type-object typeObj2. this def has another Type-object typeObj3. how to access variable declared inside typeObj3. I have syntax below for each Type.

CREATE OR REPLACE TYPE typeObj1
AS OBJECT
   (
      SYSTEM_IDENTIFER                    VARCHAR2(50),
      PROCESS_TYPE                          VARCHAR2(50),
      abc                                            typeObj2
     
   )
/

[Code]...

/I have tried to access the type-object in where clause in following way

FROM TABLE(CAST(I_typeObj1 AS typeObj1)) ITTPRC,
......
Where
.......
AND (ADDKEY.ADDTN_INFO_KEY_TYP_NM IN (SELECT ADDTN_INFO_KEY_TYP_NM FROM TABLE(ITTPRC.abc)))

AND (ADTINF.ADDTN_RQST_TYP_VAL_DT  IN (SELECT ADDTN_RQST_VAL_DT FROM TABLE(     ITTPRC.def)) OR ITTPRC.def IS NULL )
AND (ADTINF.ADDTN_RQST_TYP_VAL_NUM  IN (SELECT ADDTN_RQST_VAL_NUM FROM TABLE( ITTPRC.def)) OR ITTPRC.def IS NULL )
AND (ADTINF.ADDTN_RQST_TYP_VALUE  IN (SELECT ADDTN_RQST_VALUE FROM TABLE( ITTPRC.def)) OR ITTPRC.def IS NULL )

In this way i am able to access the variable inside typeObj3. But problem is i am getting error "ORA-01427 single-row subquery returns more than one row" when i pass more that one typeObj2.

I passed the values like this in proc execution.

T_T_A_I_V  :=  typeObj3('asdasd',NULL,NULL),
                       typeObj3('String654',NULL,NULL),
                       typeObj3('abcdef',NULL,NULL));                                    
T_T_A_I_I  :=  typeObj2('CampusCode',T_T_A_I_V),
                          typeObj2('PlanNumber',T_T_A_I_V);

What i have done is removed typeObj3 from typeObj2, variables defined in typeObj3 are added in typeObj2 then i got ride of above error. is it correct

View 4 Replies View Related

SQL & PL/SQL :: Splitting 1 Output Row Into 3 Output Rows

Sep 25, 2013

Currently I have a requirement where I need to create 2 more output rows using each result row.

In my requirement I am populating charges table with types of charges, on each line item of charges, I need to apply 2 types of taxes and populate it along with the charge line item. I will be storing charges in table charges and the 2 taxes to be applied in taxes table respectively. For each row of charges, i need to apply these 2 taxes present in taxes table resulting in 3 rows output.

--Create tables charges
create table charges
(
charge_type varchar2(10) ,
charge number
);

[Code]....

My expected output should be like below:

Item_type amount
-------------------- ----------
charge1 100
Charge1_tax1 10
Charge1_tax2 20
charge2 200
Charge2_tax1 20
Charge2_tax2 40

how I can achieve the expected output using a single sql query

View 6 Replies View Related

SQL & PL/SQL :: Find Out Object Name

Feb 16, 2010

I want to find out the name of objects like procedures,functions which are using a specific column of table.

for example i have a table 'Orafaq' which has column 'Iss_Ide', i want to know which objects like procedures,functions,views are using column "Iss_Ide" of table orafaq

View 3 Replies View Related

SQL & PL/SQL :: Same Object In Different Schema

Oct 11, 2011

I have 3 schemas (master, baby and web)- master has two pakages , PkgA which has user access and package PkgB with definer access. It also has a table called Tab1. Both pakages are inserting data into table Tab1. Baby schema also has table Tab1. When we call pakage PkgA where data will insert (mater or baby table) and when we call pakage PkgB where data will insert (mater or baby table). What will happen when we call pakages from web and how can we make sure data is inserting baby Tab1 table?

View 4 Replies View Related

Two Object Tables - Row Will Not Insert

Jun 14, 2007

I have 2 object tables. Location and a department. Department references a location Object. But this wont insert. I get "0 rows created".

CREATE OR REPLACE TYPE location_objtyp AS OBJECT
(
locationID NUMBER,
name VARCHAR2(48)
);
/
CREATE OR REPLACE TYPE dept_objtyp AS OBJECT
(
deptID NUMBER,
name VARCHAR2(48),
locationID_ref REF location_objtyp
);
[code]...

This does not insert. I get no error. Only - "0 rows created".

View 3 Replies View Related

Oracle Sys Object Invalid

Jun 21, 2013

Oracle sys object are Invalid,But database working fine. How to fix these problem, I don't have oracle support,

Database Dba_registry contain are All Valid.But sys object getting Invalid.

Oracle 10g 10.2.0.5 Standard

OWNERCOUNT(*)
MDSYS359
DMSYS24
PUBLIC147
CTXSYS3
OLAPSYS32
XDB 5
SYS 141

Dba_registry

COMP_IDSTATUS
APSOPTION OFF
SDOOPTION OFF
ODMOPTION OFF
AMDOPTION OFF
XOQOPTION OFF
OWMVALID
CATALOGVALID
CATPROCVALID
JAVAVMVALID
XMLVALID
CATJAVAVALID
RULVALID
EXFVALID
CONTEXTVALID
XDBVALID
EMVALID
ORDIMVALID

View 3 Replies View Related

Check All Object Privileges

Sep 6, 2011

How can i list all the object privileges from n user?

for example:

I granted to USER1:

GRANT ALL on my_table1 to USER1;
GRANT ALL on my_table2 to USER1;
GRANT ALL on my_tableN to USER1;

How can i list all privileges from this user over all tables?

I don't know if this is possible, but i wanna to list:

USER1 ----- UPDATE, INSERT, DELETE ON my_table1
USER1 ----- UPDATE, INSERT, DELETE ON my_table2
USER1 ----- UPDATE, INSERT, DELETE ON my_tableN

Is this possible?

View 1 Replies View Related

Associating XMLTYPE Object With A XSD?

Oct 11, 2012

How to create an AQ queue in with payload of type "sample_orc.xsd".

Right now I created an object of XMLTYPE. Below is the code

CREATE OR REPLACE TYPE sample_payload_type AS OBJECT (
test_data SYS.XMLTYPE
);

Now How will I associate an XSD say "sample_orc.xsd" to this object?

View 2 Replies View Related

DB Object Validation Report?

Jul 21, 2010

In our company we have a requirement to export data out of a live dbs and import that into a test db for issue replication,debugging & fixing from time to time.

As a junior DBA am resposible to import a dump file provided to me into a test DB. The export is taken off by customer dbas or consultants for a specified list of tables/schemas etc.

I have readonly access to source database and the issue I am facing is after the import there are certain objects that get missed out or do not get imported properly.

I would like to know if there was a script I can use to generate a report on the source DB and then run the same on the target DB after the import and compare to find out if any objects got missed out.

View 7 Replies View Related

SQL & PL/SQL :: How To Get Total Object Privileges

Jun 1, 2010

Is there any data dictionary table to get the object grants for total objects in the database?

Using DBA_TAB_PRIVS, i get object grants for tables only. But i'm looking for remaining objects also. The list of remaining objects is below.

view, or materialized view
Sequence
Procedure, function, or package
User-defined type
Synonym for any of the preceding items
Directory, library, operator, or indextype
Java source, class, or resource

provide me the other data dictionary tables for querying.

View 3 Replies View Related

SQL & PL/SQL :: Change Datatype From Object

Dec 8, 2010

I have created an Object Type and this Type is mapped to a column datatype in a table.This Table has values inserted.

create or replace
type column_type as object (
col_name varchar2(30),
col_comment varchar2(4000)
);
[code]....

ORA-02303: cannot drop or replace a type with type or table dependents...how to resolve this issue without having to delete any column from the table?

View 2 Replies View Related

SQL & PL/SQL :: Fetch Into Object Type?

Oct 2, 2011

what ios wrong in the following code

create or replace type testobj as object(col1 number);
create or replace type tabtest as table of testobj;
create or replace procedure proc(a out tabtest) is
cursor c is

[code]..

View 5 Replies View Related

SQL & PL/SQL :: ORA-00955 / Name Already Used By Existing Object

Mar 15, 2012

During import , tables were imported but index was not imported due to ORACLE home was full.after import i was trying to create the the same index as it was not imported i am getting below error.

The "error ORA-00955: name is already used by an existing object"

My index name is GL01PK . I am trying to verify if the index with above name is present or not , using following query.

select OWNER,OBJECT_NAME,SUBOBJECT_NAME,OBJECT_ID ,OBJECT_TYPE from dba_objects where object_name like '%GL01%'

below is the output which shows that GL01PK index is not present.

GLOT1 GL01 150943 TABLE
FNSONLC3 GL01 147240 TABLE
FNSONLC3 GL01_13042011 148184 TABLE
FNSONLC3 GL01_07052011 148195 TABLE

how can i create the index here with the same name GL01PK

View 3 Replies View Related

SQL & PL/SQL :: Invalid Object History?

Jun 10, 2010

I can get a list of invalid objects, know how to recompile them but I was wondering if there was a way to query the date/time of when an object went invalid.

I'm working on a 10.2.0.4.0 (Enterprise Edition) database running on SLES10.

View 1 Replies View Related

SQL & PL/SQL :: Unable To Recreate An Object?

Mar 15, 2010

I have the metadata of an object in one of my database table as xml. I failed to recreate the object in the other schema using metadata api. I developed a stored function to do the above job. My function doesn't throw any error as well as it doesn't create the object.

My code snippet is

CREATE OR REPLACE PROCEDURE DDI.move_table(
table_name in VARCHAR2,
from_schema in VARCHAR2,
to_schema in VARCHAR2 )
AUTHID CURRENT_USER

[code]....

The schema where i create and execute my function have dba privilege also.

View 9 Replies View Related

PL/SQL :: Displaying Value Of Object Type

Aug 30, 2012

I have created one type as Object and I am trying to display the values available in object type for debugging purpose. To display the contents of object type.

View 4 Replies View Related

SQL & PL/SQL :: Varray Of Object Type

Jun 23, 2010

I want to pass varray of object as out parameter (more than 1 ), Tested the below code getting error.

Note : I want to get value from table and assign it to varray object and pass varray as out parameter.

Here below the code I tested.

create type emp_type as object (
emp_no number,
emp_name
);
create type emp is varray(10) of emp_type;
[code]........

Getting error while above code.

View 11 Replies View Related

SQL & PL/SQL :: What Are The Privileges The User Is Having On A Object

Oct 2, 2010

How can we find out what are the privileges the user is having on a object.

For example I want to find what are the privileges the "uesr1" is having on "stud_table".

View 3 Replies View Related







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