convert the column to a string name

pls help me.

I need to know how can I convert the column to a string name because I can not insert the column name into my table.


for matrix (SELECT nom_de_colonne
OF all_col_comments@myDBLink
WHERE UPPER (trim (table_name)) = "ROLEMATRIX")
loop
INSERT INTO myTABLE (myColumn)
VALUES (matrix.column_name);
end loop;


my error:
ORA-00984: column not allowed here

which line you are confronted with error, because I've also tested this, his work on my side!

Tags: Database

Similar Questions

  • Convert the column values into buckets

    Hello

    Please help me to convert the column values into buckets.
    I have the values of the columns in the following way.


    Age of Orderdate * 9 10 12 14 15 18 19 20 21 22 26 27 28 29 33 34 40 45 * and so on



    But the requirement is the column values should be displayed in form

    Age by order date * 15 1 2 3 4 5 6 7 8 9 10 11 - 16-20 21-25, 26-30 30 + *.


    Please someone give me the solution.

    Thanks in advance.

    Hervé Rama

    Hi Richard,

    Just to double check, you have Setup buckets for 1, 2, 3, 4, 5, 6, 7 and 8 individually (each with a fair value). The problem is that you simply do not have all data fall into buckets above, correct?

    If this is the case, it looks like has been answered your original question. If so, the label would assign 'Proper' points by clicking on the button label correct next to the appropriate response and open a new thread with your new question. The reason why I say this is it will help other people who have a similar bucket question to your solution, without complicating the issue with subsequent questions.

    If you can post a separate thread, I'd be more than happy to help you with your secondary problem.

    Best regards

    -Joe

  • How to convert the column of ROW using DBMS_REDIFINITION object type column

    Hi all
    Suppose I have the following table to convert:
    create table customer as select customer_id cid, cust_first_name name, cust_address street from customers;
    alter table customer modify cid primary key;
    I created the table based on the customers of the OE schema table, while the street column has cust_address_typ with the following attribute object type
    SQL> describe cust_address_typ
     Name                                     Null?     Type
     ----------------------------------------------------- -------- ------------------------------------
     STREET_ADDRESS                               VARCHAR2(40)
     POSTAL_CODE                                   VARCHAR2(10)
     CITY                                        VARCHAR2(30)
     STATE_PROVINCE                               VARCHAR2(10)
     COUNTRY_ID                                   CHAR(2)
    I want to convert the object attribute adresse_rue in a column of RDM. Consider the following temporary table:
    CREATE TABLE INT_CUSTOMER(
    CID NUMBER,
    NAME VARCHAR2(30),
    street varchar2(100)
    );
    First of all, I checked if the table can be redefined:
    --Verify if the table can be redefined
    BEGIN
    DBMS_REDEFINITION.CAN_REDEF_TABLE('OE','CUSTOMER',DBMS_REDEFINITION.CONS_USE_PK);
    END;
     4  /
    
    PL/SQL procedure successfully completed.
    But when I started the redefinition, I got an error:
    BEGIN
    DBMS_REDEFINITION.START_REDEF_TABLE(
    uname => 'OE',
    orig_table => 'CUSTOMER',
    int_table => 'INT_CUSTOMER',
    col_mapping => 'CID CID, NAME NAME, STREET CUST_ADDRESS_TYP(STREET_ADDRESS)'
    );
    END;
      9  /
    BEGIN
    *
    ERROR at line 1:
    ORA-00923: FROM keyword not found where expected
    ORA-06512: at "SYS.DBMS_REDEFINITION", line 52
    ORA-06512: at "SYS.DBMS_REDEFINITION", line 1646
    ORA-06512: at line 2
    What seemed to be the problem?

    Best regards
    Val

    Published by: Valerie good-natured October 9, 2011 21:43

    Have you tried this one:

    BEGIN
    DBMS_REDEFINITION.START_REDEF_TABLE(
    uname => 'OE',
    orig_table => 'CUSTOMER',
    int_table => 'INT_CUSTOMER',
    col_mapping => 'CID CID, NAME NAME,"CUSTOMER".STREET.STREET_ADDRESS STREET'
    );
    END;
    

    Looking at your trace file, I claim that when you use the call above to START_REDEF_TABLE, the inner workings of this procedure will create this SQL statement:

    select CID CID, NAME NAME,"CUSTOMER".STREET.STREET_ADDRESS STREET from "OE"."CUSTOMER" "CUSTOMER"
    

    (You can prove or disprove my claim by tracing it ;-)))

    And this statement has had an alias - even if the alias is the same as the name of the table...

  • Find the column for a constraint name

    Hi guru,.

    I know the name of the constraint, now I need the column name and the name of the table of the constraint?

    Thank you

    Ask the USER_CONS_COLUMNS then you'll find the column name and table name

    SQL > Select * from USER_CONS_COLUMNS where Constraint_Name = "";

  • How to convert the column lines

    I need to convert my output lines of sql for the column as a pivot to 11g

    Please give me the example of this

    check out this link

    http://nimishgarg.blogspot.com/2010/06/Oracle-pivot-data-rows-to-columns.html

    request for 10g would be

    Select *.
    (select job,
    Sum (decode(DEPTNO,10,SAL)) dept10,
    Sum (decode(DEPTNO,20,SAL)) dept20,
    Sum (decode(DEPTNO,30,SAL)) dept30,
    Sum (decode(DEPTNO,40,SAL)) dept40
    from scott.emp
    Working Group)
    order by 1;

  • the column of numeric string filtering

    I have this problem.
    Consider having a table named table1 with an id of the column named Column1 of varchar2.
    This column contains the giuds and the number (es '12345' and 'ed6tyJh56')
    I want to filter all the lines containing the string of number.
    I did:
    Select * from table1 where LENGTH (TRIM (TRANSLATE (column1, ' + -. 0123456789', ' '))) is null.

    OK so far.

    My problem is that I am not able to filter the table that contains a predicate as column1 > 100

    I tried to write:

    Select / * + no_query_translation * / column1)
    Select / * + no_merge * / column1 from table1 where LENGTH (TRIM (TRANSLATE (column1, ' + -. 0123456789', ' '))) a null value
    ) a
    where a.column1 > 100

    but nothing. I get the message "invalid character '!
    I believe the problem can be solved with a function but who work for a single line, I ' m courious to know if
    There is a trick or something to force the order of filters somting.
    In particular, to force the filter (a.column1 > 100) on display online.

    Anyone know?

    .. or be achieved the first inline view

    SQL> create table table1
      2  (column1 varchar2(100)
      3  );
    
    Table created.
    
    SQL> insert into table1 values ('12345');
    
    1 row created.
    
    SQL> insert into table1 values ('ed6tyJh56');
    
    1 row created.
    
    SQL>
    SQL> select * from table1 where LENGTH(TRIM(TRANSLATE(column1, ' +-.0123456789',' '))) is null
      2  /
    
    COLUMN1
    --------------------------------------------------------------------------------
    12345
    
    SQL>
    SQL> select column1 from (
      2  select rownum, column1 from table1 where LENGTH(TRIM(TRANSLATE(column1, ' +-.0123456789',' ')))
     is null
      3  ) a
      4  where a.column1 > 100
      5
    SQL> /
    
    COLUMN1
    --------------------------------------------------------------------------------
    12345
    
    SQL> 
    

    Published by: Alex Nuijten on September 8, 2009 13:46

  • convert the column values to a single line...

    I have to return the column values to a single line separated by commas.
    If the nulls in the column just ignore without a comma.
    Here is one for example. There are three values and two NULL values in the table
    SQL> select ID from temp_fa;
    ID
    -----
    
             1
             2
    
             3
    
             5
    
    6 rows selected.
    
    
    I am expecting an output as 1,2,3,5
    Help, please

    There is always more than one title in the Oracle world ;)
    You can use the TRIM, for example (same configuration as your example):

    hoek&XE>  create table t as select level col  from dual connect by level <= 6;
    
    Tabel is aangemaakt.
    
    hoek&XE> update t set col = null where col in (1,3,5);
    
    3 rijen zijn bijgewerkt.
    
    hoek&XE> select * from t;
    
           COL
    ----------
    
             2
    
             4
    
             6
    
    6 rijen zijn geselecteerd.
    
    hoek&XE> select ltrim(sys_connect_by_path(col, ','), ',') output
      2  from  ( select col
      3          ,      row_number() over (order by col) rn
      4          from   t
      5        )
      6  where connect_by_isleaf=1
      7  start with rn=1
      8  connect by rn = prior rn+1;
    
    OUTPUT
    -------------------------------------------------------------------------------------------------------------
    2,4,6,,,
    
    1 rij is geselecteerd.
    
    hoek&XE> select trim ( both ',' from sys_connect_by_path(col, ',')) output
      2  from  ( select col
      3          ,      row_number() over (order by col) rn
      4          from   t
      5        )
      6  where connect_by_isleaf=1
      7  start with rn=1
      8  connect by rn = prior rn+1;
    
    OUTPUT
    -------------------------------------------------------------------------------------------------------------
    2,4,6
    
    1 rij is geselecteerd.
    
  • Convert the object to a string

    Hey guys - I'm beating my head against the wall on this workflow I have been working on for a week and I was wondering if anyone can point me in the right direction.  Trying to figure out how to take the entry (VC:VirtualMachine) for an item in the workflow and convert it to a string (hostNameOrIP) to be used for the next item in the same workflow.

    Here's a bit of context:

    The global workflow is the copy of the file to the workflow comments followed by run a workflow of SSH in command.  The copy of the file to the comments using a parameter such as VC:VirtualMachine; However, I like to wear this VM name in the next part of the workflow but the command run SSH wants to format as a string.  It sounds stupidly simple, but I am challenging my brain on it.   Joined logic available to the workflow - I wonder if I need a scriptable between the workflow task two elements / nested that performs the conversion or is it possible to have the first nested workflow, the name as a string of output and then use an output for an entry?Workflow.png

    Yes, you need to set a variable.  It could be an output of your workflow or a script task, as you say somewhere in your workflow.  If your vm is named to match the host name, you can use something like vmName var = vm.name;  If you want to use the real host name or ip address, you must enter the vm.guest.hostName or vm.guest.ipAddress.

  • How to convert the column online

    Hello

    Do is samble of my data, I need to convert columns into rows

    create table uload_table (id1 number, tidset varchar2(200));
    
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,1);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,2);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,3);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,4);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,5);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,7);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,8);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,10);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,2);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,3);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,4);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,5);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,8);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,9);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,10);
    select * FROM UNLOAD_TABLE ;
    ID1      TIDSET
    ----- ----------   
    1     1
    1     2
    1     3
    1     4
    1     5
    1     7
    1     8
    1     10
    2     2
    2     3
    2     4
    2     5
    2     8
    2     9
    2     10
    I need the result to be as below.
    ID1      TIDSET
    ----- ----------   
    1     ;1;2;3;4;5;7;8;10
    2     ;2;3;4;5;8;9;10
    any help please,.

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e26088/functions089.htm#SQLRF30030

    Concerning

    Etbin

  • Convert the column online

    Table "tab1" has given below.

    column_acolumn_bcolumn_ccolumn_d
    1234

    Could you please help to provide the query data is displayed as below?

    column_e
    1
    2
    3
    4

    You can use the unpivot operator control, for example:

    with tab1 as

    (select 1 as column_a, column_b, 3 column_c 2, 4 as double column_d)

    Select column_e

    of tab1

    UNPIVOT

    (column_e FOR name (column_a, column_b, column_c, column_d))

  • convert the column to the SQL line

    Hello world

    I have table with 2 fields.
    like;

    F1 f2
    x x 1
    x x 2
    x x 3
    x x 4

    y y1
    Y2 y
    y y3
    y y4

    I want to get the data in this table as;
    F1 f2 f3 f4 f5
    x x 1 x 2 x 3 x 4
    y y1 y2 y3 y4


    Thank you in advance.

    user1516131 wrote:

    I want to get the data in this table as;

    I guess that x 1, x 2... is just an example and in reality, it can be any value. If Yes, you can use (and, as hoek said, it's a static solution):

    with t as (
               select 'x' f1, 'x1' f2 from dual union all
               select 'x', 'x2' from dual union all
               select 'x', 'x3' from dual union all
               select 'x', 'x4' from dual union all
               select 'y', 'y1' from dual union all
               select 'y', 'y2' from dual union all
               select 'y', 'y3' from dual union all
               select 'y', 'y4' from dual
              )
    select  f1,
            f2,
            f3,
            f4,
            f5
      from  (
             select  f1,
                     f2,
                     lead(f2) over(partition by f1 order by f2) f3,
                     lead(f2,2) over(partition by f1 order by f2) f4,
                     lead(f2,3) over(partition by f1 order by f2) f5,
                     row_number() over(partition by f1 order by f2) rn
               from  t
            )
      where rn = 1
    /
    
    F F2 F3 F4 F5
    - -- -- -- --
    x x1 x2 x3 x4
    y y1 y2 y3 y4
    
    SQL> 
    

    SY.

  • convert the date to a string format

    date in Word format

    example:

    30 may-2013' as thirtieth may twenty thirteen.

    Thank you.

    Select to_char (to_date (30-may-2013 ',' Mon-DD-YYYY'), ' DDspth month year ") as double sample;

  • Create the instance of string name

    How to create an instance of the object to a string name?

    Ah, found it is getDefinitionByName()

  • Filter the table break corresponding to the part of the column

    Hello

    JDeveloper Version 11.1.2.4.0.

    I have a table with a filter. I need to make this filter to do the following:

    select column1 from table where upper(column1) like upper ('%filterValue%')
    

    (If in the column, I have a name of "Christopher" and I look in the filter of "Frank" I want the line with Christopher is put into correspondence.)


    I have replace the getCriteriaItemClause like this:

        public String getCriteriaItemClause(ViewCriteriaItem vci) {
            if (vci != null) {
                AttributeDef attrDef = vci.getAttributeDef();
                String attrName = attrDef.getName();
    
    
                if ("java.lang.String".equals(attrDef.getJavaType().getName()) && vci.getValue() != null) {
                    String colName = vci.getViewCriteria().isCriteriaForQuery() ? vci.getColumnNameForQuery() : attrName;
                    String filterVal = (String)vci.getValue();
    
    
                    String sql = "(UPPER(%s) like UPPER('%s%%'))";
    
    
                    String clause = String.format(sql, colName, filterVal);
                    System.out.println(" The view criteria is overriden to: " + clause);
                    return clause;
                }
            }
            return super.getCriteriaItemClause(vci);
        }
    

    The display criteria replaced: (UPPER (Person.LAST_NAME) as UPPER ("Franck%%'))

    I tried to do the SQL string to be ' (UPPER (%s) as SUPERIOR ('%%%')) ", but it does not work and gives me very strange and unexpected results.").


    Kind regards

    Pamela

    Is not you the problem in how you build the qry sql? Have you tried something like:

            String qwe = "Hello";
           

    String xyz = "upper('%"+qwe+"%');";

    It prints "upper ('%hello%');", which is what you want. Right?

  • How to keep the columns of history in capital letters?

    Hello

    Is there a way to convert the columns that are marked as columns of history (ex: Created_By, Updated_By) uppercase and then store them in the database table? Once these columns are marked as history columns, Set accessor methods are not generated in the EOImpl class, and whenever a record is created or updated, the created_by and updated_by on these recordings are filled automatically by the framework using the name of securityContext so my interpretation is not bad.

    Is it possible to override this to ensure that whenever a transaction takes place, these columns are always inserted/updated on top of case?

    Thank you.

    You will need to return username converted to uppercase if the kind of story is HISTORY_CREATE_USER.

    So it should look like this:

    protected Object getHistoryContextForAttribute(AttributeDefImpl attributeDefImpl){
        if(attributeDefImpl.getHistoryKind()==AttributeDefImpl.HISTORY_CREATE_USER){
            return ADFContext.getCurrent().getSecurityContext().getUserName().toUpperCase();
        }else{
            return super.getHistoryContextForAttribute(attributeDefImpl);
        }
    }
    

    Dario

Maybe you are looking for