Possible bug with TREAT and EXECUTE IMMEDIATE

Hello, i experienced a strange behavior which seems to be a bug.
Consider following definitions:
CREATE OR REPLACE TYPE T_Base FORCE AS OBJECT (
  DummyProperty NUMBER
) NOT FINAL;
CREATE OR REPLACE TYPE T_Child UNDER T_Base (
  AnotherDummyProperty  NUMBER
CREATE OR REPLACE FUNCTION SpecificValidation (iValue T_Child) RETURN NUMBER IS
BEGIN
  -- some specific validation is done here, not important for the example
  RETURN NULL;
END;
CREATE OR REPLACE PROCEDURE ValidateIt (iValue T_Child) IS
  lResult NUMBER;
BEGIN
  -- The principle used here is that each client can have its own implementation of validation function, and when it does not exist, we do not care.
  -- In reality we put functions and procedures into packages, I narrowed it to a minimal working example.
  BEGIN
    EXECUTE IMMEDIATE 'BEGIN :lResult := SpecificValidation(:iValue); END;'
      USING OUT lResult, IN iValue;
  EXCEPTION WHEN OTHERS THEN
    IF INSTR(SQLERRM, 'PLS-00201') = 0 THEN
      RAISE;
    END IF;
  END;
END;
CREATE OR REPLACE PROCEDURE Process (iValue T_Base) IS
BEGIN
  -- in fact we know that iValue must be of typ T_Child, it is checked using IS OF ( ) operator and exception is raised if this check fails
  -- This does not work for some reason.
  -- It fails in EXECUTE IMMEDIATE with PLS-00306. I don't really get why, because ValidateIt accepts a value of type T_Child and it passes it to the validation procedure, which also expects value of type T_Child.
  ValidateIt(TREAT(iValue AS T_Child));
END;
CREATE OR REPLACE PROCEDURE Process2 (iValue T_Base) IS
  lChild  T_Child;
BEGIN
  -- The only difference here is that result of TREAT is saved to a variable.
  -- This works as expected.
  lChild := TREAT(iValue AS T_Child);
  ValidateIt(lChild);
END;
In reality it is much more complex, I narrowed it to a minimal working example.
Now when running this:
DECLARE
  lItem T_Base := T_Child(5, 2);
BEGIN
  BEGIN
    -- This call will end up with PLS-00306 error.
    Process(lItem);
    dbms_output.put_line('Process completed successfully.');
  EXCEPTION WHEN OTHERS THEN
    dbms_output.put_line('Exception when calling Process.');
    dbms_output.put_line(SQLERRM);
    dbms_output.put_line(DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
  END;
  BEGIN
    Process2(lItem);
    dbms_output.put_line('Process2 completed successfully.');
  EXCEPTION WHEN OTHERS THEN
    dbms_output.put_line('Exception when calling Process2.');
    dbms_output.put_line(SQLERRM);
    dbms_output.put_line(DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
  END;
END;
then call to Process fails with PLS-00306 on EXECUTE IMMEDIATE.
The only difference between Process and Process2 is that in Process2, result of TREAT is saved to a variable of type T_Child.
Is this behavior documented somwhere or is it a bug?

That's interesting. I would say it is, or should be, a bug.
Also interesting is, when I re-write your example to eliminate dynamic SQL and instead rely on dynamic method dispatch, the problem goes away... first, the changes:
drop type T_Child;
drop type T_Base
CREATE OR REPLACE TYPE T_Base FORCE AS OBJECT ( 
  DummyProperty NUMBER 
) NOT FINAL
CREATE OR REPLACE TYPE T_Child UNDER T_Base ( 
  AnotherDummyProperty  NUMBER 
create or replace type T_Base_Processor as object (
  dummyProperty    number
, static FUNCTION GetClientProcessor(iClientId varchar2) RETURN T_Base_Processor
, member FUNCTION SpecificValidation (iValue T_Child) RETURN NUMBER
, member PROCEDURE ValidateIt (iValue T_Child)
, member PROCEDURE Process (iValue T_Base)
, member PROCEDURE Process2 (iValue T_Base)
) NOT FINAL
create or replace type T_Another_Processor under T_Base_Processor (
  overriding member FUNCTION SpecificValidation (iValue T_Child) RETURN NUMBER
create or replace type body T_Base_Processor
is
  static FUNCTION GetClientProcessor(iClientId varchar2) RETURN T_Base_Processor IS
BEGIN
  return    case
        when upper(iClientId) = 'ADMINISTRATOR' then
            new T_Another_Processor(null)
        else
            new T_Base_Processor(null)
        end;
END;
  member FUNCTION SpecificValidation (iValue T_Child) RETURN NUMBER IS 
BEGIN 
  -- some specific validation is done here, not important for the example 
  dbms_output.put_line('T_Base_Processor.SpecificValidation');
  RETURN NULL; 
END; 
  member PROCEDURE ValidateIt (iValue T_Child) IS 
  lResult NUMBER; 
BEGIN 
  -- No more need for dynamic SQL, instead rely on dynamic dispatch
  lResult := SpecificValidation(iValue);
END; 
  member PROCEDURE Process (iValue T_Base) IS 
BEGIN 
  -- in fact we know that iValue must be of typ T_Child, it is checked using IS OF ( ) operator and exception is raised if this check fails 
  -- This does not work for some reason. 
  -- It fails in EXECUTE IMMEDIATE with PLS-00306. I don't really get why, because ValidateIt accepts a value of type T_Child and it passes it to the validation procedure, which also expects value of type T_Child. 
  ValidateIt(TREAT(iValue AS T_Child)); 
END; 
  member PROCEDURE Process2 (iValue T_Base) IS 
  lChild  T_Child; 
BEGIN 
  -- The only difference here is that result of TREAT is saved to a variable. 
  -- This works as expected. 
  lChild := TREAT(iValue AS T_Child); 
  ValidateIt(lChild); 
END;
end;
create or replace type body T_Another_Processor
is
  overriding member FUNCTION SpecificValidation (iValue T_Child) RETURN NUMBER
is
begin
  -- some other specific validation is done here, not important for the example 
  -- You could even call the overridden method as well using
  --   treat(self as T_Base_Processor).SpecificValidation(iValue)
  dbms_output.put_line('T_Another_Processor.SpecificValidation');
  RETURN NULL; 
end;
end;
And again with slight modifications, your test block:
DECLARE 
  lProcessor T_Base_Processor := T_Base_Processor.getClientProcessor('JOE');
  lItem T_Base := T_Child(5, 2); 
BEGIN 
  BEGIN 
    -- This call no longer throws a PLS-00306 error. 
    lProcessor.Process(lItem); 
    dbms_output.put_line('Process completed successfully.'); 
  EXCEPTION WHEN OTHERS THEN 
    dbms_output.put_line('Exception when calling Process.'); 
    dbms_output.put_line(SQLERRM); 
    dbms_output.put_line(DBMS_UTILITY.FORMAT_ERROR_BACKTRACE); 
  END; 
  -- Demonstrate dynamic dispatch by choosing a different processor
  lProcessor := T_Base_Processor.getClientProcessor('ADMINISTRATOR');
  BEGIN 
    lProcessor.Process2(lItem); 
    dbms_output.put_line('Process2 completed successfully.'); 
  EXCEPTION WHEN OTHERS THEN 
    dbms_output.put_line('Exception when calling Process2.'); 
    dbms_output.put_line(SQLERRM); 
    dbms_output.put_line(DBMS_UTILITY.FORMAT_ERROR_BACKTRACE); 
  END; 
END; 
T_Base_Processor.SpecificValidation
Process completed successfully.
T_Another_Processor.SpecificValidation
Process2 completed successfully.
Gerard

Similar Messages

  • Possible Bug with Drag-and-Drop Being Published via HTML5 - Getting "Undefined" Error When Dragging Object

    Hello,
    I came up with a way to use drag-and-drop interactions that will take advantage of file input so that I may create a drag-and-drop interaction that uses one draggable object over and over allowing multiple scoring/tracking possibilities.  Example use...is having the draggable object be dynamic in that it randomly changes its text so that a learner can drag a term it's possible classification.........thus allowing the possibility of having many terms easily loaded without having to redo a drag-and-drop interaction for each needed terms/classifications updates/changes.
    My Issue: When using a variable to represent the text for a draggable Smart Shape object, I'm getting the error message "undefined" when, clicking/pressing on the object, as well as during the drag of the object. This issue occurs when publishing the project in an HTML5 format.  Flash interestingly enough seems to work perfect...but we are not interested in publishing via Flash any longer.
    To better help you explore this error message, I've set up a test project so that you can see when and how the "undefined" message shows up during a drag-and-drop interaction.  I've also included the Captivate 8 project file used to make the exploration project I'm sharing in this post.
    Link to Captivate project I created for you all to explore "undefined" error message": http://iti.cscc.edu/drag_and_drop_bug/
    Link to this Captivate 8 Project file: http://iti.cscc.edu/drag_and_drop_bug.cptx
    It's pretty interesting how things react in this demo, please try the following actions to see some interesting happenings:
    Drag the Yellow (or variable drag box) to the drag target.
    Drag Black Hello square to Drag target and click undo or reset - watch the undefined message come up on the Yellow (or variable drag box).
    Drag the Yellow (or variable drag box) to the drag target and then use the undo or reset.
    Move both draggable boxes to the drag target and use the undo and reset buttons...
    Anyhow, I know you all are sharp and will run the demo through its paces.
    I'd really be very honored if anyone help me figure out how I could (when publishing out to HTML5) no longer have the "undefined" error message show up when using drag-and-drop with a variable for shape text. This technique has been well received at the college I work at...and I have many future project requests for using such an idea on a variety of similar interactions. I'd love see a solution or see if this might be a bug Adobe may be able to fix!
    I tried to find a solution to the issue documented here for quite some time, but I was not able to find anyone with this problem much less attempting the idea I'm sharing in the help request -  save the darn "undefined" message that comes up!
    Many thanks in advance for any help and/or direction that you all may be able to provide,
    Paul

    Hello,
    I just wanted to supply a minor update related to my drag-and-drop question/issue stated above:
    I did another test using Captivate 7, and found that the undefined error (publishing as HTML5) does not appear and the variable data remains visible - except the variable data turns very small and does not honor any font size related settings.
    I did go ahead and submit this to Adobe as a possible bug today.
    Thanks again for any help related to this issue.  If the issued documented above is solved, it will allow many amazing things to be done using Captivate's drag-and-drop for both regular type projects as well as interaction development for iBooks! 
    Matter of fact if this issue gets fixed, I'll publish a Blog entry (or video) on way's I've used Captivate's drag-and-drop to create dynamic learning activities for Higher Ed. and for use in iBooks.
    ~ Paul

  • Can someone confirm a possible bug with Universal Access?

    Can someone confirm a possible bug with Universal Access?
    I have a Mac Pro 3,1, 10.7.1 but if you could confirm or not this possible bug with any model.
    In Energy Saver preference pane:
    Set Mac to never sleep.
    Set Display Sleep to ~2 minutes.
    In Desktop & Screen Saver:
    Set screen saver to start at ~1 minutes.
    In Universal Access:
    Check Enable access for assistive devices.
    Check radio button Zoom to On.
    Zoom in window not checked.
    Confirm that Zoom works by pressing:
    ⌥⌘= (option, command, =).
    Set screen back to normal by pressing ⌥⌘-.
    Let screen sleep after screen saver starts.
    Wake screen and see if ⌥⌘= still works.
    Thanks … Ken

    Other than the time intervals (smallest Screen Saver kick-in is 3 minutes), it works fine for me - at least I can still zoom in/out after waking the display.
    Tested on two different MacBook Pro models in 10.7.1

  • Possible bug with Pick flag and Collections

    Odd behaviours in v3.3  (Windows) with pick flags in Collections:
    Create (or use) a Collection Set which contains a number of different collections
    Assign Pick plag to one photo in each collection
    Bug 1: Highlight Collection Set and note that none of the images shows the Pick Flag in the thumbnail view. Also Filtering this view with Pick flag fails to pick up the Flagged images
    Now return to one of the Collections within the Set and create a Virtual Copy of one of the images that has a Pick flag. (Note virtual copy does not have a flag - which seems logical). Return to Collection Set and (Bug 2) note that Pick flag has disappeared from original image and now appears on Virtual copy.
    Something wrong here somewhere I suspect.

    lightshop wrote:
    Odd behaviours in v3.3  (Windows) with pick flags in Collections:
    Create (or use) a Collection Set which contains a number of different collections
    Assign Pick plag to one photo in each collection
    Bug 1: Highlight Collection Set and note that none of the images shows the Pick Flag in the thumbnail view. Also Filtering this view with Pick flag fails to pick up the Flagged images
    Now return to one of the Collections within the Set and create a Virtual Copy of one of the images that has a Pick flag. (Note virtual copy does not have a flag - which seems logical). Return to Collection Set and (Bug 2) note that Pick flag has disappeared from original image and now appears on Virtual copy.
    Something wrong here somewhere I suspect.
    I could partially repeat bug 2.
    I have Collection Set (Test) which contain to collections: "Collection 1" and "Collection 2". Both Collections contain 4 images.
    I selected "Collection 1" and applied Pick flag to all those images. When I select Test (Collection Set) I got 8 images shown,  which none had flags. Ok, this works as expected. I selected "Collection 1" and then selected 1 image and made Virtual copy from it. Lr show me now 4 images with Flag and 1 virtual copy without. Again, works as expected. I now select Test (Collection Set) and I get 9 images (as expected), but one of them, the virtual copy, has pick flag applied. Not as expected. If I go back to "Collection 1" I get four images with Pick flags and one virtual copy without. (as expected.)

  • Need suggestion on PLSQL Create and EXECUTE IMMEDIATE

    Most of you already know plsql doesn't like create table, so we have to use EXECUTE IMMEDIATE for creating table. What if I want to see if the table exist, if not then create the table, later I will insert data into that table.
    My problem is it returned me the error saying I am try to insert into a non existing table when trying to compile my code. I think plsql doesn't pick up the execute statement.
    what I did is, both create and insert are executed by using EXECUTE IMMEDIATE. Anyone have such experience before and willing to share your knowledge?
    PS: I am having same problem for creating sequence as well.

    I think plsql doesn't pick up the execute statement.Since it is a runtime instruction, it will pick it up at runtime. but to be able to run, it needs to compile the code and in order to compile (so it can run) the code it needs that table/sequence you are referencing to exist already. So, you need to run the code to get the table and run needs to compile the code and compile needs the table to compile. can't go from here to there when you try to mix dynamic sql with static sql on the same object within the same program unit (or dependent units).

  • Optimistic Locking - Possible bug with Weblogic

    After extensive testing of a j2ee application Im involved with, it would appear their exists a problem with using Weblogic's Optimistic Concurrency (OL) mechanism.
    The exact problem is as follows:
    The ejbCreate and ejbRemove methods of a particular entity bean are as follows:
    public abstract class ProductBean implements javax.ejb.EntityBean {
    ejbCreate(){
    FolderEntityHome folderEH = FolderComponent.getFolderEntityHome();
    folderEH.create(getId());
    ejbRemove(){
    FolderEntityHome folderEH = FolderComponent.getFolderEntityHome();
    try {
    FolderBean folderEH.findByProductId(getId());
    catch(InvalidAccessRightsException iare)
    throw new RemoveException();
    Previously before OL was added when a RemoveException was thrown, this would cause the ejbRemove exception to fail, thus both the product and folder would still exist.
    After adding OL, when an InvalidAccessRightsException occurs giving rise to a RemoveException being thrown, weblogic simply ignores the RemoveException and deletes the Product even though the Folder could not be deleted. This causes system errors when users try to access the folder which contains a link to a product which no longer exists!
    Is anyone aware of this particular problem? Is it indeed a bug with Weblogic? For clarity, I believe I am using version 8.1 and the way in which I have implemented OL is to use an additional version column in the underlying tables for all entity beans.

    In case anyone's interested, it appears from further testing that the problem I've been having in the way the RemoveException behaves is down to the difference in which version 6.0 treats this exception compared to version 8.1!
    In version 6.0, if you threw a RemoteException at any point in the ejbRemove(), the entity would not be removed!
    In version 8.1, something wierd happens. If a RemoteException() is thrown in the ejbRemove() and sometime during the same transaction at the point of commit, the entity on which the exception is thrown is attempted to be accessed (through a finder), then the entity continues to be deleted! If on the other hand, a RemoveException is thrown and no access/modification is attempted on that entity within the same transaction, then at the point of commit, the entity is not removed!
    Seems this is indeed a problem which needs to be addressed in future releases.
    Message was edited by:
    rotan_imretxe
    Message was edited by:
    rotan_imretxe

  • Possible bug with iTunes 11 ?? (with Smart Playlists)

    Hi folks
    New to Apple Support, but after upgrading to iTunes 11 earlier today (on my Mac Mini) I've discovered a potential bug / difference in the way it operates compared to earlier versions. Can someone else try something similar and see if they get the same result - I think I read somewhere that v11 is not available on Windows yet, so I cant compare what happens there
    I've imported all our CD's into iTunes, and we've set up several Smart Playlists (SP). Using the Rating setting for the songs, we can break them up into groups, eg
    Rating 0 = not yet processed
    Rating 1 = not interested in listening to again
    Rating 2 = kids songs (for our children)
    Rating 3 = christmas songs
    Rating 4 = songs i like, but my wife probably wouldnt
    Rating 5 = songs we both like - good for background music etc
    Using Home Sharing to our iPad's rocks !!
    Now, onto the bug.
    Using the SP that has just songs with Rating 0, I could play any song, set the Rating to whatever, and naturally once set, that disappears from the SP
    In all earlier versions of iTunes, playback would continue with the next song, so I could set that Rating, etc etc. Worked really well to churn through a chunk of songs in say 15 minute blocks
    With iTunes v11, playback stops as soon as I set the Rating.
    How can you help ?????????? Set up a smart playlist with whatever criteria you like - make sure you have a number of songs returned and ensure Live Updating is set, have a song playing, and make that song no longer valid for that SP. Anyone doing this in earlier versions of iTunes should have the next song begin, and if this is a bug, then those using iTunes 11 will have playback stop
    Sorry for the long post, but in order to determine a potential bug, you need to describe the situation and how to test it.
    Thanks for reading
    PS I'm on a 2010 Mac Mini with OSX v10.7.x (whatever the current release of that is) and just upgraded to iTunes 11

    Soo, maybe it isnt possible bug, but the way Apple have changed iTunes when going to v11. Stooopid
    Anyway, found this link about downgrading to an earlier version. I've just completed it and found one or two "errors" in the method, which I'll detail below
    http://www.emacconsulting.com/apple/itunes/downgrade-itunes-11-to-itunes-10-7/
    In the latter part of the instructions
    11) Open your iTunes Music Folder.
    If you never moved your iTunes folder it’s located here:
    Your HD/Your User/Music/iTunes
    Or go to the Finder type:  Command + Shift + G
    Paste this into the the dialog:  ~/Music/iTunes
    If you moved it to another hard drive, you will know where to locate your iTunes folder.
    12) Open the “Previous iTunes Libraries” folder.
    13) Find the most recent copy of the “iTunes Library 2012-xx-xx.itl” file.
    Normally it will the last file at the bottom of the list.
    14) Drag a copy of the file into the iTunes folder.
    15) Delete the “iTunes Library” file.
    16) Change the name of the “iTunes Library 2012-xx-xx.itl” to ”iTunes Library” with no .itl extension.
    In #11, I simply went to "My HD"/Users/"My User"/Music/iTunes
    Copied the latest .itl and moved it up a directory level
    The old file in #15 is called "iTunes Library.itl" - which I renamed, and renamed the copied version back to "iTunes Library.itl" = though I do have extensions showing, some people may not and hence wont see the .itl
    Anyway all is fixed in my world, and when I launched v10.7, it asked me if I wanted to upgrade to v11 - I said No and not to prompt me again. Playcount issue is resulved, as is changing SmartList criteria with playback continuing
    Apple - please correct these bugs before releasing any new versions of iTunes... you've made a very large number of people unhappy

  • Possible bug with Triggers tab

    Hi there,
    I'm using 1.0.0.12.15 and think there is a bug with the triggers tab. When I navigate to my table (which has one trigger on it), and then click on the Triggers tab, the trigger shows up multiple times. It's probably not a coincidence that it shows up the same number of times that there are columns :)
    Looks like a missing join condition somewhere.
    Hope this helps

    Tracked this one down too...
    SQL Developer is getting the triggers like this:
    Select dt.trigger_NAME, dt.trigger_type, dt.triggering_Event, dt.status, do.object_id , do.owner sdev_link_owner, dt.trigger_NAME sdev_link_name,'TRIGGER' sdev_link_type
    from all_triggers dt, all_objects do
    where do.owner = :OBJECT_OWNER
    and dt.owner = :OBJECT_OWNER
    and dt.trigger_name = do.object_name
    and dt.table_name = :OBJECT_NAME
    However, we got other objects (mainly tables) with the same name as the trigger. Not specifying the object type will identify them the same way as the trigger, resulting them all to be included in the select!
    Adding "and do.object_type = 'TRIGGER'" will solve the problem.
    K.

  • Compiler bug with generics and private inner classes

    There appears to be a bug in the sun java compiler. This problem was reported against eclipse and the developers their concluded that it must be a problem with javac.
    Idea also seems to compile the example below. I couldn't find a bug report in the sun bug database. Can somebody tell me if this is a bug in javac and if there is a bug report for it.
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422
    public class Foo <T>{
    private T myT;
    public T getT() {
    return myT;
    public void setT(T aT) {
    myT = aT;
    public class Bar extends Foo<Bar.Baz> {
    public static void main(String[] args) {
    Bar myBar = new Bar();
    myBar.setT(new Baz());
    System.out.println(myBar.getT().toString());
    private static class Baz {
    @Override
    public String toString() {
    return "Baz";
    Eclipse compiles and runs the code even though the Baz inner class is private.
    javac reports:
    Bar.java:1: Bar.Baz has private access in Bar
    public class Bar extends Foo<Bar.Baz>
    ^
    1 error

    As I said in my original post its not just eclipse that thinks the code snippet is compilable. IntelliJ Idea also parses it without complaining. I haven't looked at the java language spec but intuitively I see no reason why the code should not compile. I don't think eclipse submitting bug reports to sun has anything to do with courage. I would guess they just couldn't be bothered.

  • Possible bug with replace on clobs?

    I couldn't find this documented anywhere, and wanted to check if I had data corruption or if there indeed is a bug with replace on long clobs.
    Best I can figure, if you are replacing before the 32768 border and a previous replace in that clob moves the new location to be after 32768, then your clob gets clobbered in that area.
    I'd like to know if this is a verifiable bug so that I feel better about having written my own replace using instr/substr.
    Oracle 10g (10.2.0.1.0)
    Test procedure:
    ======================================
    declare
    vclob clob;
    tempc1 clob;
    tempc2 clob;
    pos number;
    ch char(1);
    begin
    vclob := rpad('*', 32749, '*') || '****12345./~\.12345*' || rpad('*', 10000, '*');
    for vi in 1..5 loop
    ch := to_char(vi);
    tempc1 := vclob;
    pos := instr(tempc1, ch);
    while (pos > 0) loop
    tempc1 := substr(tempc1, 1, pos-1) || 'BUGS' || substr(tempc1, pos+1);
    pos := instr(tempc1, ch, pos+1);
    end loop;
    tempc2 := vclob;
    pos := instr(tempc2, ch);
    while (pos > 0) loop
    tempc2 := substr(tempc2, 1, pos-1) || 'BUGGY' || substr(tempc2, pos+1);
    pos := instr(tempc2, ch, pos+1);
    end loop;
    dbms_output.put_line('Replace ' || ch || ' at ' ||
    instr(vclob, ch) || ' and ' ||
    instr(vclob, ch, instr(vclob, ch)+1));
    dbms_output.put_line(': 32750 32760 32770 32780');
    dbms_output.put_line(': 67890123456789012345678901234567890');
    dbms_output.put_line('Original: ' || substr(vclob, 32746, 50));
    dbms_output.put_line(ch || '->BUGS : ' ||
    substr(replace(vclob, ch, 'BUGS'), 32746, 50));
    dbms_output.put_line('Correct : ' || substr(tempc1, 32746, 50));
    dbms_output.put_line(ch || '->BUGGY: ' ||
    substr(replace(vclob, ch, 'BUGGY'), 32746, 50));
    dbms_output.put_line('Correct : ' || substr(tempc2, 32746, 50));
    end loop;
    end;
    /======================================
    Output: (changed slightly for formatting)
    ======================================
    Replace 1 at 32754 and 32764
    : _______ 32750 ___ 32760 ___ 32770 ___ 32780
    : _______ 67890123456789012345678901234567890
    Original: ********12345./~\.12345***************************
    1->BUGS : ********BUGS2345./~\.BUGS2345*********************
    Correct : ********BUGS2345./~\.BUGS2345*********************
    1->BUGGY: ********BUGGY2345./~\.BUGGY2345*******************
    Correct : ********BUGGY2345./~\.BUGGY2345*******************
    Replace 2 at 32755 and 32765
    : _______ 32750 ___ 32760 ___ 32770 ___ 32780
    : _______ 67890123456789012345678901234567890
    Original: ********12345./~\.12345***************************
    2->BUGS : ********1BUGS345./~\.1BUGS345*********************
    Correct : ********1BUGS345./~\.1BUGS345*********************
    2->BUGGY: ********1BUGGY345./~\.¿¿¿5************************
    Correct : ********1BUGGY345./~\.1BUGGY345*******************
    Replace 3 at 32756 and 32766
    : _______ 32750 ___ 32760 ___ 32770 ___ 32780
    : _______ 67890123456789012345678901234567890
    Original: ********12345./~\.12345***************************
    3->BUGS : ********12BUGS45./~\.1¿¿5*************************
    Correct : ********12BUGS45./~\.12BUGS45*********************
    3->BUGGY: ********12BUGGY45./~\.¿¿¿5************************
    Correct : ********12BUGGY45./~\.12BUGGY45*******************
    Replace 4 at 32757 and 32767
    : _______ 32750 ___ 32760 ___ 32770 ___ 32780
    : _______ 67890123456789012345678901234567890
    Original: ********12345./~\.12345***************************
    4->BUGS : ********123BUGS5./~\.1¿¿5*************************
    Correct : ********123BUGS5./~\.123BUGS5*********************
    4->BUGGY: ********123BUGGY5./~\.¿¿¿5************************
    Correct : ********123BUGGY5./~\.123BUGGY5*******************
    Replace 5 at 32758 and 32768
    : _______ 32750 ___ 32760 ___ 32770 ___ 32780
    : _______ 67890123456789012345678901234567890
    Original: ********12345./~\.12345***************************
    5->BUGS : ********1234BUGS./~\.1234BUGS*********************
    Correct : ********1234BUGS./~\.1234BUGS*********************
    5->BUGGY: ********1234BUGGY./~\.1234BUGGY*******************
    Correct : ********1234BUGGY./~\.1234BUGGY*******************======================================

    Correct me if I'm wrong. What this lines does (if there isn't a space between the two single-quotes) is removing the string represented by xmlnsVal from the string xmlDoc. I've been using this method in some situations.
    But I don't know why it won't work either. However, isn't it necessary to do conversion from CLOB to varchar2 before calling replace? Maybe the implicit conversion isn't so reliable. I've seen someone did the following:
    -- clobvar is CLOB
    -- stringvar is varchar2(4000)
    stringvar := cast(clobvar as varchar2(4000));      -- not testedAfter that you can use stringvar in your replace function.
    Or alternately, if exists in 9i, you can try the function regexp_replace() instead. Good luck.

  • Possible bug with c interop in fortran

    A colleague and I are writing some c interop examples for a book and have come across a possibe bug.
    We are testing passing 2 d arrrays (c99 vla) between fortran, c and c++.
    Fortran main program calling c function works.
    C main program calling Fortran subroutine works.
    C++ calling fortran subroutine fails.
    here is the fortran soubroutine
    subroutine reciprocal(nr,nc,x,y) bind(c,name='reciprocal')
    use iso_c_binding
    implicit none
    integer (c_int) , value :: nr
    integer (c_int) , value :: nc
    real (c_float) , dimension(1:nr,1:nc) , intent(in ) :: x
    real (c_float) , dimension(1:nr,1:nc) , intent(out) :: y
      y=1.0/x
    end subroutine reciprocal
    we compile this with
    sunf90 -c ch3110.f90 -o ch3110_f.o
    we then try compiling the following with
    sunCC ch3110.cxx ch3110_f.o
    #include <iostream>
    using namespace std;
    extern "C" void reciprocal(int nr,int nc,float x[nr][nc],float y[nr][nc]);
    int main()
      const int nr=2;
      const int nc=5;
      float x[nr][nc];
      float y[nr][nc];
      float t[]={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0};
      int r;
      int c;
      int i=0;
      for (r=0;r<nr;r++)
        for (c=0;c<nc;c++)
          x[r][c]=t[i];
          i++;
      cout << " C++ passing a 2d array to Fortran " << endl;
      for (r=0;r<nr;r++)
        for (c=0;c<nc;c++)
          cout << x[r][c] << " ";
        cout << endl;
      reciprocal(nr,nc,x,y);
      for (r=0;r<nr;r++)
        for (c=0;c<nc;c++)
          cout << " 1 / " << x[r][c] << " = " << y[r][c] << endl;
      return(0);
    and get the following error message
    ian@linux-9624:~/document/fortran/third_edition/examples> sunf90 -c ch3110.f90 -o ch3110_f.o
    ian@linux-9624:~/document/fortran/third_edition/examples> sunCC ch3110.cxx ch3110_f.o
    "ch3110.cxx", line 5: Error: An integer constant expression is required within the array subscript operator.
    "ch3110.cxx", line 5: Error: An integer constant expression is required within the array subscript operator.
    "ch3110.cxx", line 5: Error: An integer constant expression is required within the array subscript operator.
    "ch3110.cxx", line 5: Error: An integer constant expression is required within the array subscript operator.
    "ch3110.cxx", line 36: Error: Formal argument x of type float(*)[1] in call to reciprocal(int, int, float(*)[1], float(*)[1]) is being passed float[2][5].
    "ch3110.cxx", line 36: Error: Formal argument y of type float(*)[1] in call to reciprocal(int, int, float(*)[1], float(*)[1]) is being passed float[2][5].
    6 Error(s) detected.
    ian@linux-9624:~/document/fortran/third_edition/examples>
    We get the same (or similar) error messages from
      g++ and gfortran 4.8.x
      g++ and gfortran 4.10.x
        we failed a bug report with the gnu team
        and it is reported as a duplicate of an existing bug.
      microsoft C++ and Intel fortran
        microsoft do not support C99 vla.
    The only combination that we have found that
    works is with the Intel beta versions of their
    fortran and C++ compilers.
    Any thoughts?
    Ian Chivers

    It appears to be a question of standards conformance and what standards :-(
    The gfortran and Intel C++ compilers are tracking the c99
    standard.Microsoft have stated that they will not be supporting c99 in
    their C++ compiler.
    I have found a statement that C++14 will support c99 vla.
    Jane and I have a
    c99 and Fortran 90 combination where the above syntax works.
    source code below.
    c source file
    =========
    +++++
    #include <stdio.h>
    void reciprocal(int nr,int nc,float x[nr][nc],float y[nr][nc]);
    int main()
      const int nr=2;
      const int nc=5;
      float x[nr][nc];
      float y[nr][nc];
      float t[]={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0};
      int r;
      int c;
      int i=0;
      for (r=0;r<nr;r++)
        for (c=0;c<nc;c++)
          x[r][c]=t[i];
          i++;
      printf(" C passing a 2d array to Fortran\n");
      for (r=0;r<nr;r++)
        for (c=0;c<nc;c++)
          printf(" %f " , x[r][c]);
        printf("\n");
      reciprocal(nr,nc,x,y);
      for (r=0;r<nr;r++)
        for (c=0;c<nc;c++)
          printf(" 1 / %f = %f \n" , x[r][c],y[r][c]);
        printf("\n");
      return(0);
    +++++
    fortran source file
    =============
    subroutine reciprocal(nr,nc,x,y) bind(c,name='reciprocal')
    use iso_c_binding
    implicit none
    integer (c_int) , value :: nr
    integer (c_int) , value :: nc
    real (c_float) , dimension(1:nr,1:nc) , intent(in ) :: x
    real (c_float) , dimension(1:nr,1:nc) , intent(out) :: y
      y=1.0/x
    end subroutine reciprocal
    +++++
    this combination WORKS
    with the sun compiler suite.
    Finally you mentiion
    +++++
    Finally, when linking Fortran and C++ code, you must use the C++ compiler (CC) to do the link step, and you must use the option -xlang=f90 to get all the libraries linked in the right order:
    CC  ch3110.cxx  ch3110_f.o  -xlang=f90
    Refer to the xlang option in the C++ Users Guide for more information.
    ++++
    jane and i did not need to do the above using c interop with the other mixed language examples
    we have written and have working.
    we have a scalar parameter passing example
      fortran calling c
    c calling fortran
    c++ calling fortran
    that works with the 12.4 beta suite.
    we have a 1 d array example
      fortran calling c
      c calling fortran
      c++ calling fortran
    working with the 12.4 beta suite.
    I was under the impression that
    sunCC
    pointed to the sun C++ compiler.
    so from your reply I assume that our example will not work with the current
    sun/oracle C++ compiler, but may work if sun track the C++14
    standard.
    here is the source code for our 1d fortran C++ combo
    c++
    ===
    #include <iostream>
    using namespace std;
    extern "C" float summation(float *,int );
    int main()
      const int n=10;
      float *x;
      int i;
      x = new  float[n];
      for (i=0;i<n;i++)
        x[i]=1.0f;
      cout << " C++ passing an array to Fortran " << endl;
      cout << " Sum is " << summation(x,n) << endl;
      return(0);
    Fortran
    =====
    function summation(x,n) bind(c,name='summation')
    use iso_c_binding
    implicit none
    integer (c_int) , value :: n
    real (c_float), dimension(1:n) , intent(in) :: x
    real (c_float) :: summation
    integer :: i
      summation=sum(x(1:n))
    end function summation
    this fortran C++ combo works.
    Notes
    ====
    From the reply we got from the gnu team they wil be implementing
    the functionality at some point.
    Intel already does in their beta.
    Microsoft will not as they are not tracking
    c99.
    Thanks for you time.

  • Deploy with error and execute succesfully

    I have a Mapping and if I deploy and execute it in the Deployment Manager it is executed succesfully but If I debug it I received these error:
    ROWKEY: 702
    TABLE: DBG$$$DIM_INSTALACIO_VIEW_0
    STATEMENT: TRACE 112: SELECT
    ORA-01403: no data found
    ROWKEY: 701
    TABLE: "DBG$$$_DIM_INSTALACIO_GRP1_0"
    STATEMENT: TRACE 113: INSERT
    ORA-22160: element at index [1] does not exist
    ROWKEY: 701
    TABLE: DBG$$$DIM_INSTALACIO_VIEW_0
    STATEMENT: TRACE 111: TRACE 114: "DIM_INST_1_COD_CONCESIONAR$2"("DBG$$$_DIM_INSTALACIO_GRP1_0_i") :="DIM_INST_1_COD_CONCESIONAR$0"("IJ_DBG$$$_EXPR_4_GRP1_0_i");
    ORA-01403: no data found
    ORA-06512: at "ODS_CLIENTES.DBG$$$_RT8_MAP_GILYCARBAJAL", line 11422
    ORA-22160: element at index [1] does not exist
    How Can it be?

    Things to check:
    1. You can be using a different target schema for you Debugging sessions than for your deployed map execution.
    2. There can be a mistake defining Test Data for the debugging session http://download.oracle.com/docs/html/B12146_01/debug.htm#i1004902
    Nikolai Rochnik

  • Possible bug with Tab Control and Context Help?

    I created Description and Tip text for each Tab of a tab control I am using on my front panel.  I have a subVI that is called by selecting a menu item from my main front panel.  The subVI's front panel also has a menu system and a Tab Control.  I have Description and Tip text written for each of the tabs on the subVI's front panel.
    When I enable context help from the menu of my main VI, the proper help text shows up for the tabs on the main vi and, when I bring up the subVI's front panel, for its tabs as well.
    So far so good...
    Now I builld the application and run it as an executable.  For ALL of my panel tab descriptions, I get the tab's label in bold text, but no description (just a blank area).
    Is this a bug in LabVIEW?
    Kevin 

    wired wrote:
    I'm still seeing this behavior in LV8.2.1.  Does anyone know if/when it was fixed?  Also, my tip strips show up in the corner of the monitor when I mouse over a tab (in both the executable and the development version).
    I see it still even in 8.5.  
    The Help part of the bug is still NOT fixeed by NI.
    But I dont get the tool tip appearing in the corner of the monitor, it is showing up as usual.
    - Partha
    LabVIEW - Wires that catch bugs!

  • Can someone try and reproduce this possible bug with DBMS_JOB.run

    11.2.0.2 EE
    OEL5
    getting an IO dump from what looks like entire shared pool. A call to a procedure using dbms_job.run shows the dump in the plan.
    Be interested to see if anyone is on 11.2.0.3 on OEL can reproduce. thanks.
    sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.2.0 Production on Tue Jan 8 16:44:33 2013
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    With the Partitioning and Automatic Storage Management options
    SQL>
    SQL> ALTER Sesssion SET EVENTS '10046 trace name context forever, level 12';
    System altered.
    /* create a small proc that takes in a var and does nothing except set a variable */
    SQL>  
    SQL>   create procedure io_test ( v_in number)
      2  IS
      3     v_variable    varchar2(10);
      4    begin
      5     null;
      6  END;  
      7   
      8   
    Procedure created.
    /* flush the shared pool to simulate a start */
    SQL> alter system flush shared_pool;
    System altered.
    /* set our tracefile id */
    SQL> alter session set tracefile_identifier=err_test;    
    Session altered.
    /* call the proc from a dbms_job submission */
    SQL>   declare
      2    v_job_no  number;
      3    begin
      4     Dbms_Job.SUBMIT ( job  => v_job_no
      5                    , what => 'sys.io_test('  || 1234 || ');');
      6       Dbms_Job.RUN (v_job_no);
      7     end;   
      8  /  
    PL/SQL procedure successfully completed.
    SQL> tkprof the trace file, go to non-recursive statements at the bottom and we see following
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.04       0.04 4294967293 4294963226 4294967122           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.04       0.04 4294967293 4294963226 4294967122           1
    some behaviour notes.
    1. If I call the proc directly, I dont see the huge IO, its only dbms_job.run that does it.
    2. If I call the dbms_job.run a second time I dont see it, its only when I flush the shared pool which simulates the first time I could be calling the proc which is how I found it initially
    3. If I call the dbms_job.run outside of a proc I do see it.
    4. Watch your IO and CPU if you generate it. Huge spike to coincide with the figures in the trace.
    5. 4294967293 is very close 2^32, is also the size of my shared pool so looks like entire pool is being dumped.
    6. Have reproduced on 3 instances on 3 separate servers. all same version 11.2.0.2.0 and patch level which is 2012 Q2.
    7. change the proc to have the variable commented out and we dont see the dump.
    8. I have a call open with support a while now but havent been able to reproduce on their side. Interested to see if someone has OEL 5, 11.2.0.2 instance, can generate it and also an 11.2.0.3 instance and can show its not in that.
    thanks.

    961469 wrote:
    rjamya wrote:
    I am suspecting this is a tkprof issue, analyzing the same trace file via orasrp doesnt show this behavior. Also the high physical reads shown are missing in the raw trace file.Im not so sure, I can see it in the raw trace file.
    do you see it in raw trace file? if so can you post the STAT line showing high disk read (pr=nnnnnnnn) values ? I dont see it in the trace file that i generated.
    Raj

  • Possible bug with HTML emails and attachments from Mail.app

    I'm trying to send an attachment with an HTML email from Mail.app and getting unexpected results. I've been messing around with the order that things get added to the new e-mail and it seems that I can have either an attachment or I can have HTML email, not both.
    The code... (of course simplified)
    tell application "Mail"
    set new_message to make new outgoing message with properties {subject:"A subject", sender:"[email protected]"}
    tell new_message
    set visible to true
    make new to recipient at end of to recipients with properties {address:"[email protected]"}
    tell content to make new attachment with properties {file name:alias "Path to your file as string"} at after the last paragraph
    set html content to "<head><body>Some HTML here...</body></head>"
    end tell
    send new_message
    end tell

    etresoft wrote:
    The problem is that there is no such thing as HTML email.
    Well, I wonder what I have been generating for over three years now. RTF ? Because it sure looks like HTML. I must agree that HTML is not documented or even mentionned in the Mail AS dictionnary, but it does work, though you must specify visible to false so that it does. Here's my sub:
    tell application "Mail"
    set DMF to default message format
    set default message format to plain text
    set newMessage to make new outgoing message with properties {subject:theSubject}
    tell newMessage
    set visible to false
    set sender to theSender
    make new to recipient at end of to recipients with properties {name:Photographer, address:theAddress}
    set html content to "<html><head><title>" & theSubject & "</title></head><body>" & "This is an automated response." & theSource & "Find your personnal planning on the web: " & thelink & "
    </body></html>"
    end tell
    send newMessage
    set default message format to DMF
    end tell

Maybe you are looking for

  • Finding of fixed vendor while creation of the sales order

    i want to find the fixed vendor (FLIEF) from EBAN ,<b>before saving the sales order</b>, for that i need to pass BANFN( purchase request no) BNFPO(purchase request item no), into EBAN ,which i got from VBEP table  .    i used user-exit (userexit_save

  • Connect Macbook to the Internet (VPN) through PC

    I got a PC with 2 network cards and a Macbook. On a PC I got VPN connection to my provider. How can I connect Macbook to the internet through that PC + safely sharing my PC's contents only to my Macbook.

  • Adobe life cycle designer

    Hi, I have installed CE 7.1 NWDS and Portal. Could any one tell me that which version of Adobe life cycle designer will be compatible for this?? Thanks, Anumit

  • Round to 2 decimal places

    hello guys, I have a table. One column of the table displays the scores. ex: 2.2222222233333 2.32232323 I want to round all the numbers in that column to 2 decimal. Result needed: 2.22 2.32 Can you please help me how can i get handle to the column an

  • Monitor Wireless services

    Hi, I would like to monitor Wireless services and I wonder if I could to this with an AP. In one of our customer sites there are many problems with the wireless connections; we can monitor the RADIUS service, if the firewall is working correctly as w