MEV: Column level of masking - error: ORA-28104: entry for sec_relevant_cols value is invalid

Hi gurus,

I try to hide the column to secure the table for a specified user, here are the details of the code that I use to apply security and DB:

Version of DB: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0

Security features:

create or replace function kr_sec_function_papf (p_object_schema IN VARCHAR2,

nom_objet_p VARCHAR2)

return varchar2

as

p_nid varchar2 (200);

Whoami varchar2 (100);

Start

If SYS_CONTEXT (' USERENV', 'SESSION_USER' ") ="VPDTEST ".

then

p_nid: = 'national_identifier = national_identifier';

return (p_nid);

on the other

p_nid: = '1 = 2';

return (p_nid);

end if;

end kr_sec_function_papf;

/

Code to add the policy:

BEGIN

DBMS_RLS. () ADD_POLICY

object_schema = > 'APPS,'

object_name = > "PER_ALL_PEOPLE_F"

POLICY_NAME = > "secure_emp"

policy_function = > 'kr_sec_function_papf ',.

statement_types = > "SELECT."

sec_relevant_cols = > 'NATIONAL_IDENTIFIER ',.

sec_relevant_cols_opt = > DBMS_RLS. ALL_ROWS);

END;

/

I get the error message when executing the above plsql block, the error is:

ORA-28104: entry for sec_relevant_cols value is invalid

ORA-06512: at "SYS." DBMS_RLS", line 20

ORA-06512: at line 2

Someone please help me solve the problem.

Thanks in advance.

~ Krishna Nand Singh

Hello world

I had this problem to be solved.

The problem is with the object_schema-online 'APPS', setting the schema name of the object is 'HR' and APPS a with the same name.

The Correct code should be:

BEGIN

DBMS_RLS. () ADD_POLICY

object_schema-online 'HR ',.

object_name-online "PER_ALL_PEOPLE_F."

POLICY_NAME-online "secure_emp."

policy_function-online "kr_sec_function_papf."

statement_types-online "SELECT."

sec_relevant_cols-online "NATIONAL_IDENTIFIER."

sec_relevant_cols_opt-online DBMS_RLS. ALL_ROWS);

END;

/

Thank you

Krishna Nand Singh

Tags: Database

