MS Access Update Inner Join command conversion

I have code in a Microsoft Access Database View, that I'm trying to convert to Oracle. I tried using Oracle SQL Developer's Migration tool and it basically skipped this command.
Update Table1 INNER JOIN Table2 On Table1.COL1 = Table2.COL2 SET Table1.COL3 = 1;
I've tried a number of things including selecting all the rows with something like
select * from Table1 o inner join Table2 t on o.COL1 = t.COL2
and then trying to somehow hook it to an update command where the command gets the above results and does a Table1.COL3 = 1 on all of those rows.
However I can't get the syntax correct.
Can someone please help?
Thanks,
Jeff
BTW: The code is in a MS Access view but probably belongs in a stored procedure. It also uses a Access-only Boolean instead of 1, which may be part of the reason the command conversion failed.

maybe this?
Update Table1
   set Table1.COL3 = 1
Where Table1.col1 in (select table2.col2 from table2);
or
Update Table1
   set Table1.COL3 = 1
Where exists (select 'x'
                 from table2
                where table2.col2 = table1.col1);note: untested.

Similar Messages

  • Inner join command

    Hi Forum,
    How to use Inner join command?
    Please explain with an example.
    Thanks,
    Mahathi

    Inner Join and Outer Join
    The data that can be selected with a view depends primarily on whether the view implements an inner join or an outer join. With an inner join, you only get the records of the cross-product for which there is an entry in all tables used in the view. With an outer join, records are also selected for which there is no entry in some of the tables used in the view.
    The set of hits determined by an inner join can therefore be a subset of the hits determined with an outer join.
    Database views implement an inner join. The database therefore only provides those records for which there is an entry in all the tables used in the view. Help views and maintenance views, however, implement an outer join.
    Specifying Database Tables
    The FROM clause determines the database tables from which the data specified in the SELECT clause is read. You can specify either a single table or more than one table, linked using inner or outer joins. The names of database tables may be specified statically or dynamically, and you can use alias names. You can also use the FROM clause to bypass the SAP buffer and restrict the number of lines to be read from the database.
    "Database table" can equally mean an ABAP Dictionary view. A view links two or more database tables in the ABAP Dictionary, providing a static join that is available systemwide. You can specify the name of a view wherever the name of a database table may occur in the FROM clause.
    The FROM clause has two parts - one for specifying database tables, and one for other additions:
    SELECT... FROM <tables> <options>...
    In <tables>, you specify the names of database tables and define joins. <options> allows you to specify further additions that control the database access.
    Specifying Database Tables Statically
    To specify the name of a database table statically, use the following:
    SELECT... FROM <dbtab> [AS <alias>] <options> . ..
    The database table <dbtab> must exist in the ABAP Dictionary. The AS addition allows you to specify an alternative name <alias> that you can then use in the SELECT; FROM, WHERE, and GROUP BY clauses. This can eliminate ambiguity when you use more than one database table, especially when you use a single database table more than once in a join. Once you have defined an alias, you may no longer use the real name of the database table
    Specifying Database Tables Dynamically
    To specify the name of a database table dynamically, use the following:
    SELECT... FROM (<name>) <options> . ..
    The field <name> must contain the name of a database table in the ABAP Dictionary. The table name must be written in uppercase. When you specify the name of a database table dynamically, you cannot use an empty INTO clause to read all of the columns into the work area <dbtab>. It is also not possible to use alternative table names.
    Specifying Two or More Database Tables as an Inner Join
    In a relational database, you normally need to read data simultaneously from more than one database table into an application program. You can read from more than one table in a single SELECT statement, such that the data in the tables all has to meet the same conditions, using the following join expression:
    SELECT...
      FROM <tab> [INNER] JOIN <dbtab> [AS <alias>] ON <cond> <options>
    where <dbtab> is a single database table and <tab> is either a table or another join expression. The database tables can be specified statically or dynamically as described above. You may also use aliases. You can enclose each join expression in parentheses. The INNER addition is optional.
    A join expression links each line of <tab> with the lines in <dbtab> that meet the condition <cond>. This means that there is always one or more lines from the right-hand table that is linked to each line from the left-hand table by the join. If <dbtab> does not contain any lines that meet the condition <cond>, the line from <tab> is not included in the selection.
    The syntax of the <cond> condition is like that of the WHERE clause, although individual comparisons can only be linked using AND. Furthermore, each comparison must contain a column from the right-hand table <dbtab>. It does not matter on which side of the comparison it occurs. For the column names in the comparison, you can use the same names that occur in the SELECT clause, to differentiate columns from different database tables that have the same names.
    The comparisons in the condition <cond> can appear in the WHERE clause instead of the ON clause, since both clauses are applied equally to the temporary table containing all of the lines resulting from the join. However, each join must contain at least one comparison in the condition <cond>.
    Specifying Two or More Database Tables as a Left Outer Join
    In an inner join, a line from the left-hand database table or join is only included in the selection if there is one or more lines in the right-hand database table that meet the ON condition <cond>. The left outer join, on the other hand, reads lines from the left-hand database table or join even if there is no corresponding line in the right-hand table.
    SELECT...
      FROM <tab> LEFT [OUTER] JOIN <dbtab> [AS <alias>] ON <cond>
           <options>
    <tab> and <dbtab> are subject to the same rules and conditions as in an inner join. The OUTER addition is optional. The tables are linked in the same way as the inner join with the one exception that all lines selected from <tab> are included in the final selection. If <dbtab> does not contain any lines that meet the condition <cond>, the system includes a single line in the selection whose columns from <dbtab> are filled with null values.
    In the left outer join, more restrictions apply to the condition <cond> than in the inner join. In addition to the above restrictions:
    EQ or = is the only permitted relational operator.
    There must be at least one comparison between columns from <tab> and <dbtab>.
    The WHERE clause may not contain any comparisons with columns from <dbtab>. All comparisons using columns from <dbtab> must appear in the condition <cond>.
    Client Handling
    As already mentioned, you can switch off the automatic client handling in Open SQL statements using a special addition. In the SELECT statement, the addition comes after the options in the FROM clause:
    SELECT... FROM <tables> CLIENT SPECIFIED. ..
    If you use this addition, you can then address the client fields in the individual clauses of the SELECT statement.
    Disabling Data Buffering
    If buffering is allowed for a table in the ABAP Dictionary, the SELECT statement always reads the data from the buffer in the database interface of the current application server. To read data directly from the database table instead of from the buffer, use the following:
    SELECT... FROM <tables> BYPASSING BUFFER. ..
    This addition guarantees that the data you read is the most up to date. However, as a rule, only data that does not change frequently should be buffered, and using the buffer where appropriate improves performance. You should therefore only use this option where really necessary.
    Restricting the Number of Lines
    To restrict the absolute number of lines included in the selection, use the following:
    SELECT... FROM <tables> UP TO <n> ROWS. ..
    If <n> is a positive integer, the system reads a maximum of <n> lines. If <n> is zero, the system reads all lines that meet the selection criteria. If you use the ORDER BY clause as well, the system reads all lines belonging to the selection, sorts them, and then places the first <n> lines in the selection set.
    Examples
    Specifying a database table statically:
    REPORT demo_select_static_database.
    DATA wa TYPE scarr.
    SELECT *
      INTO wa
      FROM scarr UP TO 4 ROWS.
      WRITE: / wa-carrid, wa-carrname.
    ENDSELECT.
    The output is:
    The system reads four lines from the database table SCARR.
    Specifying a database table dynamically:
    REPORT demo_select_dynamic_database.
    DATA wa TYPE scarr.
    DATA name(10) TYPE c VALUE 'SCARR'.
    SELECT  *
      INTO  wa
      FROM  (name) CLIENT SPECIFIED
      WHERE mandt = '000'.
      WRITE: / wa-carrid, wa-carrname.
    ENDSELECT.
    A condition for the MANDT field is allowed, since the example uses the CLIENT SPECIFIED option. If NAME had contained the value ‘scarr’ instead of ‘SCARR’, a runtime error would have occurred.
    Inner join:
    REPORT demo_select_inner_join.
    DATA: BEGIN OF wa,
            carrid TYPE spfli-carrid,
            connid TYPE spfli-connid,
            fldate TYPE sflight-fldate,
            bookid TYPE sbook-bookid,
          END OF wa,
          itab LIKE SORTED TABLE OF wa
                    WITH UNIQUE KEY carrid connid fldate bookid.
    SELECT  pcarrid pconnid ffldate bbookid
      INTO  CORRESPONDING FIELDS OF TABLE itab
      FROM  ( ( spfli AS p
                INNER JOIN sflight AS f ON pcarrid = fcarrid AND
                                           pconnid = fconnid    )
                INNER JOIN sbook   AS b ON bcarrid = fcarrid AND
                                           bconnid = fconnid AND
                                           bfldate = ffldate     )
      WHERE p~cityfrom = 'FRANKFURT' AND
            p~cityto   = 'NEW YORK'  AND
            fseatsmax > fseatsocc.
    LOOP AT itab INTO wa.
      AT NEW fldate.
        WRITE: / wa-carrid, wa-connid, wa-fldate.
    ENDAT.
      WRITE / wa-bookid.
    ENDLOOP.
    This example links the columns CARRID, CONNID, FLDATE, and BOOKID of the table SPFLI, SFLIGHT, and SBOOK, and creates a list of booking numbers for all flights from Frankfurt to New York that are not fully booked. An alias name is assigned to each table.
    Left outer join:
    REPORT demo_select_left_outer_join.
    DATA: BEGIN OF wa,
            carrid   TYPE scarr-carrid,
            carrname TYPE scarr-carrname,
            connid   TYPE spfli-connid,
          END OF wa,
          itab LIKE SORTED TABLE OF wa
                    WITH NON-UNIQUE KEY carrid.
    SELECT scarrid scarrname p~connid
      INTO CORRESPONDING FIELDS OF TABLE itab
      FROM scarr AS s
           LEFT OUTER JOIN spfli AS p ON scarrid   =  pcarrid AND
                                         p~cityfrom = 'FRANKFURT'.
    LOOP AT itab INTO wa.
      WRITE: / wa-carrid, wa-carrname, wa-connid.
    ENDLOOP.
    The output might look like this:
    The example links the columns CARRID, CARRNAME, and CONNID of the tables SCARR and SPFLI using the condition in the left outer join that the airline must fly from Frankfurt. All other airlines have a null value in the CONNID column in the selection.
    If the left outer join is replaced with an inner join, the list looks like this:
    Only lines that fulfill the ON condition are included in the selection.

  • Inner join command is not supporting pooled table

    Hi Forum,
    I'm new to abap. I tried passing fields of two tables into a single table using inner join command. But one of the tables is a pooled table so the command "inner join" is not supporting that. How to pass the fields in those two tables into a single table? Kindly help me out.
    Rgrds,
    Mahathi

    Hi ....
    U can't perform JOIN with Pooled or Cluster tables
    trying to join A018 and KONP .... here A018 is Pooled table... Look at below threads...
    Re: abap query join A018/KONP
    Can't perform join table
    Hope it will solve your problem..
    <b>Reward points if useful.</b>
    Thanks & Regards
    ilesh 24x7

  • Noob: failed attempt to update inner join

    I'm attempting to update fields in joined tables bh and bhp, based on information contained in both. The updated fields are not the fields the tables are joined on. I'd expect that to fail but I can't figure out why what I'm trying to do fails. I've read elsewhere in this forum that you can't update views containing joins, and I suspect that's related to this problem, but don't have the experience to understand this better.
    I can easily accomplish this update through Access linked by ODBC. What I can't do is write SQL script to do the same. I want to do that so the update can be scheduled with cron.
    The tables are logs of having run production batches. batchhistory logs the details of the batch (run time, current status) and batchhistorypatient logs details specific to each affected customer. The tables are joined on batchname, starttime, and facility. The 'last' fields are in both tables but they're not a join field and the distinction is maintained with a fully-qualified field name.
    Do I have to create some kind of intermediate view on the fly, and update that?
    Thanks in advance for suggestions or referral to specific documentation and examples.
    UPDATE HCS.BatchHistory BH INNER JOIN HCS.BatchHistoryCustomer BHC ON
    BH.STARTTIME = BHC.STARTTIME AND
    BH.BATCHNAME = BHC.BATCHNAME AND
    BH.facility = BHC.facility
    SET
    BH.LAST = "Y",
    BHC.LAST = "Y"
    WHERE
    BH.STATE="COMPLETE" AND
    BH.DATEOFSERVICE)&lt;GetDate() AND
    BH.last="N" OR
    BHC.last="N"
    Edited by: Chris Cowles on Feb 16, 2009 11:18 AM. Changed
    BHC.LAST = "Y",
    BHC.LAST = "Y" to
    BH.LAST = "Y",
    BHC.LAST = "Y"
    Please excuse my error.

    Example data:
    batchhistory
    batchname, starttime, facility, dateofservice, state, last
    north, 1/1/2009 0900, abc, 1/1/2009 0830, complete, N
    north, 1/2/2009 0900, abc, 1/1/2009 0835, complete, N
    north, 1/3/2009 0900, abc, 1/1/2009 0835, complete, Y
    batchhistorycustomer
    batchname, starttime, facility, customer, dateofservice, state, last
    north, 1/1/2009 0900, abc, 0001, 1/1/2009 0830, complete, N
    north, 1/1/2009 0900, abc, 0002, 1/1/2009 0830, complete, Y
    north, 1/1/2009 0900, abc, 0003, 1/1/2009 0830, complete, Y
    north, 1/2/2009 0900, abc, 0001, 1/1/2009 0835, complete, Y
    north, 1/2/2009 0900, abc, 0002, 1/1/2009 0835, complete, Y
    north, 1/2/2009 0900, abc, 0003, 1/1/2009 0835, complete, N
    north, 1/3/2009 0900, abc, 0001, 1/1/2009 0835, complete, N
    north, 1/3/2009 0900, abc, 0002, 1/1/2009 0835, complete, Y
    north, 1/3/2009 0900, abc, 0003, 1/1/2009 0835, complete, N
    batchhistory.last and batchhistorycustomer.last are independent.

  • Documentation on "Inner Join"

    We are in the process of migrating to Oracle 9.2 and I was reading about some of the new features. In one of the code examples there was a query written using the "inner join" command, something that I was not familiar with but that was not presented as a new feature. I've since tried using this and there appears to be significant performance gains in its use but I am unable to find any documentation relating to it. One of the developers here said that MS Access often uses this syntax so is it included for compatibility or is it something I should be looking to use more often?
    Can someone provide me with the link to the relevant documentation for this feature or explain its use more fully i.e. can it deal with complex joins?
    Thanks
    Richard

    There isn't much documentation that I've found on the ANSI joins. Here is one in the SQL reference:
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_103a.htm#2080352
    One advantage to using the ANSI joins is greater flexibility with outer joins. Another advantage is explicit documentation of cartesian products with the CROSS JOIN keyword (no reson to wonder why someone just left out the join). Finally, the ANSI join syntax allows one to remove join-code from the WHERE clause making the WHERE clause much easier to read (it only has conditions).
    As far as performance goes, I haven't noticed any change (good or bad) whilist switching over to ANSI joins...
    Stan

  • Update Con Inner Join

    haber tengo una duda, existe en oracle los Inner join, si existen me podrian decir cual es el error en este update
    me envia este codigo de oracle
    ORA-00933: SQL command not properly ended
    Código HTML:
    UPDATE NOTAS SET C5=0, P5=0, C6=0, P6=0, C7=0, P7=0, C8=0, P8=0, C9=0, P9=0, C10=0, P10=0, C11=0, P11=0, C12=0, P12=0, C13=0, P13=0, C14=0, P14=0, C15=0, P15=0, EX3=0, PEX3=0, P1=0, GLOSA_C1='SIN COMENTARIO', P2=0, GLOSA_C2='SIN COMENTARIO', P3=0, GLOSA_C3='SIN COMENTARIO', P4=0, GLOSA_C4='SIN COMENTARIO', PEX1=0, GLOSA_EX1='SIN COMENTARIO', PEX2=0, GLOSA_EX2='SIN COMENTARIO', CANT_NOTAS=4, CANT_EXAMENES=2 INNER JOIN DETALLE_ASIGNACION_ALUMNO ON(DETALLE_ASIGNACION_ALUMNO.ID_ALUMNO=ALUMNO.ID_ALUMNO) INNER JOIN NOTAS ON(DETALLE_ASIGNACION_ALUMNO.ID_ALUMNO=NOTAS.ID_ALUMNO) WHERE DETALLE_ASIGNACION_ALUMNO.ID_DETALLE_ALUMNO='1' AND NOTAS.ID_ASIGNATURA='2'
    grax por la ayuda
    Responder Con Cita

    Check from the INNER JOIN.

  • Help with an update with join (works in access)

    This is my working query in ms access...
    UPDATE Caxnode AS A INNER JOIN Caxnode AS B ON A.node_alias = B.node_alias SET A.partition_Type = 'LDOM', A.node_mode = 'LOGICAL', A.host_id = b.host_id, A.num_of_proc = b.num_of_proc WHERE (((A.node_mode)='virtual' Or (A.node_mode)='regular') AND ((B.partition_Type)='LDOM'));
    This doesn't work in oracle, I googled and read that update doesnt work with inner join in oracle..
    can someone please help me translate this query to work on oracle?
    Thanks!
    -nikhil.

    thanks for your reply. however, im a little confused . i want to update the table caxnode for a particular node_alias if the same table has the SAME node_alias defined as partition_Type=ldom
    for eg..
    my table is as follows
    id node_alias host_id node_mode partition_type num_procs
    1 abc abc virtual null 2
    2 abc xyz logical LDOM 4
    3 def def virtual null 2
    4 def ppp logical LDOM 8
    5 abc abc regular null 3
    So those that are ldoms are marked ldom in partition_type, those that are not recognised as ldoms are marked null in partition_type. LDOM's are logical in node_mode, others are either virtual or regular in node_mode.
    Now since there are some old entries that are marked regular/virtual and NULL but are actually LDOMs, I need to go through the table and mark those as LDOM's which have same node_alias marked as LDOM later on.
    In the table above, abc is marked as LDOM in row 2, so row 1 and 5 should reflect that. the host id should change to host_id in row 2 because the same alias is defined as ldom in row 2..
    Same with def.. host_id for def should change to host_id thats in row 4 because def is also defined as ldom in row 4..
    The table should look like this
    id alias host_id node_type num_procs
    1 abc xyz LDOM 4
    2 abc xyz LDOM 4
    3 def ppp LDOM 8
    4 def ppp LDOM 8
    5 abc xyz LDOM 4

  • About a question using Update ... inner join ?

    select *
    FROM a
    INNER JOIN b ON a.ProductID=b.ProductID
    WHERE a.HeadID='000246'
    this statement is ok ;
    But the following statement does not work ! Why ?
    UPDATE a SET
    a.Quantity=a.PurchaseQuantity/b.ConversionGene
    FROM a
    INNER JOIN b ON a.ProductID=b.ProductID
    WHERE a.HeadID='000246'

    "Because Oracle syntactically does not support that type of construct..." Is a correct statement, but not because "It expects only one table in UPDATE statement". The synatax for an updateable join in Oracle requires a "proper" in-line view to be updated.
    As long as the table joined (in my example t1) has a declared unique constraint on the columns used to join by (in my example id), you can do it like:
    SQL> SELECT * FROM t;
            ID DESCR
             1 One
             2 Two
             3 Three
    SQL> SELECT * FROM t1;
            ID DESCR2
             1 Un
             2 Deux
    SQL> UPDATE (SELECT t.descr, t1.descr2
      2          FROM t
      3             JOIN t1 ON t.id = t1.id)
      4  SET descr = descr2;
    2 rows updated.
    SQL> SELECT * FROM t;
            ID DESCR
             1 Un
             2 Deux
             3 ThreeTTFN
    John

  • Syntax errors in update query with inner joins and sub query.

    Below is the query:
    UPDATE sp_CFQ_Coord_Corrections 
    INNER JOIN (CFQ_Coord_Corrections 
    INNER JOIN CFQ_Referrals ON CFQ_Coord_Corrections.CorrID = CFQ_Referrals.RecID) 
    ON sp_CFQ_Coord_Corrections.ID = CFQ_Referrals.RecID 
    SET CFQ_Coord_Corrections.MatchFound = 1, 
    CFQ_Coord_Corrections.RecTblID = [CFQ_Referrals].[RecTblID], 
    sp_CFQ_Coord_Corrections.MatchFound = 1
    WHERE (((CFQ_Coord_Corrections.MatchFound)=0) 
    AND ((sp_CFQ_Coord_Corrections.MatchFound)=0) 
    AND ((CFQ_Coord_Corrections.RecImported)=1) 
    AND ((CFQ_Referrals.RecFileName)='COORDCORR_SPOINT') 
    AND ((CFQ_Referrals.RecCombKey)='No.Match') 
    AND ((sp_CFQ_Coord_Corrections.RecImported)=1));
    Error messages seen when executed:
    Msg 156, Level 15, State 1, Line 3
    Incorrect syntax near the keyword 'INNER'.
    Msg 102, Level 15, State 1, Line 10
    Incorrect syntax near 'CFQ_Coord_Corrections'.
    Please help.....

    Below is the query:
    UPDATE sp_CFQ_Coord_Corrections 
    INNER JOIN (CFQ_Coord_Corrections 
    INNER JOIN CFQ_Referrals ON CFQ_Coord_Corrections.CorrID = CFQ_Referrals.RecID) 
    ON sp_CFQ_Coord_Corrections.ID = CFQ_Referrals.RecID 
    SET CFQ_Coord_Corrections.MatchFound = 1, 
    CFQ_Coord_Corrections.RecTblID = [CFQ_Referrals].[RecTblID], 
    sp_CFQ_Coord_Corrections.MatchFound = 1
    WHERE (((CFQ_Coord_Corrections.MatchFound)=0) 
    AND ((sp_CFQ_Coord_Corrections.MatchFound)=0) 
    AND ((CFQ_Coord_Corrections.RecImported)=1) 
    AND ((CFQ_Referrals.RecFileName)='COORDCORR_SPOINT') 
    AND ((CFQ_Referrals.RecCombKey)='No.Match') 
    AND ((sp_CFQ_Coord_Corrections.RecImported)=1));
    Error messages seen when executed:
    Msg 156, Level 15, State 1, Line 3
    Incorrect syntax near the keyword 'INNER'.
    Msg 102, Level 15, State 1, Line 10
    Incorrect syntax near 'CFQ_Coord_Corrections'.
    Please help.....
    sp_CFQ_Coord_Corrections is a table and not a stored procedure.
    are these both tables "sp_CFQ_Coord_Corrections" and "CFQ_Coord_Corrections" different ??

  • Update Query with Inner Joins

    Dear Experts,
    Update Employee set desicode = o.dcod from employee e inner join operator o on
    e.employee_id = o.employe_id
    waiting for suggestions,

    The other thread from yesterday that Satyaki mentioned Update.
    William:
    The SQL Server syntax from the OP is their version of an updateable join view. One interesting quirk of the implementation is that it does not require a unique key in the joined table, and will not error even if there are multiple rows that could update a row in the main table. I am still trying to figure out how it decides which row to use for the update, or if it actually updates multiple times and last update wins.
    John

  • QUESTION INNER JOIN FOR UPDATE

    Dear All,
    does oracle support this sql update statement?
    UPDATE Tb1 INNER JOIN Tb2 ON Tb1.empid = Tb2.empid2 SET
    Tb2.salary = Tb1.salary * 0.5
    Best Regards
    Terence Chua

    No - because you are trying to update the salary in Tb2
    in an update statement for TB1
    If you are trying to update the salary in T1 based on the salary in T2, use the following
    UPDATE Tb1
    set Tb1.salary = (
    select TB2.salary * 0.5
    from TB2
    where TB2.empid2 = TB1.empid
    However, I am wondering if you have your model confused.
    Can you please confirm that you have two separate tables.
    TB1 has column EMPID
    TB2 has column EMPID2
    or - are TB1 and TB2 the same table
    If they are the same table - please confirm if you have one EMPID column - or an EMPID column and an EMPID2 columns.

  • Trying to convert SELECT query to Update query with INNER JOINS

    Assalam O Alaikum!
    I've tried to convert this query of mine but failed.
    I wish to use it for update datasource in data GridView. I'm fetching data with it but converting it to update is not helping giving multiple errors.
    I tried to share the pic but they don't let me do so. Its actually a gridView with check boxes. check the item and update it..
    Here is the query. Please help me with that.
    <pre>
    SELECT [rightsId], [saveRights], [updateRights],
    [viewRights], [deleteRights], [printRights],
    [processRights], [verifyRights], [unProcessRights],
    [unVerifyRights], CONVERT(VARCHAR(100),tblGroup.groupId)as groupId, convert(varchar(100),tblmenu.[menuId])as menuid
    FROM [tblRights] inner join tblMenu ON
    tblMenu.menuId=tblRights.menuId INNER JOIN
    tblGroup ON tblGroup.groupId=tblRights.rightsId
    </pre>

    code is fine the above query works fine with the fetching(select) but when I try to write it with update it doesn't. Here is the asp code. I'm doing nothing with c# or vb.
      <asp:GridView ID="GridView1" runat="server" AllowPaging="True"
                DataSourceID="ratGrid" AutoGenerateColumns="False"
                CssClass="GridViewStyle" Width="100%" AllowSorting="True" AutoGenerateEditButton="True" BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2">
                <Columns>
                    <asp:BoundField DataField="rightsId" HeaderText="rightsId" ItemStyle-Width="75px" SortExpression="rightsId" Visible="False">
                    <ItemStyle Width="75px" />
                    </asp:BoundField>
                    <asp:CheckBoxField DataField="saveRights" HeaderText="Save" SortExpression="saveRights" />
                    <asp:CheckBoxField DataField="updateRights" HeaderText="Update" SortExpression="updateRights" />
                    <asp:CheckBoxField DataField="viewRights" HeaderText="View" SortExpression="viewRights" />
                    <asp:CheckBoxField DataField="deleteRights" HeaderText="Delete" SortExpression="deleteRights" />
                    <asp:CheckBoxField DataField="printRights" HeaderText="Print" SortExpression="printRights" />
                    <asp:CheckBoxField DataField="processRights" HeaderText="Process" SortExpression="processRights" />
                    <asp:CheckBoxField DataField="verifyRights" HeaderText="Verify" SortExpression="verifyRights" />
                    <asp:CheckBoxField DataField="unProcessRights" HeaderText="UnProcess" SortExpression="unProcessRights" />
                    <asp:CheckBoxField DataField="unVerifyRights" HeaderText="UnVerify" SortExpression="unVerifyRights" />
                    <asp:BoundField DataField="groupId" HeaderText="groupId" ReadOnly="True" SortExpression="groupId" Visible="False" />
                    <asp:BoundField DataField="menuid" HeaderText="menuid" SortExpression="menuid" ReadOnly="True" Visible="False" />
                </Columns>
                <RowStyle CssClass="RowStyle" BackColor="#FFF7E7" ForeColor="#8C4510" />
                <PagerStyle CssClass="PagerStyle" ForeColor="#8C4510" HorizontalAlign="Center" />
                <SelectedRowStyle CssClass="SelectedRowStyle" BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                <HeaderStyle CssClass="HeaderStyle" BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle CssClass="AltRowStyle" />
                <SortedAscendingCellStyle BackColor="#FFF1D4" />
                <SortedAscendingHeaderStyle BackColor="#B95C30" />
                <SortedDescendingCellStyle BackColor="#F1E5CE" />
                <SortedDescendingHeaderStyle BackColor="#93451F" />
            </asp:GridView>
            <asp:SqlDataSource ID="ratGrid"
                 runat="server"
                ConnectionString="<%$ ConnectionStrings:Conn_Str %>"
                SelectCommand="SELECT [rightsId], [saveRights], [updateRights],
    [viewRights], [deleteRights], [printRights],
    [processRights], [verifyRights], [unProcessRights],
    [unVerifyRights], CONVERT(VARCHAR(100),tblGroup.groupId)as groupId, convert(varchar(100),tblmenu.[menuId])as menuid
    FROM [tblRights] inner join tblMenu ON
    tblMenu.menuId=tblRights.menuId INNER JOIN
    tblGroup ON tblGroup.groupId=tblRights.rightsId"
               FilterExpression="menuId like '{0}%' and [groupId] like '{1}%'" >
                            <FilterParameters>
                <asp:ControlParameter ControlID="ddlmenu" Name="menu"
                        PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="ddlgroup" Name="Country"
                        PropertyName="SelectedValue" Type="String" />
                </FilterParameters>
            </asp:SqlDataSource>
    Your table needs key(s) and you need to assign the key as DataKeys property for the GridView to make your UpDate and Delete work without coding.

  • Edit form with an Inner Join - Can not update/delete data?!

    Hi all,
    I have an Edit form which shows me data from 2 tables (through an Inner Join SQL-Statement). I just realized that I can not edit data anymore, the following error msg appears:
    Error in mru internal routine: ORA-20001: no data found in tabular form
         Error     Unable to process update.
    OK     
    Can someone please help me?

    The ringed in red are from the second table, but the first table has some more data. Here is the SQL Statement I have (D1 and D2 are from the second table - Whereas the DOBJ_NR1 and the DOBJ_NR2 are both primary keys and foreign keys in table one, but the user selects the key from table two...):
    SELECT
    D1.DOBJ_NR DOBJ_NR1,
    D1.NAMSP NAMSP1,
    D1.DOBJ_NAME DOBJ_NAME1,
    D2.DOBJ_NR DOBJ_NR2,
    D2.NAMSP NAMSP2,
    D2.DOBJ_NAME DOBJ_NAME2,
    R.RS_NAME,
    R.ROLE1TO2,
    R.CARDMIN1TO2,
    R.CARDMAX1TO2,
    R.ROLE2TO1,
    R.CARDMIN2TO1,
    R.CARDMAX2TO1,
    R.ON_DELETE,
    R.ON_UPDATE,
    R.O_RS_COMMENT,
    R.INS_BY REL_INS_BY
    FROM
    DO_RELATIONSHIP R
    INNER JOIN DATAOBJECT D1 ON R.DOBJ1_NR = D1.DOBJ_NR
    INNER JOIN DATAOBJECT D2 ON R.DOBJ2_NR = D2.DOBJ_NR
    Edited by: user12067949 on Dec 5, 2009 3:18 AM

  • Update statement with inner join issues

    I have searched for the answer on this and not really 100%....so figured I would ask...be nice :)
    what have I done wrong? Or am I just going about this the wrong way? I have looked at the oracle docs and I can't find an example showing me this. I do see where you SET values based on the select query results. I want to update the result of a query based on the join with static values....
    UPDATE table.a
    SET table.a_STATUS=9,table.a.INDEX = 'N'
    WHERE (SELECT table.a INNER JOIN table.b ON (table.a.COMPANY = table.b.COMPANY) AND (table.a.PO_NUMBER =table.b.PO_NUMBER) AND (table.a.PO_RELEASE =table.b.PO_RELEASE) AND (table.a.PO_CODE =table.b.PO_CODE) AND (table.a_STATUS=1) AND (table.b.CLOSED_FL = 'Y'));

    Hi,
    Welcome to the forum!
    user11360811 wrote:
    I have searched for the answer on this and not really 100%....so figured I would ask...be nice :)
    what have I done wrong? Or am I just going about this the wrong way? I have looked at the oracle docs and I can't find an example showing me this. I do see where you SET values based on the select query results. I want to update the result of a query based on the join with static values....
    UPDATE table.aThat's updating a table called A in a schema called TABLE (which is not a good name for any user-named object). Are those really your table and schema names? Perhaps you meant to have an underscore instead of a dot:
    UPDATE  table_ais much, much more reasonable. It means the table name is TABLE_A (a perfectly good name) in the current schema.
    SET table.a_STATUS=9,table.a.INDEX = 'N'
    WHERE ( ...There's a syntax error. You can't just say
    "WHERE (sub-query)"; it has to be
    "WHERE EXISTS (sub-suery)" or
    "WHERE (sub-query) = some_value" or
    "WHERE some_value IN (sub_query)", or something similar. WHERE can never be used without some kind of comparison operator, such as EXISTS, = or IN.
    SELECT table.a INNER JOIN table.b ON ...Here are some more syntax errors. The correct syntax for any query is
    SELECT  column_list
    FROM    table_name ...If table.a is your (first) table name, then you're missing the list of columns to SELECT, and the mandatory keyword FROM.
    (table.a.COMPANY = table.b.COMPANY) AND (table.a.PO_NUMBER =table.b.PO_NUMBER) AND (table.a.PO_RELEASE =table.b.PO_RELEASE) AND (table.a.PO_CODE =table.b.PO_CODE) AND (table.a_STATUS=1) AND (table.b.CLOSED_FL = 'Y'));Some general advice about UPDATE:
    If it's not obvious how to use UPDATE to do what you want, then there's a good chance that UPDATE is the wrong tool for the job. MERGE might be much simpler, and more efficient as well. This is especially likely if you need to join the table that's being updated to some other table.
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved. That way, the people who want to help you can re-create the problem and test their ideas.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Simplify the problem as much as possible. Remove all tables and columns that play no role in this problem.
    If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results will be the contents of the changed table(s) when everything is finished.
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    Edited by: Frank Kulash on Jan 17, 2013 4:58 PM

  • Update statement with inner join

    Hello everyone. I am am trying to do an update statement with an inner join. I have found several examples of SQL statements that work with Sql server and mysql but they don't work in Oracle. Does anyone know the proper way in Oracle 10G? I am trying to update all fields in one table from fields in another table.
    for example:
    UPDATE table3
    SET
    TL3.name = TL2.name,
    TL3.status = TL2.status,
    TL3.date = TL2.date
    FROM table3 TL3 JOIN table2 TL2
    ON (TL3.unique_id = TL2.unique_id);
    any help will be appreciated.

    Hi,
    You can also use MERGE, like this:
    MERGE INTO  table3     dst
    USING   (
             SELECT  unique_id
             ,         name
             ,         status
             ,         dt          -- DATE is not a good column name
             FROM    table2
         )          src
    ON     (dst.unique_id     = src.unique_id)
    WHEN MATCHED THEN UPDATE
    SET     dst.name     = src.name
    ,     dst.status     = src.status
    ,     dst.dt          = src.dt
    ;Unlike UPDATE, this lets you avoid essentially doing the same sub-query twice: once in the SET clause and then again in the WHERE clause.
    Like UPDATE, you don't acutally join the table being changed (table3 in this case) to the other table(s); that is, the FROM clause of the suib-query does not include table3.
    Riedelme is right; you'll get better response to SQL questions like this in the SQL and PL/SQL forum:
    PL/SQL

