PL/SQL :: How To Check Particular Attributes Exists Or Not In XML Tag

Aug 14, 2012

As per the earlier post,I am able to parse now.

i have also another concern as per below xml file.

My requirement is to identify perticular node ,whose having PriorValue attribute present in <pi:the Actual_Comp_Change> tag,those record should return.

<?xml version="1.0" encoding="UTF-8"?>
<pi:Extract_Employees xmlns:pi="urn:com.workday/picof">
<pi:Employee>
<pi:Employee_ID>1100</pi:Employee_ID>

[Code]....

OUTPUT:
EmployeeID_ Name JobTitle_     Grade ActualComp_Change_
1100     Surana     Intern - Master¿s     A     500000
1000     roy     Intern - Master¿s     B     216000
1000     roy     Intern - Master¿s     00     266000

But my requirement is to display only those employeeID ,where Actual_Comp_Change tag having PriorValue attribute.

The required OutPUT should be :

EmployeeID_ Name JobTitle_     Grade ActualComp_Change_
1100     Surana     Intern - Master¿s     A     500000

is there any possibility to use ExistNode() function to the above quer or is there any alternative solution.

View 5 Replies


ADVERTISEMENT

PL/SQL :: Check Given Value Exists Or Not

Jun 18, 2013

i have a procedure like create or replace procedure studrec( a in sid%rowtype)asi sid%rowtype;beginselect sid into ifrom students; i need to check whether sid is exist in the variable i or not

View 5 Replies View Related

How To Check A Table If Exists

Oct 12, 2005

I have a script like this:

------------------------------------------------------------

DROP TABLE CON_TEST CASCADE CONSTRAINTS ;

CREATE TABLE CON_TEST (
IDI NUMBER(10,0),
USERID VARCHAR2(10),
PWD VARCHAR2(10),
NOTE VARCHAR(100)
)

----------------------

But i think if table CON_TEST doen't exist, an error message will appear. I know that in SQL Server we can check if table exists or not. So, i wonder if we can do that in Oracle?

