Replacement for UTIL_FILE exception of NO_DATA_FOUND

A few years ago, I had code that processed an exception called: UTL_FILE.NO_DATA_FOUND. In fact, I have used this in cursors as well and have found that this does not work. What is the replacement?

I am responding to my own question. Looks like it was changed to UTIL_FILE.NO_DATA_FOUND to NO_DATA_FOUND.
Sorry for the question.
Thanks

Similar Messages

  • Double Factory pattern purposal as replacement for Double Check #2

    Hi All,
    Here is the code for the pattern proposal, its intended as a replacement for double checked locking, which was proved to be broken in 2001. Here is the code...
    public class DoubleFactory {
       private static Object second_reference = null;
       public static Object getInstance() {
          Object toRet = second_reference;
             if (toRet == null) {
                second_reference = CreationFactory.createInstance();
                toRet = second_reference;
          return toRet;
       private DoubleFactory() {}
    public class CreationFactory {
       private static Object instance = null;
       public static synchronized Object createInstance() {
          if (instance == null) {
             instance = new Object();
          return instance;
      }Also I have spent several months discussing this with Peter Haggar, who believes that this code is not guaranteed to work. However I have been unable to discern from his message why he believes this will not be guaranteed to work, and I am posting this here to attempt to find a clearer explanation or confirmation that the pattern I am purposing (Double Factory) is guaranteed to work.
    Thanks,
    Scott
    ---------------------------- Original Message ----------------------------
    Subject: Re: [Fwd: Double Factory replacement for Double Check #2] From:
    "Scott Morgan" <[email protected]>
    Date: Fri, January 25, 2008 10:36 pm
    To: "Peter Haggar" <[email protected]>
    Hi Peter,
    I appologize if my last response came accross as rude or something. If
    my code is not guaranteed to work ok, can you help me understand why. I
    am after all looking for a solution for all of us.
    If my solution is wrong as you say because the member variables of the
    singleton are not up to date. I understand this to mean that the
    second_reference pointer is assigned to the memory where the instance
    object will get created before the instance object even starts the
    creation process (when the jvm allocates memory and then enters the
    constructor method of the Singleton). This doesn't seem possible to me.
    Can you refrase your statments, to help me understand your points?
    If not I am happy to turn to the original wiki for discussion.
    Thanks for your effort,
    Scott
    Thanks for asking my opinion, many times, then telling me I'm
    wrong...wonderful. You are a piece of work my friend. For what it'sworth, your email below shows you still don't understand these issues
    or what I was saying in my emails. I've been more than patient.
    >
    All the best. And by the way, your code is not guaranteed to work. It's not just me that's "wrong", it's also the engineers at Sun who
    designed Java, the JVM, and the memory model, and countless people who
    have studied it. I'm glad you have it all figured out.
    >
    Peter
    "Scott Morgan" <[email protected]>
    01/18/2008 12:47 PM
    Please respond to
    [email protected]
    To
    Peter Haggar/Raleigh/IBM@IBMUS
    cc
    Subject
    Re: [Fwd: Double Factory replacement for Double Check #2]
    Hi Peter,
    Thanks I understand your position now. However am I still believe that
    it will work and be safe;
    1) the Singleton you show would be fully constructed (having exited theSingleton() method) before the createInstance() method would have
    returned.
    2) The second_reference could not be assigned until the createInstance()
    method returns.
    3) So by the time second_reference points to Singleton all of the valueswill be set.
    >
    >
    I do understand that if the createInstance method was not synchronized(at the CreationFactory class level) that my logic would be flawed, but
    since there is synchronization on that method these points are true, and
    your comments about up-to-date values are not accurate.
    >
    Cheers,
    Scott
    >In your listing from your latest email T2 does encounter a sync block
    on createInstance.
    >>>>
    No. T2 will call getInstance and see second_reference as non-null.second_reference was made non-null by T1.
    >>
    >>>>
    What are you exactly are you refering to with the phrase 'up-to-datevalues'?
    >>>>
    Assume my singleton ctor is thus:
    public class Singleton
    private int i;
    private long l;
    private String str;
    public Singleton()
    i = 5;
    l = 10;
    str = "Hello";
    T2 will get a reference to the Singleton object. However, because youaccess second_reference without synchronization it may not see i as 5,
    l as 10 and str as "Hello". It may see any of them as 0 or null. This
    is not the out of order write problem, but is a general visibility
    problem because you are accessing a variable without proper
    synchronization.
    >>
    Peter
    "Scott Morgan" <[email protected]>
    01/16/2008 11:38 PM
    Please respond to
    [email protected]
    To
    Peter Haggar/Raleigh/IBM@IBMUS
    cc
    Subject
    Re: [Fwd: Double Factory replacement for Double Check #2]
    Hi Peter,
    In your listing from your latest email T2 does encounter a sync blockon createInstance.
    >>
    What are you exactly are you refering to with the phrase 'up-to-datevalues'?
    In this code the Singleton should also be
    A) non mutable (as in the instance of class Object in the example).
    If the singleton was more complex then the code to populate it'svalues
    would go inside the sync of createInstance().
    B) mutable with synchronization on it's mutator methods.
    In your article you mention out of order writes, which doesn't occurin
    this code.
    Cheers,
    Scott
    You read it wrong.
    - T1 calls getInstance which in turn calls createInstance.
    - T1 constructs the singleton in createInstance and returns to
    getInstance.
    - T1 sets second_reference to the singleton returned in getInstance. -T1 goes about its business.
    - T2 calls createInstance.
    - T2 sees second_reference as non-null and returns it
    - Since T2 accessed second_reference without sync, there is noguarantee
    that T2 will see the up-to-date values for what this object refers to.
    - Therefore the code is not guaranteed to work.
    >>>
    If this is not clear:
    - Re-read my email below
    - Re-read my article
    - If still not clear, google on Double Checked Locking and readanything
    from Brian Goetz or Bill Pugh.
    Peter
    "Scott Morgan" <[email protected]>
    01/13/2008 05:26 AM
    Please respond to
    [email protected]
    To
    Peter Haggar/Raleigh/IBM@IBMUS
    cc
    Subject
    Re: [Fwd: Double Factory replacement for Double Check #2]
    Hi Peter,
    Thanks for the reply, I don't see how T2 would see the a referenceto
    a
    partialy initialized object before the createInstance() method had
    returned. If T1 was in createInstance() when T2 entered
    getInstance(), T2 would wait on the CreationFactory's class monitor to
    wait to enter createInstance().
    Or in other words in the line of code ....
    second_reference = CreationFactory.createInstance();
    The pointer second_reference couldn't be assigned to the singleton
    instance when the synchronized createInstance() had fully constructed,initialized and returned the singleton instance. Before that the the
    second_reference pointer would always be assigned to null. So any
    thread entering getInstance() before createInstance() had returned
    (for the first time) would wait on the CreationFactory's class monitor
    and enter the createInstance() method.
    >>>
    So T2 will wait for T1.
    Cheers,
    Scott
    PS I think I am writing requirements for my next project :)
    Sorry for the delay...been in all day meetings this week.
    You are correct...I had been reading your code wrong, my apologies.
    My explanations, although correct, did not exactly correspond to your
    code.
    However, the code is still not guaranteed to work. Here's why:
    Assume T1 calls getInstance() which calls createInstance() and returnsthe
    singelton. It then sets second_reference to refer to that singleton.
    So
    far, so good. Now, T2 executes and calls getInstance(). It can see
    second_reference as non-null, so it simply returns it. But, there
    was
    no
    synchronization in T2's code path. So there's no guarantee that even
    if
    T2 sees an up-to-date value for the reference, that it will seeup-to-date
    values for anything else, ie what the object refers to...it's
    instance data. If T2 used synchronization, it would ensure that it
    read
    up-to-date
    values when it obtained the lock. Because it didn't, it could see
    stale
    values for the object's fields, which means it could see a partially
    constructed object.
    >>>>
    In the typical double-checked locking, the mistake is to assume theworst
    case is that two threads could race to initialize the object. But
    the worst case is actually far worse -- that a thread uses an object
    which
    it
    believes to be "fully baked" but which is in fact not.
    Peter
    "Scott Morgan" <[email protected]>
    01/03/2008 06:33 PM
    Please respond to
    [email protected]
    To
    Peter Haggar/Raleigh/IBM@IBMUS
    cc
    Subject
    Re: [Fwd: Double Factory replacement for Double Check #2]
    Hi Peter,
    Thanks for responding, I am still thinking that your mis
    interpreting
    the code so I have rewritten it here (Replacing
    DoubleFactory.instance with DoubleFactory.second_reference for
    clarity). If the T1 burps (gets interrupted) in the createInstance
    method it wouldn't have returned so the second_reference pointer
    would have never been
    assigned
    so T2 would just try again upon entering the getInstance method. Orif
    it had already entered getInstance it would be waiting to enter
    (until T1 releases the lock on CreationFactory.class ) on the
    createInstance method.
    >>>>
    public class DoubleFactory {
    private static Object second_reference = null;
    public static Object getInstance() {
    Object toRet = second_reference;
    if (toRet == null) {
    second_reference =
    CreationFactory.createInstance();
    toRet = second_reference;
    return toRet;
    private DoubleFactory() {}
    public class CreationFactory {
    private static Object instance = null;
    public static synchronized Object createInstance() {
    if (instance == null) {
    instance = new Object();
    return instance;
    Does this clear up my idea at all?
    second_reference should be always pointing to
    null
    or
    a fully initialized Object
    (also referenced by the pointer named 'instance' ), I don't see howit would end up partially initialized.
    >>>>
    Thanks Again,
    Scott
    "It" refers to T2.
    Your createInstance method is identical to my Listing 2 and is fine
    and
    will work.
    Yes, the problem with your code is in getInstance.
    >I don't see how the DoubleFactory getInstance method could bereturning
    a partially initialized object at this point. If CreationFactoryalways
    returns a fully initialized object and DoubleFactory only assigns a
    new
    reference/pointer to it how could DoubleFactory getInstance return a
    reference/pointer to partially initialized object?
    >>>>>>>
    >>>>>
    The reason it is not guaranteed to work is explained in my previousemails
    and in detail in the article. However, I'll try again. Anytime you
    access shared variables from multiple threads without proper
    synchronization, your code is not guaranteed to work. Threads are
    allowed
    to keep private working memory separate from main memory. There are
    2
    distinct points where private working memory is reconciled with main
    memory:
    - When using a synchronized method or block - on acquisition of thelock
    and when it is released.
    - If the variable is declared volatile - on each read or write of
    that
    volatile variable. (Note, this was broken in pre 1.5 JVMs which isthe
    reason for the caveat I previously mentioned)
    Your createInstance method uses synchronization, therefore, the
    reconciliation happens on lock acquisition and lock release. T1 can
    acquire the lock in createInstance, make some updates (ie create an
    object, run it's ctor etc), but then get interrupted before exiting
    createInstance and therefore before releasing the lock. Therefore,
    T1
    has
    not released the lock and reconciled its private working memory withmain
    memory. Therefore, you have ZERO guarantee about the state of mainmemory
    from another threads perspective. Now, T2 comes along and accesses
    "instance" from main memory in your getInstance method. What will
    T2
    see?
    Since it is not properly synchronized, you cannot guarantee that T2sees
    the values that T1 is working with since T1 may not have completely
    flushed its private working memory back to main memory. Maybe it
    did completely flush it, maybe it didn't. Since T1 still hold the
    lock,
    you
    cannot guarantee what has transpired. Maybe your JVM is not usingprivate
    working memory. However, maybe the JVM your code runs on does or
    will
    some day.
    Bottom line: Your code is not properly synchronized and is notguaranteed
    to work. I hope this helps.
    Peter
    "Scott Morgan" <[email protected]>
    01/03/2008 12:49 PM
    Please respond to
    [email protected]
    To
    Peter Haggar/Raleigh/IBM@IBMUS
    cc
    Subject
    Re: [Fwd: Double Factory replacement for Double Check #2]
    Hi Peter,
    Thanks for your response, I don't follow what 'it' refers to in
    the
    phrase 'It can see'. So for the same reason that you state that
    example 2 from your article I believe this class CreationFactory to
    work flawlessly when a client object calls the createInstance
    method.
    >>>>>
    I see this CreationFactory code as identical to your example 2 doyou agree with this?
    >>>>>
    public class CreationFactory {
    private static Object instance = null;
    public static synchronized Object createInstance() {
    if (instance == null) {
    instance = new Object();
    return instance;
    }Then my rational in the DoubleFactory class is that it can obtain a
    reference/pointer to the fully initialized object returned bycalling the above code. I believe you think that the problem with
    my code is
    in
    the DoubleFactorys getInstance method, is this correct?
    I don't see how the DoubleFactory getInstance method could bereturning
    a partially initialized object at this point. If CreationFactory
    always
    returns a fully initialized object and DoubleFactory only assigns a
    new
    reference/pointer to it how could DoubleFactory getInstance return a
    reference/pointer to partially initialized object?
    >>>>>
    Thanks again,
    Scott
    public static synchronized Singleton getInstance() //0
    if (instance == null) //1
    instance = new Singleton(); //2
    return instance; //3
    This above code is fine and will work flawlessly.
    Annotating my paragraph:
    T1 calls getInstance() and obtains the class lock at //0. T1 "sees"
    instance as null at //1 and therefore executes: instance = new
    Singleton() at //2. Now, instance = new Singleton() is made up of
    several lines of non-atomic code. Therefore, T1 could be
    interrupted
    after Singleton is created but before Singleton's ctor isrun...somewhere
    before all of //2 completes. T1 could also be interrupted after
    //2 completes, but before exiting the method at //3. Since T1 has
    not
    exited
    its synchronized block it has not flushed its cache. Now assume T2
    then
    calls getInstance().
    All still true to this point. However, with your code the nextparagraph
    is possible, with the code above, it's not. The reason is that T2
    would
    never enter getInstance() above at //0 because T1 holds the lock. T2will
    block until T1 exits and flushes it's cache. Therefore, the code
    above
    is
    properly thread safe.
    It can "see" instance to be non-null and thus
    return it. It will return a valid object, but one in which its ctor
    has
    not yet run or an object whose
    values have not all been fully flushed since T1 has not exited itssync
    block.
    "Scott Morgan" <[email protected]>
    01/02/2008 06:10 PM
    Please respond to
    [email protected]
    To
    Peter Haggar/Raleigh/IBM@IBMUS
    cc
    Subject
    Re: [Fwd: Double Factory replacement for Double Check #2]
    Hi Peter,
    Thanks for the response I understand the rational for inventing
    the
    double check anti pattern, I am sorry I still don't understand the
    difference between your solution #2 and my CreationFactory class.
    >>>>>>
    From your article figure 2.public static synchronized Singleton getInstance() //0
    if (instance == null) //1
    instance = new Singleton(); //2
    return instance; //3
    If I understand your email correctly this figure 2 is also flawed,since...
    >>>>>>
    T1 calls getInstance() and obtains the class lock at //0. T1 "sees"
    instance as null at //1 and therefore executes: instance = new
    Singleton() at //2. Now, instance = new Singleton() is made up ofseveral lines of non-atomic code. Therefore, T1 could be
    interrupted
    after Singleton is created but before Singleton's ctor isrun...somewhere
    before all of //2 completes. T1 could also be interrupted after
    //2 completes, but before exiting the method at //3. Since T1 has
    not
    exited
    its synchronized block it has not flushed its cache. Now assume T2
    then
    calls getInstance(). It can "see" instance to be non-null and thus
    return it. It will return a valid object, but one in which its
    ctor
    has
    not yet run or an object whose
    values have not all been fully flushed since T1 has not exited itssync
    block.
    So is #2 is also flawed for this reason?
    If so please revise your article, since I interpreted #2 as a
    plausible
    solution recommended by you (which lead me to the DoubleFactory
    idea).
    If not please help me understand the difference between #2 and my
    CreationFactory class.
    >>>>>>
    Thanks,
    Scott
    #2 is in Listing 2 in the article. What I meant was to forget the
    DCL
    idiom, and just synchronize the method...that's what listing 2
    shows.
    DCL
    was invented to attempt to get rid of the synchronization for 99.9%
    of
    the
    accesses.
    The solution I outlined in my email is using the DCL idiom, but on
    a
    1.5
    or later JVM and using volatile.
    You solution is not guaranteed to work. Here's why:
    public class DoubleFactory {
    private static Object instance = null;
    public static Object getInstance() {
    Object toRet = instance;
    if (toRet == null) {
    instance =
    CreationFactory.createInstance();
    toRet = instance;
    return toRet;
    private DoubleFactory() {}
    public class CreationFactory {
    private static Object instance = null;
    public static synchronized ObjectcreateInstance()
    //1
    if (instance == null) {
    instance = new Object(); //2
    return instance;
    } //3
    }T1 calls createInstance() and obtains the class lock at //1. T1"sees"
    instance as null and therefore executes: instance = new Object() at//2.
    Now, instance = new Object() is made up of several lines of
    non-atomic
    code. Therefore, T1 could be interrupted after Object is created
    but
    before Object's ctor is run...somewhere before all of //2
    completes.
    T1
    could also be interrupted after //2 completes, but before exiting
    the
    method at //3. Since T1 has not exited its synchronized block ithas
    not
    flushed its cache. Now assume T2 then calls getInstance(). It can"see"
    instance to be non-null and thus return it. It will return a
    valid object, but one in which its ctor has not yet run or an
    object
    whose
    values have not all been fully flushed since T1 has not exited itssync
    block.
    The bottom line is that if you are accessing shared variables
    between
    multiple threads without proper protection, you are open for aproblem.
    Proper protection is defined as: proper synchronization pre 1.5,
    and
    proper synchronization or proper use of volatile 1.5 or after.
    Therefore, if you must use the DCL idiom you have one option: -
    Use DCL with volatile on a 1.5 or later JVM.
    >>>>>>>
    You can also forget about DCL and just use synchronization (listing2
    in
    my article) or use a static field (listing 10 in my article).
    I hope this clears it up.
    Peter
    "Scott Morgan" <[email protected]>
    01/02/2008 04:00 PM
    Please respond to
    [email protected]
    To
    Peter Haggar/Raleigh/IBM@IBMUS
    cc
    Subject
    Re: [Fwd: Double Factory replacement for Double Check #2]
    Hi Peter,
    I apologies for not understanding but I don't see what is
    different
    between the solution you purposed...
    2) Don't use DCL but use synchronization
    and the code that I am putting forward. Perhaps I do just notunderstand
    but you seem to be contradicting yourself in this email?
    I understand that you are saying in #2 that this will always 'work'
    with
    out any issues...
    public static Object instance = null;
    public static synchronized Object getInstance() {
    if (instance == null) {
    instance = new Object();
    return instance;
    But first you seem to say in the email that if T1 gets
    interrupted
    it
    may leave the instance pointing to a partially initialized object?
    So as far as I understand it the createInstance method in my
    CreationFactory class should be successful (always retuning a
    fully initialized object) for the same reason #2 is successful.
    Please keep in mind that there are two different instancepointers
    in
    the code I sent you, one is part of the DoubleFactory class and
    the other is part of the CreationFactory class.
    >>>>>>>
    Thanks for your time, just looking for better solutions!
    Scott
    Scott,
    Your solution is not guaranteed to work for various reasons
    outlined
    in
    the article. For example, you can still return from your code apartially
    initialized object. This can occur if T1 gets interrupted beforeleaving
    the synchronized method createInstance() and T2 calls
    getInstance().
    T2
    can "see" toRet/instance as non-null but partially initialized
    since
    T1
    has not fully flushed its values.
    As of 1.5, Sun fixed various issues with the memory model that
    were
    broken. Double Checked Locking will still break unless you usevolatile
    (which was fixed in 1.5). Therefore, the following code works:
    volatile Helper helper;
    Helper getHelper() {
    if (helper == null)
    synchronized(this) {
    if (helper == null)
    helper = new Helper();
    return helper;
    but the original DCL idiom will not work. So, your options are:
    1) Use DCL with volatile (above)
    2) Don't use DCL but use synchronization
    3) Don't use DCL, but use a static field.
    #2 and #3 are outlined in my article from 2002.
    Hope this helps,
    Peter
    "Scott Morgan" <[email protected]>
    12/26/2007 04:12 PM
    Please respond to
    [email protected]
    To
    Peter Haggar/Raleigh/IBM@IBMUS
    cc
    Subject
    [Fwd: Double Factory replacement for Double Check #2]
    Hi Peter,
    Thanks for the article on the out of order write problem. Whatdo
    you
    think of this as a solution?
    TIA,
    Scott
    ---------------------------- Original Message----------------------------
    Subject: Double Factory replacement for Double Check #2
    From: "Scott Morgan" <[email protected]>
    Date: Wed, December 26, 2007 2:55 pm
    To: [email protected]
    Hi Ward,
    Here is a pattern submission
    Double Factory
    Lazy initialization of singletons in accepted for a while usingthe
    double check pattern. However it has been discovered that the
    double
    check pattern isn't thread safe because of the out of order write
    problem. This problem occurs when Threads entering the Singleton
    Factory method return with a fully constructed, but partially
    initialized, Singleton object.
    >>>>>>>>
    Therefore: It makes sense to look for a way to initializeSingletons
    in
    a Lazy and Thread Safe manor. The following illustrates a fairly
    simple
    solution...
    package foo;
    public class DoubleFactory {
    private static Object instance = null;
    public static Object getInstance() {
    Object toRet = instance;
    if (toRet == null) {
    instance =
    CreationFactory.createInstance();
    toRet = instance;
    return toRet;
    private DoubleFactory() {}
    public class CreationFactory {
    private static Object instance = null;
    public static synchronized ObjectcreateInstance()
    if (instance == null) {
    instance = new Object();
    return instance;
    This gets around the out of order write problem because all
    Threads
    waiting on the CreationFactory's Class monitor will have a fully
    constructed and initialized instance when they actually exit the
    createInstance method.
    >>>>>>>>
    >>>>>>>>
    During runtime while the Singleton instance is getting created(constructed and initialized) there may be a few Threads waiting
    on
    the
    CreationFactory Class's objects monitor. After that period all
    the
    Treads
    accessing
    the Singleton will have unsynchronized reads to the instance,
    which
    will
    optimize execution.
    References:
    http://www.ibm.com/developerworks/java/library/j-dcl.html
    Copyright 2007 Adligo Inc.

    Scott-Morgan wrote:
    Hi All,
    Thanks for your comments, here are some more....
    jtahlborn you state that
    the only way to guarantee that a (non-final) reference assignment is visible across threads is through the use of volatile and synchronized,
    From the jvm spec
    http://java.sun.com/docs/books/jls/third_edition/html/memory.html
    17.4.1 Shared Variables
    Memory that can be shared between threads is called shared memory or heap memory.
    All instance fields, static fields and array elements are stored in heap memory.
    Since both the second_reference and instance fields are both static, they are shared and visible across all threads.Yes, all these things are shared across threads, however, if you keep reading, there is a notion of "correct" sharing. obviously these values may be visible, that's why double-checked locking was used for so long before people realized it was broken. it worked most of the time, except when it didn't, and that's what i'm trying to show. that the only way to correctly share state between threads is via synchronization points, the most common being volatile and synchronized (there are a couple of other less used ones which don't apply here). The articles you linked to below from ibm cover the "visibility" in great depth, this is exactly what i am referring to.
    You also state that volatile is a solution, but you seem to rebut your self in stating that the overhead for volatile is almost as great as synchronization.
    This article illustrates the solution, and also comments on the overhead of volatile.
    http://www.ibm.com/developerworks/library/j-jtp03304/
    linked from
    http://www.ibm.com/developerworks/java/library/j-dcl.html
    volatile is a solution, in that it is correct, and you avoid the appearance of synchronization each time. however, since the semantics of volatile were strengthened in the new memory model, using volatile will perform practically (if not exactly) the same as simply synchronizing each time. the article you link to says exactly this under the heading "Does this fix the double-checked locking problem?".
    Also could you be more specific about the example at the end of the jvm memory spec page, like a section number?It's the very last thing on the page, the "discussion" under 17.9, where it mentions that changes to "this.done" made by other threads may never be visible to the current thread.

  • FOR LOOP EXCEPTION not working !!! please help

    Hi,
    Why is the NO_DATA_FOUND execption not getting executed. ????
    Hereis the code....
    CURSOR newreccur IS
    SELECT * from emp_table;
    BEGIN
    v_file_handle := UTL_FILE.FOPEN('out','new.dat','W');
    BEGIN
    FOR emp_rec IN newreccur LOOP
    -- Write procurement records
    UTL_FILE.PUT(v_file_handle,'emp_rec.num');
    END LOOP;
    EXCEPTION WHEN NO_DATA_FOUND THEN
    dbms_output.put_line ('No data found ')
    END;
    EXCEPTION
    WHEN UTL_FILE.INVALID_PATH
    THEN
    DBMS_OUTPUT.PUT_LINE ( 'Invalid Path ' || TO_CHAR (SQLCODE) );
    UTL_FILE.FCLOSE_ALL;
    END;

    cursor for loops do not raise no_DatA_found - they simply stop looping when they run out of data. you can set a variable within the loop, and then check it after the loop if you need to know if data was returned or not.

  • Replacement for obsolete 'FM NAMETAB_GET'

    Hi,
       We have been upgrading SAP from 4.6B to ECC6.0...During this process we have encountered an obsolete 'FM NAMETAB_GET', but as no documentation is available for the same, we are looking for an alternative / replacement for the 'FM NAMETAB_GET'...All suggestions are welcome...
    Thanks in advance

    Hi Nishant,
    here is the sample code for the function module NAMETAB_GET
    data:    begin of nametab occurs 60.
          include structure dntab.
    data:    end of nametab.
    call function 'NAMETAB_GET'
       exporting
         langu          = sy-langu
        tabname        = table
      tables
         nametab        = nametab
       exceptions
        no_texts_found = 1.
    REPLACEMENT
    data:    begin of nametab occurs 60.
            include structure DFIES.
    data:    end of nametab.
    CALL FUNCTION 'DDIF_NAMETAB_GET'
      EXPORTING
        TABNAME           = table
    TABLES
       DFIES_TAB         = nametab
    EXCEPTIONS
       NOT_FOUND         = 1
       OTHERS            = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    rewards if useful......

  • Exception when no_data_found then variable =: 'Text field of my choice'

    Hi,
    I have an exception in a package I have created. The package compiles fine but when I test it nothing is returned. I want TEXT 'NULL' to be returned as I'll use this in a lookup later on.
    EXCEPTION WHEN no_data_found THEN
      v_Passangers                  :='NULL';
      v_Third_Party                 :='NULL';
      v_Witnesses                   :='NULL'; 
      v_Authorities                 :='NULL';
    begin
      MyPackage.Load_Context_1(355271);
      dbms_output.put_line('v_Passangers : '||MyPackage.v_Passangers );
      dbms_output.put_line('v_Third_Party : '||MyPackage.v_Third_Party );
      dbms_output.put_line('v_Witnesses   : '||MyPackage.v_Witnesses  );
      dbms_output.put_line('v_Authorities   : '||MyPackage.v_Authorities );
    end;RETURNS:
    v_Passangers:
    v_Third_Party:
    v_Witnesses:
    v_Authorities:                       I Would Like:
    v_Passangers: NULL
    v_Third_Party: NULL
    v_Witnesses: NULL
    v_Authorities: NULLThanks!!!
    Banner:
    Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE 11.2.0.2.0 Production"
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    Hi,
    First question, why have you posted this to the AQ forum? It is more of a PL/SQL question.
    However, in response - how do you know that NO_DATA_FOUND is actually occurring? How are thes package variables declared?
    Can you upload the contents of this package ? MyPackage.Load_Context_1(355271);
    I don't like the use of the word NULL - it leads to mass confusion, the word should mean what it means to Oracle, there are several other ways of acheiving this which I think would be better practice, for instance - it would be much betetr to have these variables returned as OUT parameters from the procedure rather than package level variables.
    Thanks
    Paul

  • Replacement for Upload FM.

    hi,
       Kindly tell me what is the replacement for the UPLOAD Func. Module.
    If it is GUI_UPLOAD.
    Then what is the replacement code for this
    CALL FUNCTION 'UPLOAD'
           EXPORTING
                filename            = p_xtract
                filetype            = 'DAT'
                item                = 'Upload SBA Input File'(005)
           IMPORTING
                act_filename        = p_xtract1
           TABLES
                data_tab            = itab_data
           EXCEPTIONS
                conversion_error    = 1
                file_open_error     = 2
                file_read_error     = 3
                invalid_table_width = 4
                invalid_type        = 5
                no_batch            = 6
                unknown_error       = 7
                OTHERS              = 8.
    Especially for the Export parameter 'ITEM' and the Importing parameter 'act_filename'.
    Kindly guide me on this...
    Regds,
    Rajesh P

    Rajesh,
    Where exactly were you using the UPLOAD function?
    At the same place, you will have to call two methods now.
    1. To get the file selected by the user, call the FILE_OPEN_DIALOG, the user will select a file which will be the output of the method.
    2. Use the file selected and pass that to the parameter as the GUI_UPLOAD METHOD.
    Here is a sample code
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    *  EXPORTING
    *    WINDOW_TITLE            =
    *    DEFAULT_EXTENSION       =
    *    DEFAULT_FILENAME        =
    *    FILE_FILTER             =
    *    INITIAL_DIRECTORY       =
    *    MULTISELECTION          =
    *    WITH_ENCODING           =
      CHANGING
        FILE_TABLE              =
        RC                      =
    *    USER_ACTION             =
    *    FILE_ENCODING           =
    *  EXCEPTIONS
    *    FILE_OPEN_DIALOG_FAILED = 1
    *    CNTL_ERROR              = 2
    *    ERROR_NO_GUI            = 3
    *    NOT_SUPPORTED_BY_GUI    = 4
    *    others                  = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE FILE_TABLE INDEX 1.
    W_FILE = FILE_TABLE-FILENAME.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
      EXPORTING
         FILENAME                = W_FILE
    *    FILETYPE                = 'ASC'
    *    HAS_FIELD_SEPARATOR     = SPACE
    *    HEADER_LENGTH           = 0
    *    DAT_MODE                = SPACE
    *    CODEPAGE                = SPACE
    *    IGNORE_CERR             = ABAP_TRUE
    *    REPLACEMENT             = '#'
    *    READ_BY_LINE            = 'X'
    *  IMPORTING
    *    FILELENGTH              =
    *    HEADER                  =
      CHANGING
        DATA_TAB                =
    *  EXCEPTIONS
    *    FILE_OPEN_ERROR         = 1
    *    FILE_READ_ERROR         = 2
    *    NO_BATCH                = 3
    *    GUI_REFUSE_FILETRANSFER = 4
    *    INVALID_TYPE            = 5
    *    NO_AUTHORITY            = 6
    *    UNKNOWN_ERROR           = 7
    *    BAD_DATA_FORMAT         = 8
    *    HEADER_NOT_ALLOWED      = 9
    *    SEPARATOR_NOT_ALLOWED   = 10
    *    HEADER_TOO_LONG         = 11
    *    UNKNOWN_DP_ERROR        = 12
    *    ACCESS_DENIED           = 13
    *    DP_OUT_OF_MEMORY        = 14
    *    DISK_FULL               = 15
    *    DP_TIMEOUT              = 16
    *    NOT_SUPPORTED_BY_GUI    = 17
    *    ERROR_NO_GUI            = 18
    *    others                  = 19
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Ravi
    Message was edited by: Ravikumar Allampallam

  • Internet Explorer 10 / 11 breaks Microsoft's group policies for proxy exceptions?

    At one of our larger sites we've started experiencing a major issue with one of our collaborative web servers in that piles of users whose systems have automatically updated to Internet Explorer 10 are not adding the sites we've deployed via group policy
    to the proxy exceptions to their proxy exceptions (Internet Options | Connections | LAN settings | Advanced).
    So basically we deploy a number of subnets and domain names to our proxy exceptions list and after our support center blew up with calls concerning random issues, I had the admins compile a list of affected and unaffected systems contrasting various items
    and we noticed the one similarity was Internet Explorer 10. Thousands of unaffected systems have Internet Explorer 8 / 9 while all those affected have Internet Explorer 10.
    Is there a new way to deploy proxy exceptions? We thought about forcing them down via registry keys but felt there must be a less obtrusive method and maybe something is wrong.

    Hi,
    Did you configure these original settings with IEM?
    Any settings that you previously configured with IEM will no longer work on computers where Internet Explorer 10 or newer is installed, regardless of the Windows version it’s been installed on.
    You can configure the proxy settings with “Internet Settings Group Policy Preferences” or on the
    Proxy Settings page of IEAK 10.
    Please refer to:
    Replacements for Internet Explorer Maintenance
    http://technet.microsoft.com/en-us/library/jj890998.aspx
    Here is a new deployment guide for IE 10, would like to share with you:
    Internet Explorer 10 Deployment Guide
    http://technet.microsoft.com/en-us/library/jj822335.aspx
    Regards,
    Yolanda
    Yolanda
    TechNet Community Support

  • Is Aqualogic BPM a replacement for WLI ?

    Hi all,
    Until now I have worked with Workshop 8.x to build my processes.
    Now I have downloaded Workshop 9.x and I cannot see anymore JPD in it. I wonder if Bea is dropping WLI for Aq BPM......
    As in the subject: is Aq BPM a replacement for WLI ?
    Thanks
    Francesco

    Hi Leonardo,
    Let me re-iterate the basic rule of programming: "We never program for exceptions". The scenario that you are describing is very much valid and applied/followed in any orchestration process i.e. in no way the orchestration layer (BPM/ WLI/ BPEL etc.) access the data directly, but it is done through a Data layer or data services; however, one must take a business process in totality and not confuse it with a specfic use case.
    Let me explain, there is a fundamental difference betwwen the process view as described for a traditional RUP or UML model (which has its origins in Object Oriented Analysis and Design- OOAD) and the BPM model. The UML model characterizes scenarios or use cases by primary actor(s) and all other systems are secondary. thus a flow in UML is the perspective of a single actor. In contrast, if one looks at a business process in totality, it might have diffenert actors altogether, and all might be primary. For example, consider a simplest business process for order processing in retail domain. Though the process is initiated by the Customer, the entire activity of order processing (taking order, checking inventory, shipping, collaborationg etc) might have the intervention of several actors (Say sales dept, sales manager, delivery manager, sales rep etc). To represent such a scenario in WLI, one may have to develop several JPD's or work-flows, each workflow concentrating on the part of a specific actor. The coupling or ordering between these workflows might or might not be apparant to the business user on a top level. As compared to this, the entire scenario can be represented in one single model of BPM. The individual activities/ responsibilities of each actor can be detailed out in subsequent sections.
    Coming to you specific question, for that particular scenario, one might not want to go for BPM. Having said that, I will also specify that when looking at the entire business flow/ process, such processes are concidered as exceptions. The primary focus of any BPM solution is to automate the unavoidable human interventions that occur in any business process, and not plain orchestartion. Also, the worklist solution might help in a very limited user base, but is not able to handle the complex scenarios of user groups, multiple assignments, multiple roles for a user, which can easily be implemented in BPM (ALBPM organization chart)
    Your point about BAM in WLI is also valid, but tell me , as a programmer, or an architect, would you like to re-invennt the wheel for doing something for which BPM is providing an out-of-the-box solution,or would you life to invest your effort in doing something else like process enhancement and modification. The point being, one can also write POJOs for maintaining BAM databases and generate reports, but as a developer commisioned to architect/ build a business process, why would one invest his/her energies in developing BAM like features?
    Thanks and Regards
    Vivek Nandey
    BEA Certified Developer for Integration Solutions

  • Leopard replacement for Landau's Mac OS X Help Line book?

    Can anyone recommend a Leopard replacement for Ted Landau's Mac OS X Help Line? I have the 10.3 and 10.4 versions of this invaluable troubleshooting guide and wanted to recommend the 10.5 version to a friend with that OS, but I just found out that he decided not to update it for Leopard. Would really appreciate knowing about a similar comprehensive, literate, easy-to-understand troubleshooting manual for 10.5, if there is one as good as Landau's. Thanks for any good suggestions!

    I'm traveling and haven't had a chance to check it out yet. But I'll look at it as soon as I have a chance to get to a bookstore.
    I'm actually trying help out a friend who's just bought her first Mac in about 10 years, after years of working only with Windows--want to save her investing in a bunch of expensive manuals that tell you everything you need to know, occasionally in English, except how to find out what's wrong and fix it, which is the only thing I want to know! I've used Landau's guides for Panther and Tiger, and was dismayed to find out that he didn't feel like rewriting 1200 pages for Leopard. So I'm curious to see the book you recommend, which sounds good--will let you know.

  • PI 7.11 - Alert creation for RFC Exceptions does not work

    Hi folks!
    In our PI 7.11 SP04 system we have created an Alert Category as well as an Alert Rule to be informed about errorneous messages in the Integration Engine (ABAP).
    The scenario is synchronous SOAP Axis to sRFC, where the RFC answers with an exception that is transferred to a SOAP Fault response message.
    Now we see messages with Application Errors in the Integration Engine, but no alert is created. Having a look at the alert creation log using report SXMSALERT_LOGREADER shows us that the system even does not try to create an alert for these messages.  Alerts are only created for errors in the Adapter Engine.
    Question:
    Why does the system not create alerts in this case and how can we achieve this?
    Thanx for any hint!
    Kind Regards,
    Volker

    Hi!
    Additional information for all:
    When forcing an error like "receiver not found" both kinds of alerts are created: AE Alert and IE Alert. Thus in general the alert configuration and the alert rule for IE errors are correct and working - only not for RFC exceptions ....
    Regards,
    Volker

  • QuickJog 1.0 - Shuttle/Jog Replacement for Premiere CS6... almost

    quickJog 1.0 - "fixing what Adobe broke in CS6"
    a shuttle/jog replacement for Premiere/Prelude CS6
    * see below for download links and instructions *
    Introduction
    I'll waste no time in expressing my opinion on this one: I loved the jog control in previous versions of Premiere, and a small part of my heart died when I realised that those beloved controls couldn't be reinstated in CS6 (though an ever larger chunk died when I realised that Q and W don't work by default in Prelude... ).
    JKL is great as a concept, but in practice, not very responsive - it's difficult to make precise jumps in speed quickly, and I'd hate to log footage in CS6 using the JKL keys alone.
    It was whilst reading through a different thread on the forums that I had an idea. Why not just jog with the middle mouse button? REAPER uses a similar idea to great effect for scrubbing.
    And so the journey began.
    Installing/using quickJog
    Pre-requisites
    Glovepie is only available for Windows. The script, therefore, only works on Windows.
    Sorry Mac users.
    To use quickJog, you'll need to download the following:
    GlovePie, from glovepie.org. Doesn't matter whether you grab the version with or without emotiv support, as long as it's a recent version
    The quickJog script, from bit.ly/getQuickJog (unreserved thanks go to Creative Inlet Films for hosting this)
    A mouse with a middle-mouse button/clickable scroll wheel
    You'll also need to ensure:
    The JKL keys have not been re-mapped in Premiere. This is essential, as quickJog 'presses' the JKL keys to alter the jog speed in Premiere.
    Installation/usage
    Is currently as simple as...
    Start Glovepie
    From the File menu, select Open...
    Navigate to wherever you unzipped the quickJog script. Open it.
    Click the Run button
    Click the [ .] button at the end of the menu bar to minimise Glovepie to the system tray
    To shuttle, click on the program monitor, source monitor or trim monitor, and scroll the mouse wheel. This functionality is built-into Premiere. You can hold Shift for bigger jumps.
    To jog, click and hold the middle-mouse button over the source monitor, program monitor, or timeline, and move left or right to increase/decrese the jog speed (just like the old jog slider).
    QuickJog tracks the position of the mouse itself, not the position of your mouse cursor, so don't worry about the cursor touching the edge of your screen.
    Keep your eyes on the video, not the mouse!
    To exit, right-click the glovePie icon, and select Exit.
    quickJog works in Prelude too, which is pretty cool.
    Links/Misc
    HOW AWESOME WOULD SOME EXTRA BITS OF INFORMATION BE FOR THE WORLD? Like information on how to tweak the configuration variables??
    Pretty awesome, I'd say James. Have you thought about actually writing this section, then?
    Paha! Don't be crass.
    Aww.

    I stand humbly informed!
    In hindsight, I'm not surprised that the JKL keys are a popular choice amongst editors (especially for those who've moved across from other NLEs), but it does rest somewhat uncomfortably in my heart. It feels like Adobe have replaced the pedals and gearstick in my car with a keyboard: not great for those moments when a child runs into the road.
    The Shuttle Pro (and Bella to my knowledge?) controllers emulate left/right arrow keypresses to do their work, making the playback 'glitchy' during shuttle operations - I don't like that. I didn't particularly like the feel of the Shuttle Pro when I tried it either. I do like controllers like this (I have one), but have been working for some time on interfacing between the Sony 9-pin protocol and Premiere.
    As such, my intermediate preference has been to use a graphics tablet (with a keyboard) for NLE work - hence why having the jog/shuttle controls on screen was so darn useful! Now that I have quickJog mapped to the stylus eraser, edits are much faster.
    Quick aside: Huge commendations on just how much can be mapped to keyboard shortcuts in Premiere, huzzah!

  • New Macbook a good replacement for 12" Powerbook?

    I think, besides the inch in display difference, that the new macbook WOULD HAVE made a GREAT GREAT GREAT replacement for users loving or wanting the portability, yet pro versatility of the old 12" Powerbooks. I think however that Apple has missed the mark in one BIG BIG WAY! Firewire. People who wanted something like the 12" powerbook wanted the power of the Macbook Pro in a smaller package. Apple hit the nail on the head with incorporating the same graphics performance, by using aluminum, by making it lighter, and by putting in the illuminated keyboard (only in the 2.4 model though). But on the last detail, they missed it. Firewire. there is no workaround. period. Why preload the systems with iMovie when you can't import video from MOST modern digital camcorders? WITHOUT EVEN introducing a new port with adapters (like they did with the Display Port). I think I would've sold my old macbook pro and had instantly purchased the new macbook if Apple had just included that one VITAL port. I would even prefer them putting it in the place of one of the two USB ports. But without being able to import video from my NEW minidv, there is just no way i could buy that macbook and call myself a proud mac owner. What kind of digital hub would that be? Isn't your slogan "works right out of the box."...? what do you guys think about the new macbook being a 12" powerbook replacement??

    I have the same situation. I wanted to upgrade from my 12" Powerbook and would move up to the 13" screen of the new MacBook (15" is much too big for my needs). Another family member has the 15" Powerbook and has always liked my smaller size. I was ready to order 2 of the 13" MacBooks and was then stunned to see that Firewire was missing. I have a Sony DV camcorder for movies. It appears Apple expects me to use my old Powerbooks to input the video into iMovie and then transfer it over to my new MacBook. This is not the cutting edge Apple Computer Company that I have been a customer of for 25 years.
    If Apple wants to add firewire to the new MacBooks, develop a USB / Ethernet to firewire adapter, or add a 13" MacBook Pro (w/ firewire) to the line-up, they will have a customer. Otherwise, I will hold onto my old Powerbooks until this is corrected.

  • APEX Listener as a replacement for modplsql ?

    Will APEX Listener ever be, or is it able to be now, a replacement for modplsql driven applications that are not APEX. It seems that it already takes care of everything needed to be a full scale modplsql replacement... In all honesty looking to see if it is possible to reduce the future licensing load on some of my clients if they wanted to build more redundancy into their front-end web applications. They wouldn't be reducing what they pay, as they are still in for the Forms installs in app server, but they are inhibited on their redundancy growth outward since adding new licenses to cover these new servers would be cost prohibitive. This is mainly a third-party product (SGHE's Self-Service Banner) that is driven off of modplsql, so rewrite isn't an option.
    Thanks for your input,
    -Richard

    As of the last EA version, it depends on which modplsql features your application uses. The main modplsql features that are not yet supported are:
    Basic database authentication - The listener must be configured with a single username and password and cannot dynamically change the database connection at run time.
    Multiple DADS - Each listener is configured for one and only one database connection. However, there is a way to install multiple copies of the listener, and configure each for a different database connection.
    Dynamic parameter passing - There must be a one to one relationship between fields on an HTML form (or query string variables in the URL) and the non-defaulted parameters of the called procedure. Name and Value arrays, with the "!" before the procedure name in the URL are not supported.
    CGI environment variables in the DAD.
    Oracle MAY support some or all of these features in the production version, or in some future version. We can probably influence this by telling Oracle what we want - but no guarantees. Kris Rice tells me that the APEX Listener was written to be extendable, so once Oracle gives us some documentation of how to extend it, some enterprising programmer may add some of these features as an extension.

  • Replacement for dvi to vga adapter for late 2008 17"Macbook pro

    Hello,
    I have a 17" inch late 2008 mack pro. The apple dvi to vga adapter cable is not working anymore. I can seem to find a replacement for it. I have tried the generic dvi to vga adapter (image attached). This does not work. Please advise

    Hello mshameel,
    It may help to reset your system's SMC and NVRAM.
    Intel-based Macs: Resetting the System Management Controller (SMC)
    http://support.apple.com/kb/HT3964
    About NVRAM and PRAM
    http://support.apple.com/kb/HT1379
    Cheers,
    Allen

  • I could not get my iPhone 5 which purchased in Australia repaired by apple in the US. Guys from apple retail store verified a replacement for me and asked to call apple care. However, apple care said they cannot get it fixed nor repaired.

    My iPhone 5 got some defects and I went to a apple reatil store yesterday. The guy from the genius bar told me that he verified a replacement for me. And I need to call 1-800-apple care to finish that process. I called apple care and one of the senior supervisors told me that I have to send it back to Australia (where I bought this iPhone) to get it repaired. Turns out I could not solve the problem after a apple store vist and several calls. I just want to know if there any way to solve this. This iPhone is a factory unlocked one that purchased in an apple retail store in Melbourne at the day it was first released. And my experience today is not what I can tell as fair. I will be really appreciate for any helps and advices. Thanks.

    Warranty on iPhone is not international, but valid only in country of
    original sale. Since you purchased the iPhone in Australia, your warranty
    is valid only in Australia. You must either personally return the iPhone
    to Australia for evaluation and possible replacement or sent it to someone
    in Australia to take into Apple for the evaluation. Apple will not accept
    international shipments for repair nor will Apple ship out of the country
    after replacement.
    Sorry to be the bearer of this news, but it is the way iPhone warranty and
    replacement has always worked.

Maybe you are looking for

  • My Firefox crashes when I try to go to Tools Get Add-ons. I don't have any add-ons installed on my Firefox at all. I use Win7 64-bit.

    My Firefox 4.0.1 crashes when I try to go to Tools>Get Add-ons. I don't have any add-ons installed on my Firefox, at all. My OS is Win7 64-bit. I've already tried Uninstall-Reinstalling Firefox but it didn't work either.

  • Asset Module - Internal Order

    Hi SAPians, Client - UK Client- Super user has settled Internal Order with negative posting. In Asst Acctg - Auc is updated with diff figures in Book Dep Area and Tax Dep Area. All these transactions are posted in 2005-2006. Now while settling the Au

  • Don't get a result set from a query to mySql database

    Hello everyone, I am writing a program in which i refer to a mySql database. I encountered a problem using the executeQuery in which i don't get a resultSet at the end of the run, instead i get a null. gust for the record, the api says that it will n

  • How to hide the grid in a colored JTable?

    Hello, I have a JTable in "zebra"-look. The color is different every second row. Now i tried to hide the grid of the table with: setShowGrid(false); Oviously this method only makes the grid's color white. How can i hide the grid in my table? thx in a

  • Problem installing Photoshop

    I am using a PC.  I have downoaded Creative Cloud.  I tried to download PHotoshop and received the following error message: Installation completed though some optimal components failed to install correctly (6).  I also downloaded Bridge and Lightroom