Maybe you are looking for

  • How do I get LR4 to find all photos in catalog after replacing hard drive on mac? question marks all

    I had the hard drive replaced on my mac.  I did a restore from back up drive to my new hard drive.  First LR4 couldn't find the catalog so I pointed to it. Then I opened lightroom 4 and it cannot see ANY of my photos. I don't want to link each folder

  • How to work with PDF forms filled up by the user?

    I would appreciate any help regrading work with PDF Forms. I present a PDF form to users with several fields that they need to fill up. My problem is to receive the values of these fields back. In PDF forms you can add a "Submit" button that sends th

  • I can't print my Yahoo! Email message

    When I clicked print to print email message the print box would appear as usual to choose your printer and the number of copies, but it would disappear in an instant (about 1 second) and I'm unable to click the print button. I tried switching my brow

  • Non-functioning booksmarks when exporting with Acrobat X

    Using InDesign CS5, I export my book documents to PDF Print and include bookmarks and hyperlinks. This has been working just fine using Acrobat Standard, and the person reading the document can navigate through the pages using either the document's T

  • Mail downloading gmail sent mail?

    This could be a gmail thing and not a .mac but I can't find a setting in gmail that seems to account for this action. I check my gmail with Mail and only occasionally use it to send stuff but when I do, at the end of the day, Mail seems to download a