By the way, is there any way to run a file script that contents TABLES, STORED, ... on a developed PC connect to oracle db server? (in case, i'm developing on PC, using Net Service Name to conect to Oracle DB Server)

View 9 Replies View Related

SQL & PL/SQL :: How To Check If Primary Key Exists

Jan 19, 2010

I have a table called TRANS, and a primary key field tran_id. How would i check if there is a record matching tran_id 'DUP7927' ?

View 25 Replies View Related

SQL & PL/SQL :: How To Check Record Exists Validation

Jan 18, 2011

1. Below TXN_LOG table Expected to have 0.5 to 1 million records & TXN_LOG_HIST table will have max 3 million records.

2. On daily basis system will move records from TXN_LOG to TXN_LOG_HIST.

3. The below mentioned check will be performed for each transaction, With out this check currently my process is doing 10tps. (transaction per second).

CREATE TABLE TXN_LOG
(
REFNO VARCHAR2(16) PRIMARY KEY,
LOCATION VARCHAR2(3),
AC_NO VARCHAR2(20),
TXN_INIT_DATE DATE,
AMOUNT NUMBER(22,3),

[code]....

The below validation we are currently using which is overhead for our transactions processing. Also the below mentioned check will be performed for each transaction, With out this check currently my process is doing 10tps. (transaction per second).

BEGIN
SELECT COUNT(1)
INTO l_exists
FROMTXN_LOG
WHERE AC_NO = p_acho
TXN_INIT_DATE = p_txn_date
AMOUNT = p_amt

[code]....

Is there any fastest method to check above record exists validation from the both the table?

View 11 Replies View Related

PL/SQL :: Create A Trigger To Check If Synonym Already Exists In DB

Mar 29, 2013

How can I create a trigger to check if synonym already exists in db and if exists then don't create synonym.

my work: ( this is just like an outline i prepared)

select * from all_synonyms;
declare
s_exists number;
begin
-- check whether the synonym exists
select 1 into s_exists from all_synonyms;
-- an error gets raise if it doesn't
exception when no_data_found then
-- DDL has to be done inside
execute immediate ' create or replace synonym';
end;
/

View 16 Replies View Related

PL/SQL :: How To Check Record Exists Prior To Insert Statement

Aug 12, 2012

Using a cursor and loop method records are inserted into the header and line tables. How do I code the IF statement prior to the INSert statement such that Insert if record does not exist else Update the record. If the record for insert fails in the line, the same record should be deleted from the header table as well and transaction should rollback. The Ora version used is 11.2.0.2.

CURSOR C1 IS
        SELECT H.*
        FROM   rex_head_extract h
        WHERE  TRUNC(h.create_date) BETWEEN v_begin_date AND v_end_date;  
FOR I IN C1 (v_begin_date, v_end_date)
 
[Code]....

--- Need to perform a check if record exists here prior to insert     
             INSERT INTO tran_head
                 (TRAN_SEQ_NBR,        ORG_NUMBER,
                  STORE_NUMBER,        TRAN_DATE,

[Code]....

View 9 Replies View Related

Forms :: Put One Check Box To Check All The Check Boxes?

Jul 30, 2011

I want to put one check box to check all the check boxes.how can i do this?

View 5 Replies View Related

PL/SQL :: First Three Not Null Attributes

Oct 29, 2013

MY requirment is: I want the first three nullable attributes. For Eg: If I have 60 columns in table, I need to fetch the first three  null data in a row. 

View 7 Replies View Related

SQL & PL/SQL :: Select Some Attributes From That Object In Same Query

Oct 25, 2013

He had created an object type and wanted to populate it in a query. So far so good. But then he wanted to select some attributes from that object in the same query. Basically, he wanted to do something like this:

With his_view
As
( select object_type( attr1, attr2) theobj
From his_table
Where ...
)
Select theobj.attr1
From his_view

But somehow he was hitting ORA-00904: "THEOBJ"."ATTR1": invalid identifier over and over again.Here's a test script:

Create type mhe_type As Object( col1 Number
, col2 Varchar2(30)
)
/
-- Basic select
With mhe_view
[code]...

Specify a correlation name, which is alias for the table, view, materialized view, or subquery for evaluating the query. This alias is required if the select list references any object type attributes or object type methods. link...

View 1 Replies View Related

SQL & PL/SQL :: Find Date When Attributes Modified?

Sep 14, 2012

The requirement is to find the last date when either ATTRIB1 or ATTRIB2 were modified for each ID. There are many other columns in the table, but I'm not interested in other columns.

Test Case

SET LINES 100
SET PAGES 100
DROP TABLE test_log
/
CREATE TABLE test_log

[code]....

Expected Output

ID LAST_CHANGE_DATE
---------- --------------------
11 02-SEP-2012 10:58:32
35 05-AUG-2012 10:58:32

I have written the below query, to get the required output.

SELECT MAX(i_date) last_change_date
FROM
(
SELECT seq,id, attrib1, attrib2, i_date,
row_number() OVER (PARTITION BY attrib1 ORDER BY i_date) rn1,
row_number() OVER (PARTITION BY attrib2 ORDER BY i_date) rn2

[code]....

View 6 Replies View Related

PL/SQL :: Oracle Objects - Insert Particular Attributes

Apr 4, 2013

I'm using the below data base version

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production.

I have created a pl sql type as object with five attributes as below.Now im trying to insert only 3 attributes with the attribute names ( As like insert into statement with column names).

Create type address_test as object (
              Streetno varchar2(20),
              Locality varchar2(20),
              City varchar2(20),
              Pin varchar2(7),
              Country varchar2(20))
[code]....

Is that possible to use attribute names in the insert statement of column object type ?

View 9 Replies View Related

Identify Attributes For Customer / DVD And Rental Tables

Oct 29, 2008

wish to do a database on dvd rental in oracle following: for the ER diagram i have indetified the entities as : branch , emp, customer,dvd, rental...

1) set the one - many relationship in the above data
2) identify the attributes for customer,dvd and rental tables and thus normalise them as well.

View 2 Replies View Related

SQL & PL/SQL :: Create Nested Query Within Select Of Attributes

Dec 21, 2011

I'm trying to create a sort of nested-query within my select of attributes . i.e.

select A.a,
B.b,
(select count(C.*)
from C
where C. = B.d
group by C.y)
from A a,
B b
where A.d = B.d
and ...

Over-simplifying my query:

select B.desc "Location",
F.desc "Source",
A.amt "Amount",
sum(G.G_CNT) "No. Units",
c.desc "Status"
[code]....

I need to incorporate a count of the number of units from TableG that have a certain status. I tried the following but when I tried to run it, I get an error saying that it's not a Group By expression -the red part is highlighted in TOAD.

select B.desc "Location",
F.desc "Source",
A.amt "Amount",
sum(G.G_CNT) "No. Units",
(select count(*)
from TableG G2
where G2.D_ID = D.ID
and G2.status = 10
group by G2.D_ID)"Count",
c.desc "Status"
[code]....

Any thoughts how I can incorporate a query in my select of attributes?how to Group By something.

View 8 Replies View Related

Client Tools :: Setup Attributes Of SQL PLUS Permanently?

Feb 7, 2011

Is it possible to set the below settings permanently?

1) In UNIX - DEFINE_EDITOR=VI
2) SET SERVEROUTPUT ON
3) SET LINESIZE n

