How to update a table whose name column contains an ampersand?

Hello

I need to update a column whose column name contains an ampersand and cannot find a way to do it. Option is not there to have the name of the column changed.

Ex:

Aircraft UPDATE
SET d & f = 1
WHERE aircraft_code = '737';

This property returns an error of missing an = sign

I tried:
TOGETHER would be ' |' &' | 'f' = 1

does not work


Any help is greatly appreciated.

Thank you
Laura

SET DEFINE OFF
stop to interpret the & sign as from a lexical setting on the client.

Not sure if you have this problem here.
& could also has power not characters in the normal column names (didn't test).

In this case, you will need to put the name of column ".»

+ example +.
{code}
Aircraft UPDATE
The VALUE "d & f" = 1
WHERE aircraft_code = '737';
{code}

Be aware that in this case the column name must be spelled exactly as if it was when the table was created.
Included case.

{code}
Aircraft UPDATE
THE "D & F" VALUE = 1
WHERE aircraft_code = '737';
{code}

Tags: Database

Similar Questions

  • How to perform a select operation on a table whose name is contained in a variable

    I use Oracle SQL * more customer.

    declare
    tablename_var varchar (10); LOOK HERE
    date of date_var;
    Start
    Select sysdate
    in date_var
    of & tablename_var; LOOK HERE
    dbms_output.put_line (' the date system is ' | var_date);
    end;

    The code above prompts the user to enter a value for the tablename_var variable, once the user enters 'double' prompt... The date system is administered by output.

    declare
    tablename_var varchar (10): = 'double'; LOOK HERE
    date of date_var;
    Start
    Select sysdate
    in date_var
    of tablename_var; LOOK HERE
    dbms_output.put_line (' the date system is ' | var_date);
    end;

    This code fails and an error. I understand. Engine the interpreter as... trying to perform a select operation on a variable and told of a table or view is expected.
    Can someone please tell me what to do, to do a select on a table whose name is contained in a variable, as above?

    Hello

    Welcome to the forum!

    You need to dynamic SQL Instructions if the table or column names are variable.

    Get the current date is not a good example; you could get that without a query simply by saying:

    date_var := SYSDATE;
    

    In addition, SELECT... IN will raise an error if the query will return exactly 1 row.
    In the example below, let's get the last entry_date of a given table:
    For example:

    declare
         tablename_var     varchar(10);
         date_var      date;
         sql_txt           VARCHAR2 (1000);
    begin
         tablename_var := 'table_x;
    
         sql_txt := 'select  MAX (entrydate)'
              || '  from  ' || tablename_var;
         dbms_output.put_line (sql_txt || ' = sql_txt');    -- Not essential, but recommended
         EXECUTE IMMEDIATE  sql_txt  INTO date_var;
    
         dbms_output.put_line ('The latest entry_date is ' || date_var);
    end;
    

    Dynamic SQL is to create a string that contains the SQL statement. Output string is purely optional, of course, but it is a very good idea when writing and code off listening. Don't forget to comment or remove the display before moving the code into Production.

    For a year, make the column name of the variable, instead of the hard-coded entry_date.

    Published by: Frank Kulash, November 5, 2009 09:20

  • How to update the table by using the value of a column in a table field

    Hi all
    use APEX4.1,
    I have a tabular presentation based on the HOLIDAY table, it contains the following fields,
    Leave_id
    Employee_name
    No_of_days
    Status
    Here's the column LOV updateable status.
    Lov includes 2 values IE APPROVE and REJECT

    and I have another Table called LEAVE_HISTORY, it contains the following fields.
    Emp_name
    status
    Here whenever the ststus is updated (click the button SUBMIT) in tabular form should also be updated in the LEAVE_HISTORY of the SITUATION of the table column.

    I tried the following in the process of "WE SUBMIT AFTER CALCULATIONS AND VALIDATIONS,"
    begin
    update LEAVE_HISTORY set status= status where upper(employee_name)=upper(emp_name);
    end;
    but it is not kept up-to-date,
    When we updated through forms we can use something like this,
    update LEAVE_HISTORY set status= :P200_status where upper(employee_name)=upper(:P_200_emp_name);  <----here we are referring page item i.e (:P_200_emp_name)
    as the code above, how to run the columns in a table?
    Thank you.

    Hi Gurujothi,

    Try this,

    begin
    update LEAVE_HISTORY
    set status= :STATUS
    where upper(Emp_name)=upper(:EMPLOYEE_NAME);
    end;
    

    Brgds,
    Max

  • How to update the table with the number management

    Hello

    I need as there is a loc_tab of the created table as below,

    CREATE TABLE loc_tab
    (
    Country_ID NUMBER,
    country_code VARCHAR2 (3),
    country_name VARCHAR2 (50).
    State_ID NUMBER,
    state_code VARCHAR2 (3),
    state_name VARCHAR2 (50).
    city_id NUMBER,
    city_code VARCHAR2 (3),
    city_name VARCHAR2 (50)
    );

    I inserted records like below,
    COUNTRY_ID     COUNTRY_CODE     COUNTRY_NAME     STATE_ID     STATE_CODE     STATE_NAME     CITY_ID     CITY_CODE     CITY_NAME
    
              IND          INDIA                    TN          TAMIL NADU          CHN          CHENNAI
              IND          INDIA                    TN          TAMIL NADU          TRI          TRICHY
              IND          INDIA                    TN          TAMIL NADU          CMT          COIMBATORE
              IND          INDIA                    TN          TAMIL NADU          MDU          MADURAI
              IND          INDIA                    AP          ANDHRA PRADESH          HYD          HYDERABAD
              IND          INDIA                    AP          ANDHRA PRADESH          SEC          SECUNDRABAD
              AUS          AUSTRALIA               QLD          QUEENSLAND          BRI          BRISBANE
              AUS          AUSTRALIA               TAS          TASMANIA          HB          HOBART
              AUS          AUSTRALIA               TAS          TASMANIA          CCE          CITY OF CLEARANCE
              AUS          AUSTRALIA               TAS          TASMANIA          BUR          BURNIE
    Now, I wanted to update the table such that all ID columns are updated with running number.

    Each ID columns should get incremented so that, for Country_ID column corresponding to "India" If country_id is 1, that there must be one for all the lines with the name as "India". Likewise for "Australia".

    In the case of State, she also has the same logic with numbers repeated until the very name of the State comes.

    For the city, it of course will hold separate ID only because the name of the city will not get duplicated.

    This update must be done in the normal way using simple SQL such as no PLSQL don't like looping, etc... is involved.

    Here are the contents of the table, and that's how the table should be updated,
    COUNTRY_ID     COUNTRY_CODE     COUNTRY_NAME     STATE_ID     STATE_CODE     STATE_NAME     CITY_ID     CITY_CODE     CITY_NAME
                                            
    1          IND          INDIA          1          TN          TAMIL NADU     1     CHN          CHENNAI
    1          IND          INDIA          1          TN          TAMIL NADU     2     TRI          TRICHY
    1          IND          INDIA          1          TN          TAMIL NADU     3     CMT          COIMBATORE
    1          IND          INDIA          1          TN          TAMIL NADU     4     MDU          MADURAI
    1          IND          INDIA          2          AP          ANDHRA PRADESH     1     HYD          HYDERABAD
    1          IND          INDIA          2          AP          ANDHRA PRADESH     2     SEC          SECUNDRABAD
    2          AUS          AUSTRALIA     1          QLD          QUEENSLAND     1     BRI          BRISBANE
    2          AUS          AUSTRALIA     2          TAS          TASMANIA     1     HB          HOBART
    2          AUS          AUSTRALIA     2          TAS          TASMANIA     2     CCE          CITY OF CLEARANCE
    2          AUS          AUSTRALIA     2          TAS          TASMANIA     3     BUR          BURNIE
    Thank you and best regards,
    Shiva
  • How to update the table when change list item in the classic report

    Hello
    I worked with apex 4.2 and I create normal classic report with list (named loved) select a column, now I want to update the table when the user changes the list with the new value, I can't create a dynamic action to do this, I create checkbox with the primary key and the loop for check point to update the table but I can not get the value of the list item. and for more speed, the user want to do it when changing the value from the list.

    My question
    1. how to do it in javascript and get the value of the list item and update the table with the new value
    2. do I have to use the API to create the list item so I can get the value of the report item or what.





    Thank you

    Ahmed

    You can find a lot of information in this forum (and outside in google) when you search for AJAX processes and demand. However, the tutorial in the link below should be useful:
    http://www.Oracle.com/WebFolder/technetwork/tutorials/OBE/DB/hol08/apexweb20/ajax_otn.htm

    BTW, if we answer your question, don't forget to mark the appropriate post as correct. It will help all of us in the forum.

  • How to remove a file whose name name is too long.

    Hi, a simple q for someone.

    I deleted a bunch of files and a rest.

    How can I delete a file whose name is too long?

    I can't delete it, even with some administrator privs.

    I tried to do in a powershell window, but does not use the correct flags.

    Repeat the same message.

    Too long to go to the bin file name.  Shorten the name and try again.

    Any advice.

    Thanks in advance.

    Try using 7z (7-Zip) to rename or delete the file.

  • Update a table with one column of another

    Oracle 11g
    Hello

    i'im trying to update the two columns of table SUPPORT (SUPPORT_X, SUPPORT_Y) with two columns of table POST_HTA_BT (POSTHTABT_GPS_X, POSTHTABT_GPS_Y)

    Understand that the two tables have the colum below:

    SUPPORT (SUPPORT_ID, SUPPORT_PLAQUE, POSTHTABT_ID, SUPPORT_X, SUPPORT_Y,...)

    POST_HTA_BT (POSTHTABT_ID, POSTHTABT_GPS_X, POSTHTABT_GPS_Y,...)

    The SUPPORT_PLAQUE has type varachar. Except the keys, the other columns are varchar type in both tables.

    The point here is to update the support_x, support_y with posthtabt_gps_x and posthtabt_gps_y.But before the update we have Sheik if the fifth number of the support plate is a number of characters from "0" to "9"and the rest of the caracter of the support_plaque is '00000'

    Please note that the support_plaque is stored in the table with the form: "0025800000!"

    So I did the below script, I try to execute in sql develop.

    SET SERVEROUTPUT ON

    DECLARE
    chiffre_liste varchar (200): = '0 ', '1', '2', '3', '4', ' 5 ', ' 6' ', 7', ' 8 ', ' 9';
    CURSOR CUR_GPS_SUPPORT IS
    Select MEDIA. SUPPORT_X, SUPPORT. SUPPORT_Y, POSTE_HTA_BT. POSTHTABT_ID, SUPPORT. EXPL_ID,
    SUPPORTED. SUPPORT_PLAQUE, POSTHTABT_GPS_X, POSTHTABT_GPS_Y
    support,.
    POSTE_HTA_BT
    where
    SUPPORTED. SUPPORT_X IS NULL and
    SUPPORTED. SUPPORT_Y IS NULL and
    SUPPORTED. POSTHTABT_ID = POSTE_HTA_BT. POSTHTABT_ID and
    SUPPORTED. EXPL_ID = POSTE_HTA_BT. EXPL_ID
    Order of SUPPORT. POSTHTABT_ID;

    w_POSTHTABT_ID POSTE_HTA_BT. Type of POSTHTABT_ID %;
    w_SUPPORT_X SUPPORT. TYPE % SUPPORT_X;
    w_SUPPORT_Y SUPPORT. TYPE % SUPPORT_Y;
    w_EXPL_ID SUPPORT. TYPE % EXPL_ID;
    w_SUPPORT_PLAQUE SUPPORT. TYPE % SUPPORT_PLAQUE;
    w_POSTHTABT_GPS_X POSTE_HTA_BT. TYPE % POSTHTABT_GPS_X;
    w_POSTHTABT_GPS_Y POSTE_HTA_BT. TYPE % POSTHTABT_GPS_Y;

    BEGIN
    DBMS_OUTPUT. Put_line ('loading the coordoonnees GPS - GPS Coord update takes care of starting ');

    FOR HEART LOOPING CUR_GPS_SUPPORT

    w_POSTHTABT_ID: = cur. POSTHTABT_ID;
    w_SUPPORT_PLAQUE: = cur. SUPPORT_PLAQUE;
    w_SUPPORT_X: = cur. SUPPORT_X;
    w_SUPPORT_Y: = cur. SUPPORT_Y;
    w_POSTHTABT_GPS_X: = cur. POSTHTABT_GPS_X;
    w_POSTHTABT_GPS_Y: = cur. POSTHTABT_GPS_X;

    If substr (cur.support_plaque, 5, 1 chiffre_liste) and substr (cur.support_plaque, 6, 5) = '00000'
    w_SUPPORT_X: = CUR. POSTHTABT_GPS_X
    w_SUPPORT_Y: = CUR. POSTHTABT_GPS_Y
    END if;
    EXCEPTION WHEN NO_DATA_FOUND THEN w_SUPPORT_X: = NULL and w_SUPPORT_Y: = NULL;
    END;

    -Updated the table of the supports
    Update SUPPORT
    Set SUPPORT_X = w_SUPPORT_X,
    SUPPORT_Y = w_SUPPORT_Y
    where SUPPORT_PLAQUE = w_SUPPORT_PLAQUE;
    -On valid imm? immediately
    commit;
    EXCEPTION when no_data_found then null;
    -No details found
    END;

    END;
    /

    and I got the following errors:

    Error report:
    ORA-06550: line 2, colum 34:
    PLS-00103: symbol ',' met instead of one of the following symbols:

    * & = - + ; <>/ is mod remains not rem
    <>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
    like4 likec between | submultiset of type multiset Member
    ORA-06550: line 2, column 52:
    PLS-00103: symbol ';' met instead of one of the following symbols:

    ), * & = - + <>/ is mod remains not rem = >
    <>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
    like4 likec between | Member of multiset must
    ORA-06550: line 38, colum 48:
    PLS-00103: symbol 'CHIFFRE_LISTE' met instead of one of the following symbols:

    (
    Symbol "(" a été substitué à "CHIFFRE_LISTE" verser continuer.) "
    ORA-06550: line 39, 12 colum:
    PLS-00103: symbol 'W_SUPPORT_X' met instead of one of the following symbols:

    ), * & -+ / at rem mod < Hurst (*) > rest and or.
    multiset
    ORA-06550: line 40, 12 colum:
    PLS-00103: symbol 'W_SUPPORT_Y' met instead of one of the following symbols:

    . (), * @ % & = - + <>/ is mod remains not rem
    <>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
    like4 likec between | mult
    ORA-06550: line 41, colum 9:
    PLS-00103: symbol 'END' met instead of one of the following symbols:

    . (), * @ % & = - + <>/ is mod remains not rem
    <>< Hurst (*) > or! = or ~ = > = < = <>and like2 or
    like4 likec between | multiset members
    06550 00000 - "line %s, column % s:\n%s".
    * Cause: Usually a PL/SQL compilation error.
    * Action:

    I checked the line number, but do not see the error in my code.

    Please could you help me?

    peace

    Hello

    glad to know that it worked. In fact, I don't see the reason to make these complicated processes.

    Remember the mantra:

    • If you can do it with SQL then do it with SQL

    Good evening!

    Alberto

  • 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

  • How to update a table and insert into another

    I need to update a table and also to insert into another table and want to do it in the same form. I can it will break in 2 different forms, but it is awkward for the user. Is there a way common to this address? As a backdrop, the user is updated the status of a message (IE, changing it from open to closed) and then provide an answer. The response table is separate from the table of messages because its format is doing different.

    Thank you and sorry to bombard the forum today.

    .oO (davidbarrackphoto)

    > I need to update a table and also to insert into another table and want to
    > do it in the same form. I can it will break in 2 different forms, but it is
    > awkward for the user. Is there a way common to this address?

    You can do what you want in your form processing script. But for
    much more advanced than you must write your own code.

    > As a backdrop.
    > the user updates the status of a message (IE, changing it from open to closed)
    > and then provide an answer. The response table is separate from the table of messages
    > because its format is doing different.

    Just curious: what is the difference? IMHO, there should be only one table
    for messages. Can you post more details about it?

    Micha

  • Collections of SQL / objects - how to store a table within a column?

    Hi guys,.

    I have a current table on production... I'm only allow you to add a column to her...

    The simplified scenario is...

    I have a table

    CREATE TABLE PLAN_TRANSACTION
    (THE ARGUMENT PLAN_ID VARCHAR2 (20) DEFAULT SYS_GUID();)
    PLAN_NUMBERS_TYPE COLUMN? );

    For the PLAN_NUMBERS column, I want to store all types and numbers associated with the PLAN_ID.


    In general, it would be

    CREATE TABLE TYPES_AND_NUMBERS
    (TYPE VARCHAR2 (20),)
    NUMBER OF NUMBERS);
    ---------------------------------
    Type A, 12345
    Type B, 12345
    Type A, 54211

    etc.

    Now instead of add another additional column PLAN_ID TYPES_AND_NUMBERS table and create a relationship of foreign key with PLAN_TRANSACTION.
    I want to keep the table inside the table PLAN_TRANSACTION column.


    I think doing this


    CREATE TYPE TYPES_AND_NUMBERS AS OBJECT
    (TYPE VARCHAR2 (20),)
    NUMBER NUMBERS);

    CREATE TABLE AS TN_TAB TYPE OF TYPES_AND_NUMBERS;


    CREATE TABLE PLAN_TRANSACTION
    (THE ARGUMENT PLAN_ID VARCHAR2 (20),)
    PLAN_NUMBERS TN_TAB
    )
    THE NESTED TABLE PLAN_NUMBERS
    STORE AS NESTED_PLAN_NUMBERS;


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

    My question is...

    Q1) is my way of creating a correct nested table?... creating an object type, then an array of objects, then storing this table within a column in a nested table...

    Q2) is otherwise easier to create a nested table as I quite new in object_relational--concepts simply, I felt quite concerned create an object to simulate a line. and create an array of object to store objects, and then put it inside a column.

    Q3) possible for me, or is it something like create type TN_TAB as table of (varchar2 TYPE, numbers);


    Thanks a lot guys!

    Best regards
    Noob

    A nested table is the easiest way to resolve this condition.
    Other solutions might involve some large objects (CLOB or XMLTYPES), but without knowing anything commercially, I think a nested table is the best way.

  • How to call a function whose name is stored in the table?

    Dear members,

    I have a function with return number and store its name in a table.

    now, I want to choose the name of this table function and run it and return the value of a variable in my form.

    Here is my code in when pressed to release button.
    DECLARE
         v_value number;
         V_FUNC VARCHAR2(100);
         V_PARAM VARCHAR2(100);
    begin
         select FUNCTION_NAME, PARAM 
         INTO V_FUNC, V_PARAM
         from function_table
         where id =1;
          
         message('V_FUNC='||V_FUNC); pause;
         v_value := v_func||';'; --run_tb_function;
         :text01 := v_value;
    end;
    This code gives the following error:

    ORA-06502


    with regard to:

    Published by: user2040934 on February 2, 2013 09:47

    You can use EXECUTE IMMEDIATE to call pl/sql dynamic. But you need to wrap it in a db procedure.

    BTW... What is the reason of this dynamic approach, as it is very unusual?

  • How to create a table with a column that is the value in another table?

    Hi all,

    It's my first post n I changed my ODI of DATASTAGE platform. Help me friends n I know basic steps in 11 ODI version which I was training in my company. I hope to have your support and can do everything an action ODI related documents.

    My question is...

    Table T1 > > > > > > > > > >

    service id / / / attr.name / / / attr.value

    S1 / / / product_code / / / P1

    S1 / / / provider / / / pro1

    S2 / / / product_code / / / P2

    S3 / / / provider / / / pro3

    Table T2 > > > > > > > > > > > > > > >

    ID / / / product_code / / / provider

    S1 / / / p1 / / / pro1

    S2 / / / p2 / / / nullvalue

    S3 / / / nullvalue / / / pro3


    I have a table T1 since I should show the table T2 is released. Can we say everything on how to write a logic and steps to follow.

    Thanks in advance.

    Published by: 854662 on April 26, 2011 01:59

    Hello

    U go.

    1 the interface:

    "Put a filter in your 1 on attr.name = array ' PRODUCT_CODE.

    In the map target TABLE2
    SERVICE_ID = TABLE1. SERVICE_ID
    PRODUCT_CODE = TABLE1. ATTR_VALUE

    Use SQL IKM append control

    Interface 2:

    "Put a filter in your 1 on attr.name = array ' PROVIDER '.

    In the map target TABLE2
    SERVICE_ID = TABLE1. SERVICE_ID
    PROVIDER = TABLE1. ATTR_VALUE

    Do SERVICE_ID as KEY (when you click the column target in properties, you can see KEY under properties of the target column) and use the incremental update of the IKM Oracle.

    PS: I assume that Oracle as the source and target.

    And you can refer to the documentation,

    https://Apex.Oracle.com/pls/Apex/f?p=44785:24:4413167952886630:no:24:P24_CONTENT_ID, P24_PREV_PAGE:5185, 29

    http://odiexperts.com/

    And of course this OTN.

    Thank you
    Guru

  • How to create the Table using the column Drag and Drop feature

    Hello:
    I'm new to Data Modeler tool Oracle SQL dev and would like to know if there is a way to create a new table by reusing existing columns or groups of columns. The idea is to maintain consistency and save time of table design. If the columns created previously can be reused and require, drag and drop column in the right pane, then only new columns must be created manually.

    Any thoughts on this will be appreciated.

    Thank you!

    Yes - just change the name of the model table in the script (t_name = "table_template") then save this new transformation for later use.

    I don't know how to apply only some of the tables. Seems like something you could do to a secondary view level?

    Perhaps someone else on the forum can advise how to change the script to work on a subview only instead of the whole model.

  • Update of table with no column

    Hello

    Why oracle is that although the statement is incorrect? is there any docid for this?

    SQL > select banner version of v$.

    BANNER
    ----------------------------------------------------------------
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64 bit Production
    PL/SQL Release 9.2.0.8.0 - Production
    CORE Production 9.2.0.8.0
    AMT for Solaris: 9.2.0.8.0 - Production Version
    NLSRTL Version 9.2.0.8.0 - Production


    SQL > desc one
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    AA NUMBER (1)
    BB NUMBER (1)

    SQL > desc b
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    AA NUMBER (1)
    CC NUMBER (1)

    SQL > select * from a;

    AA BB
    ---------- ----------
    1 1
    2 2
    3 3
    4 4
    3 s

    SQL > select b bb;
    Select bb b
    *
    ERROR on line 1:
    ORA-00904: "BB": invalid identifier


    SQL > update a game aa = 3 where bb (select b BB); -> bb of the column does not exist in table b

    5 lines to date.

    SQL > select * from a;

    AA BB
    ---------- ----------
    1 of 3
    1 p
    3 3
    3 4
    6 P

    Thank you
    Shanker

    No specific document. He has correlated subqueries. There is, of course, usually join condition.

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/statements_10002.htm#i2066912

  • How to update one table from another table

    Hello

    I have two tables, t1 or t2, I wrote the below query, but got an error as ORA-00904 ' identifier Inavlid b.purchase_capturedate. The query is:

    Update t1 a
    Set a.docdate = b.purchase_capturedate
    where (a.docid))
    Select docid_request from t2 b where a.docid = b.docid_request and b.itemcategoryid = 6)



    Help, please.


    Kind regards

    Hello

    describe your tables t1 and t2

    Concerning
    Sankar MN

Maybe you are looking for