TABLE ILLEGAL STATEMENT  error with MODIFY command

Hi gurus,
i want you to inform me about table illegal statement error. The error occurs when i use modify as below.
loop at itab.
   select .......
         where xxx eq itab-xxxx.
       MODIFY itab.
  endselect.
endloop.
i know that i have to give the sy-tabix as INDEX parameter to the modify command. but i want to know why i have to do this?
cause when i debug, i follow the sy-tabix field and it have not a change in select endselect.
may the reason of the error about cursor in select and cursor effects modify command?
or why?
Thx,

Hello,
I guess this is because your MODIFY statement is inside the SELECT ... ENDSELECT & not inside the LOOP ... ENDLOOP.
SAP documentation says:
Within a LOOP loop, the INDEX addition can be ommitted. In this case the current table line of the LOOP loop is changed.
You have to change the coding:
DATA: v_index TYPE i.
loop at itab.
v_index = sy-index.
select .......
where xxx eq itab-xxxx.
MODIFY itab INDEX v_index.
endselect.
endloop.
BR,
Suhas
PS: The coding practice followed is not very performance oriented as well. May be you should have a look around in some blogs, wikis in SCN & change the code accordingly.
Edited by: Suhas Saha on Nov 19, 2009 9:41 AM

Similar Messages

  • Error with sql commands with ms access

    hi!
    I'm having problems with sending commands like "create group x" and "alter database password" these aren't working.
    I'm using the jdbcodbc bridge. Simply doing this:
    Statement stmt = con.createStatement();
    stmt.executeUpdate ("alter database password a null");
    doesn't work.
    create group also don't work. Surely other stuff also don't work. But things like create table, drop table, create proc, do work.
    I can't do all the stuff that appears here.
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acadvsql.asp
    What may be happenning?
    can all that really work from java just like this or it don't?
    I'm using Access 2002 with access 2000 db format.
    Thanks.
    Greeting from chile.

    Well may be I am ignorant. I'm doing a real thing (for somebody) for the first time. They will buy few pcs. Also I think I would like they update to access 2000 or 2002 from 97 because of the semi stored procedures... They will do a lot of effort to just buy that but they really need it.
    I just actually wanted the ability to mantain users and assign permissions to do stuff from the same application. That would have been nice but it is not critical, at least execute procedures does work.

  • I don't see the table I had create with the command line

    hi ,
    I just install sql developer, and connect to mydatabase, but I see a lot of tables who are not mine, but I don't see the one I have created. so could you tell me haow t make my tables to appear. or if I have to recreate them with wich command in sql developer? thanks

    Stranger.
    You do not need to recreate tables in the SQL Developer.
    The tables that you created and that they are in the database must be visualized, in accordance with the permissions.
    You are connected to the SQL Developer with the same user that created the table (owner)?
    The table that you desire to see appears below in the result of the command?
    select * from user_tables;

  • Illegal State Exception with response.sendRedirect

    Hi all,
    When i am using response.sendRedirect(address), It is giving illegal state exception at few places. At few places it is working fine. I couldnt trace the reason.
    I am using tomcat 4.1 with SSL configured for the server. Will session tracking effect response.sendRedirect(address)'s ability any way?
    Can any body help me out...
    Thanks in advance...
    krish

    I believe this quite often occurs when you have tried to send some kind of response already. I.E. you should not have sent anything to the client when you call this method so start by looking for any write's you have prior to the sendRedirect().
    Ted.

  • Errors with EXPDP command

    we have been experiencing problems with our DataPump exports over the last few weeks, and I have been unable to determine the cause of the problem. Any help would be appreciated.
    The following command is being used:
    expdp system/xxxxxx@ORACLE_SID full=y directory=DUMP_DIR dumpfile=DUMPFILE.PMPlogfile=expdpDUMPFILE.log
    The export will run for 30 - 40 minutes, and will then fail with the following errors:
    ORA-39014: One or more workers have prematurely exited.
    ORA-39029: worker 1 with process name "DW01" prematurely terminated
    ORA-31671: Worker process DW01 had an unhandled exception.
    ORA-24795: Illegal ROLLBACK attempt made
    ORA-06512: at "SYS.KUPW$WORKER", line 1297
    ORA-24795: Illegal ROLLBACK attempt made
    ORA-06512: at "SYS.KUPW$WORKER", line 6983
    ORA-24795: Illegal ROLLBACK attempt made
    ORA-06512: at "SYS.KUPW$WORKER", line 2761
    ORA-24795: Illegal ROLLBACK attempt made
    ORA-24795: Illegal ROLLBACK attempt made
    ORA-06512: at "SYS.KUPW$WORKER", line 10804
    ORA-02354: error in exporting/importing data
    ORA-01891: Datetime/Interval internal error
    Job "SYSTEM"."SYS_EXPORT_FULL_56" stopped due to fatal error at 00:41:53
    ORA-39014: One or more workers have prematurely exited.
    The export files are generally 9-10 GB, and will work for one or two nights, and then fail for 2-3 night. The problem has been consistent, but will occasionally work. We are running Oracle 10g in a 2 server RAC environment, and the export will not work consistently on either server.
    Any help or suggestions would be appreciated.
    Harlyn

    914215 wrote:
    hey harlyn, did get any solution for this issue in datapump export...I have been facing this issue for a long time..followed many online forums but no luck...can you please share the resolution if u have..thanks in advance...post results from following SQL
    SELECT * FROM V$VERSION;

  • Compiling errors with modified SALOME module PKGBUILDS from AUR

    Good day,
    I am in the process of installing SALOME (6.4.0), a pre- and post-processor for differential equation solvers (FEM in my case).
    The source code is distributed as a single tar.gz file and inside one finds source directories for the various modules used.
    In AUR is available a set of old, outdated modules of SALOME 5.1.4 (here)
    So far, I have successfully compiled and installed the salome-kernel package by modifying the PKGBUILD to find the source locally on my computer. Apart from changing some version variables, all I needed to change was to add
    PYTHON=/usr/bin/python2
    to ./configure, since it looks for /usr/bin/python by default and this causes issues (I'm not sure why python2 and python3 exists, actually).
    I then proceeded to salome-med. I managed all of its non-salome dependencies and am now stuck on salome-gui which is also a dependency. I followed the same procedure, this time specifying both python and opencascade paths. ./configure seems to finish with no problems (a summary is shown and all deps are present) and after a bit of compiling it stops with the following errors:
    Plot2d.h:49:11: error: field 'text' has incomplete type
    Plot2d.h:51:78: error: invalid use of incomplete type 'struct QString'
    /usr/include/QtCore/qglobal.h:1525:7: error: forward declaration of 'struct QString'
    Plot2d.h:88:73: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:91:73: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:94:73: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:97:73: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:101:66: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:104:66: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:107:66: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:110:66: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:112:3: error: 'QPixmap' does not name a type
    Plot2d.h:115:3: error: 'QPixmap' does not name a type
    Plot2d.cxx: In constructor 'Plot2d_Point:lot2d_Point(double, double, const QString&':
    Plot2d.cxx:50:27: error: class 'Plot2d_Point' does not have any field named 'text'
    Plot2d.cxx: At global scope:
    Plot2d.cxx:388:92: error: 'QPixmap Plot2d::markerIcon(const QSize&, const QColor&, Plot2d::MarkerType)' should have been declared inside 'Plot2d'
    Plot2d.cxx:406:90: error: 'QPixmap Plot2d::lineIcon(const QSize&, const QColor&, Plot2d::LineType)' should have been declared inside 'Plot2d'
    Plot2d.cxx: In function 'bool Plot2d::existMarker(int, const QwtPlot*, QwtSymbol::Style, const QColor&, Qt:enStyle)':
    Plot2d.cxx:461:44: error: request for member 'style' in 'crv->QwtPlotCurve::symbol()', which is of non-class type 'const QwtSymbol*'
    make[2]: *** [libPlot2d_la-Plot2d.lo] Error 1
    make[2]: Leaving directory `/home/stefan/builds/salome-med/salome-med/DEPMAKER_DEPS/salome-gui/src/GUI_SRC_6.4.0/src/Plot2d'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/stefan/builds/salome-med/salome-med/DEPMAKER_DEPS/salome-gui/src/GUI_SRC_6.4.0/src'
    make: *** [all-recursive] Error 1
    I'm not sure what most of this means, since I know basically nothing about Qt (which seems to be the problem). I've read somewhere of someone having had problems with previous versions of salome using qwt 4 commands while the affected user had qwt 5, which made me suspect that maybe some Qt syntax changed since salome 6.4 was released. The documentation says that it was tested with Qt 4.6 and qwt 5.1. I have:
    Qt = 4.8
    pyqt = 4.9
    qwt = 6.01
    I attempted to look at some of the lines in the problem files but due to my lack of knowledge couldn't figure out anything. I do not suspect anyone here knows everything about SALOME but maybe someone who knows about Qt and the likes recognises what's wrong. The files showing errors are here:
    http://docs.salome-platform.org/salome_ … 2d_8h.html
    http://docs.salome-platform.org/salome_ … ource.html
    http://docs.salome-platform.org/salome_ … _8cxx.html
    http://docs.salome-platform.org/salome_ … files.html
    I'm using a 32bit processor, if it's relevant.
    I'll gladly and quickly supply any extra info.
    Thank you in anticipation,
    A.L.
    Last edited by ArseneLupin (2012-02-15 22:05:51)

    If the main app uses RSLs, the modules should not.  Use -static-rsls and
    extern the RSL classes.

  • Problem with modify command....

    Hi abapers,
    loop at itab.
    read table ifinal with key kunnr = itab-kunnr.
    if sy-subrc = 0.
    move: ifinal-dmbtr to itab-dmbtr.
    modify itab index sy-tabix.
    endif.
    endloop.
    Now the problem is that when i am using modify index sy-tabix it creating an additional entry
    and when i am using only modify itab its working fine so wat could be the reason that modify index sy-tabix is
    not working propertly.
    Thanks

    Hi Aarif,
    I am assuming there is one-to-one relationship between itab and ifinal.
    Try using following code.
    sort itab by kunnr.
    sort ifinal by kunnr.
    data: l_index like sy-tabix.
    l_index = 1.
    loop at itab.
      loop at ifinal from l_index.
         if ifinal-kunnr eq itab-kunnr.
            move: ifinal-dmbtr to itab-dmbtr.
        elseif ifinal-kunnr gt itab-kunnr.
           move sy-tabix to l_index.
           exit.
       endif.
    endloop.
      modify itab transporting dmbtr.
    endloop.
    Regards,
    Anil Salekar

  • Illegal State Exception with Servlets

    Hi Friends,
    I am using RequestDispatcher to forwrd my request from one servlet to another
    Here's the code
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class TryServlet extends HttpServlet
    public void service(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url="jdbc:odbc:con";
    Connection con= DriverManager.getConnection(url,"scott","tiger");
    Statement stmt=con.createStatement();
    ResultSet rst=stmt.executeQuery("select * from Projects");
    response.setContentType("text/html");
    PrintWriter out=response.getWriter();
    while (rst.next())
    String firstname=rst.getString("PIN");
    String lastname=rst.getString("ProjectTitle");
    out.println("<p> Name:"+firstname+" "+lastname+"");
    con.close();
    RequestDispatcher rd=getServletContext().getNamedDispatcher("HelloServlet");
    rd.forward(request,response);
    return;
    catch(Exception e)
    e.printStackTrace();
    I m getting the error
    java.lang.IllegalStateException: Cannot forward after response has been committed
    i need to include the two rows of tables before i forwad the request to HelloServlet
    What needs to be done?
    thanx
    Pooja

    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class TryServlet extends HttpServlet
    public void service(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url="jdbc:odbc:con";
    Connection con= DriverManager.getConnection(url,"scott","tiger");
    Statement stmt=con.createStatement();
    ResultSet rst=stmt.executeQuery("select * from Projects");
    response.setContentType("text/html");
    PrintWriter out=response.getWriter();
    while (rst.next())
    String firstname=rst.getString("PIN");
    String lastname=rst.getString("ProjectTitle");
    out.println("<p> Name:"+firstname+" "+lastname+"");
    con.close();
    RequestDispatcher rd=getServletContext().getNamedDispatcher("HelloServlet");
    rd.forward(request,response);
    return;
    catch(Exception e)
    e.printStackTrace();
    please explain your problem for more details???

  • Got error with newfs command for disk on a Storagetek ST2540.

    Hi,
    It's the first time that use forum and I have pour english language.
    I have Solaris 9 on Sunfire V480 with Qlogic HBA qla2340 connected to SAN ST2540.
    I have 3 LUNs on virtual disk on ST2540 (2 X 2TB and 1 about 730 GB).
    I can create a UFS file system on one of those 3 LUNs.
    A UFS file sytem of 2 TB.
    I got error on ohters like this.
    newfs /dev/rdsk/c6t3d2s0
    newfs: construct a new file system /dev/rdsk/c6t3d2s0: (y/n)? y
    Warning: 2128 sector(s) in last cylinder unallocated
    /dev/rdsk/c6t3d2s0: 4095981488 sectors in 666664 cylinders of 48 tracks, 128 sectors
    1999991.0MB in 4662 cyl groups (143 c/g, 429.00MB/g, 448 i/g)
    super-block backups (for fsck -F ufs -o b=#) at:
    32, 878752, 1757472, 2636192, 3514912, 4393632, 5272352, 6151072, 7029792,
    7908512,
    Initializing cylinder groups:
    ...........................write error on sector 1182585152: I/O error
    Log message in /var/adm/messages
    scsi: [ID 107833 kern.warning] WARNING: /pci@8,600000/QLGC,qla@1/sd@3,2 (sd99):
    SCSI transport failed: reason 'aborted': retrying command
    I don't know which trace look for.
    It is somebody has a idea?

    try the -T param for newfs. beware that you need a later edition of solaris 9.. 08/03 or so...
    Edited by: sid_sanders on Sep 12, 2008 2:47 PM

  • ORAOLEDB:Ora-2005 error with ADO command object

    Hello,
    I am using adodb.command object
    to make few insert queries in database.
    Provider is oledbora.oracle.
    Something like,
    vb sample code:
    dim varr(52)
    varr(1) = ----
    varr(2) = -----
    adodb.commandtext = xxxxxx
    call adodb.execute(,varr)
    I am receiving ora-2005 error.
    (implicit (-1) length not allowed)
    ###**** Interesting fact is, same piece
    of code is working with msdaora provider.

    Sameer, please direct OLEDB-related issues to the forum for OLEDB.

  • Suddenly getting bootstrap_register() errors with osascript commands

    Rarely but every so often my osascript commands start spitting back (for me) obscure errors--commands that tell me the iTunes current track, stream name, etc., various miscellany. Note that they do ordinarily work and have for quite some time. But for reasons I cannot fathom, this starts happening (a basic example):
    $ osascript -e 'tell application "iTunes" to stop'
    2009-01-11 03:44:03.443 osascript[974] CFLog (0): CFMessagePort:
    bootstrap_register(): failed 1100 (0x44c), port = 0x2103, name =
    'Processes-0.17563649'
    See /usr/include/servers/bootstrap_defs.h for the error codes.
    2009-01-11 03:44:03.443 osascript[974] CFLog (99):
    CFMessagePortCreateLocal(): failed to name Mach port
    (Processes-0.17563649)
    CFMessagePortCreateLocal failed (name = Processes-0.17563649
    error = 0)
    Abort trap
    They vary of course, but pretty much follow the model of the above whatever I try to do. I don't seem able to recover from this and get my osascript-ability back short of restarting the whole system. (This is not limited to iTunes. And I do wrap these up in shell scripts and the like, but the above is an actual verbatim example of what's happening to me right now.)
    Please forgive me: my searches haven't found the answer. Is there some process I can kill, anything else I can do here? Any idea why this happens in the first place?

    As a generic resolution of such memory issues, kindly
    please follow up the next steps by the same order:
    1.      
     Assure your memory configuration terms are
      with static values for min + max terms.
    2.      
     For max terms , please assure you assign the appropriate value according to your memory specs + how many SQL instances installed
    there on server
    3-     
     Then Schedule appropriately a
     memory recycling job to Run some  or all of the below commands but particularly more the first 2 ones
     DBCC FREESYSTEMCACHE
    ('ALL');
     DBCC DROPCLEANBUFFERS
     DBCC FREEPROCCACHE
     DBCC FREESESSIONCACHE
    4-      
     If you have low memory specs,
    you have try to reduce polling interval of this schedule .
    5-      
     Then configure the following notifications alerts
    by an appropriate
     polling interval  like 1 minute  :
    o  
     Memory grant queue waits _ Average wait time (ms) >0
    o   
     Memory grant queue waits _Waits started per second>0
    6-     
     Run your query again
    >>and follow up the alerts .
    7-     
     If you got alerted while executing your queries through
     more than attempt , then otherwise to :
     Enhance your query by seeking for examples the highest column sizes where they reduce TDS (Tabular Data stream packet) of query
    then reduce memory usage
     Or seeking more memory for the server
     Or seeking if your VM has got properly its assigned memory or not ..?
     Since VM either Hyper V or VM ware or..etc might suffer from a general overload on the whole of station hosting VMs ending up
    with such standstill cases for them
    Think more deeply of performance terms

  • I attempted to upgrade to iOS6 and received an error with a command to restore!? What do I do? I don't want to lose all my apps and details!

    Is there anything I can do NOT to lose my apps and info?
    This is the last straw! If I lose my apps I say bye bye to Apple!

    This is why it said on your phone, before it started to update to ensure you have backed up. There is no way arround the restore. This issue normall comes from the iPhione loosing charge during update or the update being corrupted during the download. The software your iPhone is having right now is inoperable and needsto be reinstalled. You'll be able to redownload all your Apps for free again, should they still be available in the appstore. But all the rest of your data must be on your Computer or iCloud, or you to load them onto your phone again.

  • Error with dbms_xslprocessor.clob2file

    Hi all!
    I am experiencing an error with this command
    dbms_xslprocessor.clob2file(v_xml,'DIR','1.xml');
    where:
    v_xml is a clob ( it is well formed and with data)
    DIR is the directory where i want to output the data, it has beeen created with: EXECUTE IMMEDIATE 'create or replace directory DIR ' ||' as ' || '''D:\XMLFILES''';
    and i don't have any error in this command
    1.xml is the name of the file.
    The errors i get when i execute that command are the following:
    ORA-29283 invalid file operation
    ORA-06512 at "SYS.UTL_FILE" line 451
    ORA-29283 invalid file operation
    ORA-06512 at "XDB.DBMS_XSlPROCESSOR" line 58
    ORA-06512 at "DBA_TEST.PRUEBA_TEST" line 106
    ORA-06512 at line 2
    thx in advance!!!

    Hi, excuse me for taking so long time to respond, but yesterday i had a mayor issue to solve, but now i am again with this problem.
    I'm gonna put some more code.
    The database is in another location, and i want to write the data in a local drive, so maybe this is important for the code.
    I will put the full code so maybe there is something else important here:
    CREATE OR REPLACE PROCEDURE DBA_TEST.PRUEBA_TEST AS
    v_select VARCHAR2(2000);
    v_ctx DBMS_XMLGen.ctxHandle;
    v_xml CLOB;
    v_more BOOLEAN := TRUE;
    xmldoc dbms_xmldom.DOMDocument;
    DIR VARCHAR2(200);
    v_DIR VARCHAR2(200);
    BEGIN
    EXECUTE IMMEDIATE 'create or replace directory DIR ' ||' as ' || '''D:\XMLFILES''';
    v_DIR := DIR;
    v_select := ' select nombre, direccion, dni from clientes where anio = 2009';
    v_ctx := DBMS_XMLGen.newContext(v_select);
    DBMS_XMLGen.setRowsetTag(v_ctx, 'rec_decla');
    DBMS_XMLGen.setRowTag(v_ctx, '');
    v_xml := DBMS_XMLGen.GetXML(v_ctx);
    DBMS_XMLGen.closeContext(v_ctx);
    dbms_xslprocessor.clob2file(v_xml,v_DIR,'1.xml');
    DBMS_LOB.FREETEMPORARY(v_xml);
    END;
    Remeber that the data are in another location, no local, and i need to output these xml in the D:\XMLFILES directory.
    I tried to grant permisions
    GRANT READ, WRITE ON DIRECTORY TO DBA_USER
    , but it said that i can't give permision to itself..
    maybe there is another way to write these files witout using:
    dbms_xslprocessor.clob2file(v_xml,v_DIR,'1.xml');
    but i would like to use it.
    Thx all!!!

  • Illegal State Exception in JSP login

    I had a working log in/check password systems for a low security application. User types in username and password and this is sent to the checkpassword.jsp. Using Server variables I counted the number of attempts and if it was more than three, they were not allowed to try again that session. When I moved this page to newer version of Tomcat running in Apache rather than over IIS, my simple counting function no longer works and I can't for the life of me understand why I'm getting an Illegal State Exception with the following code:
    java.sql.ResultSet RS=statement.executeQuery("Select WUUSER, WUPWD FROM WEBUSER WHERE WUUSER='"+ (request.getParameter("username").toUpperCase()) + "' AND WUPWD= '" + (request.getParameter("password")) +"'");
    HttpSession ViewProtectedPage = request.getSession(true);
    HttpSession UserSession = request.getSession(true);
    if (RS.next())
    ViewProtectedPage.putValue("password","correct");
    //HttpSession UserSession = request.getSession(true);
    //allows username to be entered in upper or lower case
    UserSession.putValue("username",(request.getParameter("username")).toUpperCase());
    response.sendRedirect("tracking.jsp");
    else
    ViewProtectedPage.putValue("password","false");
    if (ViewProtectedPage.getValue("trycount")==null) {
    ViewProtectedPage.putValue("trycount","1");
    response.sendRedirect("loadtrackbadlogin.html");
    if (ViewProtectedPage.getValue("trycount")=="1") {
    ViewProtectedPage.putValue("trycount","2");
    response.sendRedirect("loadtrackbadlogin.html");
    if (ViewProtectedPage.getValue("trycount")=="2") {
    ViewProtectedPage.putValue("trycount","3");
    response.sendRedirect("loadtrackbadlogin.html");
    if (ViewProtectedPage.getValue("trycount")=="3") {
    response.sendRedirect("noentry.html");
    RS.close();
    It works fine if the user uses the proper username and password but crashes on me if they use the wrong info. I think it has something to do with my initialization of the user variables.

    I don't know that this is the root cause of your problem, but it certainly could be. When comparing two strings, you need to use the .equals() method, not ==.
    (except in the null case, where checking for null with == is perfectly okay).
    if (ViewProtectedPage.getValue("trycount").equals("1")
    ..etc
    Some other notes... use if/else if/else rather than a whole bunch of ifs, since all your statements are mutually exclusive. Maybe even put those lower ifs inside your outer "else" since you're obviously not going to reach them after a sendRedirect(). On that same note, place a return; after the sendRedirect() to state that the rest of the page need not be loaded/executed.

  • SQL error msg - The DELETE statement conflicted with the SAME TABLE REFERENCE constraint

    Executed as user: ****. The DELETE statement
    conflicted with the SAME TABLE REFERENCE constraint "FK_PARENT_TASK_REF".
    The conflict occurred in database "****", table "****", column
    'PARENT_TASK_ID'. [SQLSTATE 23000] (Error 547) The statement has been
    terminated. [SQLSTATE 01000] (Error 3621). The step failed.
    Does this error msg indicate the whole script failed to execute or was it just a single step/task that failed ?
    What does error msg mean ?
    Anyway to prevent this error msg and ensure script runs successfully

    Hi mdavidh,
    This error occurs because the record  'PARENT_TASK_ID' was referenced by 'FK_PARENT_TASK_REF'.
    Please refer below codes:
    CREATE TABLE MyTable (
    ID INT, primary key(ID), -- primary key
    ID_Parent INT foreign key(ID_Parent) references MyTable(ID), -- foreign key reference the same table
    insert into MyTable(ID,ID_Parent)
    values(0,0);
    insert into MyTable(ID,ID_Parent)
    values(1,0);
    insert into MyTable(ID,ID_Parent)
    values(2,0);
    insert into MyTable(ID,ID_Parent)
    values(3,1);
    insert into MyTable(ID,ID_Parent)
    values(4,3);
    insert into MyTable(ID,ID_Parent)
    values(5,4);
    CREATE TRIGGER MyTrigger
    on MyTable
    instead of delete
    as
    set nocount on
    update MyTable set ID_Parent = null where ID_Parent in (select ID from deleted)
    delete from MyTable where ID in (select ID from deleted)
    Now we could delete records.
    delete from MyTable where ID_Parent=0
    Thanks,
    Candy Zhou

Maybe you are looking for

  • Error while performing SSO with java application

    hi ALL , I got rhe following error when i call a java application in portal  using ticket logon sso Exception report message Internal Server Error description The server encountered an internal error (Internal Server Error) that prevented it from ful

  • Create a new layout for VF04

    hi all, how can i create a new layout apart from the standard for VF04 ( maintain billing due list ) , reason being the user does not require all the fields which are on display in the std one. Hence forth i want to create a new user specific layout.

  • 5s How to determine which version of operating system is currently installed

    How can I determine which version of the operating system is currently installed in my 5s without having to go to iTunes using my PC?

  • Strange noise

    hi, I have got an intel based iMac with 2.4ghz core two duo, 2 gb ram and an upgraded 750gb HD. Coming to the point, when i run windows xp on bootcamp, and i play need for speed under ground two which doesnt use alot of the hardwarr resource, i hear

  • Can't install iTunes on my new Vista-PC

    I bought my Dell Notebook 2 months ago. It's with Vista Home Premium (no upgrade from XP, Vista installed from the beginning) and runs fine so far. But I've got no chance installing iTunes - seems to be simply impossible (it tells something of "Visua