MYSQL Error When Deleting multiple records

Folks,
I am finally converting my website from MS-Access to MySQL and until Monday I was having pretty good luck. However, I have come across a issue I cannot find any solution to and am wondering if one of you can assist.
When I try to delete a number of records using tgeh same commands that worked in Access, I get this error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
ODBC driver does not support the requested properties.
/New_Site/Trade/Trade_Signup_Edit_Update.asp, line 34
This is the code:
Set adoCon2 = Server.CreateObject("ADODB.Connection") adoCon2.Open "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=MySQLB1.webcontrolcenter.com;" &_ "DATABASE=pinotdays; UID=pinotdays; PASSWORD=********; OPTION=3" Set rsTrade_List = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT * FROM Trade_List WHERE Entity_Number = " & request.form("ID") rsTrade_List.CursorType = 2 rsTrade_List.LockType = 3 rsTrade_List.Open strSQL, adoCon2 Set rsTrade_Delete = Server.CreateObject("ADODB.Recordset") StrSql = "DELETE * FROM Trade_List Where Parent_Entity_Number=" & request.form("ID") & " AND Entity_Number <> " & request.form("ID") rsTrade_Delete.CursorType = 2 rsTrade_Delete.LockType = 3 rsTrade_Delete.Open strSQL, adoCon2
The error occurs on the final line listed. Being new to MySQL, I thought I would change teh driver to 5.1 but that brought me nowhere. I used "SELECT" in the string and tried to do rsTrade_Delete.Delete and that did not work. I tried to delete a single record by selecting a ID=1 and that did not work.
So, is there a trick to deleting records in MySQL?
Thanks for your help....
Regards,
Steve

StrSql = "DELETE * FROM Trade_List Where Parent_Entity_Number=" &
request.form("ID") & " AND Entity_Number <> " &
request.form("ID")
The DELETE statement for MySQL deletes entire rows. No need to specify fields (or all fields with the asterisk). In fact, that should probably result in a syntax error.
StrSql = "DELETE FROM Trade_List Where Parent_Entity_Number=" & request.form("ID") & " AND Entity_Number <> " & request.form("ID")
Mark A. Boyd
Keep-On-Learnin' :-)

