How to get if THEN ELSE another condition table

Hi eveybody,.
I have a situation and I need your advice guys.
I apply if THEN ELSE condition in PL/SQL from another table. I do the merger in tableA that will run IF Column1 in tableC = Y.
Ex: Tablec has three columns: source, dest, condition. Condition IF = Y in tableC, then merge into tableA use (Sql query in table C source selection) B.

Please let me know how to get the condition = Y of table C.
Condition IF = Y for each source in C, then fusion will happen for this source.

Please provide your comments and your responses.
I'd really appreciate your comments and your responses.
Thank you very much.

user13426784 wrote:
DB link is passed as parameter in MS and we need to check the status for this link db to TableC.

select   status
  into  v_status
  from  tableC
  where db_link = v_source;
if v_status = 'Y'
  then
    EXECUTE IMMEDIATE 'MERGE INTO tableA A USING
(select  from tableA@' || v_source || ')B
when matched insert
when not matched update';
end if;

SY.

Tags: Database

Similar Questions

  • How to get one application to another changes

    Hello

    I'm starting to write my thesis on data migration at the APEX.
    I have a master application running in our society and a few copies to run on other servers partners. When I make a change in the main application or in its database, how to make all the changes to other applications of the partners?
    I will write on the possibilities of how to do this. To get an informed perspective, I looked in some books from the library, but there is no real explanation how to do this. Maybe I'm looking for the wrong words.

    Can someone tell me some possibilities how to get the changes to an application on one server to another copy of this application on another server?
    You don't have to explain how it works. I need just a little help I know what I have to look in the library (or Google Scholar)

    Concerning
    Felix

    It depends...

    If 'other' applications and data are supposed to be exact copies of the 'master' of all at once, then you might be looking at replication of database.

    If 'other' applications are simply the 'versions' of a 'master' i.e. request with the same treatment base but different data then you look at configuration management and release management.

    I think you are talking about the latter: you have developed an application and installed in different places; you have changed the application (and some data) and now update remote applications to match what you have just developed?

  • How to get the text formatting in the tables

    Dear experts and aid

    For my project, I import an RTF file and then read the data into 3 tables. It works fine when just using the contents of the string of paragraphs. However, the final script should be able to read and to replace the text formatted...
    Why use intermediate tables? Because otherwise I need to swap between two fm-documents (and you can be a part of the book).

    The imported file starts with a certain number of lines separated into two parts by a TAB ("designates a TAB in \x08 FM)
    [[Garneau, 1990 #12]]    »   [9]
    The good article can also be locally as text, e.g. [9]
    Then follow the same (or smaller) number of paragraphs with text formatted like this:
    [9]"D. Garneau, ed., National Language Support Reference Manual (national language Information Design Guide. Toronto, CDN: IBM National Language technical Centre, 1990.

    Is it possible to replace in the body of the function below the next song

      while(pgf.ObjectValid()) {
        pgfText = GetText (pgf, newDoc);
        gaBibliography.push(pgfText);
        pgf = pgf.NextPgfInFlow;
      }
    

    with this

      while(pgf.ObjectValid()) { 
        gaBibliography.push(pgf);
        pgf = pgf.NextPgfInFlow;
      }
    

    Do I need a special statement of the gaBibliography range?
    And how to get the right part of the lines as formatted intro thingy in table gaFmtCitsFmt ?

    Currently, I read in the tables as "strings" (function GetText not shown):

    var gaFmtCitsRaw  = [];                           // left column in processed RTF
    var gaFmtCitsFmt  = [];                           // right column in processed RTF
    var gaBibliography= [];                           // bibliography lines from processed RTF
    // filename is something like E:\_DDDprojects\FM+EN-escript\FM-testfiles\BibFM-collected-IEEE.rtf 
    
    function ReadFileRTF (fileName) {
      var nCits=0, nBib = 0, openParams, openReturnParams, newDoc, pgf, pgfText ;
      var TAB = String.fromCharCode(8);               // FM has wrong ASCI for TAB
      var parts = [];
      
      openParams = GetOpenDefaultParams();
      openReturnParams =  new PropVals();  
      newDoc = Open (fileName, openParams, openReturnParams);  
      pgf = newDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;  // get first pgf in flow
    
    // --- read the temp/formatted citations  
      while(pgf.ObjectValid()) {
        pgfText = GetText (pgf, newDoc);
        if (pgfText.substring (0,2) == "[[") {        // citation lines start with [[
          parts = pgfText.split(TAB);                 // get the two parts of the line
          gaFmtCitsRaw.push (parts[0]);               // Push the result onto the global array
          gaFmtCitsFmt.push (parts[1]);
          pgf = pgf.NextPgfInFlow;
        } else { break }
      }
    
    // --- read the bibliography
      while(pgf.ObjectValid()) {                      // until end of doc
        pgfText = GetText (pgf, newDoc);
        gaBibliography.push(pgfText);
        pgf = pgf.NextPgfInFlow;
      }
      newDoc.Close (Constants.FF_CLOSE_MODIFIED);
    } // --- end ReadFileRTF
    

    The following questions will then be how to change the script of FindAndReplace of Ian Proudfoot for managing text formatted as replacement. I will need to use the copy and paste IMHO...

    Klaus, okay, before pasting, you must assign the TextSelection object at your insertion point.

    // Add a new paragraph after the current paragraph.
    var newPgf = oDoc.NewSeriesPgf (lastPgf);
    var textRange = new TextRange (new TextLoc (newPgf, 0), new TextLoc (newPgf, 0));
    
    oDoc.TextSelection = textRange;
    oDoc.Paste ();
    

    -Rick

  • How to get into an "if" clause condition in the transformation XSLT mapping window?

    Suppose I opened a window of XSLT transformation Mapper and draw a "line" of a source to an element element target.
    Now I have a right-click on the target element and select "Add XSL Node-> 'if' in the context menu. The 'if' node appears the target of packaging item.

    Fine so far. Now, I want to clarify the 'if' condition (for example, that the copy should be done only if the source of the string value contains a 'aaa' pattern)

    How can I get it? I (double-) clicked on all the "if" clause line icons
    Context menu don't watch either entered no "enter the condition.

    So EXACTLY how can I enter the 'if' condition otherwise?

    Peter

    You must do this on the source code. Click on the source, there is "".

    "Define your test condition =" "/ tns:input1 = / tns:input2 ' or check if you string source contains"abcd", i.e. xsl: if test =" contain(/tns:source_column1,'abcd'). "

    hope this will help

  • How to get a user of another computer account turned off my computer for the family

    There is a user account on my computer from another computer and it has more rights and privledges that I don't. and he can go through my files and probably a lot more than what I know. Help, please

    > It has more rights and privledges that I don't

    This means that his account is administrator, and yours is not.
    Nothing can be done. It has all the privileges and you do not have the privilege to delete his account.
    I n ' know what's between you and him, and I don't even want to know.
    The only possible way is to take it to the reliable computer rooms maintenance shop and have the technology to remove his account, PROVIDED that it is YOUR computer.

  • How to get ALL of the 'real' database table in apps/apps

    Hi all

    EBS R12.2

    OEL 6

    I create tables derived from drawing apps and custom drawing.

    When I connect to apps/apps, there are a lot of objects, synonyms, views that point to other tables, synonyms, views of another schema as AP, AR, GL, etc..

    What is confusing is a view contains a table attached, then it is created with a synonym of an another synonyms joined another scheme.

    How can I get the list of actual tables being accessed from these apps objects?

    I would also like to count the lines of ALL the actual tables and get their real value.

    Thank you very much

    JC

    See the answers here >DBA_DEPENDENCIES

  • How to get a magic number for any table that returns more than 32 k?

    I'm in a unique situation where in I try to extract the values of the multiple tables and to publish as XML output. The problem is based on the condition of a few tables can retrieve more than 32 KB and less than 32 KB of data. Less than 32KB is not a problem, as the generation of XML is smooth. The minute he reached more than 32 k, it generates a runtime error. I was wondering if there is a way to make sure that the minute results of the query is greater than 32 KB, it must break say - if results is 35KO, so should I break this result 32 KB and 3 KB. Once then pass these data to appear as XML output. Again, it is not just for a table, but all the tables which are called in the function.

    Is it possible? I'm unable to get ideas, or did I do something so complex from the point of view of production support. If you'd be grateful if someone can guide me on this.

    The way it is, is the following:
    I have a table named ctn_pub_cntl


    CREATE TABLE CTNAPP.ctn_pub_cntl 
    (ctn_pub_cntl_id          NUMBER(18)
    ,table_name                  VARCHAR2(50)
    ,last_pub_tms              DATE
    ,queue_name               VARCHAR2(50)
    ,dest_system              VARCHAR2(50)
    ,frequency                  NUMBER(6)
    ,status                      VARCHAR2(8)
    ,record_create_tms          DATE
    ,create_user_id                VARCHAR2(8)
    ,record_update_tms          DATE
    ,update_user_id             VARCHAR2(8)
    ,CONSTRAINT ctn_pub_cntl_id_pk PRIMARY KEY(ctn_pub_cntl_id)
    );
    
    

    To do this, the data are:


    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_SBDVSN'
    ,TO_DATE('10/2/2004 10:17:44PM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.TSZ601.UNP'
    ,'SAP'
    ,15
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
     ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_TRACK_SGMNT_DN'
    ,TO_DATE('02/06/2015 9:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,30
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FXPLA_TRACK_LCTN_DN'
    ,TO_DATE('10/2/2004 10:17:44PM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.YRDPLN.INPUT'
    ,'SAP'
    ,30
    ); 
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FXPLA_TRACK_LCTN2_DN'
    ,TO_DATE('02/06/2015 9:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.TSZ601.UNP'
    ,'SAP'
    ,120
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms 
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FXPLA_TRACK_LCTN2_DN'
    ,TO_DATE('04/23/2015 11:50:00PM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.YRDPLN.INPUT'
    ,'SAP'
    ,10
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms 
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FIXED_PLANT_ASSET'
    ,TO_DATE('04/23/2015 11:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,10
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms 
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_OPRLMT'
    ,TO_DATE('03/26/2015 7:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,30
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_OPRLMT_SGMNT_DN'
    ,TO_DATE('03/28/2015 12:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,30
    );
    
    /
    
    COMMIT;
    
    

    Once the above data are inserted and committed, then I created a feature in a package:


    CREATE OR REPLACE PACKAGE CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH
    IS
    
    TYPE tNameTyp IS TABLE OF ctn_pub_cntl.table_name%TYPE INDEX BY BINARY_INTEGER;
    g_tName tNameTyp;
    
    TYPE tClobTyp IS TABLE OF CLOB INDEX BY BINARY_INTEGER;
    g_tClob tClobTyp;
    
    
    FUNCTION GetCtnData(p_nInCtnPubCntlID IN CTN_PUB_CNTL.ctn_pub_cntl_id%TYPE,p_count OUT NUMBER ) RETURN tClobTyp;
    
    
    END CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH;
    
    
    --Package body
    
    CREATE OR REPLACE PACKAGE BODY CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH
    IS
    
         doc           xmldom.DOMDocument;
         main_node     xmldom.DOMNode;
         root_node     xmldom.DOMNode;
         root_elmt     xmldom.DOMElement;
         child_node    xmldom.DOMNode;
         child_elmt    xmldom.DOMElement;
         leaf_node     xmldom.DOMNode;
         elmt_value    xmldom.DOMText;
         tbl_node      xmldom.DOMNode;
         table_data    XMLDOM.DOMDOCUMENTFRAGMENT;
      
         l_ctx         DBMS_XMLGEN.CTXHANDLE;
         vStrSqlQuery  VARCHAR2(32767);
         l_clob        tClobTyp;
         --
         l_xmltype     XMLTYPE;
         --
    --Local Procedure to build XML header     
    PROCEDURE BuildCPRHeader IS
    
      BEGIN
        child_elmt := xmldom.createElement(doc, 'PUBLISH_HEADER');
        child_node  := xmldom.appendChild (root_node, xmldom.makeNode (child_elmt));
    
        child_elmt := xmldom.createElement (doc, 'SOURCE_APLCTN_ID');
        elmt_value := xmldom.createTextNode (doc, 'CTN');
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
        
        child_elmt := xmldom.createElement (doc, 'SOURCE_PRGRM_ID');
        elmt_value := xmldom.createTextNode (doc, 'VALUE');
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
    
        child_elmt := xmldom.createElement (doc, 'SOURCE_CMPNT_ID');
        elmt_value := xmldom.createTextNode (doc, 'VALUE');
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
    
        child_elmt := xmldom.createElement (doc, 'PUBLISH_TMS');
        elmt_value := xmldom.createTextNode (doc, TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS'));
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
        
    END BuildCPRHeader;
    
    --Get table data based on table name
    FUNCTION GetCtnData(p_nInCtnPubCntlID IN CTN_PUB_CNTL.ctn_pub_cntl_id%TYPE,p_Count OUT NUMBER) RETURN tClobTyp IS
        
        vTblName      ctn_pub_cntl.table_name%TYPE;
        vLastPubTms   ctn_pub_cntl.last_pub_tms%TYPE;
         
    BEGIN
                g_vProcedureName:='GetCtnData';    
                g_vTableName:='CTN_PUB_CNTL';
                
            SELECT table_name,last_pub_tms
            INTO   vTblName, vLastPubTms
            FROM   CTN_PUB_CNTL
            WHERE  ctn_pub_cntl_id=p_nInCtnPubCntlID;
        
        -- Start the XML Message generation
            doc := xmldom.newDOMDocument;
            main_node := xmldom.makeNode(doc);
            root_elmt := xmldom.createElement(doc, 'PUBLISH');
            root_node := xmldom.appendChild(main_node, xmldom.makeNode(root_elmt));
            
          --Append Table Data as Publish Header
            BuildCPRHeader;
            
          --Append Table Data as Publish Body
          
           child_elmt := xmldom.createElement(doc, 'PUBLISH_BODY');
           leaf_node  := xmldom.appendChild (root_node, xmldom.makeNode(child_elmt)); 
           
           DBMS_SESSION.SET_NLS('NLS_DATE_FORMAT','''YYYY:MM:DD HH24:MI:SS''');
           
           vStrSqlQuery := 'SELECT * FROM ' || vTblName 
                          || ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
                        --  ||  ' AND rownum < 16'
                          --;
          DBMS_OUTPUT.PUT_LINE(vStrSqlQuery);
           
           l_ctx  := DBMS_XMLGEN.NEWCONTEXT(vStrSqlQuery);
          DBMS_XMLGEN.SETNULLHANDLING(l_ctx, 0);
          DBMS_XMLGEN.SETROWSETTAG(l_ctx, vTblName); 
           
          -- Append Table Data as XML Fragment
          l_clob(1):=DBMS_XMLGEN.GETXML(l_ctx);  
          elmt_value := xmldom.createTextNode (doc, l_clob(1)); 
         leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value)); 
         
         xmldom.writeToBuffer (doc, l_clob(1));
         l_clob(1):=REPLACE(l_clob(1),'&lt;?xml version=&quot;1.0&quot;?&gt;', NULL);
         l_clob(1):=REPLACE(l_clob(1),'&lt;', '<');
         l_clob(1):=REPLACE(l_clob(1),'&gt;', '>');
         
         RETURN l_clob;
         
         DBMS_OUTPUT.put_line('Answer is' ||l_clob(1));
         
         EXCEPTION
            
            WHEN NO_DATA_FOUND THEN
            
            DBMS_OUTPUT.put_line('There is no data with' || SQLERRM);
            g_vProcedureName:='GetCtnData';
            g_vTableName:='CTN_PUB_CNTL';
            g_vErrorMessage:=SQLERRM|| g_vErrorMessage;
            g_nSqlCd:=SQLCODE;
            ctn_log_error('ERROR',g_vErrorMessage,'SELECT',g_nSqlCd,p_nInCtnPubCntlID,g_vPackageName,g_vProcedureName,g_vTableName);
            
            
            WHEN OTHERS THEN
           
           DBMS_OUTPUT.PUT_LINE('ERROR : ' || SQLERRM);
           ctn_log_error('ERROR',g_vErrorMessage,'OTHERS',g_nSqlCd,p_nInCtnPubCntlID,g_vPackageName,g_vProcedureName,g_vTableName);
           
    END GetCtnData;
    
    
    PROCEDURE printClob (result IN OUT NOCOPY CLOB) IS
        xmlstr   VARCHAR2 (32767);
        line     VARCHAR2 (2000);
    BEGIN
        xmlstr := DBMS_LOB.SUBSTR (result, 32767);
    
        LOOP
           EXIT WHEN xmlstr IS NULL;
           line := SUBSTR (xmlstr, 1, INSTR (xmlstr, CHR (10)) - 1);
           DBMS_OUTPUT.put_line (line);
           xmlstr := SUBSTR (xmlstr, INSTR (xmlstr, CHR (10)) + 1);
        END LOOP;
    END printClob;
    
    END CTN_PUB_CNTL_EXTRACT_PUBLISH;
    
     
    

    If you notice my query:


    vStrSqlQuery := 'SELECT * FROM ' || vTblName 
                          || ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
                         ||  ' AND rownum < 16'
                        ;
    

    The minute I comment

    ||  ' AND rownum < 16' ;


    It generates an error because this query returns about 600 lines and all these lines must be published in XML format and the tragedy, is that it is a C program between institutions i.e. C calls my functions of packged and then will do all the processing. This will return the results to the C program. Then obviously C does not recognize the CLOB and somewhere in the process, I convert to VARCHAR or CLOB CLOB, I have to use VARCHAR as a return type. That's my challenge.


    Someone who can help me find the number required of magic and also a brief knows how, I understand that. Thanks in advance.

    Not that I would use it myself but your package can be simplified down, like this:

    create or replace package ctn_pub_cntl_extract_publish is
    
      C_DTFORMAT  constant varchar2(30) := 'YYYY-MM-DD HH24:MI:SS';
    
      function getXMLData (p_table_name in varchar2, p_pub_tms in date) return xmltype;
      function getCTNData (p_id in number) return clob;
    
    end ctn_pub_cntl_extract_publish;
    /
    
    create or replace package body ctn_pub_cntl_extract_publish is
    
      function getXMLData (p_table_name in varchar2, p_pub_tms in date)
      return xmltype
      is
    
        v_query  varchar2(32767) :=
                 q'{select * from $$TABLE_NAME where record_update_tms <= to_date(:1, 'YYYYMMDDHH24MISS')}';
    
        ctx      dbms_xmlgen.ctxHandle;
        doc      xmltype;
    
      begin
    
        execute immediate 'alter session set nls_date_format = "'||C_DTFORMAT||'"';
        v_query := replace(v_query, '$$TABLE_NAME', dbms_assert.simple_sql_name(p_table_name)); 
    
        ctx := dbms_xmlgen.newContext(v_query);
        dbms_xmlgen.setBindValue(ctx, '1', to_char(p_pub_tms, 'YYYYMMDDHH24MISS'));
        dbms_xmlgen.setRowSetTag(ctx, p_table_name);
        dbms_xmlgen.setNullHandling(ctx, dbms_xmlgen.DROP_NULLS);
        doc := dbms_xmlgen.getXMLType(ctx);
        dbms_xmlgen.closeContext(ctx);
    
        return doc; 
    
      end;
    
      function getCTNData (p_id in number)
      return clob
      is
    
        doc  clob;
    
      begin
    
        select xmlserialize(document
                 xmlelement("PUBLISH"
                 , xmlelement("PUBLISH_HEADER"
                   , xmlforest(
                       'CNT' as "SOURCE_APLCTN_ID"
                     , 'VALUE' as "SOURCE_PRGRM_ID"
                     , 'VALUE' as "SOURCE_CMPNT_ID"
                     , to_char(sysdate, C_DTFORMAT) as "PUBLISH_TMS"
                     )
                   )
                 , xmlelement("PUBLISH_BODY"
                   , getXMLData(t.table_name, t.last_pub_tms)
                   )
                 )
               )
        into doc
        from ctn_pub_cntl t
        where t.ctn_pub_cntl_id = p_id;
    
        return doc;
    
      end;
    
    end ctn_pub_cntl_extract_publish;
    

    Function getXMLData() generates a canonical XML document out of the table that is passed as a parameter.

    Function built getCTNData() code XML "PUBLISH", the document using SQL/XML functions, the getXMLData() call in the process and returns the content serialized as a CLOB.

  • How to get the value of an af:Table SelectOneChoice

    V11.1.2.4.0 - JSF JDeveloper

    Greetings,

    Im having a problem getting a column value that is an object of a select choice.

    This isn't a common problem, as I actually did something that others so please follow my problem

    Description and if you have questions/answers please answer below.

    I create a database view that returns me 3 columns, say TestValue TestCode, TestDescription.

    I added an extra temporally column in my OV and called Temp.

    I drag / drop my OV, remove value Temp and its position of the column, I drag / drop a LOV, who comes from a different view.

    that shows me the doctor name & first name and identification number of the back doctor select a value of choice.

    I'm using a function that go through the iterator, gets the lines and save them in the database (no matter how).

    The problem is my selectonechoice, are not row.bindings.DoctorId.InputValue, but the links. DoctorId.InputValue instead, so I can retrieve value selectonechoice of the current line.

    Then when my loop is finished and insert rows in my database, id of the doctor of the line everyone is the same as the binding do not change through the loop.

    I don't know how to add value to the current line select only one option to use the correct value to each loop of the line.

    Here is my loop function:

            DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding iterator = bc.findIteratorBinding("ExaminationsIterator");
            DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    
    
             RowSetIterator rsi = iterator.getRowSetIterator();  
             int i=0;
             
            OperationBinding save_exams = bindings.getOperationBinding("SAVE_EXAMINATION");
            OperationBinding save_exams_commit = bindings.getOperationBinding("SAVE_EXAMINATION_COMMIT");
               
            try{
             while(i < rsi.getRowCount()){
                 
                 Row r = iterator.getCurrentRow();
                                 
                 save_exams.getParamsMap().put("CodeTest", r.getAttribute("CodeTest"));
                 save_exams.getParamsMap().put("Dates", r.getAttribute("Dates"));   
                 save_exams.getParamsMap().put("CodeId", orderid.getValue());   
                 save_exams.getParamsMap().put("Times", r.getAttribute("Times"));    
                 save_exams.getParamsMap().put("DoctorId", resolveExpression("#{bindings.DoctorId.attributeValue}").toString()); 
                 save_exams.getParamsMap().put("IdPatients", patientid.getValue());   
                 save_exams.execute();
                 rsi.next();
                 i++;
             }
            
                save_exams_commit.execute();
    

    I get the connection id of the current doctor and the value of the rows no.

    Can you help me on this please?

    I created a work around solution, until an expert that I come with a more advanced solution.

    (1) I add a LOV at the id of the doctor on the view target object.

    (2) on the duration, I fill my view of database

    3) go through all my DB view iterator lines

    (4) appends each line on the View object target (missing id of the doctor, because I want it to be on common language runtime) & commit lines

    (5) after the loop ends and the target object from view show me results from the view of DB, I choose the runtime id of the doctor and commit the changes if

    the new lines, with the new update will be finally filled to the database.

    I hope this helps if anyone has a similar task.

    Please let me know if you find a more direct solution, this work with 2 tables to fill 1.

  • How to get the QDR of ADF Pivot table datacell

    JDeveloper 11.1.1.5 version
    Java 1.6
    The ADF faces

    I want to click commandlink in a data cell that sends the value of the header cells to a bean of support. I think that we must get the QDR of a clicked data cell, but how?

    I created the PivotTable: column headers consist of a variable number of dates; row headers consist of the names of the units. The data that cross are a percentage of variance using energy over time. (There is no calculation in the PivotTable, just displaying data from the view).

    ........ 11 Jan 12 13 Jan Jan jan 14. .etc
    Module-1 2.00 5, 25 - 9.30-11.15
    Unit-2 - 554.22 497.00 7.70 2.00
    Unit-3 10.00 - 5, 00 5.00 1.00

    To the cell above it with 497.00 value, the user must click this value (commandlink) and the bean 1) calculate the values of the unit and the date to use as parameter values for ExecuteWithParams under another iterator and 2) navigate to another page using this another iterator.

    It seems that the QDR (reference data) is involved, but can't find enough information about how to implement the same.

    Here are the PivotTable on the jspx:

    < dvt:pivotTable id = "pivotTable1".
    Summary = "reading analytical pivot table.
    value = "#{bindings." CdsaReadingsItfVwView1.pivotTableModel}.
    var = 'cellData.
    varStatus = "cellStatus" >
    < dvt:dataCell >
    < af:commandLink id = "cl".
    Text = "#{cellData.DataValue} '"
    action = "#{pivot_bean.commandlink_action}" / >
    < / dvt:dataCell >
    < / dvt:pivotTable >



    In the bean, we try to getPivotTable(), but it is always null.

    Any direction is welcome.

    David K

    Check how the PivotTable selection demo was created:
    http://jdevadf.Oracle.com/ADF-richclient-demo/faces/feature/PivotTable/pivotTableSelection.JSPX
    Code for this demo here:
    http://www.Oracle.com/technetwork/developer-tools/ADF/documentation/ADF-faces-RC-demo-083799.html

  • How to get the last records of a Table

    Hey Geeks,

    I have this 'conflict '.

    I need to get the 'current balance' for each account, the newest "current_Balance".

    The table looks like this

    ACCOUNT_IDBUSINESS_TRANSACTION_IDCURRENT_BALANCETRANSACTION_AMOUNTTRANSACTION_DATE
    1 062 570238 043 51751'022-20'00031.03.2014 17:49:00.808000
    1 062 570238 042 40771'022-20'00031.03.2014 17:33:55.666000
    1 062 570238 042 36891'022-26'00031.03.2014 17:33:20.067000
    1 062 570238 041 273117'022-50,00031.03.2014 17:18:25.189000
    1 062 570238 041 174167'022-10,00031.03.2014 17:16:59.361000
    1 062 570238 038 702177'022-2'50031.03.2014 16:44:58.332000
    5 607 555238 046 7131'026-28'50031.03.2014 18:35:16.212000
    5 607 555238 040 59229'526-100,00031.03.2014 17:10:15.474000

    I need this result:

    ACCOUNT_ID CURRENT_BALANCE

    5 607 555 1'026

    1 062 570 51'022                   


    How we handle this?


    Thxs for your help


    Ineffective :-)

    SELECT Account_id

    MAX (current_balance) KEEP (DENSE_RANK LAST ORDER BY transaction_date) current_balance

    MAX (business_transaction_id) KEEP (DENSE_RANK LAST ORDER BY transaction_date) business_transaction_id

    Of account_balances

    GROUP BY account_id

    See on Oracle: clause to keep

    Concerning

    Marcus

  • How to get the first 5 records the table max

    Hello Experts,

    I had a rqmt to extract first five columns in a table for the past 6 years, I have implemented the function Rank and doing this, but it does not work, can anyone suggest me how to implement this?

    Thank you.

    Hello...

    Define first five... is this

    Select * from table_name
    where rownum<6>

    Then, create a column inside fx: RCOUNT (1), then filter this column: less than 6.
    ------------------------
    or is it based on a few rows?
    just explain.

    Check if correct/help
    Bachelot

  • How to get all minimum values for a table of valuable documents?

    I need to get the list of records of the minimum value for a table that has the structure and the data below
    create table emp (name varchar2(50),org varchar2(50),desig varchar2(50),salary number(10),year number(10));
    
    insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',3000,2005);
    insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',4000,2007);
    insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',7000,2007);
    insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',7000,2008);
    insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',7000,2010);
    commit;
    
    
    SELECT e.name,e.org,e.desig,min(e.year) FROM emp e,(
    SELECT e1.name,e1.org,e1.desig,e1.salary FROM emp e1
    GROUP BY (e1.name,e1.org,e1.desig,e1.salary)
    HAVING COUNT(*) >1) min_query
    WHERE min_query.name = e.name AND min_query.org = e.org AND min_query.desig =e.desig
    AND min_query.salary = e.salary
    group by (e.name,e.org,e.desig);
    With the above query, I can get the year less value where the EMP has maximum salary. It returns a single record. But I want all the records that are minimal compared to the value of the year max

    Power required
    emp1     org1     mgr     7000     2008
    emp1     org1     mgr     7000     2007
    Please help me with this...

    Hello

    Aggregate functions reduce the result set with one row per group.
    Almost all of the aggregate functions are homologous analytics that can give the same results without restricting the result set. Since you want the output to contain several lines per group, then the analytic functions are probably better for you.

    Here's one way:

    WITH      got_analytics     AS
    (
         SELECT     name, org, desig, salary, year
         ,     MAX (salary)  OVER ( PARTITION BY  name, org, desig)          AS max_salARY
         ,     ROW_NUMBER () OVER ( PARTITION BY  name, org, desig, salary
                                    ORDER BY        year  DESC
                           )                              AS year_num
         FROM    emp
    )
    SELECT     name, org, desig, salary, year
    FROM     got_analytics
    WHERE     salary          = max_salary
    AND     year_num     > 1
    ;
    
  • How to get the value of row current table when press the button submit

    Hello

    I want to get the current value of the SuccessionPlanId line which is part of the column in a table that is advanced.

    I created a (created using customization, from action through CO) button in the table as column, so each line with a single key, if I press the button of the first line means so I want to extract the first line SuccessionPlanId and if it's the 3rd way so I want to get the value of the value of the third row.

    How in the post of controller?

    Please answer soon, its urgency.

    Thanks in advance,
    SAN

    OK, need to go with a delicate way,

    1.) create a new table with Jdeveloper and there shud be a replica of the room once except the button submit newly added, pls note button type shud be present the type of button.

    2.) hide the existing table area and create a new stacklayoutbean.

    (3.) this stacklayout bean will have the property to extend, you give the full path of the new custom of advanced table box.

    Now you should be able to get the reference of the line during the click on the "submit" button

  • How to get textframe parent of the current Table?

    Hi all

    I have ITableModel and had ITextModel through ITableTextContainer; through textmodel, I get iframelist. But my question is how can he get the exact relative of the current table textframe?

    Pls suggest on that.

    I got it!

    ITableTextContainer GetAnchorTextIndex().

  • How to get the metadata for the selected tables of a schema

    Hello

    I need the metadata for the tables selected for an activity. The list of the table continues to change now. I get the list of tables just before the activity.

    What I need is to know how to put the list of tables in the sub query dynamicallly

    +++++++++++
    exec dbms_metadata.set_transform_param (DBMS_METADATA. False SESSION_TRANSFORM, 'SEGMENT_ATTRIBUTES',);
    exec dbms_metadata.set_transform_param (DBMS_METADATA. False SESSION_TRANSFORM, 'STORAGE',);
    exec dbms_metadata.set_transform_param (DBMS_METADATA. SESSION_TRANSFORM, 'TABLESPACE', TRUE);

    Select DBMS_METADATA. GET_DDL ('TABLE', '&') from user_tables where rownum < 2;
    +++++++++++

    What I need is something of the form where table_name in (< table1 >, < table2 >, < table3 >,..., etc.) in the query above, so that i access all the metadata
    He doesn't hit me how I can write this query to single line. Can someone help here?

    Regds,
    Malika

    Hello

    try using the name of the column to user_tables and owner of the table in the "DBMS_METADATA. GET_DDL' and the reel to reel for some files and run this file in turn exit.

    coil
    Select ' select DBMS_METADATA. GET_DDL ("' TABLE," ' | table_name |', "' ) double;' from user_tables
    where ;
    spool off;

    @some_file - trying to spool output too.

    -Pavan Kumar N

Maybe you are looking for