External Java Function with a Result Type

Dear all,
I have created a workflow process which use a Function Activity of type "External Java" without a result type and it works fine, but i have created another with the result type of boolean (WFSTD_BOOLEAN) and it doesn't work properly. I will explain what is happening.
I start a process and it stops in that function activity, then the oracle Function Activity Agent executes the class associated to that function and it works fine. Then i review the workflow process and check that the status of the activity is "Deferred". I execute the wf_engine.background process, and then the status of the activity is "Complete" but the result field is blank, thus the process is stopped and did not go through the "True" branch of the process. I have follow the Oracle Workflow and Java Technical White Paper to build the class associated to the function activity, and i return true in the execute method and don't put anything in the errorStack variable.
The documentation says:
resultOut If a result type is specified in the Activities properties page for the activity in the Oracle Workflow Builder, this parameter represents the expected result that is returned when the procedure completes.
Note: Unlike the resultout for a PL/SQL procedure called by a function activity, the resultOut for a Java procedure does not include a status code. In the Java API, only the result type value is required. The status of the activity will be set automatically by the Workflow Engine depending on whether there is a value in the errorStack variable.
am I doing something wrong? could anyone help me?
Thanks in advance.

Hi Allison,
I've found the solution to the problem. If i set the variable resultOut to "T" or "F" before finnishing the execute method it works.
I think that you have to set the variable resultOut with the internal value of the lookup type that you are using as the result type of the function activity.
Bye!