Similar Messages

  • Error when deleting a record:  "FRM-40202 Field must be entered"

    Dear all, please I need your help in this little problem.
    I am using Forms 10g , and I am having an issue when deleting a record at runtime. It is giving "FRM-40202 Field must be entered".
    I have reviewed the code but still cannot guess what could be the reason.
    Any idea please. Thanks
    Edited by: user562674 on 02/05/2011 12:35 ص

    Hi
    This error is caused due to the NOT NULL constraint u have in ur db for that item...
    u have 2 options to use ...
    1.Either u set the Required property of that item to > no
    2.Or u give it an intial value...
    To get ride of this error message...
    Hope this helps...
    Regards,
    Ammatu Allah.

  • Error when edit multiple records in a details table

    Hi,
    I have a requirement to provide forms like details table which allows user to add new rows or edit rows in the same page and same table.
    My page is SetObjectivesPG under /oracle/apps/per/wpm/objectives/webui/
    I embeded my custom region in the standard page which allows user to add or edit in same table like forms.
    I can able to create mutlple records, and i'll save once I created all the records I want. But when I edit it is not allowing me to do multiple without committing each changes.
    I'm getting the following error:
    Unable to perform transaction on the record.
    Cause: The record contains stale data. The record has been modified by another user.
    Action: Cancel the transaction and re-query the record to get the new data.
    Please give suggestions to solve this issue.
    Thanks a lot in advance,
    SAN

    Hi,
    Is there any specific reason that you are using 'Row.STATUS_NEW' ?
    Comment that line and instead of that, write below line after setting all the values (i.e. after 'scorecardObjVO.getCurrentRow().setAttribute("StartDate", today);'):
    newObjective.setNewRowState(Row.STATUS_INITIALIZED);
    Check this and let me know if you are still facing the issue.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Attribute change run fails - "Error when deleting the data record /B05/X.."

    Hello,
    I get the error message "Error when deleting the data record /B05/X.." on doing the change run.
    I have already done RSRV on this objects and found no errors, but still the activation fails.
    please give your suggestions ASAP to fix the issue as it is on production system.
    Thanks.

    Attribute change run could fails due to 2 reasons-
    (1) attribute xchange run is already runnnig for any toher object(monitor lock) (check by thi prog-RSDDS_CHANGERUN_MONITOR)
    (2) data is loading deleting from the object on which attribut changerun is running.(go in a manage tab and check)
    check this two conditions and rerun the attribute changrun again from program - RSDDS_AGGREGATES_MAINTAIN and give the master data name in the selection.
    Hope it helps you.

  • How to Delete Multiple Records using selectbox in jsf

    Hi!
    My Senario is I want to delete multiple records using checkbox. After selecting multiple records when i click the delete button the selected
    rows shuld be deleted.if am doing like this but the edit ,delete for each row functionality is not working.
    <h:selectBooleanCheckbox id ="bcb" value="#{item.empno}">
    </h:selectBooleanCheckbox>
    But other functionality is not wokring.
    Can any one plz tell how to select the multiple records and how to send the id to the serverside.
    I want code code for jsp and as well as backingBean how to accaess .
    Any Reply shuld be apreciated

    You may find this article useful as well: http://balusc.blogspot.com/2006/06/using-datatables.html
    Check the chapter "Select multiple rows" for two generic ways to select multiple rows in a datatable.

  • Short dump error when extracting delta records from R/3

    I am working on BW 3.5 and I am facing some short dump error when extracting delta records from the r/3 to BW.
    Below is the error message
    Kindly do the needful ASAP.
    Job started
    Step 001 started (program SBIE0001, variant &0000000024277, user ID BWREMOTE)
    Asynchronous transmission of info IDoc 2 in task 0001 (0 parallel tasks)
    DATASOURCE = 0ISCM_PAYMENT_01
             Current Values for Selected Profile Parameters               *
    abap/heap_area_nondia......... 2000000000                              *
    abap/heap_area_total.......... 2000000000                              *
    abap/heaplimit................ 40000000                                *
    zcsa/installed_languages...... DE                                      *
    zcsa/system_language.......... E                                       *
    ztta/max_memreq_MB............ 2047                                    *
    ztta/roll_area................ 6500000                                 *
    ztta/roll_extension........... 2000000000                              *
    2,454 LUWs confirmed and 2,454 LUWs to be deleted with function module RSC2_QOUT_CONFIRM_DAT
    ABAP/4 processor: MESSAGE_TYPE_X
    Job cancelled

    Hi,
    I look at the transaction ST22 to see which type of error has given you. Take a look at the notes to correct the error.
    Another option is to look at OSS notes, because the error is giving you a standard extractor.
    Greetings,

  • Delete multiple record in tabular with check box.

    Hello guys,
    I need your suggestion..
    I have master detail block. (INSTRUCTOR and SECTION)
    At detail block, I add check box item (name: RB_SECTION_ID) with Database Item "No", and value when check :SECTION_ID (on the property).
    I make a button DELETE. The trigger was DELETE from SECTION where section_id = :SECTION.RB_SECTION_ID and
    instructor_id = :INTRUCTOR.INSTRUCTOR_ID;
    but It not work.
    How we delete multiple record by check multiple check box then click DELETE button..??
    Regard.
    Nia..

    You datablock in the form cannot automaticaly refresh the changes you make with the SQL statements.
    For that you need to explicity call certain built-ins to refresh the data
    execute_query(no_validate) --> fetches the available data for that session. Here you deleted some records, so those records will not be available until you do a rollback in the same session(i.e, you exit the form without saving). But until you save, those deleted records will be avaiable for the users in other sessions)
    Also, your code works only because the records you deleted are all already saved ones.
    So it will be a good practice to use built-in of form builder rather than DML stmt.s
    Here you can do like this
    begin
    go_block('TRY_TABLE');
    first_record;
    loop
    if :TRY_TABLE.CCKBOX = 'Y' THEN
    delete_record;
    END IF;
    NEXT_RECORD;
    EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
    END LOOP;
    END;
    If your code is like above one, you can revert your deletion by simply giving a F7 (enter-query) and F8 (xecute query).

  • To delete multiple records

    hi all,
    Can any tell tell me how to delete multiple records in table control of a screen
    i have checked the multiple rows in table control attributed and assigned a name.I needhelp in writing code.
    Thanks

    hi,
    As you have marked multiple fields in the table control your table control is mulple selection enabled.
    <b>PROCESS AFTER INPUT.</b>
    loop at IT_CONF.
        field X_CONF-CHECK
          module TC_CONF_mark on request.
      endloop.
      module TC_CONF_user_command.
      MODULE USER_COMMAND_0102.
    *this modifies the internal table with check field as X
    module tc_conf_mark input.
      data: g_tc_conf_wa2 like line of it_conf.
      if tc_conf-line_sel_mode = 1.
        clear g_tc_conf_wa2.
        loop at it_conf into g_tc_conf_wa2
          where check = 'X'.
          g_tc_conf_wa2-check = ''.
          modify it_conf
            from g_tc_conf_wa2
            transporting check.
        endloop.
      endif.
      modify it_conf
        from x_conf
        index tc_conf-current_line
        transporting check.
    endmodule.
    module tc_conf_user_command input.
    * write code to handle table control scrolling /pageup/pagedown
    endmodule
    *Check the ok_code
    module user_command_0102 input.
        case ok_code.
          when 'DEL'.
           * Delete from internal table where check = X
        endcase.
    endmodule.                
    <b>PROCESS BEFORE OUTPUT.</b> 
      module TC_CONF_change_tc_attr.
      loop at   IT_CONF
           into X_CONF
           with control TC_CONF
           cursor TC_CONF-current_line.
        module TC_CONF_get_lines.
      endloop.
    module tc_conf_change_tc_attr output.
      describe table it_conf lines tc_conf-lines.
    endmodule.
    module tc_conf_get_lines output.
      g_tc_conf_lines = sy-loopc.
    endmodule.
    Thus you will delete the marked lines from the internal table in PAI and in PBO you can read the refreshed internal table without the table entries that are marked as deleted in the table control and display the same in the table control. This is another way.
    Regards,
    Richa

  • Urgent:                FORMS-III   Deleting Multiple Records By Marking X

    Deleting Multiple Records By Marking X
    In Forms III, i need to delete multiple records by marking X (in non database Item)
    i.e.
    ========================
    D Empno Ename Deptno
    ========================
    X 10001 ABC 10
    10002 DEF 10
    X 10003 GHI 20
    X 10004 JKL 20
    =======================
    How To Do????????????
    Rgds,
    Rashad

    Create a button say lable "delete" in a block other than the block from where u want to delete records.
    suppose the block's name is emp_blk
    now create a WHEN-BUTTON-PRESS trigger for delete button and write the following code
    begin
    go_block('emp_blk');
    first_record;
    loop
    if :emp_blk.d ='X' then
    delete_record;
    end if;
    if :system.last_record='TRUE' then
    exit;
    end if;
    next_record;
    end loop;
    end;
    filnally commit on save.

  • Deleting multiple records via html checbkoxes?

    I'm trying to delete multiple records in a table based on the
    selection of checkboxes.
    I have an html form with 4 checkboxes. If a user checks any
    box, I want to delete the associated records. and if they ucnheck
    something I want to insert multiple records. This form does not
    hold the primary keys but other unique parameters. Here is my sql
    statement.

    > and that keyword is not mentioned in the DELETE
    statement chapter.
    IN is not specific to DELETE statements. It can also be used
    with SELECT or UPDATE statements. It is a way of specifying
    multiple values in a single statement, instead of using multiple OR
    statements:
    http://www.w3schools.com/sql/sql_in.asp
    Since you are using cfqueryparam, you also need to use
    list="true" (ie you are passing in a list of values, not just one)
    <cfset listOfValues = "1,2,5,6,8">
    WHERE ColumnName IN
    <cfqueryparam value="#listOfValues#" list="true"
    cfsqltype="...">

  • Delete Multiple Records from Item Master

    Hi,
    We received wrong master data which has been uploaded and two groups have to be deleted. All the items in those particular groups have also to be deleted. Can anyone suggest how to delete multiple records from Item Master?
    Currently I am navigating through each Item and doing a Right Click + Remove. It is very painful given the huge number of records.
    Regards
    Sudatt

    Hi Sudatt.....
    I recommend you not to run any kind of delete or update SQL query as it harms DB.
    You can create your own front end application with the help of any technical consultant which can be
    achieved very easily. Else such problems create a big problem during upgradation to next version.......
    Regards,
    Rahul

  • Need to delete multiple records at a time

    Hi,
    My requirement is to delete multiple records at a time, i am using JDV11g and read only ADF table and rowSelection="multiple".
    i have taken command button and invoking the below method.
    RowKeySet rowKeySet = (RowKeySet)this.t1.getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)this.t1.getValue();
    System.out.println("RowKeySet is: "+ rowKeySet.getSize());
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData =
    (JUCtrlHierNodeBinding)cm.getRowData();
    System.out.println("RowData is : "+rowData.getAttribute("ParamValue7"));
    rowData.getRow().remove();
    Please do need full

    Hi,
    I don't understand what you mean by "+Please do need full+" , so I am ignoring this part. Here's a link that shows you best practices
    http://blogs.oracle.com/smuenchadf/examples/
    See example 134.
    Frank
    ps.: I suggest you bookmark the link

  • Please Help! Deleting multiple record by using checkbox selected

    Hello everybody,
    I am a new to JSP. I really don't know how to delete multiple record by using checkbox selected and pressing submit button.
    For example, deleting webmailbox letters using checkbox selected and delete button. The mail we checked will delete from the inbox.
    I like to use my user account deleting system of my project like above example.
    How can I do in JSP? I will very please you if you share you knowledge and code for me.
    If you have URL address, could you share me for reference?
    Please help me...
    With Thanks and Regards,
    wtdahl

    Take a look at this thread, I thing it answers your question quite good:
    http://forum.java.sun.com/thread.jsp?thread=516658&forum=45&message=2463505

  • Maximum Open cursor  Exceeded error when deleting records from a table

    I have a strange problem.
    I have a table EMP_MASTER . Whenever I am trying to delete a record from this table, I am getting Maximum no. of open cursor exceeded error. But this error doesnot come when i delete from any other tables. And no. of open cursor is much lesser than OPEN_CURSOR parameter.
    All other tables (around 700) has foreign key constraint to this EMP_MASTER table for created_user paramater.
    Is it some thing like, when I am trying to delete a record from EMP_master, implicit cursor opens up and checks all referenced tables. and that limit gets exceeded ?
    Please help.
    Thanks,
    Raj

    Raji03 wrote:
    There is no trigger defined for this table.
    Is there a limit on which no.of references made to a column ? Because one column in this field, Emp no is being referenced in almost every other table. around 700 tables. Will it have any adverse effect ?That should have nothing to do with your problem directly. Again, those tables could have triggers defined on them and you are leaking cursors in one of those triggers (wild guess).
    An example of a table with many many others foreign key'd to it.
    create table parent_of_everything
       column1 number primary key
    insert into parent_of_everything select level from dual connect by level <= 1000;
    commit;
    --create 1000 tables all with foreign keys to the parent_of_everything
    begin
       for i in 1 .. 1000
       loop
          execute immediate 'create table child_' || i || ' (column1 number, column2 number, constraint child_' || i || '_fk foreign key (column1) references parent_of_everything (column1) on delete cascade)';
          execute immediate 'insert into child_' || i || ' select level, mod(level, ' || i || ') from dual connect by level <= 1000';
          commit;
       end loop;
    end;
    TUBBY_TUBBZ?delete parent_of_everything;
    1000 rows deleted.
    Elapsed: 00:02:53.03No problems were had (none were expected).
    Cleanup script.
    --remove the 1000 child tables
    begin
       for i in 1 .. 1000
       loop
          begin
             execute immediate 'drop table child_' || i || ' purge';
          exception when others
             then
                null;
          end;
       end loop;
    end;
    /

  • ORA-01654 error message when inserting multiple records

    Hello all,
    I have a Test table with attributes TEST_ID, TEST_NAME, TEST_DATE, STATUS, and want to insert multiple records into this table based on user input form. If user select a value from the drop down list, and the number of records to insert into the Test table, the application should insert that many into the Test table with the same TEST_DATE, STATUS, but TEST_NAME should be the drop down list value + i (1....the number of inserted records). I manually created the form, and wrote a sql for the process.
    For example if the user select MUSIC, 3 then data should look like this
    TEST_ID TEST_NAME TEST_DATE STATUS
    1 MUSIC1 04/06/2010 Y
    2 MUSIC2 04/06/2010 Y
    3 MUSIC3 04/06/2010 Y
    I got the error ORA-01654: unable to extend index TEST_TOOL_ID.TEST_PK by 128 in table space FLOW_13120862905990037739.
    The process query
    DECLARE IDTEST NUMBER := 1;
    BEGIN
    WHILE (IDTEST < :P1_COUNT + 1) LOOP
    INSERT INTO TEST ( TEST_NAME, TEST_DATE, STATUS )
    VALUES ((:P1_TEST_NAME || ' ' ||IDTEST), SYSDATE, 'Y');
    END LOOP;
    END;
    Here is the link to this application
    http://apex.oracle.com/pls/apex/f?p=4000:1:3173416575551580::NO:RP:FB_FLOW_ID,F4000_P1_FLOW:32828,32828
    Any help would be appreciated.
    Thanks,
    Karoline

    This is the output i get when i change the getMessage with printStackTrace.
    String getMessage() replaced with printStackTrace:
    G:\studies\Chapter11\MakeDB.java:33: 'void' type not allowed here
                   System.out.println("Could not drop primary key on UserStocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:43: 'void' type not allowed here
                   System.out.println("Could not drop UserStocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:54: 'void' type not allowed here
                   System.out.println("Could not drop Users table: "
    ^
    G:\studies\Chapter11\MakeDB.java:64: 'void' type not allowed here
                   System.out.println("Could not drop Stocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:83: 'void' type not allowed here
                   System.out.println("Exception creating Stocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:102: 'void' type not allowed here
                   System.out.println("Exception creating Users table: "
    ^
    G:\studies\Chapter11\MakeDB.java:119: 'void' type not allowed here
                   System.out.println("Exception creating UserStocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:133: 'void' type not allowed here
                   System.out.println("Exception creating UserStocks index: "
    ^
    G:\studies\Chapter11\MakeDB.java:159: 'void' type not allowed here
                   System.out.println("Exception inserting user: "
    ^
    9 errors
    Tool completed with exit code 1

Maybe you are looking for