Table with numeric columns and string

Hello everyone. I am a new labviewer, so I have 2 questions fundamental.

1. I found this basic timer loop, which I need to get inside my structure of the event. How to wire this loop with my writing and reading?

2. I need to wire my digital indicator "Elapsed time" with my table, so I want the 'measure' in the first column and "elapsed time" in the second column. I know I can't mix string and digital indicator in the same table, so the best way would be to make two tables 1 d (digital channel), or there are more basic ways to correct the problem?

Thanks in advance

Orlando

2010:

Tags: NI Software

Similar Questions

  • How to create a table with editable column values.

    Hello world
    I think it's very simple, but I am unable to find how to do this. This is my requirement. I need to create a table with n columns and 1 line initially. the user must be able to enter data into this table and click of a button must insert the data into the database table. Also, there should be a button at the bottom of the table to add 1 line to the table.

    I know how to do the insertion of data, but can someone please let me know how to create a table which allows the user to enter data and how to create a line button Add 1?


    Thanks in advance!

    Raghu,

    Go through the tutorial of Toolbox Page & Advanced section of the Guide of the OFA table.

    Step 1 - you need to create EO & VO from this EO. This EO will be table of database where you want to insert the data.

    Step 2 - create an advanced table region. (See this section in table advanced for more details)

    Step 3 - attach this VO in the BC4J region advanced Table component.

    Kind regards
    GYAN

  • Table with fixed header and the left column

    I created a table in my application with the fixed left column (left most column is fixed and remaining columns are scrolling from left to right). is it possible to create a table with fixed position and fixed left column?

    Suppose there are 50 rows and 10 columns in my paintings, and only 3 columns and 15 rows are visiable on the screen

    (1) when the user scroll left to right left only most of the columns must be fixed. Remaining cap of the table and column scroll left to right and vice versa. also

    (2) when user scroll high high bottems single topic most must be fixed and remaining all lines (with to the left most column) should be scrollable.

    I am able to put in place a point at the top, but not both. Please suggest

    "If I repopulate the value in the cell when user scrolling, shell, I get scrolling effect correctly as it only shows half cell when the user highlight half of the cell."

    Approach using TablelayoutManager display single cells and scrolling would be cell at a time.  And Yes, you will need to override navigationMovement and n of methods appropriate TouchEvent your TableLayoutManager so that he knows when to fill the cells.

    Another alternative is to have four managers, we don't the the upper left corner (the dead angle), one to make the top row (column headings), one to make the left column (row headings), and the other to do the rest (data).  Place all these in a delicate header and line manager.  Only allow the user to scroll the data part.  Have the difficult Manager to listen the scroll events.  Then have the wily Manager add and remove the dummy column and header line managers as appropriate.  Note that these topic fields would not good passes, they would be either there or they would not be displayed. That would give you your 1/2 a scroll of the cell.  And you wouldn't have to substitute anything to detect movement, you would have left the listener do scrolling for you.

  • How to create the table with the rows and columns using the layout?

    One of my friends advised me to put my site on the mode of provision as it is better than the standard as he said
    but I couldnot make an ordinary table with the rows and columns in mode available th
    y at - there someone who can tell me how to?
    Thank you very much

    Wednesday, April 18, 2007 21:01:38 + 0000 (UTC), "Mr.Ghost".
    wrote:

    > A friend of mine advised me to put my whole site on the mode of disposal as its
    > better than standard, as he says

    Your friend won't. Don't listen to him any more. Mode of disposal creates
    very fragile and rigid code pauses at the first opportunity.

    Gary

  • Gears - error when you try to insert values into a table with multiple columns

    Hello

    I started playing with the gears and SQlLite today and I get an error when I try to insert values into a table with multiple columns.

    I have:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text, DeveloperAge int)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?, ?)', [devName, devAge]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I get the error:

    net.rim.device.api.database.DatabaseException; insert into developers values (?,?): SQL logic error or missing database.

    I use this reference: http://code.google.com/apis/gears/api_database.html

    Everything works if I have only one field as:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?)', [devName]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I use the plug-in Visual Studio 2.0 for 2008 that are running Windows XP SP and Simulator 2.13.0.56

    Thank you

    Davy

    Yes, a SQLite database will persist between battery pulls.  The database is registered either to internal MEM or removable media (not the device memory), depending on which is available on your device.

    In general, its not considered a best practice to remove your table as soon as it is empty and re - create it again when you want to add data.  This adds extra overhead fresh for the final, delete and insert first for a given table.  Instead, define and finalize your drawing before you create your table.  Once created, review the static schema.

    That being said, for development purposes, it may be easier to provide an easy way to drop your tables while you develop your schema.

    See you soon,.

    Adam

  • Export an ADF table with default column order

    Hello

    Jdev 11.1.1.5.0

    We have ADF Table with column drag and drop option. Also we have implemented ADF Table with excelHTMl type of export.

    Everything works as expected. Only problem is if we try to exchange a few columns by drag-and - drop option and then export the table, we receive the order of the columns with brewing. But our demand is, the user must obtain the export with the initial order table by default.

    It would be great, if you can suggest an idea to export the ADF table with default column order.

    Thanks in advance,

    MSR.

    I realized the required functionality. We can restore the default order of the columns to aid

       Function richeTableau = this.getFetchResultsTable ();
       Iterator rItr = rTable.getChildren () .iterator ();
       {while (rItr.hasNext ())}
           ((RichColumn) rItr.next ()).setDisplayIndex(-1);
       }

    Then we can call the real export help feature

       queue the event via a JavaScript inserted into the page
       FacesContext context = FacesContext.getCurrentInstance ();
       Erks = ExtendedRenderKitService
       Service.getService (context.getRenderKit (), ExtendedRenderKitService.class);
       erks.addScript (context, "customHandler()");
  • Declare a type of table with multiple columns

    I have a table with a column of type, and I want to create one with two columns.

    My type is:
    create or replace type "NUMBER_TABLE" in the table of the number;

    And I use it in function:

    FUNCTION GetValues()
    return NUMBER_TABLE
    as
    results NUMBER_TABLE: = NUMBER_TABLE();
    Start
    Select OrderId bulk collect in: results from (select * from tbl_orders);
    -Other code...
    end;

    I want select it be like this:
    Select OrderId, OrderAddress bulk collect into: results from (select * from tbl_orders);

    How to do this?

    Is that what you are looking for:

    CREATE OR REPLACE TYPE two_col_rec AS OBJECT (empno NUMBER, ename VARCHAR2(10))
    /
    
    CREATE OR REPLACE TYPE two_col_table AS TABLE OF two_col;
    /
    
    CREATE OR REPLACE FUNCTION GetValues RETURN two_col_table AS
       results two_col_table := two_col_table();
    BEGIN
       SELECT two_col(empno, ename) BULK COLLECT INTO results FROM emp;
       --
       RETURN results;
    END;
    /
    show errors
    
  • Unique table with several columns or several tables split?

    What is the best.

    A table with multiple columns inside or divided into several tables. Why?
    How will the performance in the two scenarios?

    Hello

    user13024762 wrote:
    I have a table EMP that has column EMP_ID, EMP_NAME MGR_ID, MGR_NAME, SALARY, EXP_IN_MNTHS, EXP_IN_YRS... etc with multiple columns

    I have the following tables
    EMP-> EMP_ID, EMP_NAME

    Each row in the table emp thie represents a separate employee. I guess other columns in the emp table might be birth_date, social_security_number and status (by example, 'Active', 'Leave', 'complete'). Here's what an employee has (at least) one of. If there is a one-to-many relationship between an employee and an attribute, then you probably want another table for this attribute.

    BISHOP-> EMP_ID, MGR_ID, MGR_NAME

    There is a one-to-many relationship between employees and managers? In other words, an employee may have 2 or more managers? If Yes, then you need another table.
    If there is only a one-to-one relationship between employees and managers (in other words, if an employee is never more than 1 Manager) so why don't you just have a mgr_id column in the emp table?
    Managers are also used for? (This is often the case, as in scott.emp and hr.employees.) If so, do not store their names in the EME and tables of mgr. Store name (and date of birth and other information) in the table emp only and, if you need a table of Bishop, just the emp_id and mgr_id column.

    SAL-> EMP_ID, SALARY

    There is a one-to-many relationship between the employees and wages? In other words, an employee may have 2 or more treatments? If so, how will you use the values? Is a special treatments in some way, as it will be used more often than others? (In other words, you may have a current and past wages salary, but the last wages are rarely used.)
    If you never have more than 1 salary for a given employee, why not just have a sal column in the emp table?

    EXP-> EMP_ID, EXP_IN_MNTHS, EXP_IN_YRS

    There is a one-to-many relationship between the employees and what whether you store in this table?

    etc. with more tables

    What is the best based on

    (1) performance and data recovery
    (2) ease of use
    (3) maintainability

    A one-to-many relationship requires an additional table. If an employee can have up to 3 managers, don't have mgr1, mgr2 and mgr3 columns in the emp table. Use a separate table, with up to 3 lines for the same employee, instead.
    For 1-1 relationships, it is usually best to not have separate tables.

  • Table with 300 columns

    While talking with a friend, he told me that sometimes he uses tables with 300 columns that will be available only once for the extraction of information. For me, it's a little strange because 300 columns looks like a large number of columns for me...

    Have tables with columns as is common practice in the data warehouse? If Yes, can you explain to me on what situations, this can happen and how often?

    Concerning

    We have tables with columns of cca 150.

    You should know that we don't talk to relational systems which are standardized. Its common practice when building data warehouse. Number of columns in the tables will depend on the complexity and the size of your warehouse and the number, size and complexity of your source systems.

    Point is that even now, when the data warehouse is "done", we still add/remove columns changes to warehouse such as changing the source systems.

  • GetLength errors on CLOB. Retrieves the size of a table with CLOB columns

    Hello

    I try to find the size of a CLOB to a table column and get the error

    PLS-00306: wrong number or types of arguments in the call to "GETLENGTH.

    When you try to use dbms_lob.getlength. Here is the code


    declare
    number num.
    Start
    for rec in (select xmlupload from FILE_TABLE where file_table_id = 33635) loop
    NUM: = dbms_lob.getLength (rec.xmlupload);
    end loop;
    dbms_output.put_line (num);
    end;

    Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi


    I'm actually trying to find the size of a table with CLOB columns, is there an easy way to do this Besides using getlength and without having to contact the Administrators (they are outsourced)?

    It works fine on my computer, the version is also 10g.

    SQL> declare
      2  num number;
      3  begin
      4  for rec in (select cntnt from ims_toms_msge where rownum<3) loop
      5  num := dbms_lob.getLength(rec.cntnt);
      6  dbms_output.put_line(num);
      7  end loop;
      8
      9  end;
     10  /
    3837
    3837
    
    PL/SQL procedure successfully completed.
    

    You should check if xmlupload is the CLOB data type.
    In addition, if you just want to get the CLOB size, you can use LENGTH() as well, you will get the same result;

    SQL>  select length(cntnt), dbms_lob.getLength(cntnt) from ims_toms_msge where rownum<2;
    
    LENGTH(CNTNT) DBMS_LOB.GETLENGTH(CNTNT)
    ------------- -------------------------
             3837                      3837
    

    Published by: PhoenixBai on September 24, 2009 13:40

  • Fill a table with two columns using a custom bean

    Hello

    Can you provide me or give me a link to an example of populating a table (with two columns) with a custom bean?

    Thank you

    TSPS

    Hello..
    I'm Jules Destrooper is what you want

    http://download.Oracle.com/docs/CD/E18941_01/tutorials/jdtut_11r2_36/jdtut_11r2_36.html

    Hopes, will help you

  • flow of Installer for tables with source schemas and destination is different

    How to set up courses of water for tables with source schemas and destination is different? But the structure of the table is the same.

    Please paste a small example too.

    Thank you
    Bala

    Hello

    I have a concrete example of this issue, I tested in my environment. Please follow the steps below to install this on your databases.

    My global_name to database source is: REP102A. WORLD
    My global_name to database target is: REP102B. WORLD

    Source table: ORDERS. ORDER_ENTRY
    Target Table: MERCHANT NAVY. ORDER_ENTRY

    Replication will happen as follows:
         
    ORDERS. ORDER_ENTRY (REP102A)-> SHIPPING. ORDER_ENTRY (REP102B)

    Needs to follow the steps below as the one proposed at each site. You may need to make the changes required for your environment.

    SCRIPT:
    =======

    * 1. Remove the configuration of the flow of SOURCE and TARGET sites: *.

    CONNECT / as SYSDBA
    RUN DBMS_STREAMS_ADM. REMOVE_STREAMS_CONFIGURATION;
    DROP USER CASCADE STRMADMIN;

    * 2. Installation STRMADMIN user and streams queued on the Source database: *.

    CONNECT / as sysdba
    Strmadmin CREATE USER IDENTIFIED BY strmadmin;
    GRANT dba, connect, resource, aq_administrator_role to strmadmin;
    ALTER SYSTEM SET aq_tm_processes = 1;
    BEGIN
    DBMS_STREAMS_AUTH. () GRANT_ADMIN_PRIVILEGE
    dealer-online "strmadmin."
    grant_privileges => TRUE);
    END;
    /

    CONNECT strmadmin/strmadmin
    BEGIN
    DBMS_STREAMS_ADM. () SET_UP_QUEUE
    queue_table-online "streams_queue_table."
    queue_name-online "streams_capture_queue."
    queue_user-online "strmadmin");
    END;
    /

    * 3. Installation STRMADMIN user and streams queued to the database target: *.

    CONNECT / as sysdba
    Strmadmin CREATE USER IDENTIFIED BY strmadmin;
    GRANT dba, connect, resource, aq_administrator_role to strmadmin;
    ALTER SYSTEM SET aq_tm_processes = 1;
    BEGIN
    DBMS_STREAMS_AUTH. () GRANT_ADMIN_PRIVILEGE
    dealer-online "strmadmin."
    grant_privileges => TRUE);
    END;
    /

    CONNECT strmadmin/strmadmin
    BEGIN
    DBMS_STREAMS_ADM. () SET_UP_QUEUE
    queue_table-online "streams_queue_table."
    queue_name-online "streams_apply_queue."
    queue_user-online "strmadmin");
    END;
    /

    * 4. Create ORDERS. ORDER_ENTRY Table on the Source database: *.

    CREATE USER controls IDENTIFIED BY;
    GRANT connect, resource TO arrested;
    CONNECT orders/orders

    CREATE THE ORDERS TABLE. ORDER_ENTRY
    (
    order_id number (8) primary key,.
    ORDER_ITEM varchar2 (30),
    ship_no number (8)
    );

    * 5. Create shipping. Target ORDER_ENTRY Table on the database: *.

    CREATE USER IDENTIFIED BY expedition expedition;
    GRANT connect, navigation resources;
    CONNECT shipping/delivery

    CREATE TABLE EXPEDITION TO FRANCE. ORDER_ENTRY
    (
    order_id number (8) primary key,.
    ORDER_ITEM varchar2 (30),
    ship_no number (8)
    );

    * 6. On the target, add the rules to apply and create a dblink from destination to source: *.

    CONNECT strmadmin/strmadmin
    SET SERVEROUTPUT ON
    DECLARE
    v_dml_rule VARCHAR2 (80);
    v_ddl_rule VARCHAR2 (80);
    BEGIN
    DBMS_STREAMS_ADM. () ADD_TABLE_RULES
    table-name => ' EXPEDITION. ORDER_ENTRY',.
    streams_type-online "apply."
    streams_name-online "streams_apply."
    queue_name-online "strmadmin.streams_apply_queue."
    include_dml to-online true.
    include_ddl-online fake,
    include_tagged_lcr-online fake,
    source_database => ' REP102A. WORLD ',.
    dml_rule_name-online v_dml_rule,
    ddl_rule_name-online v_ddl_rule,
    inclusion_rule-online true);
    DBMS_OUTPUT. Put_line (' apply rule DML for SHIPPING.) ORDER_ENTRY => ' | v_dml_rule);
    END;
    /

    CREATE DATABASE LINK rep102a.world CONNECT TO strmadmin IDENTIFIED BY strmadmin USING 'rep102a ';
    -check the link works with:
    SELECT * from [email protected];

    BEGIN
    DBMS_APPLY_ADM. () ALTER_APPLY
    apply_name-online "streams_apply."
    apply_user-online "strmadmin");
    END;
    /

    * 7. The source adds the rules of capture, transformation, create a database link for target, add spread rules, then prepare the tables for instantiation: *.

    CONNECT strmadmin/strmadmin
    SET SERVEROUTPUT ON
    DECLARE
    v_dml_rule VARCHAR2 (80);
    v_ddl_rule VARCHAR2 (80);
    BEGIN
    DBMS_STREAMS_ADM. () ADD_TABLE_RULES
    table-name => ' ORDERS. ORDER_ENTRY',.
    streams_type-online "capture."
    streams_name-online "streams_capture."
    queue_name-online "strmadmin.streams_capture_queue."
    include_dml to-online true.
    include_ddl-online fake,
    include_tagged_lcr-online fake,
    source_database => ' REP102A. WORLD ',.
    dml_rule_name-online v_dml_rule,
    ddl_rule_name-online v_ddl_rule,
    inclusion_rule-online true);
    DBMS_OUTPUT. Put_line ('Capture DML rule for ORDERS.) ORDER_ENTRY => ' | v_dml_rule);
    -Add the schema to rename it to change ORDERS to NAVIGATION for this rule
    DBMS_STREAMS_ADM. () RENAME_SCHEMA
    nom_regle-online v_dml_rule,
    from_schema_name-online "ORDERS."
    to_schema_name-online 'EXPEDITION. "
    operation => "ADD");
    END;
    /

    CREATE DATABASE LINK rep102b.world CONNECT TO strmadmin IDENTIFIED BY strmadmin USING 'rep102b ';
    -check the link works with:
    SELECT * from [email protected];

    -post-harvest enqueues the LCR will have schema as EXPEDITION via renamed of schema processing
    -then add the rule of propagation for SHIPPING. ORDER_ENTRY

    SET SERVEROUTPUT ON
    DECLARE
    v_dml_rule VARCHAR2 (80);
    v_ddl_rule VARCHAR2 (80);
    BEGIN
    DBMS_STREAMS_ADM. () ADD_TABLE_PROPAGATION_RULES
    table-name => ' EXPEDITION. ORDER_ENTRY',.
    streams_name-online "streams_prop."
    source_queue_name-online "strmadmin.streams_capture_queue."
    destination_queue_name-online "[email protected]."
    include_dml to-online true.
    include_ddl-online fake,
    include_tagged_lcr-online fake,
    source_database => ' REP102A. WORLD ',.
    dml_rule_name-online v_dml_rule,
    ddl_rule_name-online v_ddl_rule,
    inclusion_rule to-online true.
    queue_to_queue-online fake);
    DBMS_OUTPUT. Put_line ("rule DML of Propagation for SHIPPING. ORDER_ENTRY => ' | v_dml_rule);
    END;
    /

    BEGIN
    DBMS_CAPTURE_ADM. () PREPARE_TABLE_INSTANTIATION
    table-name => ' ORDERS. ORDER_ENTRY',.
    SUPPLEMENTAL_LOGGING-online 'key');
    END;
    /

    * 8. Set the instantiation scn for ORDERS. ORDER_ENTRY on the site target and start apply: *.

    -Apply on site
    CONNECT strmadmin/strmadmin
    SET SERVEROUTPUT ON
    DECLARE
    iSCN NUMBER;
    BEGIN
    iSCN: = DBMS_FLASHBACK. [email protected] ();
    DBMS_OUTPUT. Put_line (' instantiation SCN is: ' | iSCN);
    DBMS_APPLY_ADM. () SET_TABLE_INSTANTIATION_SCN
    source_object_name => ' ORDERS. ORDER_ENTRY',.
    source_database_name => ' REP102A. WORLD ',.
    instantiation_scn-online iSCN,
    apply_database_link => NULL);
    COMMIT;
    END;
    /

    BEGIN
    DBMS_APPLY_ADM. START_APPLY ('streams_apply');
    END;
    /

    -Check if apply is enabled
    SELECT apply_name, dba_apply State;

    * 9. Start capturing on source: *.

    CONNECT strmadmin/strmadmin
    BEGIN
    DBMS_CAPTURE_ADM. START_CAPTURE ('streams_capture');
    END;
    /

    * 10. Wait capture change its status of 'CAPTURER the CHANGES' and check that the status of propagation is ENABLED: *.

    CONNECT strmadmin/strmadmin
    SELECT capture_name, State FROM v$ streams_capture;
    SELECT propagation_name, dba_propagation State;

    * 11. Perform inserts in ORDERS. Table ORDER_ENTRY on the source site: *.

    CONNECT orders/orders
    INSERT INTO orders.order_entry VALUES (23450, 'Johnny Walker', 98456);
    INSERT INTO orders.order_entry VALUES (23451, "Chivas Regal", 98457);
    COMMIT;

    * 12. On the site apply, check the DELIVERY. ORDER_ENTRY and check if the data is replicated: *.

    CONNECT shipping/delivery
    SELECT * FROM shipping.order_entry;

    * 13. Check the application errors in the queue to apply: *.

    CONNECT strmadmin/strmadmin
    SELECT apply_name, local_transaction_id, error_number, error_message FROM dba_apply_error;

    Thank you
    Florent

  • External table with mixed columns

    Hello everyone. We use Oracle 11R1. We have an external table pointing to a CSV with 7 columns inside. The file has always column 7 but the column order differs from time to time. Each column has a header that remains consistent. Is there a way to map the column names to the column header, s so that we did not change the definition of the external table every time a new file is available in?

    Thank you.

    Hello

    As John said, you must assign names of columns when the table is created.  I guess you could have a dynamic SQL solution that reads the header you mentioned, uses this information to write a CREATE table, drop the table, and then recreated with the new order of the columns.

    You may have a view that maps the 7 columns in your table of 7 columns in the view.  Which column gets the mapping to that may depend on the header.

  • ALTER TABLE with the column NULL time consuming

    Hello

    I have a table with nearly 2 million documents (about 10 GB size table) when I perform the following change statement its run fast

    ALTER TABLE tbl_1 ADD (DEFAULT col_4 NUMBER 100 NOT NULL);

    but when I do not give the NOT NULL in the alter its taking a long time to complete this i.e tbl_1 of ALTER TABLE ADD (NUMBER col_4 by DEFAULT 100); once I do the column as NOT NULL.

    Can someone explain why is it happening like that regarding the execution point.

    Thanks in advance.

    I can reproduce the effect in 11.2.0.1 - but not in 12.1.0.1.

    drop table tbl_1;

    create table tbl_1

    as

    Select rownum id

    , lpad ('* ', 50,' *') padding

    of the double

    connect by level<=>

    ALTER TABLE tbl_1 ADD (NUMBER col_4 by DEFAULT 100);

    --> slow in 11.2.0.1; fast 12.1.0.1

    ALTER TABLE tbl_1 ADD (DEFAULT col_4 NUMBER 100 NOT NULL);

    --> Quick 11.2.0.1 and 12.1.0.1

    A SQL trace for two operations (11g) shows that the altar slow (without the constraint explicit non-null) made explicit (and tedious) update of any row in the table:

    Update 'TBL_1"set"COL_4"= 100

    call the query of disc elapsed to cpu count current lines

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

    Parse        1      0.00       0.02          0          1          0           0

    Run 1 11,63 33.56 8336 1016125 2053531 1000000

    Fetch        0      0.00       0.00          0          0          0           0

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

    Total 2 11,63 33,58 8336 1016126 2053531 1000000

    The other trace file does not contain the explicit Update. I guess in the optimized case that oracle stores somewhere that col_4 has the value 100 and updates only the line of the block after completing DML operations. But that's just a guess.

  • Is there a way to get a list of tables with multi-column primary keys?

    I have a model over 1000 tables, each containing primary and some keys with unique indexes.  I need a list of multi-column primary keys and a list of the unique indexes that are not the primary key.  Is there a way this information easily?

    I have a generator that creates the merge instructions and I needed a way to retrieve the PK, if any, UK and otherwise the first Unique Index.  This comes from a cursor, so there are some variables for the schema and the name of the table and a constant for pk 'P' and 'U '.

    -- Primary/Unique Key
    SELECT   *
    FROM     dba_cons_columns concol, dba_constraints con
    WHERE    concol.owner = UPPER ( pv_schema )
    AND      concol.table_name = UPPER ( pv_table_name )
    AND      ( con.constraint_type = const.v_constraint_primary
    OR        ( con.constraint_type = const.v_constraint_unique
    AND        NOT EXISTS
                 (SELECT NULL
                  FROM   dba_constraints conx
                  WHERE  conx.constraint_type = const.v_constraint_primary
                  AND    conx.owner = con.owner
                  AND    conx.table_name = con.table_name
                  AND    conx.constraint_name = con.constraint_name) ) )
    AND      concol.owner = con.owner
    AND      concol.table_name = con.table_name
    AND      concol.constraint_name = con.constraint_name;
    
    -- Unique Index
    SELECT *
    FROM   dba_ind_columns indcol,
           (SELECT   indcol.table_owner,
                     indcol.table_name,
                     indcol.index_owner,
                     MIN ( indcol.index_name ) min_index_name
            FROM     dba_ind_columns indcol, dba_indexes ind
            WHERE    ind.index_type = 'NORMAL'
            AND      ind.uniqueness = 'UNIQUE'
            AND      indcol.table_owner = UPPER ( pv_schema )
            AND      indcol.table_name = UPPER ( pv_table_name )
            AND      indcol.table_owner = ind.table_owner
            AND      indcol.table_name = ind.table_name
            AND      indcol.index_owner = ind.owner
            AND      indcol.index_owner = indcol.table_owner
            AND      indcol.index_name = ind.index_name
            GROUP BY indcol.table_owner,
                     indcol.table_name,
                     indcol.index_owner) ind
    WHERE  indcol.table_owner = ind.table_owner
    AND    indcol.table_name = ind.table_name
    AND    indcol.index_owner = ind.index_owner
    AND    indcol.index_name = ind.min_index_name;
    

Maybe you are looking for