How to set the AUTOCOMMIT on/off, while using PLSQL Program.

View 3 Replies View Related

Reports & Discoverer :: Destype Parameter Attributes

Oct 21, 2011

Attributes required on the destype parameter list. This attributes are like PRINTER

EXAMPLE:
ADD_PARAMETER(listap,'DESTYPE',text_parameter,'PRINTER');

View 1 Replies View Related

ODP.NET :: Null Values In (ref) Attributes - C# Odp Type Factory?

Nov 22, 2012

I'm using the odp.net type factory (class IOracleCustomType and the specific annotations...) to map udts to c# classes.By now I had no problems with it, because I've never used "ref" attributes within the udts.Now I need the use of "ref" attributes within udts but it seems that the odp factory cannot handle those references.

For example:_*

A Simple Type:
create or replace type bookcontent_t force as object (
    id number(20)
  , name varchar2(1000)
);*And a collection with references to objects of this type:*

create or replace type fms_bookcontent_ref_cln force as table of *ref* bookcontent_t;The c# class is generated by odp.net.

When I retrieve data by using odp.net I get a collection with the correct number of elements but the values are null.What can I do to solve this problem with "ref" attributes/lists? How can I get the referenced object instances?

View 0 Replies View Related

Spatial :: Select Attributes In Point Cloud

Oct 10, 2012

I have data in point cloud (x,y,z,a,b,c,d (a,b,c,d are some attributes about this point)). i create a point cloud (sdo_pc - geometry), block tables (sdo_geometry - geometry). if i use a function to_geometry, result is only in multi point without attributes. it is way display this 3D data, and at the same time inquire of concerning for a attributes in concrete points?

View 0 Replies View Related

Server Administration :: How To Change Attributes Of Table From Nologging To Logging

Feb 27, 2012

How to change the attributes of a table from nologging to logging?

SQL> select table_name,LOGGING from dba_tables where owner='HXL';

TABLE_NAME LOG
------------------------------ ---
TB_OBJECTS NO

SQL> alter table hxl.tb_test logging;

Table altered.

SQL> select table_name,LOGGING from dba_tables where owner='HXL';

TABLE_NAME LOG
------------------------------ ---
TB_OBJECTS NO

View 4 Replies View Related

SQL & PL/SQL :: Access Attributes Of Objects Of Nested Table In Member Function Of Oracle Database

Nov 17, 2011

I have created two types and a list of the first type:

create type type1;
/
create type type1_list as table of ref type1;
/
create type type2;
/

I have now just created the two types as follows:

create type type1 as object(
id# number
);
/
create type type2 as object(
attribute1 type1_list,
MEMBER FUNCTION function1 RETURN NUMBER
);
/

Ok, I've created the tables (I don't know if it's necessary to point out my problem)

CREATE TABLE type1_table OF type1;
/
CREATE TABLE type2_table OF type2
NESTED TABLE attribute1 STORE AS nested_type1_list_table;
/

And what I wanted to do now is to implement the member function1 and check something of the attributes of type1 in the list of attribute1... And that's where my question occurs, how does it work, I can't figure it out. I tried something like this:

Quote:
create or replace
TYPE BODY type2 AS
MEMBER FUNCTION function1 RETURN NUMBER AS

[Code]....

But I don't get the right way, it doesn't work

View 4 Replies View Related

Data Guard :: ARCH Wait On SENDREQ While Configured With LGWR ASYNC Attributes?

Oct 5, 2010

In statspack I find a lot of wait events "ARCH wait on SENDREQ". The database is configured with the LGWR ASYNC attribute. In the documentation I can read that the "ARCH wait"-events may happen in case the database is configured with the ARCH attribute.How is it possible I get these "ARCH wait"-envents and do these wait events have any effect on the "on line" performance of the database? Is it possible that a user that saves data in the database has to wait for thest "ARCH wait"-events?

View 1 Replies View Related

SQL & PL/SQL :: Not In Not Exists?

Aug 29, 2012

I have a question i wanted to know that " Is it possible to write the Following Query Using NOT EXISTS

SELECT * FROM DEPT WHERE DEPTNO NOT IN (SELECT UNIQUE DEPTNO FROM EMP);

And one more doubt is there, can we use join to get same result.

View 9 Replies View Related

SQL & PL/SQL :: Backward Accessing Super Type Attributes From Sub-type Body In Oracle Collection?

Jan 2, 2013

I have 3 user defined collection types. I am trying to access the type3's attribute in type1 body (like backward accessing).