Similar Questions

  • ERROR: ORA-01017: name of user and password invalid. connection refused

    Hi all

    I need your help.

    I have installed Oracle Audit Vault Server Release 10.2.3.2 in agent collection and Linux system in Windows system. Adding and start collecting DBAUD went fine however adding AGAIN collector back return errors when executing command avorcldb add_collector as follows

    [oracle@avsrv ~] $

    [oracle@avsrv ~] $ avorcldb add_collector - SrcName orcl nom_agent - avagent01 - colltype REDO - av Lugaopc:1521:orcl

    collector REDO_Collector for orcl source already exists

    the initialization of the REDO Collector

    ERROR: could not get by using jdbc connection AV source user:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lugaopc)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))

    ERROR: ORA-01017: name of user and password invalid. connection refused

    [oracle@avsrv ~] $

    Here are the contents of the avorcldb.log file

    09/09/13 16:58:44 [INFO] command add_collector treatment

    09/09/13 16:58:44 [INFO] treatment arg - FromName = orcl

    09/09/13 16:58:44 [INFO] treatment arg - nom_agent = avagent01

    09/09/13 16:58:44 [INFO] treatment arg - colltype = REDO

    09/09/13 16:58:44 [INFO] treatment arg - av = Lugaopc:1521:orcl

    09/09/13 16:58:44 [INFO] connect information: Lugaopc:1521:orcl

    09/09/13 16:58:45 [INFO] connecting administration AV got using jdbc:oracle:oci:@AVDB

    09/09/13 16:58:45 [INFO] execution SQL like [ADM@AV] select s.host |': ' | A1.num_value |': ' | avsys.av A2.char_value $attrvalue a1, a2 avsys.av$ attrvalue, avsys.av$ s source, avsys.av$ attrdef ad1, ad2 avsys.av$ attrdef where source_name =: 1 and a1.inst_id = s.source_id and a2.inst_id = s.source_id and a1.attr_id = ad1.attr_id and ad1.attr_name = 'PORT' and a2.attr_id = ad2.attr_id and ad2.attr_name = 'DB_SERVICE. '

    09/09/13 16:58:45 [INFO] using bind value orcl

    09/09/13 16:58:45 [INFO] Return value = Lugaopc:1521:orcl

    09/09/13 16:58:45 [INFO] connect information: Lugaopc:1521:orcl

    09/09/13 16:58:45 [INFO] execution SQL like [ADM@AV] select to_char (source_id) in the avsys.av$ source where source_name =: 1

    09/09/13 16:58:45 [INFO] using bind value orcl

    09/09/13 16:58:45 [INFO] return value = 1

    09/09/13 16:58:46 [INFO] got the source user connection using jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lugaopc)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))

    09/09/13 16:58:46 [INFO] executing SQL in [ADM@AV] select decode (c.status, 1, 'active', 0, 'fallen', null) of avsys.av$ collector c, avsys.av$ s source where source_name =: 1 and collector_name =: 2 and c.source_id = s.source_id

    09/09/13 16:58:46 [INFO] using bind value orcl

    09/09/13 16:58:46 [INFO] bind Using REDO_Collector value

    09/09/13 16:58:46 [INFO] Return value = active

    09/09/13 16:58:46 [MESG] collector REDO_Collector for orcl source already exists

    09/09/13 16:58:46 [INFO] executing SQL in [ADM@AV] select decode (c.status, 1, 'active', 0, 'fallen', null) of avsys.av$ collector c, avsys.av$ s source where source_name =: 1 and collector_name =: 2 and c.source_id = s.source_id

    09/09/13 16:58:46 [INFO] using bind value orcl

    09/09/13 16:58:46 [INFO] bind Using REDO_Collector value

    09/09/13 16:58:46 [INFO] Return value = active

    09/09/13 16:58:46 [MESG] initialization REDO Collector

    09/09/13 16:58:46 [INFO] execution SQL like [ADM@AV] select the username of avsys.av$ source where source_name =: 1

    09/09/13 16:58:46 [INFO] using bind value orcl

    09/09/13 16:58:46 [INFO] Return value = AVSRCUSR1

    09/09/13 16:58:46 [INFO] as [ADM@AV] SQL execution {? = call avsys.dbms_audit_vault.reset_source_user (?)}

    09/09/13 16:58:46 [INFO] adding user password mask

    09/09/13 16:58:46 [INFO] execution SQL like [USR@SRC] select table_name from user_tables where upper (table_name) = upper(:1)

    09/09/13 16:58:46 [INFO] bind Using STREAMS_HEARTBEAT value

    09/09/13 16:58:46 [INFO] Return value = STREAMS_HEARTBEAT

    09/09/13 16:58:46 [INFO] execution as [USR@SRC] SQL drop table streams_heartbeat

    09/09/13 16:58:46 [INFO] execution as [USR@SRC] SQL create table streams_heartbeat (src_dbname varchar2 (4000), job_number number, heartbeat_time timestamp)

    09/09/13 16:58:46 [INFO] execution SQL like [USR@SRC] declare dbs_name varchar2 (4000); start selecting rename in dbs_name from global_name; insert into streams_heartbeat values (dbs_name, 0, SYSTIMESTAMP); end;

    09/09/13 16:58:46 [INFO] SQL execution as [USR@SRC] create or replace procedure update_heartbeat IS start update streams_heartbeat set heartbeat_time = (select systimestamp from double); commit; end;

    09/09/13 16:58:46 [INFO] execution SQL like [USR@SRC] select table_name from user_tables where upper (table_name) = upper(:1)

    09/09/13 16:58:46 [INFO] bind Using CAPTURE_RULES value

    09/09/13 16:58:46 [INFO] Return value = CAPTURE_RULES

    09/09/13 16:58:46 [INFO] execution as [USR@SRC] SQL drop table capture_rules

    09/09/13 16:58:46 [INFO] execution as [USR@SRC] SQL create table capture_rules (nom_regle varchar2 (50), rule_scope varchar2 (6), rule_type VARCHAR2 (3), obj_name varchar2 (100))

    09/09/13 16:58:46 [INFO] execution SQL like [ADM@AV] select Rename global_name

    09/09/13 16:58:46 [INFO] Return value is AVDB. AVSRV

    09/09/13 16:58:46 [INFO] execution SQL like [USR@SRC] select db_link in user_db_links where db_link =: 1

    09/09/13 16:58:46 [INFO] Using AVDB bind value. AVSRV

    09/09/13 16:58:46 [INFO] Return value is AVDB. AVSRV

    09/09/13 16:58:46 [INFO] the Execute SQL as database link [USR@SRC] drop "AVDB. AVSRV ".

    09/09/13 16:58:46 [INFO] execution SQL like [USR@SRC] select the version of v$ instance

    09/09/13 16:58:46 [INFO] Return value = 11.2.0.1.0

    09/09/13 16:58:46 [INFO] creating DB link using AVDB. AVSRV, AVSRCUSR1, {avsrcusr_pwd}, Lugaopc, 1521, orcl

    09/09/13 16:58:46 [INFO] login as srcuser_ora01 to @(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=Lugaopc) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = orcl)))

    09/09/13 16:58:46 [INFO] output of SQLPlus

    09/09/13 16:58:46 [INFO]

    09/09/13 16:58:46 [INFO] Package created.

    09/09/13 16:58:46 [INFO]

    09/09/13 16:58:46 [INFO] no error.

    09/09/13 16:58:47 [INFO]

    09/09/13 16:58:47 [INFO] package body created.

    09/09/13 16:58:47 [INFO]

    09/09/13 16:58:47 [INFO] no error.

    09/09/13 16:58:47 [INFO]

    09/09/13 16:58:47 [INFO] Package created.

    09/09/13 16:58:47 [INFO]

    09/09/13 16:58:47 [INFO] no error.

    09/09/13 16:58:47 [INFO]

    09/09/13 16:58:47 [INFO] package body created.

    09/09/13 16:58:47 [INFO]

    09/09/13 16:58:47 [INFO] no error.

    09/09/13 16:58:47 [INFO] execution SQL like [USR@SRC] select distinct name of user_errors, whose name =: 1

    09/09/13 16:58:47 [INFO] bind Using DBMS_SRC_STREAMS_COLLECTOR value

    09/09/13 16:58:47 [INFO] Return value = null

    09/09/13 16:58:47 [ERROR] could not get by using jdbc connection AV source user:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lugaopc)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))

    09/09/13 16:58:47 [ERROR] ORA-01017: name of user and password invalid. connection refused

    java.sql.SQLException: ORA-01017: name of user and password invalid. connection refused

    at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:765)

    at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:414)

    to oracle.jdbc.driver.PhysicalConnection. < init > (PhysicalConnection.java:546)

    to oracle.jdbc.driver.T2CConnection. < init > (T2CConnection.java:162)

    at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)

    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)

    at java.sql.DriverManager.getConnection(DriverManager.java:525)

    at java.sql.DriverManager.getConnection(DriverManager.java:140)

    to oracle.av.avca.jdbc.JdbcConnection. < init > (JdbcConnection.java:87)

    at oracle.av.orcldb.DAO.initConnection(DAO.java:79)

    to oracle.av.orcldb.DAO. < init > (DAO.java:64)

    at oracle.av.orcldb.commands.AddCollector.setupCollector(AddCollector.java:746)

    at oracle.av.orcldb.commands.AddCollector.execute(AddCollector.java:230)

    at oracle.av.orcldb.Command.process(Command.java:89)

    at oracle.av.orcldb.Main.process(Main.java:118)

    at oracle.av.orcldb.Main.main(Main.java:132)

    I searched the forum at my best level without clear solution

    Concerning

    Sadik

    avorcldb add_collector - REDO SrcName orcl nom_agent - avagent01 - colltype - av Lugaopc:1521:orcl

    Specify the connection string to the Vault check server not in the source database



  • 'CREATE JAVA' error: ORA-29506: derived from the USING clause invalid query

    Hello

    I created a table with the following attributes:

    name varchar2 (200);
    LOB_DATA blob


    I loaded a java source file in the lob_data blob.

    I then called the SQL:

    create or replace and compile the java source named "RemoteCommand" using blob
    Select lob_data from str_blob_table where name = 'RemoteCommand.java ';

    and I get the error:

    ORA-29506: invalid query from the USING clause
    ORA-00936: lack of expression
    29506 00000 - "query invalid derived from USING clause.
    * Cause: The USING clause does not form a valid query.
    * Action: Correct the USING clause.



    If I simply copy and paste the query part of the USING clause:

    Select lob_data from str_blob_table where name = 'RemoteCommand.java ';

    I get a valid result in SQLDeveloper.


    Any thoughts on what is happening here?

    A few notes:
    1. it is a 8i database.
    2. it works very well on a 9i database, but according to the SQL reference for 8i, it should work as well.

    Thank you
    Brent

    Try to delete "select" in the USING clause, that is to say change the SELECT BLOB SUPPORT... for BLOB to HELP... The original form of the syntax of JAVA to CREATE did not expect the SELECT token must be explicitly provided. Somewhere between 8i and 9i the parser was changed to try the provided text as well as what, with SELECT prefixed. So a CREATE JAVA statement you tried working in 9i but in 8i fails because SELECT would always be added before you try using the clause as a query, resulting a SELECT duplicate token.

  • AutoConfig error: ORA-12705: cannot access NLS data or invalid environment specified files

    Hi, experts:

    When it is run on the database layer, obtained adautocfg.sh

    ====

    ....

    Executable: /ap10/immted/db/tech_st/11.2.0.3/bin/sqlplus

    SQL * more: Production of liberation 11.2.0.3.0 Sat Jun 28 23:30:17 2014

    Copyright (c) 1982, 2011, Oracle.  All rights reserved.

    Enter the value 1: enter the value 2: enter the value 3: ERROR:

    ORA-12705: cannot access files of NLS data or invalid environment specified

    =====

    We have 12.1.3, 11.2.03 and Linux. I've issued $unset NLS_LANG, set ORA_NLS10 = "' in the .env file." What should I check?

    In the $ORACLE_HOME/appsutil/contextfile.xml the following:

    "s_db_oranls" = "unix" OSD > /ap10/immted/db/tech_st/11.2.0.3/nls/data/9idata < / ORA_NLS >

    Thanks and greetings

    Now, I got the same error when doing $sqlplus / as sysdba. $sqlplus/nolog is fine.

    Hello

    AutoConfig was successful before?

    Are there any recent book.

    If you're upgrading from 11.2.0.3 or recently updgraded to 11.2.0.3 database, then course do perofmed you listed in article - 7 for creating data 9i of the below TechNote MOS.

    Interoperability note Oracle EBS R12 with Oracle Database 11 g 2 (11.2.0.3) (Doc ID 1585578.1)

    See also below the TechNote if is not for 11.2.0.3 but his relevant:

    Upgrade 9i to 10 g 2 fails with ORA-12709: error loading creates characters of the base set (Doc ID 732861.1)

    Thank you

    A H E E R X

  • get the error ORA-04088

    Hello

    I created a trigger to trigger the error if a trial off to enter data in a column that is attached to a number sequence.
    This trigger works, but with errors, these errors become after trying to insert values into the table.

    The errors are:

    Insert into test2 values(24,'horse','hyderabad',30); - 30 here is worth attempting to enter the column use
    Error report:
    SQL error: ORA-20101: insertion of the value to enter the not allowed... It will take the auto-numbering
    ORA-06512: at "SCOTT. TRI_UNQID', line 11
    ORA-04088: error during execution of trigger ' SCOTT. TRI_UNQID'


    My trigger is
    create or replace
    trigger tri_unqid
    before insert on test2 
    for each row
    declare
    v_number number(2);
    ins_exp exception;
    begin
    if :new.regid is not null  then
    raise ins_exp;
    else 
    select unqid.nextval into v_number from dual;
    :new.regid:=v_number;
    end if;
    exception
    when ins_exp then
    raise_application_error(-20101,'inserting the regid value not allowed.. it will take auto number');
    end tri_unqid;
    Output:
    It's the execution and throw my exception and other... I am not able to solve...
    and another point is if it is inserted successfully with errors, then it's values are inserted into the table at the front not the end of the records... How is it going...

    can any body explain

    Thank you
    Baba

    Published by: BluShadow on April 11, 2013 10:26
    fixed {noformat}
    {noformat} tags.  The "code" in the tag is enclose in "{" and "}", not "&lt;" and "&gt;"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    It's the execution and throw my exception and other... I am not able to solve...

    This is because there is no problem.

    Check your error message

    
    SQL Error: ORA-20101: inserting the regid value not allowed.. it will take auto number
    ORA-06512: at "SCOTT.TRI_UNQID";, line 11
    ORA-04088: error during execution of trigger 'SCOTT.TRI_UNQID' 
    

    Read from the bottom up. Oracle means

    1. a SCOTT trigger. TRI_UNQID caused an error
    2. the error occurred on line number 11
    3. the error message is ' insertion of the value to enter the not allowed... " It will take auto number.

    Why oracle has to say what trigger or procedure caused the error? Because there might be several trigger or procedure that may generate the same error if a user just need to know what is causing the error. And a line number is always helpful for debugging.

    So everything is good here. There is no problem to solve.

    and another point is if it is inserted successfully with errors, then it's values are inserted into the table at the front not the end of the records... How is it going...

    In a HEAP organized table this is SO forward or back (order of the lines is not relevant). If you want to display the records in an orderly manner use the ORDER BY Clause in the SELECT statement.

    So all is good here as well.

  • recover standby db with the error: ORA-01157

    I added two data files to the main database, and somehow the newspaper from the day before apply kept fail with the following error:
    SQL > SQL > ORA-00283: cool cancelled due to errors
    ORA-01111: name for the data file 613 is unknown - rename it to the correct file
    ORA-01110: data file 613: "/ u0/oracle/orahome/dbs/UNNAMED00613.
    ORA-01157: cannot identify/lock data file 613 - see DBWR trace file
    ORA-01111: name for the data file 613 is unknown - rename it to the correct file
    ORA-01110: data file 613: ' / u01/oracle/orahome/dbs/UNNAMED00613.


    Then I disabled standby_file_management and try now with the error:
    ALTER database create datafile ' / u01/oracle/orahome/dbs/UNNAMED00613 "as"+ PRD_DAT/prd/datafile/indx_02.891.793937499 ".
    *
    ERROR on line 1:
    ORA-01276: cannot add files
    + PRD_DAT/prd/datafile/indx_02.891.793937499.  File has a file name of Oracle managed files.

    How can I solve this problem?

    ALTER database create datafile ' / u01/oracle/orahome/dbs/UNNAMED00613 "as"+ PRD_DAT/prd/datafile/indx_02.891.793937499 ".
    *
    ERROR on line 1:
    ORA-01276: cannot add files
    + PRD_DAT/prd/datafile/indx_02.891.793937499. File has a file name of Oracle managed files.

    It's an OMF. Impossible to assign names to it. Please try as below:

    ALTER database create datafile ' / u01/oracle/orahome/dbs/UNNAMED00613 ' as new;

    Refer to this http://shivanandarao.wordpress.com/2012/04/02/managed-recovery-process-mrp-terminates-on-standby-database-upon-adding-datafile-on-the-primary-database/

  • ORA-04061: current status of has been invalidated

    Hello

    In the development of databases
    ------------------------------------------------------

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE 11.2.0.2.0 Production."
    AMT for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    Need solution for this oracle error
    ----------------------------------------------------
    I get this error - ORA-04061: current status of has been invalidated



    pkg1-> hand pkg package

    pkg1 calling another package pkg2

    I have modified and recompiled package pkg2.

    After you run the package PKG1 it throw this error ORA-04061.

    I check user_objects and this status are VALID.

    In both package doesn't have all the variables.

    Please suggest the question above.

    Thanks in advance.

    Kind regards
    Sudhakar P

    Just re run the pkg1 you should be fine. Oracle is just saying that Pkg2 has been changed and must recharge it in memory.

  • XML - ORA-19025: EXTRACTVALUE returns the value of a single node

    Hello

    I'm new to XML DB. Can someone help me with the below XML

    I use the following XML... (I pasted a part only of it coz I need data only up to this article)

    XML
    --------------------

    <? XML version = "1.0" encoding = "UTF-8"? > < SOAP - ENV:Envelope xmlns:SOAP - ENV = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-."
    example"container ="http://www.w3.org/2001/XMLSchema"> < SOAP - ENV:Body >
    < ns:PicklistWS_GetPicklistValues_Output xmlns:ns = "urn: crmondemand/ws/list dropdown /" >
    < ListOfParentPicklistValue xmlns = "urn: / xml/crmondemand/list of choices" >
    < ParentPicklistValue >
    < language > ENU < / language >
    < ParentFieldName > plProduct_Team < / ParentFieldName >
    < ParentDisplayValue > Marketing On Demand < / ParentDisplayValue >
    < ParentCode > Marketing On Demand < / ParentCode >
    < Disabled > N < / disabled >
    < ListOfPicklistValue >
    < PicklistValue >
    Escalation of OCP/SME < code > < code >
    Escalation of OCP/SME < DisplayValue > < / DisplayValue >
    < Disabled > N < / disabled >
    < / PicklistValue >
    < PicklistValue >
    Ask fusion < code > < code >
    Merge request < DisplayValue > < / DisplayValue >
    < Disabled > N < / disabled >
    < / PicklistValue >



    Code
    ---------




    SELECT distinct
    EXTRACTVALUE (value (SR), ' / ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code ','xmlns = "urn: / crmondemand/xml/list of choices"') AS display.
    Return EXTRACTVALUE (value (SR),'/ ParentPicklistValue/ListOfPicklistValue/PicklistValue/DisplayValue ',' xmlns = "urn: / crmondemand/XML/picklist"'),.
    EXTRACTVALUE (value (SR), '/ ParentPicklistValue/ParentDisplayValue','xmlns = "urn: / crmondemand/XML/picklist"') AS parent_display,
    EXTRACTVALUE (value (SR), '/ ParentPicklistValue/ParentCode','xmlns = "urn: / crmondemand/XML/picklist"') AS parent_return
    TABLE (XMLSEQUENCE ((EXCERPT)
    WEB_SERVICE (' <? xml version = "1.0" encoding = "UTF - 8" standalone = "no"? > < envelope soap: xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/")
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" container = "http://www.w3.org/2001/XMLSchema" >
    < soap: Body >
    < PicklistWS_GetPicklistValues_Input xmlns = "urn: crmondemand/ws/list dropdown /" >
    Type < FieldName > < / FieldName >
    Service request < RecordType > < / RecordType >
    < / PicklistWS_GetPicklistValues_Input >
    < / soap: Body >
    "< / envelope soap: >.
    (' document / urn: crmondemand/ws/list dropdown /: ' GetPicklistValues, Id_de_la_session).
    "/: soap envelope / soap: Body / * / * / * ',' xmlns:soap ="(http://schemas.xmlsoap.org/soap/envelope/'))) SR "


    ERROR
    ---------

    ORA-19025: EXTRACTVALUE returns the value of a single node


    UNDERSTANDING
    ---------------------------

    As my Xpath only points until the node - ParentPicklistValue and not the child nodes under it. That's why, when I try to interview the child nodes - / ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code, I get the error mentioned above.

    REQUIREMENT
    -----------------------

    Can someone help me to receive the values of the mother and child values based on xml and query above.

    Hello

    It's a classic ;)

    You need a second XMLSequence who shreds the collection of PicklistValue in relational lines:

    select extractvalue(value(sr2), '/PicklistValue/Code', 'xmlns="urn:/crmondemand/xml/picklist"') AS Display
         , extractvalue(value(sr2), '/PicklistValue/DisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS Return
         , extractvalue(value(sr1), '/ParentPicklistValue/ParentDisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_display
         , extractvalue(value(sr1), '/ParentPicklistValue/ParentCode', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_return
    from table(
           xmlsequence(
             extract( WEB_SERVICE( ... )
                    , '/soap:Envelope/soap:Body/ns:PicklistWS_GetPicklistValues_Output/ListOfParentPicklistValue/ParentPicklistValue'
                    , 'xmlns="urn:/crmondemand/xml/picklist"
                       xmlns:ns="urn:crmondemand/ws/picklist/"
                       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' )
           )
         ) sr1
       , table(
           xmlsequence(
             extract( value(sr1)
                    , '/ParentPicklistValue/ListOfPicklistValue/PicklistValue'
                    , 'xmlns="urn:/crmondemand/xml/picklist"' )
           )
         ) sr2
    ;
    

    What is your version of the database BTW?
    10.2 and upward, you can use the XMLTable.

  • error ora-00036 maximum number of levels of sql recursive (50) exceeded

    I have a trigger of the declaration on the LEVELS table, I want to update COMPONENTS field when another field is changed in TIERS, in order to avoid the calculations, I used to ch line shutter COMPONENTS to complete a package, but I get this error ora-00036 maximum number of recursive sql exceeded (50)

    It's my trigger:

    create or replace trigger DBTRGA_UPD_TIERS

      after update on tiers 

     

      I INT ;

     

      FOR I IN (PKG_TIERS. TAB. FIRST)... (PKG_TIERS. TAB. Last) LOOP

    UPDATE to levels

    PUT REFERENCE_EXTERNE = "YYYY"

    WHERE LEVELS = PKG_TIERS. TAB (I). I_TIERS;

      END LOOP;

    end DBTRGA_UPD_TIERS;


    This is ma for each trigger line:

    create or replace trigger DBTRGA_UPD_TIERS_E

    after Update FOR CODE_TYPE_TIERS on LEVELS

      for each row

    V_CPT INTEGER ;

      IF : NEW. CODE_TYPE_TIERS IS NOT NULL THEN

    IF PKG_TIERS. TAB. LAST IS NULL THEN

    PKG_TIERS. TAB(1). I_TIERS: =: NEW. BLEACHERS;

    PKG_TIERS. TAB(1). CODE_TYPE_TIERS: =: NEW. CODE_TYPE_TIERS;

       ELSE

    V_CPT: = PKG_TIERS. TAB. LAST + 1;

       END IF;

      END IF;

    end DBTRGA_UPD_TIERS_E;

    Clearly, you have past of recursion.  After updating the table of LEVELS, then a statement trigger level (after update) as the fires that updates the table LEVELS... which will cause then itself to once again fire... which will cause himself to fire once again... which will cause itself to the light again... etc etc.

    If it is a business logic that should be implemented, so you don't want to include it as a trigger, you want to just have a code in a package that updates the table once.

    If it were me, I would scrap two triggers in this case.  Have a trigger is fired for each row updated (in SQL) which has then cross to the PL/SQL package for details of this update line, means you to act so the context switching between SQL and PL/SQL for each update line, which will affect the performance of the updates.

    Explain what you're actually trying to do (business logic), with a few examples and data tables and we might be able to propose a better approach, which is not abusing triggers in this way.

  • When I try to change the interactive report columns, then triggers the error: "unable to change column attributes. "ORA-01403: no data found. Pls tell me why?

    When I try to change the interactive report columns, then triggers the error: "unable to change column attributes. "ORA-01403: no data found. Pls tell me why?

    You use listener EA3 ADR?

  • Unable to create a table with virtual columns... Get the error ORA-12899... Suggestions please.

    Hi all

    Here is the create table script, which does not work, error ORA-12899 keep expressing. Please suggest...,.,.

    CREATE TABLE FX_TRANS
    (
    SAGE_TRADE_TYPE VARCHAR2 (50 BYTE),
    UPSTREAM_EXECUTION_TS TIMESTAMP (9).
    LOCAL_TZ VARCHAR2 (20 BYTE),
    GMT_CONV_ENTERED_DT_TS TIMESTAMP (9) ALWAYS GENERATED IN THE FORM ("SONARDBO". "FN_CONVERT_TIMEZONE"("LOCAL_TZ","ENTERED_DT_TS")), "
    GMT_CONV_EXECUTION_DT_TS TIMESTAMP (9) ALWAYS GENERATED IN THE FORM ("SONARDBO". "FN_CONVERT_TIMEZONE"("LOCAL_TZ","UPSTREAM_EXECUTION_TS")), "
    );

    [Error] Running (5:3): ORA-12899: value too large for column 'GMT_CONV_EXECUTION_DT_TS' (actual: 11, maximum: 20)

    [Error] Performance (6:3): ORA-12899: value too large for column 'GMT_CONV_EXECUTION_DT_TS' (actual: 11, maximum: 20)


    Used fucntion Script that I use as a VIRTUAL column expression:

    CREATE OR REPLACE FUNCTION SONARDBO. FN_CONVERT_TIMEZONE
    (
    PI_LOCAL_TZ IN VARCHAR2,
    PI_DT IN TIMESTAMP
    )
    RETURNS THE TIMESTAMP
    DETERMINISTIC
    IS
    LV_TIMESTAMP TIMESTAMP;
    BEGIN
    LV_TIMESTAMP: = CASE WHEN PI_LOCAL_TZ = 'SERGEANT' THEN
    TO_TIMESTAMP (TO_CHAR)
    ((FROM_TZ)
    PI_DT,
    "Asia/Singapore")
    IN THE ZONE IS "GMT"),.
    'YYYY-MM-DD HH. FF H '),'YYYY-MM-DD HH. TZDS FF PM ")"
    WHEN PI_LOCAL_TZ = "GMT" THEN
    TO_TIMESTAMP (TO_CHAR)
    ((FROM_TZ)
    PI_DT,
    "GMT")
    IN THE ZONE IS "GMT"),.
    'YYYY-MM-DD HH. FF H '),'YYYY-MM-DD HH. TZDS FF PM ")"
    WHEN PI_LOCAL_TZ = "IS" THEN
    TO_TIMESTAMP (TO_CHAR)
    ((FROM_TZ)
    PI_DT,
    "America/New_York")
    IN THE ZONE IS "GMT"),.
    'YYYY-MM-DD HH. FF H '),'YYYY-MM-DD HH. TZDS FF PM ")"
    ANOTHER NULL
    END;


    RETURN LV_TIMESTAMP;
    EXCEPTION
    WHILE OTHERS THEN
    LIFT;
    END;
    /

    Thank you very much

    Arpit

    This one worked for me.

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

    drop table FX_TRANS;
    
    CREATE TABLE FX_TRANS (
       SAGE_TRADE_TYPE VARCHAR2 (50 BYTE),
       UPSTREAM_EXECUTION_TS TIMESTAMP (9),
       LOCAL_TZ VARCHAR2 (20 BYTE),
       ENTERED_DT_TS TIMESTAMP (9),
       GMT_CONV_ENTERED_DT_TS timestamp(9)
             GENERATED ALWAYS AS
                (cast ("FN_CONVERT_TIMEZONE" ("LOCAL_TZ", "ENTERED_DT_TS") as timestamp(9))),
       GMT_CONV_EXECUTION_DT_TS timestamp(9)
             GENERATED ALWAYS AS
                (cast("FN_CONVERT_TIMEZONE" ("LOCAL_TZ", "UPSTREAM_EXECUTION_TS") as timestamp(9))));
    
    INSERT INTO fx_trans (SAGE_TRADE_TYPE,
                          UPSTREAM_EXECUTION_TS,
                          LOCAL_TZ,
                          ENTERED_DT_TS)
         VALUES ('A',
                 SYSTIMESTAMP,
                 'SGT',
                 SYSTIMESTAMP + 1 / 24);
    
    commit;
    

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

    See you soon,.

    Manik.

  • SQL error: ORA-01779: cannot modify a column that matches a key examine

    Hi all

    The requirement is that I have two tables s_party_d and S_CONTACT_d. the need to update the column name with FST_NAME | ',' | Last_name when column rowid in both tables are equal. I used the query previously below: -.

    Update
    (select
    E1. Name,
    e.FST_NAME,
    Select
    Of
    s_party_d e1,
    E S_CONTACT_d
    where
    E1. Game of ROW_ID = e.ROW_ID)
    name = FST_NAME | ',' | LAST_NAME;

    But I get the error message when executing the query

    Error in the command line: 31 column: 3
    Error report:
    SQL error: ORA-01779: cannot modify a column that is mapped to a table not preserved key
    01779 00000 - 'impossible to change a column that is mapped to a non-preserved table at key'
    * Cause: An attempt was made to insert or update columns in a join finds out who
    map to a table not kept the key.
    * Action: Change the directly underlying base tables.

    Can U please tell me why this error and how to solve?

    Thank you
    Mathon

    Mathon wrote:

    So, I have to look into some other method... I can't achieve this using a single update statement...

    Well, no matter what you do you need to decide what FST_NAME | ',' | Name to use. As I already pointed out for each line of the line of the s_party_d table there are several rows in table S_CONTACT_d. Again, you must yo decide what S_CONTACT_d table row you want to use. For example:

    update s_party_d e1
       set e1.name = (
                      select  max(e.FST_NAME) ||', '|| max(e.LAST_NAME)
                        from  S_CONTACT_d e
                        where e1.ROW_ID=e.ROW_ID
                     )
     where e1.ROW_ID in (
                         select  e.ROW_ID
                           from  S_CONTACT_d e
                        )
    /
    

    SY.

  • Gets the error ORA-01779 after I added the column

    Hi, I'm a total newbie in APEX but collaborated with ordinary development Oracle (tables, views, packages, triggers, etc) for a number of years.

    I ve been assigned in order to respect an existing application to APEX. One task is to add a column to a single character named 'ACTIVE' to a database table and also present on a current project list page. The value can be 'Y' or 'n'. In the view which is the source of data for the project page ad 'Y' turned into 'Yes' and 'n' turned into 'no '. So far so good, everything works well.

    There is another page on which it is possible to create new or modify existing projects. This page uses a view as a source of data. On this page, I added a group of radiobutton that contains two options: 'Yes' and 'no '. When I select to edit a project in the project list page the second page is loaded and the correct option, 'yes' or 'No', is marked on the page. This group of radiobutton works exactly like a couple of other groups of radiobutton also represented with a single character column in the database. So far so good!

    However, when I try to save the project file by clicking on "Apply Changes" I get this error:

    ORA-20001: DML error: p_rowid = 50, ID = p_alt_rowid, p_rowid2 =, p_alt_rowid2 is. ORA-01779: cannot modify a column that is mapped to a table not preserved key

    What is the problem here? The new 'ACTIVE' column is added to the view, when I run the view I Don t get all records in duplicate, the underlying table has a column id as the primary key.

    Since I Don t know that APEX is under the hood it s hard tp what's wrong. Anyone knows the solution to this problem?

    / Magnus

    Hello Magnus,

    Is there an INSTEAD OF trigger defined on the view? Have you added the new column ACTIVE there too?

    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this response in marking it as useful or Correct ;-)

  • Execute Immediate with DOF and TABLE() - error ORA-22905

    Hello

    I have a problem trying to use a user defined the Type of the Table in a statement Execute Immediate containing a CREATE TABLE statement.

    Is there no work around for this problem?

    The actual code for the SELECT * OF TABLE(:T) is dynamic and slow. That's why I try to avoid to create/fill the table in two steps (as does with MY_TABLE1). Also, in this case, I can't use SELECT * but must specify all the columns (amount variable and over 100 columns).

    CREATE TYPE MY_TABLE_TYPE AS TABLE OF VARCHAR2(30);
    /
    DECLARE
        MT MY_TABLE_TYPE;
    BEGIN
        SELECT * BULK COLLECT INTO MT FROM DUAL;
        -- Two steps
        EXECUTE IMMEDIATE 'CREATE TABLE MY_TABLE1 (A VARCHAR2(30))';
        EXECUTE IMMEDIATE 'INSERT INTO  MY_TABLE1    SELECT * FROM TABLE(:T)' USING MT; -- OK
        -- One step
        EXECUTE IMMEDIATE 'CREATE TABLE MY_TABLE2 AS SELECT * FROM TABLE(:T)' USING MT; -- ERROR ORA-22905   
    END;
    /
    

    byee

    Andrea

    In my view, the error message is incorrect or the less misleading. Bind variables cannot be used in DDL:

    SQL > declare
    2 number of v_var: = 99;
    3. start
    4 run immediately "' create the my_table2 in select table: double T" using v_var; "
    5 end;
    6.
    declare
    *
    ERROR on line 1:
    ORA-01027: bind variable not allowed for data definition operations
    ORA-06512: at line 4 level

    SQL >

    What you could do is use the package variable:

    SQL > CREATE OR REPLACE
    2 PACKAGE PKG1
    3 EAST
    4 MT MY_TABLE_TYPE;
    5 FUNCTION GET_MT
    6 RETURN MY_TABLE_TYPE;
    7 END;
    8.

    Package created.

    SQL > CREATE OR REPLACE
    PACKAGE 2 BODY PKG1
    3 EAST
    4 GET_MT FUNCTION
    5 RETURN MY_TABLE_TYPE
    6 EAST
    7. START
    8 RETURN MT;
    9 END;
    10 END;
    11.

    Package body created.

    SQL > DROP TABLE MY_TABLE1 PURGE
    2.

    Deleted table.

    SQL > DROP TABLE MY_TABLE2 PURGE
    2.
    DROP TABLE MY_TABLE2 PURGE
    *
    ERROR on line 1:
    ORA-00942: table or view does not exist

    SQL > START
    2. SELECT * BULK COLLECT INTO PKG1.MT FROM DUAL;
    3 - two steps
    4 RUN IMMEDIATELY "CREATE TABLE MY_TABLE1 (A VARCHAR2 (30))';"
    5 IMMEDIATELY EXECUTE "INSERT INTO MY_TABLE1 SELECT * FROM TABLE (PKG1." GET_MT)';
    6 - one step
    7 IMMEDIATE EXECUTION "CREATE TABLE MY_TABLE2 AS SELECT * FROM TABLE (PKG1." GET_MT)';
    8 END;
    9.

    PL/SQL procedure successfully completed.

    SQL > select * from my_table1;

    A
    ------------------------------
    X

    SQL > select * from my_table2;

    COLUMN_VALUE
    ------------------------------
    X

    SQL >

    SY.

  • Error ORA-01830 drives me crazy

    I've not found anything relevant online to my question so I'll try here. To set this up, I'm still in the learning I'll phase of Oralce, so be gentle please.

    I run this query:

    Update fascor_load
    Set order_status_id = 18
    where load_date < to_date('06-APR-01','DD-MON-YY');.

    He has in turn triggers:

    create or replace
    relaxation Fascor_Load_BUR
    before the update on Fascor_Load
    for each line

    declare
    closed whole;
    Date of Current_Date_Time;

    Start
    Select order_status_id from firm order_status where description = "CLOSED";
    Select to_char (sysdate,' HH24 LUN-JJ-AA "") in the double Current_Date_Time;

    If: old. Order_Status_ID <>: new. Order_Status_ID and
    : new. Order_Status_ID = closed and
    : new. Load_Completion_Date is null then

    -Insert Current Date/time in the field of Load_Completion_Date
    : new. Load_Completion_Date: = Current_Date_Time;
    end if;
    end;


    When you run the query, I get:


    ************************************************************
    Error from the 1 in the command line:
    Update fascor_load
    Set order_status_id = 18
    where load_date < to_date('06-APR-01','DD-MON-YY')
    Error report:
    SQL error: ORA-01830: date format picture ends before converting all of the input string
    ORA-06512: at "EIS_EMERY. FASCOR_LOAD_BUR', line 7
    ORA-04088: error during execution of trigger ' EIS_EMERY. FASCOR_LOAD_BUR'
    01830 00000 - "date format picture ends before converting all of the input string.
    * Cause:
    * Action:
    *************************************************************

    Someone has ideas on what exactly the cause this problem? I thought that perhaps that is the data type of Load_Completion_Date, which is of type 'Date', so I dropped the column and then tried to add it again but this time by putting a mask on it, but it would not get in shape the type date when adding the column.

    I'm lost on this and it seems to simple.

    927300 wrote:
    For me, the result is:

    18 APRIL 12

    Select TO_CHAR (sysdate,'YYYY-MM-DD HH24:MI:SS) twice;

    do high instead
    It is strictly a matter of presentation of data; also known as the formatting!

Maybe you are looking for