Similar Messages

  • Customized java class for an external Java function activity

    Hi,
    how can i customize my jdeveloper in order to build my own classes for external Java function activities ?
    because any time i try to build my class the compiler tells me that it doesn't know WFFunctionAPI! And i do not have any idea neither which libraries i have to reference nor where i can find them. i tried to reference the *.jar file from my <ORACLE_HOME>.Wf.Java\Oracle\Apps\Fnd\Wf path, but the compiler still was mocking at me!
    Thanks for your help
         abi

    In the "Project" menu, select "Project Properties";
    In the "Libraries" tab, click the "Add" button;
    Click "New";
    Type "Oracle Workflow" (or any other name) in the Name field;
    In the "Class path" field, click the "..." button;
    Click "Add path" and select <ORACLE_HOME>/wf/java;
    Click "Add ZIP/Jar" and select wfjava.jar and wfapi.jar from the <ORACLE_HOME>/wf/java/oracle/apps/fnd/wf/jar directory.
    Click "Ok" in all those windows and compile your class.
    Regards,
    Daniel Viero - [email protected]
    iProcess Solugues em Tecnologia
    Porto Alegre, RS - Brasil

  • Exception - Trying to invoke an External Java Function

    Hi,
    Can any one Please Help me out am Stuck up with the following Exception While trying to invoke a External java Function.
    Step 1: Written the attached Java Class from "Oracle WorkFlow's Developers's" guide.
    Ref: http://www.stanford.edu/dept/itss/docs/oracle/10g/workflow.101/b10284/deffa02.htm#stdjfa
    Step 2: In builder created a process and created a Java Function
    <package-name>.<class-name>
    Step 3: Compiled the Java Class,and Created a jar file and included the jar and the required .jar files [which are required to make that class compile free] in the class path.
    Step 4: We modified the wfjvlsnr.bat by including the custom jar file which was created and the dependent jar files in the classpath and ran the Java Agent.
    Step 5: Invoked the Process from client, once the process is invoked we are getting
    Unable to load class gov.oracle.apps.fnd.wf.SampleWF
    java.lang.ClassNotFoundException: gov.oracle.apps.fnd.wf.SampleWF
    Tue Oct 10 14:33:38 GMT+05:30 2006 Enqueuing VAC02/VAC02 gov.oracle.apps.fnd.wf.SampleWF
    null
    Unable to load class gov.oracle.apps.fnd.wf.SampleWF
    : java.lang.ClassNotFoundEx
    ception: gov.oracle.apps.fnd.wf.SampleWF
    Regards
    Varma

    The engine doesn't see your jar file,
    try to change the path where you put your jar file, or try to call it for first in the set classpath

  • How to use INVOKE function with INT parameter types

    Can you tell me how to use invoke function with int parameter type ?

    Pass the int as an Integer.

  • How to call java function with parameter from javascript in adf mobile?

    how to call java function with parameter from javascript in adf mobile?

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • Java functions with Oracle 10g

    I have browsed through other related message threads on this forum and it seems that the general recommendation is to develop stored procedures and functions using PL/SQL.
    I need to implement a set of functions that perform date related processing and are self contained (no SQL code or calls). For this I could reuse some Java methods that I have successfully used in an Apache Derby database. In this situation what is your experience related to performance of Java functions compared to PL/SQL? Does the effort of rewriting this code in PL/SQL make sense?

    I made some changes on the class posted by to solve the encoding problems with CLOBs.
    So here is the result of my job.
    import java.sql.SQLException;
    import oracle.sql.*;
    import java.io.*;
    import java.util.zip.InflaterInputStream;
    import java.util.zip.DeflaterOutputStream;
    * A simple class for LOB compression and decompression in Oracle Database.
    * Will work in 8i and better.  Use utl_compress from 10g onward.
    public class CompressionUtility {
         private static void pipeStreams( InputStream inStream, OutputStream outStream, int bufferSize) throws IOException {
              //System.out.println("PIPE -");
              byte[] buffer=new byte[bufferSize];
              int cnt;
              while ((cnt=inStream.read(buffer))!=-1) {
                   outStream.write(buffer,0,cnt);
         private static void pipeStreams( Reader inStream, Writer outStream) throws IOException {
              //System.out.println("PIPE Reader-Writer");
              int val = 0;
              while ( (val = inStream.read()) != -1 ) {
                   outStream.write(val);
         private static void pipeStreams( Reader inStream, OutputStream outStream) throws IOException {
              //System.out.println("PIPE Reader-");
              int val = 0;
              while ( (val = inStream.read()) != -1 ) {
                   outStream.write(val);
        private static void pipeStreams( InputStream inStream, Writer outStream) throws IOException {
              System.out.println("PIPE -Writer");
              int val = 0;
              while ( (val=inStream.read()) != -1 ) {
                   outStream.write(val);
    * Compresses the CLOB into BLOB
    * @param clob the source CLOB (plain text)
    * @param blob the target BLOB (will hold compressed binary data) it should be
    * an empty BLOB retrieved for example with dbms_lob.createtemporary(l_blob,true);
    * @throws Exception mostly I/O exception if ever
         public static void compress(CLOB clob, BLOB blob) throws IOException, SQLException {
              //System.out.println("Compressione C->B");
              Reader in=clob.getCharacterStream();
              Writer z=new OutputStreamWriter(new DeflaterOutputStream(blob.getBinaryOutputStream()));
              DeflaterOutputStream z = new DeflaterOutputStream(blob.getBinaryOutputStream());
              int val = 0;
              while ( (val=in.read()) != -1 ) {
                   z.write(val);
              pipeStreams(in, z);
              in.close();
              z.close();
    * Decompresses the BLOB into CLOB
    * @param blob the source BLOB (compressed binary data)
    * @param clob the target CLOB (will hold plain text) it should be an empty CLOB
    * retrieved for example with dbms_lob.createtemporary(l_clob,true);
    * @throws Exception mostly I/O exception if ever
        public static void decompress(BLOB blob, CLOB clob)
          throws IOException, SQLException {
               //System.out.println("Decompressione B->C");
            Writer out=clob.getCharacterOutputStream();
            Reader z=new InputStreamReader(new InflaterInputStream(blob.getBinaryStream()));
              InflaterInputStream z = new InflaterInputStream(blob.getBinaryStream());
            int val = 0;
              while ( (val=z.read()) != -1 ) {
                   out.write(val);
            pipeStreams(z, out);
            z.close();
            out.close();
    * Compresses the BLOB into BLOB
    * @param slob the source BLOB (plain binary data)
    * @param blob the target BLOB (will hold compressed binary data) it should be
    * an empty BLOB retrieved for example with dbms_lob.createtemporary(l_blob,true);
    * @throws Exception mostly I/O exception if ever
        public static void compress(BLOB slob, BLOB blob)
          throws IOException, SQLException {
               //System.out.println("Compressione B->B");
            InputStream in=slob.getBinaryStream();
            DeflaterOutputStream z=new DeflaterOutputStream(blob.getBinaryOutputStream());
            pipeStreams(in, z, blob.getBufferSize());
            in.close();
            z.close();
    * Decompresses the BLOB into CLOB
    * @param blob the source BLOB (compressed binary data)
    * @param slob the target CLOB (will hold plain binary data) it should be an
    * empty CLOB retrieved for example with dbms_lob.createtemporary(l_blob,true);
    * @throws Exception mostly I/O exception if ever
        public static void decompress(BLOB blob, BLOB slob)
          throws IOException, SQLException {
               //System.out.println("Decompressione B->B");
            OutputStream out=slob.getBinaryOutputStream();
            InflaterInputStream z=new InflaterInputStream(blob.getBinaryStream());
            pipeStreams(z, out, blob.getBufferSize());
            z.close();
            out.close();
    }The main problem was with the getAsciiStream() function that has to be replaced by getCharacterStream().

  • Same functions with different return types in C++

    Normally the following two functions would be considered the same:
    int getdata ( char *s, int i )
    long getdata ( char *s, int i )
    Every other compiler we use would resolve both of these to the same function. In fact, it is not valid C++ code otherwise.
    We include some 3rd party source in our build which sometimes messes with our typedefs causing this to happen. We have accounted for all of the function input types but never had a problem with the return types. I just installed Sun ONE Studio 8, Compiler Collection and it is generating two symbols in our libraries every time this occurs.
    Is there a compiler flag I can use to stop it from doing this? I've got over 100 unresolved symbols and I'd rather not go and fix all of them if there is an easier way.

    Normally the following two functions would be
    considered the same:
    int getdata ( char *s, int i )
    long getdata ( char *s, int i )Not at all. Types int and long are different types, even if they are implemented the same way.
    Reference: C++ Standard, section 3.9.1 paragraph 10.
    For example, you can define two functions
    void foo(int);
    void foo(long);
    and they are distinct functions. The function that gets called depends on function overload resolution at the point of the call.
    Overloaded functions must differ in the number or the type of at least one parameter. They cannot differ only in the return type. A program that declares or defines two functions that differ only in their return types is invalid and has undefined behavior. Reference: C++ Standard section 13.1, paragraph 2.
    The usual way to implement overloaded functions is to encode the scope and the parameter types, and maybe the return type, and attach the encoding to the function name. This technique is known as "name mangling". The compiler generates the same mangled name for the declaration and definition of a given function, and different mangled names for different functions. The linker matches up the mangled names, and can tell you when no definition matches a reference.
    Some compilers choose not to include the return type in the mangled name of a function. In that case, the declaration
    int foo(char*);
    will match the definition
    long foo(char*) { ... }
    But it will also match the definitions
    myClass foo(char*) { ... }
    double foo(char*) { ... }
    You are unlikely to get good results from such a mismatch. For that reason, and because a pointer-to-function must encode the function return type, Sun C++ always encodes the function return type in the mangled name. (That is, we simplify things by not using different encodings for the same function type.)
    If you built your code for a 64-bit platform, it would presumably link using your other compilers, but would fail in mysterious ways at run time. With the Sun compiler, you can't get into that mess.
    To make your program valid, you will have to ensure your function declarations match their definitions.

  • Java function with oracle parameters

    Hi all,
    Does someone knows why i have an error using the java function setDouble with the NLS_TERRITORY = FRANCE and not with NLS_TERRITORY = AMERICA ?
    what have i do to correct it ?
    Thanks in advance

    What is the output of the following, both when
    NLS_TERRITORY = FRANCE and with NLS_TERRITORY = AMERICA ?
    SQL> select to_number('123.45') from dual ;
    TO_NUMBER('123.45')
                 123.45
    1 row selected.
    SQL> select to_number('123,45') from dual ;
    select to_number('123,45') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    SQL>

  • Rfc functions with export field type exid h

    Hi, in WAS700 I encountered rfc functions with export fields of the type exid h
    I found in the rfccal.c the following section:
            if (*exid == 'h')  continue;
                   I don't know how handle type 'h' (internal table)
                   with RFC API. Therefore ignore it.
    Example function : SWNC_GET_WORKLOAD_STATISTIC
    In the rfcsdk docs I can't find a thing how you should handle such an export field.
    Any solution for this ?

    hi hans,
    sorry i shouldn't have answered your question. to me RFC is tooo strange. I had a quick look at the FM, searched DDIC for something like exid and had a look at the WSDL of the webservice WSDL of that FM. nothing seemed very complicated to me in terms of a webservice call to it (apart from the semantically...uhm...questionable interface; MEM_OBJS_FR_YOUN anybody?) but I really have no idea of the inner workings of RFC.
    sorry again. hope you get it solved here.
    anton

  • Java function with Dynamic config throws null pointer exception

    hi Experts,
       I am using dynamic config using java function in my message mapping.
      The source message has a field called "fname".
      The value of "fname" is the input to my java UDF.
      The java UDF code is:
       public String getDynamicFile(String fname, Container container) throws StreamTransformationException{
       String str = fname + ".xml";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, str);
    return str;
       When I test this message mapping I get the following exception:
       Runtime Exception:[java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.put(com.sap.aii.mapping.api.DynamicConfigurationKey, java.lang.String) of an object loaded from local variable '<4>'] in class com.sap.xi.tf._<message mapping>_ method getDynamicFile[test, com.sap.aii.mappingtool.tf7.rt.Context@2e52cb31]
    What am I doing wrong in this UDF?
    Thanks
    Gopal

    Hi,
          Your UDF will run fine in an end to end execution,i.e, during runtime. However, if you want to test your message mapping test tab without the dynamic config UDF throwing an exception, encpasulate the code in a try catch block
    public String getDynamicFile(String fname, Container container) throws StreamTransformationException{
    String str = fname + ".xml";
    try{
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, str);
    }catch(Exception ex){}
    return str;
    The above code should run fine when you test in the message mapping test tab.
    Regards

  • Error  Stack 1 when running external java function

    Hello,
    I defined 1 item that contains an external java program.
    When I launch the process, i receive following error on the
    Java agent listener screen :
    Thu Mar 07 10:25:10 CET 2002 Executing TST_JAVA/22 xx.yyyy.workflow.UpdateWorkflowAttribute
    Thu Mar 07 10:25:11 CET 2002 Enqueuing TST_JAVA/22 xx.yyyy.workflow.UpdateWorkflowAttribute
    Error Stack: 1
    WF_FN_ERROR (MODULE=xx.yyyy.workflow.UpdateWorkflowAttribute) (ITEMTY
    PE=TST_JAVA) (ITEMKEY=22) (ACTID=739) (FUNCMODE=RUN) (ERRMESSAGE=null)
    and the status remains deferred.
    Running the background engine does not change the status of the item. It remains deferred. Anybody has any idea of what is happening ?
    grtz,
    Chris.

    I remember rec. similar errors.
    If you are writing a simple code based on the code shown in the workflow guide, looks like you have included some statements which are invalid at run time. examine your code and try to remove all unnecessary statements. write a very simple piece of code by just inserting only the required statements and the error will vanish.
    hope this helps
    satish paul
    Hello,
    I defined 1 item that contains an external java program.
    When I launch the process, i receive following error on the
    Java agent listener screen :
    Thu Mar 07 10:25:10 CET 2002 Executing TST_JAVA/22 xx.yyyy.workflow.UpdateWorkflowAttribute
    Thu Mar 07 10:25:11 CET 2002 Enqueuing TST_JAVA/22 xx.yyyy.workflow.UpdateWorkflowAttribute
    Error Stack: 1
    WF_FN_ERROR (MODULE=xx.yyyy.workflow.UpdateWorkflowAttribute) (ITEMTY
    PE=TST_JAVA) (ITEMKEY=22) (ACTID=739) (FUNCMODE=RUN) (ERRMESSAGE=null)
    and the status remains deferred.
    Running the background engine does not change the status of the item. It remains deferred. Anybody has any idea of what is happening ?
    grtz,
    Chris.

  • Execute an external java program with Runtime, problem with classpath

    Hi,
    I m calling an external java program by the command:
    Runtime.getRuntime().exec("java -classpath \"library/*\" org.mypackage.TestMainProgram param1 c:/input/files c:/output/files");All my classes are stored in the relative directory "library", and it contains ONLY .jar files. However, I keep getting errors like:
    "java.lang.NoClassDefFoundError: library/antlr/jarCaused by: java.lang.ClassNotFoundException: library.antlr.jar     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)Could not find the main class: library/antlr.jar. Program will exit.Exception in thread "main" where "antlr.jar" is a jar file in "library". It is there but still the program keeps complaining it cannot be found. The problem applies to any jars in "library", ie.., if i have "mylib.jar" then it will complain "NoClassDefFoundError: library/mylib/jar".
    Could anyone give some pointers please?
    Many thanks!
    Edited by: 836590 on 14-Feb-2011 09:03

    836590 wrote:
    Hi,
    I m calling an external java program by the command:
    Runtime.getRuntime().exec("java -classpath \"library/*\" org.mypackage.TestMainProgram param1 c:/input/files c:/output/files");All my classes are stored in the relative directory "library", and it contains ONLY .jar files. However, I keep getting errors like:
    "java.lang.NoClassDefFoundError: library/antlr/jarCaused by: java.lang.ClassNotFoundException: library.antlr.jar     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)Could not find the main class: library/antlr.jar. Program will exit.Exception in thread "main" where "antlr.jar" is a jar file in "library". It is there but still the program keeps complaining it cannot be found. The problem applies to any jars in "library", ie.., if i have "mylib.jar" then it will complain "NoClassDefFoundError: library/mylib/jar".
    Could anyone give some pointers please?
    Many thanks!
    Edited by: 836590 on 14-Feb-2011 09:03First, if you run from the command line
    java -classpath "library/*" org.mypackage.TestMainProgram param1 c:/input/files c:/output/filesfrom the parent directory of library, does it work?
    Despite what I said to Kayaman about Runtime.exec not expanding the asterisk, it looks like that's what's happening, so that you're getting
    java -claspath library/aaaa_something_before_antlr.jar library/antlr.jar library/bbb.jar library/ccc.jar  org.mypackage.TestMainProgram param1 c:/input/files c:/output/filesThat is, it *is* expanding the asterisk to a list of files in the directory, and the first one is being taken as the classpath, and the second one--library/antlr.jar is being taken as the class to execute. I'm certain this doesn't happen on Linux, so it must be a Windows thing.
    Two suggestions:
    1) Try single quotes instead of double.
    2) Try the exec that takes an array
    Runtime.getRuntime().exec(new String[] {"java", "-classpath", "'library/*'", "org.mypackage.TestMainProgram", "param1", "c:/input/files", "c:/output/files");Edited by: jverd on Feb 14, 2011 9:41 AM

  • Quirky External Speaker Functionality with I Mac

    Here we go - I recently upgraded from an older E Mac to a new I Mac. I moved my Harmon Kardon speakers from the E Mac to the new I Mac. The connection was via USB on the E Mac and is also via USB on the I Mac. However, most of the time the sound on the external speakers associated with the new I Mac is totally distorted. The speakers do appear on the Sound Tab. The big problem is that most times the sound on the external speakers is distorted with the I Mac but not all the time !. I cannot understand why sometimes the sound is distorted, and other times it is not. I have tried various ways of playing sound, but this problem seems to be totally random. Any ideas ?

    The display was not added as it simply won't detect if the monitor is there, "no signal detected."
    Yes the display worked fine prior to upgrading to Mavericks. I just tried the shut-down and then restarted, but still no luck... I'd hate to have to take it back to the apple store and have them look at it...

  • External java function that should return String array

    Hi everyone,
    I have a split function in plsql that takes 10 times longer a java tokenizer function that i was written. So, i want to use java external function to split my plsql strings into pieces.
    I can write a java external procedure that returns types like int, float and String types. I have no problem about it.
    My problem is returning an array of strings. I found a book that has an example about how can we get directory list in plsql with java external procedure.
    (code)
    import java.io.File;
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.*;
    public class JFile {
    public static oracle.sql.ARRAY dirlist (String dir)
    throws java.sql.SQLException
    Connection conn = new OracleDriver().defaultConnection( );
    ArrayDescriptor arraydesc =
    ArrayDescriptor.createDescriptor ("DIRLIST_T", conn);
    File myDir = new File (dir);
    String[] filesList = myDir.list( );
    ARRAY dirArray = new ARRAY(arraydesc, conn, filesList);
    return dirArray;
    CREATE OR REPLACE FUNCTION dirlist (dir IN VARCHAR2)
    RETURN dirlist_t
    AS
    LANGUAGE JAVA
    NAME 'myFile.dirlist(java.lang.String) return oracle.sql.ARRARY';
    (code)
    I could compile this source file in localhost but not remotehost. There are jar files ( import oracle.sql.*; import oracle.jdbc.*; ) that should be added to remote classpath. ( others have already added java classpath ). But, which classpath i should add? Oracle has own JVM and Classpath, probably i should upload these jar files to oracle classpath. Am i wrong? How can i do? Can you explain in detail? How can i return string array from java external function in Oracle ?
    I am using Oracle 11.1.0.7 on Solaris Sparc Machine.

    Hi,
    What do you mean "compile in remote host"
    Aren't you using the loadjava tool? - that should be enough, the RDBMS already "has" the jars needed.
    [A must read|http://download.oracle.com/docs/cd/B28359_01/java.111/b31225/chone.htm#BABCFIIF]
    Regards
    Peter

  • Calling Java Function with Return as String []

    Hi,
    I have written the following code. It's not compiling OK.
    DECLARE
    TYPE Tokens_Type IS VARYING ARRAY(20) OF VARCHAR2(20);
    s1 Tokens_Type DEFAULT NULL;
    SQL_STR VARCHAR2(2000) DEFAULT NULL;
    BEGIN
    SQL_STR := 'CREATE OR REPLACE FUNCTION Schema1.SPLIT_STR (S2 VARCHAR2(20)) '           ||
    'RETURN s1 '               ||
    'AS LANGUAGE JAVA '          ||
    'NAME ''String_Mani.split_it (String) return java.lang.String []''';
    EXECUTE IMMEDIATE SQL_STR;
    END;
    What's the problem with this?

    Hi,
    I have written the following code. It's not compiling OK.
    DECLARE
    TYPE Tokens_Type IS VARYING ARRAY(20) OF VARCHAR2(20);
    s1 Tokens_Type DEFAULT NULL;
    SQL_STR VARCHAR2(2000) DEFAULT NULL;
    BEGIN
    SQL_STR := 'CREATE OR REPLACE FUNCTION Schema1.SPLIT_STR (S2 VARCHAR2(20)) ' ||
    'RETURN s1 ' ||
    'AS LANGUAGE JAVA ' ||
    'NAME ''String_Mani.split_it (String) return java.lang.String []''';
    EXECUTE IMMEDIATE SQL_STR;
    END;
    What's the problem with this?

Maybe you are looking for