Ex. My Collection Types Structure (something like master detail structure)

create type type1 as object
(
attr1 varchar2(10),
attr2 varchar2(10),
member procedure function1

[code]...

so, in the type1 body i have to get or assign the value either to type2's attribute or type3's attribute. I have search all the in internet but i haven't find anything such. how to find the reverse method of accessing the super type's attribute(s) in sub type's body.

View 3 Replies View Related

Datafile 11 - Not Exists

Aug 3, 2009

i see in my alert.log this message:

Errors in file /oracle/BWP/saptrace/usertrace/bwp_ora_2728058.trc:
ORA-01114: IO error writing block to file 1030 (block # 602122)
ORA-27063: number of bytes read/written is incorrect
IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: -1
Additional information: 180224

But this file_id i don't have in my database, i am making these queries:

SQL> select FILE_ID from dba_temp_files order by FILE_ID;

FILE_ID
----------
1
2
3
4
5
6
7
8
9
[code]....

I don't have this file_id, why alert.log is showing me it? Of course, nobody has created this datafile and nobody has removed it too.

View 11 Replies View Related

Application Express :: Report Not Initially Sorted As Defined By Report Attributes Sort Sequence

Nov 1, 2012

I have a Report Region with Type SQL Query and Source "SELECT * FROM <table>" where <table> has a primary key from a sequence. Under Report Attributes, I have Report Column "ST_NM" with Show and Sort checked and having a Sort Sequence of "1". I assume this is to set the iniital display sequence but regardless, the report rows display in Primary key order initially.

To try it: [URL]

1) How do I set the initial display sequence to be other than the primary key sequence?

View 4 Replies View Related

SQL & PL/SQL :: EXISTS Not Working In Oracle 10g

Mar 30, 2012

following is a query which i find difficult to understand why EXISTS is failing. There are two scenarios where if i block LINE 30 and unblock line 31 of the code then one record is returned.

SELECT A.ENTITY_CODE,
A.VRNO,
A.VRDATE,

[Code]....

View 4 Replies View Related

SQL & PL/SQL :: Checking Whether Record Exists

Jan 22, 2013

Which is the best way to check whether a record exists.

DECLARE
l_count NUMBER;
BEGIN
SELECT COUNT(*) INTO l_count FROM emp WHERE empno=7839;
IF l_count=1 THEN
dbms_output.put_line('exists');
ELSE
dbms_output.put_line('not exists');
END IF;
END;

[Code]...

View 7 Replies View Related

SQL & PL/SQL :: Function Returning Top Value If Not Exists Then Next One?

Nov 20, 2010

how to write a function that returns top value if not exists then next top for combination of customer_id and hierarchy.For instance :

If I've got table

customer_id ,hierarchy, function_code
123 |1 | Z1
123 |2 |67
123 |3 |5B
678 |10 |S2
678 |11 |Z2
345 |2 |11

For the customer ID 123 I want to return Z1, for customer 678 I want to return S2 and for customer ID 345 I want 11

Problem is that I'm new to the concept of looping. I know how to write a function that accepts customer_id as a value write a cursor and then check IF hierarchy = 1 the return FUNCTION_CODE IF hierarchy - 2 THEN ...

but I need something more universal as some of the customers may have hierarchy function 1 and that would be the top one for him but others might have function of hierarchy 10 as top and checking all of the possibilities using if would be just stupid. So how to write something universal ? And of course if function did not find any customer_id then return null.

View 9 Replies View Related

SQL & PL/SQL :: Using Where Not Exists Against A List Of Values?

Jul 13, 2012

I have a list of values from a spreadsheet and want to know which values are NOT matched in columns of a table

here's the list (really 4000+ long)

1234,
2345,
3244,
and I want to find the values that are not in the table 'table_name' like this
....

where not exists (Select number_n from table_name
where number_n in ('1234', '2345', '3244', ...(the list above))

View 11 Replies View Related

PL/SQL :: Select Exists On Time

Sep 17, 2013

I have this sample:
the column data1 is datetime datatype  with
t as (   select 'SMITH' nom,to_date('21/09/2013 07:30:00') data1
from dual union all   select 'ALLEN',to_date('21/09/2013 07:40:00')
from dual union all   -- select 'WARD',to_date('21/09/2013 07:50:00')
from dual union all   
select 'JONES',to_date('21/09/2013 08:00:00')
from dual union all   

[Code]..

How can I write a select to check that If I input 10 minutes to nom 'ALLEN' it's ok because the time 07:40 + 10 minutes = 07:50 the row not exists, (the next)but If input 20 it exists because the sum = 08:00 and row  isn't free , indeed, there is 'JONES'?

View 4 Replies View Related







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