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

Hello,
I am needing to update a column whose column name contains an ampersand, and cannot figure out a way to do this. Option is not there to have the column name changed.
Ex:
UPDATE aircrafts
SET d&f = 1
WHERE aircraft_code = '737';
this returns an error of missing an = sign
I tried:
SET 'd'||'&'||'f' = 1
doesnt work
Any help is greatly appreciated.
Thanks,
Laura

SET DEFINE OFF
will stop interpreting the & sign as starting of a lexical parameter on the client.
Not sure if you have that issue there.
& might also be a not allowed character in normal column names (didn't test).
In that case you might need to put the column name in ".
+example+
{code}
UPDATE aircrafts
SET "d&f" = 1
WHERE aircraft_code = '737';
{code}
Be aware that in this case the column name must be spelled exactly like it was when the table was created.
Included upper/lower case.
{code}
UPDATE aircrafts
SET "D&F" = 1
WHERE aircraft_code = '737';
{code}

Similar Messages

  • How to view all tables and column names from a remote database

    Hey Guys,
    I have a database in a remote server. I have the db link and the schema name.. Now i want to view all the tables in the remote database with column names.. I dont have access to that database using sql developer.. But i can view some tables using the db link..Is there any way i can view all the tables with the column names?

    user10683742 wrote:
    Dont think i have DBA access..It gives the following error
    ORA-00942: table or view does not exist
    00942. 00000 - "table or view does not exist"You don't have to have 'dba' access, per se. You just have to have SELECT ALL TABLES privilege. when you use a db_link, you are connecting to the remote db with the user defined in the link, and .. on that db .. you will have the privileges of the user defined in the db link. Exactly as if you had used sqlplus to connect to that db with that user.

  • How to know a table's column name and its types

    if there has one table called "myEmp" stored in my database, it uses to hold employees' information. when a newcomer is hired, the HR will use a register page to register his/her information. for the flexible purpose, i couldn't know how many columns in this table, since it may be added two columns or deleted one column in one day, all i should do is show all fields in the register page and get all data to insert into this table.
    so, how can i know one table's structure in java? i know there has a method in DatabaseMetadata class: getTables(catalog, schema, tablename, tabletype), it's return is resultset . i wrote a code below:
    DatabaseMetaData md = conn.getMetaData();
    ResultSet md.getTables(null, null, tablename, types);
    i set catalog and schema both are null since i don't know what else can i set?
    the ResultSet doesn't contain the information i want.
    is there anyone can tell me where i am wrong and the right method? thanx a lot!
    sincerely
    Jasmine

    use ResultSetMetaData to get Column names

  • How to update a table with strin that contains &

    Hi,
    I would like to update ename col of emp table with a string that contains &
    update emp set ename = 'tom&jerry' where empno = 7369But this gives an error.Please advice.
    Regards,

    Consult the sql*plus reference manual on how to disable the &
    Software engineers should be capable of doing research themselves, please stop abusing this forum to increase your salary by being spoon fed for free.
    Sybrand Bakker
    Senior Oracle DBA

  • How to update zero to a column value when record does not exist in table but should display the column value when it exists in table?

    Hello Everyone,
    How to update zero to a column value when record does not exist in table  but should display the column value when it exists in table
    Regards
    Regards Gautam S

    As per my understanding...
    You Would like to see this 
    Code:
    SELECT COALESCE(Salary,0) from Employee;
    Regards
    Shivaprasad S
    Please mark as answer if helpful
    Shiv

  • How to update Spry-table and present the updated table in a div element?

    Hello!
    I am using a very interesting AJAX-framework called Spry when designing a web page. Here the web page is: Link.
    I need some help.
    Every time a new project or shift is added, the changes are written to an xml-file. When the page is reloaded, Spry reads data from xml-files.
    This is caused by this code:
    dsProjects = new Spry.Data.XMLDataSet("timetable/projects.xml", "projects/project");
    dsShifts = new Spry.Data.XMLDataSet("timetable/{dsProjects::url}", "project/shift"); //look inside projects.xml and //extrac xml-file. url
    dsName = new Spry.Data.XMLDataSet("timetable/{dsProjects::url}", "project");
    I call this function that I have written: loadProjectsIntoDivElement ().
    This function does the following: [See attached code.]
    It iterates through the Spry-datastructure and puts the data in a table inside of the div-element called 'projectsList'.
    Now, when I add a new project, I want it to be inserted into the Spry-datastructure and then cause the new data to be written into the div element called 'Specials_DIV'.
    I have found out how to update a Spry-datastructure (e.g. dsProjects above), but I don't know how to update the table containing the data without refreshing the page. This should be done using Spry.
    Some code:
    1:
    2:
    3:
    function loadProjectsIntoDivElement () {
    $('#projectsList').html('');
    $('#projectsList').append('<table id="Specials_Table"><tr><th spry:sort="id">ID</th><th spry:sort="NAME">Name </th><th spry:sort="hoursestimated">Nr. of hours estimated</th><th spry:sort="hoursworked">Nr. of hours worked</th><th spry:sort="costperhour">Cost per hour.</th></tr>{function::init_hours}<tr spry:repeat="dsProjects" onclick="chooseProject({ds_RowID})"><td>{id}</td><td>{NAME}</td><td>{hoursestimated}</td><td>{hoursworked}</td><td>{costperhour}</td></tr></table><br/>{function::get_hours}<br/>');
    I have tried to accomplish this in various ways but I don't succeed.
    I want to do it without refreshing the page.
    Update: I found some code here that I will try: Link
    Thanks in advance!
    Anders Branderud
    My blog

    Hello!
    Thanks!
    I don't succeed with the implementation in any browser.
    I have found a way to it, but I would like a way that updates the data quicker and without reloading all of the page. After all, I am only adding one row on the end of the data structure, so there should be no need to read in all data again.
    Now I do it like this:
    When a project is added, do this:
    1. Store a new row in the project file through a php script.
    2. When the post-call to the php-file returns, do refresh of the whole page.
    Then the newest version of the xml file will be read in.
    However, I don't want to read the data from a xml file each time that a new project is created.
    I know how to add the new data to a Spry-datastructure [in my code 'dsProjects'], but I don't know how to display the updated data without reloading the whole page.
    I have tried some various ways to do it, but haven't succeded.
    Thanks!
    Anders Branderud

  • How to Select data using same column name from 3 remote database

    Hi,
    Can anyone help me on how to get data with same column names from 3 remote database and a single alias.
    Ex.
    SELECT *
    a.name, b.status, SUM(b.qty) qantity, MAX(b.date) date_as_of
    FROM
    *((table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3)a,*
    *(table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3)b)*
    WHERE b.dept = 'finance'
    AND a.position = 'admin'
    AND a.latest = 'Y' AND (b.status <> 'TRM') AND b.qty > 0;
    GROUP BY a.name, b.status ;
    NOTE: the bold statements is just an example of what I want to do but I always gets an error beacause of ambiguous columns.
    Thanks in advnce. :)
    Edited by: user12994685 on Jan 4, 2011 9:42 PM

    user12994685 wrote:
    Can anyone help me on how to get data with same column names from 3 remote database and a single alias.Invalid. This does not make sense and breaks all scope resolution rules. And whether this is in a single database, or uses tables across databases, is irrelevant.
    Each object must be uniquely identified. So you cannot do this:
    select * from (table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3) a3 objects cannot share the same alias. Example:
    SQL> select * from (dual, dual) d;
    select * from (dual, dual) d
    ERROR at line 1:
    ORA-00907: missing right parenthesisYou need to combine the objects - using a join or union or similar. So it will need to be done as follows:
    SQL> select * from (select * from dual d1, dual d2) d;
    select * from (select * from dual d1, dual d2) d
    ERROR at line 1:
    ORA-00918: column ambiguously definedHowever, we need to have unique column names in a SQL projection - so the join of the tables need to project a unique set of columns. Thus:
    SQL> select * from (select d1.dummy as dummy1, d2.dummy as dummy2 from dual d1, dual d2) d;
    DUM DUM
    X   X
    SQL> I suggest that you look closely at what scope is and how it applies in the SQL language - and ignore whether the objects referenced are local or remote as it has no impact to fundamentals of scope resolution.

  • How to update a table containing BLOB?

    Hi,
    I'm trying to update two columns in a table.
    one is NUMBER and the other is BLOB
    Is there a way to do so in OCCI in a single operation ?
    the table looks like this:
    CREATE TABLE ACCUMULATORS
    (TARGET_SUBS NUMBER(9),
    ITERATOR NUMBER(9),
    NUMERATOR NUMBER(9),
    LARGE_DATA BLOB,
    PRIMARY KEY(TARGET_SUBS,ITERATOR));
    and the query is something like:
    UPDATE ACCUMULATORS SET NUMERATOR = :x1 , LARGE_DATA = :x2 WHERE (TARGET_SUBS = :x3) AND (ITERATOR = :x4);
    Thanks,
    Menachem

    I had an interview question that is:
    How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) from another server ex: Transaction server?
    Set up steps so that inset, update or delete operation gets done correctly across servers.
    I was not sure about the answer, it would be great if someone please put some light on this and explain in details about this process in MS SQL Server 2008 R2.
    Also it would be very helpful if you please describe would it be different for SQL Server 2012? If so, then what are the steps?

  • How to update the table available in BADI method

    Hi Friends,
    I have to implement one badi ME_REQ_POSTED for purchase requistion, in this badi  I have to read first line item and do
    some check...if that check is true i need to update subsequent line item (line 20, 30, 40 or so) with purchase group and MRP controller.
    In this BADI i have method POSTED, in this method parameter IM_EBAN is a table which i need to modify with my different
    values for purchase group and MRP controller.
    Kindly let me know how to update this table, so the changes can be reflected in purchase requistion.
    Since when I tried to directly modify the table in a loop, system throw one error stating IM_EBAN can not be modified.
    kindly help.
    pradeep

    hi
    I have implemented this exit but it does not stop at it while saving Purchase requistion. But my previous BADI stops at it when saving.
    Kindly guide.

  • How to update the table value in the valuechange event?

    I have an input field in the datatable with the valueChangeListener
    <rich:dataTable id="cart" value="#{cart.cartList}" var="item">
    <h:inputText value="#{item.cost}" id="qty" valueChangeListener="#{items.updateCost}" onchange="submit()">
    <h:outputText value="#{item.errorMsg}"> </h:outputText>
    in the backing bean
         Item item = (Item) model.getRowData();
    // do some update, if the cost too larger, change to max_cost
         item.setCost(max_cost);
         item.setErrorMsg("Error Msg");
    After calling the valuechange method, the screen output doesn't update the cost.
    How to update the table value in the valuechange event?

    As you're misusing the valueChangeListener to set another input field, you need to skip the update model values phase. Otherwise the value set in the valueChangeListener will be overridden by the submitted value. You can do this by calling the FacesContext#renderResponse() inside the valueChangeListener method. This will shift the current phase immediately to the render response phase, hereby skipping the update model values and invoke application phases.

  • How to update a table (CUSTOMER) on a Report Server with the data from the same table (CUSTOMER) from another server Transaction server?

    I had an interview question that is:
    How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) From another server ex: Transaction server?
    Set up steps so inset, update or delete operation takes place across the servers.
    It would be great if someone please enlighten me in details about this process in MS SQL Server 2008 R2.
    Also please describe would it be different for SQL Server 2012?
    If so, then what are the steps?

    I had an interview question that is:
    How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) from another server ex: Transaction server?
    Set up steps so that inset, update or delete operation gets done correctly across servers.
    I was not sure about the answer, it would be great if someone please put some light on this and explain in details about this process in MS SQL Server 2008 R2.
    Also it would be very helpful if you please describe would it be different for SQL Server 2012? If so, then what are the steps?

  • How to update database table !!!

    hi all,
    Please advice how to update database table with certain cndition needs to be checked.
    Please consider below scenario.
    have used enqueu and dequeue function to lock entries  and also i have used BAPI so considering that return parameter . i want to update table
    /tdk/st0027.
    1. I want to update database table
    2. there are certain condition needs to be checked like ,
       loop at it_final into wa_final.
    th_return-type = 'S'.
               if th_final-vbeln = /tdk/st0027-vbeln and
                  th_final-posnr = /tdk/st0027-posnr and
                  th_final-etenr = /tdk/st0027-sdslno.
    above condition which i need to check .and need to append below system fields need to be appended in table.
              th_final-prstsind = '20'.
              th_final-chgdate  = g_date.
              th_final-chgtime  = g_uzeit.
              th_final-chgprog  = g_cprog.
              th_final-chguser  = g_uname.
              append th_final to td_final.
              update /tdk/st0027 FROM th_final.
              endif.
    endloop.
    but i am getting error saying that  "The type od database table and work area (TH_FINAL)  are not unicode convertible"?
    I am not able to understandwhat would be the solution for this ?
    Thanks and regards,
    Prasad K. NAralkar

    The error occurs in the UPDATE statement included in the code. In this statement it is seen that there is a mismatch of structure defined for the DDIC table /tdk/st0027 and that of your work area th_final.
    try to create a structure w.r.t the DDIC table.
    Eg: DATA: wa_temp TYPE /tdk/st0027.
    MOVE-CORRESPONDING th_final TO wa_temp.
    Then try to UPDATE using the temporary work area i.e wa_temp which has structure similar to that of the database table.

  • How to update two tables with trigger

    Hi:
    how to update two tables with trigger ?
    I have two tables :
    (1)ASIA
    MI number;
    (2)ASIA_P
    ID number;
    When I insert a new value into the asia.MI ,I also can
    insert the same value into the asia_p.id field.
    I have write a trigger as follows but it does't work.
    create or replace trigger MI_TRG
    before insert on asia
    for each row
    declare
    seq number;
    begin
    select MI_SEQ.Nextval into seq from dual;
    :new.MI:=seq;
    insert into ASIA_PRO(MI_ID)
    values
    (seq);
    end MI_TRG;
    How to realize it ?
    thanks
    zzm

    Why do you say it does not work?

  • Migrating from Sql Server tables with column name starting with integer

    hi,
    i'm trying to migrate a database from sqlserver but there are a lot of tables with column names starting with integer ex: *8420_SubsStatusPolicy*
    i want to make an offline migration so when i create the scripts these column are created with the same name.
    can we create rules, so when a column like this is going to be migrated, to append a character in front of it?
    when i use Copy to Oracle option it renames it by default to A8420_SubsStatusPolicy
    Edited by: user8999602 on Apr 20, 2012 1:05 PM

    Hi,
    Oracle doesn't allow object names to start with an integer. I'll check to see what happens during a migration about changing names as I haven't come across this before.
    Regards,
    Mike

  • List tables and column names a stored procedure is querying

    Hello,
    Is there a way to list tables and column names that a stored procedure is querying, i.e, selecting from, using T-SQL?  If yes, is there a way to also show data types for the columns that a stored procedure is querying, i.e, selecting from?
    Thank you,  
    Lenfinkel

    One way to view the dependencies of an object is to use SSMS; navigate to the object, right click and select "view dependencies".  However this does not tell you what columns are being referenced by the Stored Procedure.
    One way to view what is being referenced by a stored procedure is to run something like
    select
    text
    from syscomments
    where
    id in
    (select id
    from sysobjects
    where
    name
    =[Your Object Name]
    And xtype
    in
    ('p','P')
    Please click "Mark As Answer" if my post helped. Tony C.

Maybe you are looking for