PL/SQL: Executing a procedure from within another procedure

Hello, I'm a newbie and I need help on how to execute procedures from within another procedure. The procedure that I call from within the procedure have return values that I want to check.
I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
but I get the error message:
PLS-00103: Encountered the symbol "USER_GET_FORUM_INFO" when expecting one of the following::= . ( @ % ; immediate
The symbol ":=" was substituted for "USER_GET_FORUM_INFO" to continue.
And when I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
I get the error message:
PLS-00222: no function with name 'USER_GET_FORUM_INFO' exists in this scope
PL/SQL: Statement ignored
The procedure USER_GET_FORUM_INFO exists. (don't understand why it says "no FUNCTION with name", it's a procedure I'm executing)
I'm stuck so thanks for any help...
Below is all the code. I'm using Oracle 9i on RedHat Linux 7.3.
================================================================================
CREATE OR REPLACE PROCEDURE user_forum_requestsaccess (
p_forumid IN NUMBER,
p_requestmessage IN VARCHAR2
AS
var_forumid NUMBER;
var_forum_exists NUMBER;
var_forum_access NUMBER;
request_exists NUMBER;
var_forumname VARCHAR2(30);
FORUM_DOESNT_EXIST EXCEPTION;
FORUM_USER_HAS_ACCESS EXCEPTION;
FORUM_REQUEST_EXIST EXCEPTION;
BEGIN
SELECT SIGN(NVL((SELECT request_id FROM forum.vw_all_forum_requests WHERE forum_id = p_forumid AND db_user = user),0)) INTO request_exists FROM DUAL;
EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
IF var_forum_exists = 0 THEN
RAISE FORUM_DOESNT_EXIST;
ELSIF var_forum_access = 1 THEN
RAISE FORUM_USER_HAS_ACCESS;
ELSIF request_exists = 1 THEN
RAISE FORUM_REQUEST_EXIST;
ELSE
INSERT INTO tbl_forum_requests VALUES (SEQ_TBL_FORUM_REQ_REQ_ID.NEXTVAL, SYSDATE, p_requestmessage, p_forumid, user);
INSERT INTO tbl_forum_eventlog VALUES (SEQ_TBL_FORUM_EVNTLOG_EVNT_ID.NEXTVAL,SYSDATE,1,'User ' || user || ' requested access to forum ' || var_forumname || '.', p_forumid,user);
COMMIT;
END IF;
EXCEPTION
WHEN
FORUM_DOESNT_EXIST
THEN RAISE_APPLICATION_ERROR(-20003,'Forum doesnt exist.');
WHEN
FORUM_USER_HAS_ACCESS
THEN RAISE_APPLICATION_ERROR(-20004,'User already have access to this forum.');
WHEN
FORUM_REQUEST_EXIST
THEN RAISE_APPLICATION_ERROR(-20005,'A request to this forum already exist.');
END;
GRANT EXECUTE ON user_forum_requestsaccess TO forum_user;
================================================================================
Regards Goran

you don't have to use execute when you want to execute a procedure (only on sql*plus, you would use it)
just give the name of the funtion
create or replace procedure test
as
begin
    dbms_output.put_line('this is the procedure test');
end test;
create or replace procedure call_test
as
begin
    dbms_output.put_line('this is the procedure call_test going to execute the procedure test');
    test;
end call_test;
begin
    dbms_output.put_line('this is an anonymous block calling the procedure call_test');
    call_test;
end;
/

Similar Messages

  • How to call a procedure from within another procedure?

    What's the syntax to call a procedure from within a procedure.
    I have a procedure z(user_id IN number, ....)
    then
    procedure a (user_id IN number, ....)
    procedure b (user_id IN number, ....)
    procedure c (user_id IN number, ....)
    I want to call procedure a, b, c from inside procedure z.
    How would I do that?

    Same way :
    SCOTT@db102 SQL> create or replace procedure a (p1 in varchar2) is
      2  begin
      3     dbms_output.put_line (p1);
      4* end;
    SCOTT@db102 SQL> /
    Procedure created.
    SCOTT@db102 SQL> create or replace procedure z (par1 in number) is
      2  begin
      3     if par1 != 0 then
      4             a ('This is proc a');
      5     end if;
      6* end;
    SCOTT@db102 SQL> /
    Procedure created.
    SCOTT@db102 SQL> set serveroutput on
    SCOTT@db102 SQL> exec z (1);
    This is proc a
    PL/SQL procedure successfully completed.
    SCOTT@db102 SQL>                                                    

  • Calling a procedure from within a procedure

    Hi Guys,
    I have created a package to base a form on. The package contains some procedures, one of which is an Update procedure which can be seen below. I have a procedure in another package that I am trying to call. Basically the second procedure is called to implement a constraint. However, I am unsure as to what I should pass into this procedure, as a package/procedure for basing a form on is different to what I have come across before.
    CREATE OR REPLACE package staff_dml IS
    TYPE staff_rec IS RECORD (staff_id NUMBER(7),
              first_name VARCHAR2(20),
              last_name VARCHAR2(20),
              tel_no NUMBER(11),
              manager_id NUMBER(7),
              position VARCHAR2(20),
    rest_id NUMBER(7),
              grade VARCHAR2(1),
              wage NUMBER(7,2));
    TYPE staff_cursor IS REF CURSOR RETURN staff_rec;
    TYPE staff_table IS TABLE OF staff_rec INDEX BY BINARY_INTEGER;
    PROCEDURE staff_update (data IN OUT staff_table);
    PROCEDURE staff_find (data IN OUT staff_cursor);
    PROCEDURE staff_lock (data IN OUT staff_table);
    END;
    CREATE OR REPLACE PACKAGE BODY staff_dml IS
    PROCEDURE staff_lock (data IN OUT staff_table)
    IS
    temp NUMBER;
    BEGIN
    SELECT staff_id into temp
    FROM staff
    WHERE staff_id = data(1).staff_id
    FOR UPDATE;
    END staff_lock;
    PROCEDURE staff_find (data IN OUT staff_cursor)
    IS
    BEGIN
    OPEN data FOR SELECT staff_id, first_name, last_name, tel_no, manager_id, position, rest_id, grade, wage
    FROM staff;
    END staff_find;
    PROCEDURE staff_update
    (data IN OUT staff_table)
    IS
    BEGIN
    IF data(1).wage != data(1).wage THEN
    special_pkg.staff_chk(data(1).wage,data(1).grade);
    END IF;
    IF data(1).grade != data(1).grade THEN
    special_pkg.staff_chk(data(1).wage,data(1).grade);
    END IF;
    UPDATE staff
    SET first_name = data(1).first_name, last_name = data(1).last_name, tel_no = data(1).tel_no, manager_id = data(1).manager_id,
    position = data(1).position, rest_id = data(1).rest_id, grade = data(1).grade, wage = data(1).wage
    WHERE staff_id = data(1).staff_id;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLCODE||' '||SQLERRM);
    END staff_update;
    END;
    The area I an concerned about is:
    IF data(1).wage != data(1).wage THEN
    special_pkg.staff_chk(data(1).wage,data(1).grade);
    END IF;
    IF data(1).grade != data(1).grade THEN
    special_pkg.staff_chk(data(1).wage,data(1).grade);
    END IF;
    I do not know what I should be passing into the special_pkg.staff_chk procedure which accepts two number inputs. I want to use this package to compare the new inputs on this to the existing ones (this is carried out by the procedure. I have tried using :new. but this is not accepted. If I leave in the EXCEPTION then i get no errors from the form, but it will not save any changes I make on the database. If I remove the EXCEPTION then I get an error from the form - FRM-40735 UPDATE-PROCEDURE trigger raised unhandled exception ORA-04098. I am pretty sure this is because I am not supplying the correct variables to the called procedure,
    The called procedure is below (tested and working):
    PROCEDURE staff_chk
    (p_wage IN NUMBER,
    p_grade IN NUMBER)
    IS
    BEGIN
    IF p_wage BETWEEN 0 AND 7.00 AND p_grade != 'C' THEN
    RAISE_APPLICATION_ERROR(-20002, 'The Incorrect grade has been applied to this employee');
    ELSIF p_wage BETWEEN 7.01 AND 10 AND p_grade != 'B' THEN
    RAISE_APPLICATION_ERROR(-20003, 'The Incorrect grade has been applied to this employee');
    ELSIF p_wage BETWEEN 10.01 AND 20 AND p_grade != 'A' THEN
    RAISE_APPLICATION_ERROR(-20004, 'The Incorrect grade has been applied to this employee');
    END IF;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('Staff member does not exist');
    END staff_chk;
    END;
    Any help would be greatly appreciated.
    Thanks,
    Anton

    Since this appears to be an Oracle Forms related question, you may want to pose it over in the Oracle Forms forum.
    Forms
    The folks over there are a lot more likely to be able to solve your problem.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Calling a procedure from within a procedure - dif to post below

    Hi Guys,
    I have created a package to base a form on. The package contains some procedures, one of which is an Update procedure which can be seen below. I have a procedure in another package that I am trying to call. Basically the second procedure is called to implement a constraint. However, I am unsure as to what I should pass into this procedure, as a package/procedure for basing a form on is different to what I have come across before.
    CREATE OR REPLACE package staff_dml IS
    TYPE staff_rec IS RECORD (staff_id NUMBER(7),
    first_name VARCHAR2(20),
    last_name VARCHAR2(20),
    tel_no NUMBER(11),
    manager_id NUMBER(7),
    position VARCHAR2(20),
    rest_id NUMBER(7),
    grade VARCHAR2(1),
    wage NUMBER(7,2));
    TYPE staff_cursor IS REF CURSOR RETURN staff_rec;
    TYPE staff_table IS TABLE OF staff_rec INDEX BY BINARY_INTEGER;
    PROCEDURE staff_update (data IN OUT staff_table);
    PROCEDURE staff_find (data IN OUT staff_cursor);
    PROCEDURE staff_lock (data IN OUT staff_table);
    END;
    CREATE OR REPLACE PACKAGE BODY staff_dml IS
    PROCEDURE staff_lock (data IN OUT staff_table)
    IS
    temp NUMBER;
    BEGIN
    SELECT staff_id into temp
    FROM staff
    WHERE staff_id = data(1).staff_id
    FOR UPDATE;
    END staff_lock;
    PROCEDURE staff_find (data IN OUT staff_cursor)
    IS
    BEGIN
    OPEN data FOR SELECT staff_id, first_name, last_name, tel_no, manager_id, position, rest_id, grade, wage
    FROM staff;
    END staff_find;
    PROCEDURE staff_update
    (data IN OUT staff_table)
    IS
    BEGIN
    IF data(1).wage != data(1).wage THEN
    special_pkg.staff_chk(data(1).wage,data(1).grade);
    END IF;
    IF data(1).grade != data(1).grade THEN
    special_pkg.staff_chk(data(1).wage,data(1).grade);
    END IF;
    UPDATE staff
    SET first_name = data(1).first_name, last_name = data(1).last_name, tel_no = data(1).tel_no, manager_id = data(1).manager_id,
    position = data(1).position, rest_id = data(1).rest_id, grade = data(1).grade, wage = data(1).wage
    WHERE staff_id = data(1).staff_id;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLCODE||' '||SQLERRM);
    END staff_update;
    END;
    The area I an concerned about is:
    IF data(1).wage != data(1).wage THEN
    special_pkg.staff_chk(data(1).wage,data(1).grade);
    END IF;
    IF data(1).grade != data(1).grade THEN
    special_pkg.staff_chk(data(1).wage,data(1).grade);
    END IF;
    I do not know what I should be passing into the special_pkg.staff_chk procedure which accepts two number inputs. I want to use this package to compare the new inputs on this to the existing ones (this is carried out by the called procedure). I have tried using :new. but this is not accepted. If I leave in the EXCEPTION then i get no errors from the form, but it will not save any changes I make on the database. If I remove the EXCEPTION then I get an error from the form - FRM-40735 UPDATE-PROCEDURE trigger raised unhandled exception ORA-04098. I am pretty sure this is because I am not supplying the correct variables to the called procedure,
    The called procedure is below (tested and working):
    PROCEDURE staff_chk
    (p_wage IN NUMBER,
    p_grade IN NUMBER)
    IS
    BEGIN
    IF p_wage BETWEEN 0 AND 7.00 AND p_grade != 'C' THEN
    RAISE_APPLICATION_ERROR(-20002, 'The Incorrect grade has been applied to this employee');
    ELSIF p_wage BETWEEN 7.01 AND 10 AND p_grade != 'B' THEN
    RAISE_APPLICATION_ERROR(-20003, 'The Incorrect grade has been applied to this employee');
    ELSIF p_wage BETWEEN 10.01 AND 20 AND p_grade != 'A' THEN
    RAISE_APPLICATION_ERROR(-20004, 'The Incorrect grade has been applied to this employee');
    END IF;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('Staff member does not exist');
    END staff_chk;
    END;
    Any help would be greatly appreciated.
    Thanks,
    Anton

    Hi,
    You triggered in fired on table and you procedure in acting is on the same table which rasing the exception.
    Go throw this link you will understand
    http://asktom.oracle.com/tkyte/Mutate/
    - Pavan Kumar N

  • Help!How can I find the name of a calling procedure from within a procedure/function?

    Is there anyway to find out the name of calling procedure(database) from within a database stored procedure/function? This is required for creating an auditing module.
    Thanks,
    Abraham
    ===========
    email:[email protected]

    You can use this query to get the procedure names that are calling your procedure.
    SELECT name FROM all_Dependencies
    WHERE upper(referenced_name) = 'YOUR_PROC_NAME'
    In your procedure, you can get these values into a cursor and then use them one by one.
    Hope this would help.
    Faheem

  • Running unix commands from within a procedure

    Oracle 11.1, AIX 6.1
    ================
    A developer would like to know what the commands are to execute from within a procedure to run unix commands on the database server and capture those results back to the procedure for parsing & manipulation.
    Thanks.

    Don't take this as the correct way to do it, but this is merely 'a' way to do it:
    have a db procedure thats executes a db function
    create or replace procedure csproc(p_cmd in varchar2)
    as
    x number;
    begin
    x:=csfunc(p_cmd);
    dbms_output.put_line('x is: '||x);
    end;
    /The function calls a piece of java to execute the os command and return the return code of the os command
    create or replace function csfunc( p_cmd  in varchar2) return number
    as language java
    name 'csclass.RunThis(java.lang.String[]) return integer';
    /Here is the java class to run the os command
    create or replace and compile java source
    named "csclass"
    as
    import java.io.*;
    import java.lang.*;
    public class csclass extends Object
    public static int RunThis(String[] args)
       Runtime rt = Runtime.getRuntime();
        int        rc = -1;
        try
           Process p = rt.exec(args[0]);
          int bufSize = 4096;
           BufferedInputStream bis =
           new BufferedInputStream(p.getInputStream(), bufSize);
           int len;
           byte buffer[] = new byte[bufSize];
           // Echo back what the program spit out
           while ((len = bis.read(buffer, 0, bufSize)) != -1)
              System.out.write(buffer, 0, len);
           rc = p.waitFor();
        catch (Exception e)
           e.printStackTrace();
           rc = -1;
        finally
           return rc;
    /and finally the os command - in this case its a very simple shell script
    #!/usr/bin/ksh
    echo "Hi" >> /app/oracle/workdir/cs.logwill have to grant privileges to my user 'CS' to run the various os commands
    exec dbms_java.grant_permission('CS','java.io.FilePermission','/app/oracle/workdir/cs.ksh','read,execute');
    exec dbms_java.grant_permission('CS','java.io.FilePermission','/app/oracle/workdir/cs.log','write');
    exec dbms_java.grant_permission('CS','SYS:java.lang.RuntimePermission','*','readFileDescriptor');
    exec dbms_java.grant_permission('CS','SYS:java.lang.RuntimePermission','*','writeFileDescriptor');and finally can run the procedure from within the db
    set serveroutput on
    exec dbms_java.set_output(1000000);
    exec csproc('/app/oracle/workdir/cs.ksh');
    x is: 0
    PL/SQL procedure successfully completed.to prove it works ok the logfile shows an entry:
    'Hi'

  • Create a text file output from within a procedure

    I can output to a file from within SQL+ using the spool command but how do I do this from within a procedure?
    I have got a table called ABC and want to output columns A and B to a new text file based on variables pased through when the procedure is run, the name of the text file should be generated from a sequence?
    Any info appreciated.
    Cheers
    Cliff

    Hi,
    U can use UTL_File Package, But the only constraint is it will write the file only on the server m/c and not on the client m/c.
    Regards
    Gaurav

  • Invoking Oracle stored procedures from within a JDBC channel for PI 7.1

    Hi ,
    Can anybody tell me that is it possible to invoke Oracle stored Procedure from within a JDBC  sender channel for PI 7.1.
    Its working in XI3.0 and XI 7.0 for Oracle DBMS versions >= 10.2.x. But I am not sure,whether it will work for PI 7.1 also.
    Thanks & Regards,
    Saru

    HI,
    refer below link,there is no much difference in PI7.1 ,executing stored procedure is same .
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/7b72b2fde93673e10000000a114a6b/content.htm
    Regards,
    Raj

  • Shrink file (log) from within a procedure

    I'd like to incorporate the DBCC shrinkfile command to my maintenance procedure. This procedure gets called after I've finished my weekly importing process. I only need to shrink the log files as almost all the modifications are either a record update or
    an insert (there are very few deletions done). I need to do this across several databases and for software maintainability would prefer to have only the one procedure.
    My issue is that there does not seem to be a way to point to the various databases from within a procedure to preform this operation. Also the maintenance plan modules have a shrink database operation but I don't see a shrink file operation so that doesn't
    appear to be an option.
    Have I overlooked something or is it not possible to preform a shrink file operation for the transaction log files for multiple databases?
    Developer Frog Haven Enterprises

    Thank you for your response. While I did not use your answer verbatim it did lead me to my solution as I only need to preform the shrink operation on 4 out of the 7 databases in my SQL instance.
    FYI my final solution was...
    -- shrink the log files
    DECLARE @sql
    nvarchar(500);
    SET @sql
    =
    'USE [vp]; DBCC SHRINKFILE (2, 100);';
    EXEC
    (@sql);
    SET @sql
    =
    'USE [vp_arrow]; DBCC SHRINKFILE (2, 100);';
    EXEC
    (@sql)
    Developer Frog Haven Enterprises

  • Fire event from within another event ?

    It seems that an event fired from within another event does not
    actually execute its code until the firing event completes. The fired
    event's Time value in its Event Data Node indicates the time that it
    was told to execute, but using GetTickCount calls shows that its code
    does not execute until the firing event is finished. This happens
    whether Value Signaling is used to generate a Value Change event or if
    CreateUserEvent and GenerateUserEvent is used. Is this because events
    are placed in a queue ? This behavior is different from Delphi for
    example where the fired event executes right away when called from the
    firing event (before the firing event completes).
    I have an event that executes upon a button value change. I would
    like that same event's code to execute when another button is pressed,
    but also have other code in the second button's event execute after
    that first button's event's code completes. Is there another way to
    accomplish this ?
    Steve

    > It seems that an event fired from within another event does not
    > actually execute its code until the firing event completes. The fired
    > event's Time value in its Event Data Node indicates the time that it
    > was told to execute, but using GetTickCount calls shows that its code
    > does not execute until the firing event is finished. This happens
    > whether Value Signaling is used to generate a Value Change event or if
    > CreateUserEvent and GenerateUserEvent is used. Is this because events
    > are placed in a queue ? This behavior is different from Delphi for
    > example where the fired event executes right away when called from the
    > firing event (before the firing event completes).
    I'm not that familiar with Delphi, but LV events are asynchronous.
    Window
    s OS has two ways of firing events, Send and Post. The LV events
    are always posted. The primary reason is that the LV events are handled
    by a node, not by a callback. The node you are calling is in the middle
    of a diagram, and reentering it not valid.
    > I have an event that executes upon a button value change. I would
    > like that same event's code to execute when another button is pressed,
    > but also have other code in the second button's event execute after
    > that first button's event's code completes. Is there another way to
    > accomplish this ?
    The best way to reuse code is to use subVIs. Firing events, or rather
    sending events is pretty close in other events to making a function call
    dispatched to anyone interested in the event. The event just hides who
    you are calling and makes you put your parameters in a funny format
    stuffed inside the event. IMO it also makes the code very hard to read
    since you don't know what calls what.
    Instead, just put the code into a sub
    VI and call it whenever you need
    to, from the event structure in one or more locations, and from other
    loops and diagrams.
    Greg McKaskle

  • Executing batch file from Java stored procedure hang

    Dears,
    I'm using the following code to execute batch file from Java Stored procedure, which is working fine from Java IDE JDeveloper 10.1.3.4.
    public static String runFile(String drive)
    String result = "";
    String content = "echo off\n" + "vol " + drive + ": | find /i \"Serial Number is\"";
    try {
    File directory = new File(drive + ":");
    File file = File.createTempFile("bb1", ".bat", directory);
    file.deleteOnExit();
    FileWriter fw = new java.io.FileWriter(file);
    fw.write(content);
    fw.close();
    // The next line is the command causing the problem
    Process p = Runtime.getRuntime().exec("cmd.exe /c " + file.getPath());
    BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line;
    while ((line = input.readLine()) != null)
    result += line;
    input.close();
    file.delete();
    result = result.substring( result.lastIndexOf( ' ' )).trim();
    } catch (Exception e) {
    e.printStackTrace();
    result = e.getClass().getName() + " : " + e.getMessage();
    return result;
    The above code is used in getting the volume of a drive on windows, something like "80EC-C230"
    I gave the SYSTEM schema the required privilege to execute the code.
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'java.io.FilePermission', '<<ALL FILES>>', 'read ,write, execute, delete');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    GRANT JAVAUSERPRIV TO SYSTEM;
    I have used the following to load the class in Oracle 9ir2 DB:
    loadjava -u [system/******@orcl|mailto:system/******@orcl] -v -resolve C:\Server\src\net\dev\Util.java
    CREATE FUNCTION A1(drive IN VARCHAR2) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'net.dev.Util.a1(java.lang.String) return java.lang.String';
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    The problem that it hangs when I execute the call to the function (I have indicated the line causing the problem in a comment in the code).
    I have seen similar problems on other forums, but no solution posted
    [http://oracle.ittoolbox.com/groups/technical-functional/oracle-jdeveloper-l/run-an-exe-file-using-oracle-database-trigger-1567662]
    I have posted this in JDeveloper forum ([t-853821]) but suggested to post for forum in DB.
    Can anyne help?

    Dear Peter,
    You are totally right, I got this as mistake copy paste. I'm just having a Java utility for running external files outside Oracle DB, this is the method runFile()
    I'm passing it the content of script and names of file to be created on the fly and executed then deleted, sorry for the mistake in creating caller function.
    The main point, how I claim that the line in code where creating external process is the problem. I have tried the code with commenting this line and it was working ok, I made this to make sure of the permission required that I need to give to the schema passing security permission problems.
    The function script is running perfect if I'm executing vbs script outside Oracle using something like "cscript //NoLogo aaa1.vbs", but when I use the command line the call just never returns to me "cmd.exe /c bb1.bat".
    where content of bb1.bat as follows:
    echo off
    vol C: | find /i "Serial Number is"
    The above batch file just get the serial number of hard drive assigned when windows formatted HD.
    Same code runs outside Oracle just fine, but inside Oracle doesn't return if I exectued the following:
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    Never returns
    Thanks for tracing teh issue to that details ;) hope you coul help.

  • Need help to call a simple function from within another function?

    I created a movieclip which has a function in its one and only frame.
    function testx() {
    x = x+2};
    This movieclip is in the main timeline (in its own layer).
    In another layer on the timeline I have created a single keyframe with a button instance called myBtn
    myBtn.onRelease = function() {
    var x
    x =2
    testx(2);
    trace (x);
    What I want to do is call the function in the movieclip frame from the button press function. However, I can't seem to reference it properly.
    Can anyone help me to basically call a simple function from within another function?

    Yes am using CS4.  Have saved it as CS3 now.  Ok the file is somewhat complicated and what I am testing is not what I ultimately want to do but if I can pass that variable I can figure it out.  In terms of describing the file I think the only parts of importance are what I put in my previous post (please let me know if there is something I should be telling you that I have missed).  I am 99.9% sure that I am using the correct instance name.
    Scene1 Layer3 Frame1 has the function call for the button.
    myBtn.onRelease = function() {
    var x
    x = 2
    testx(2);
    trace (x);
    Slideshow layer //Actions Frame1 has the function
    function testx(x) {
    x = x+2};
    thank you so much for helping me.

  • How can I call a LabVIEW executable from within another LabVIEW executable?

    I have a customer requirement for two LabVIEW executables. Based on their current setup, they need to run executable "A" or "B", both of which are under independent revision control. I have created a third "selection" executable that allows the operator to choose between one of the two, but I am receiving errors when I attempt to call a LabVIEW executable from within a LabVIEW executable using either the "System exec" VI or the "Run Application" VI. If I call a non-LabVIEW executable (such as Windows Explorer) everything works fine.

    > I have a customer requirement for two LabVIEW executables. Based on
    > their current setup, they need to run executable "A" or "B", both of
    > which are under independent revision control. I have created a third
    > "selection" executable that allows the operator to choose between one
    > of the two, but I am receiving errors when I attempt to call a LabVIEW
    > executable from within a LabVIEW executable using either the "System
    > exec" VI or the "Run Application" VI. If I call a non-LabVIEW
    > executable (such as Windows Explorer) everything works fine.
    As with the other poster, I suspect a path problem. You might try the
    path out in a shell window, and if it works, copy the complete absolute
    path to LV to see if that works. LV is basically passing the comma
    nd to
    the OS and doesn't even know what is in it, so you should be able to get
    it to work.
    The other poster commented on subpanels, which is a good suggestion, but
    without going to LV7, an EXE can have open more than one VI. You can
    use the VI Server and the Run method to fire up another top-level VI.
    The decision is whether you want both to be in unique processes.
    Greg McKaskle

  • Executing OS command from within PL/SQL...

    Hi
    I would like to know if you can issue operating system command
    from within a PL/SQL block on Oracle Database(not developer
    2k) .Is there any built in package for the same ? Like a similar
    command is available in forms i.e HOST .
    Can anyone help please ?
    Thank You
    Cheers
    Raghavendra
    null

    The only documentation I have seen uses dbms_pipe which
    communicates with a host 3gl program, usually C, which in turn
    issues a call to the c function system(). You could also mimic
    these same actions without using dbms_pipe by using a extproc
    program linked to the database if you are running db version 8.0
    or above. See the pl/sql procedure manual for dbms_pipe examples.
    Raghavendra (guest) wrote:
    : Hi
    : I would like to know if you can issue operating system command
    : from within a PL/SQL block on Oracle Database(not developer
    : 2k) .Is there any built in package for the same ? Like a
    similar
    : command is available in forms i.e HOST .
    : Can anyone help please ?
    : Thank You
    : Cheers
    : Raghavendra
    null

  • Using APEX_MAIL from within a procedure invoked from DBMS_JOB

    I have done a lot of googling and wasted a couple of days getting nowhere and would appreciate some help. But I do know that in order to use APEX_MAIL from within a DBMS_JOB that I should
    "In order to call the APEX_MAIL package from outside the context of an Application Express application, you must call apex_util.set_security_group_id as in the following example:
    for c1 in (
    select workspace_id
    from apex_applications
    where application_id = p_app_id )
    loop
    apex_util.set_security_group_id(p_security_group_id =>
    c1.workspace_id);
    end loop;
    I have created a procedure that includes the above (look towards the end)
    create or replace procedure VACANCIES_MAILOUT
    (p_application_nbr number,
    p_page_nbr number,
    p_sender varchar2)
    AS
    Purpose: Email all people registerd in MAILMAN [email protected]
    with details of any new vacancies that started listing today.
    Exception
    when no_data_found
    then null;
    when others then raise;
    l_body CLOB;
    l_body_html CLOB;
    l_vacancy_desc VARCHAR2(350);
    to_headline varchar2(200);
    to_org varchar2(100);
    l_vacancies_desc varchar2(2000);
    to_workspace_id number(22);
    CURSOR vacancies_data IS
    select DISTINCT v.headline to_headline,
    ou.org_name to_org
    from VACANCIES v,
    Org_UNITS ou
    where
    ou.org_numb = v.Org_Numb
    and v.public_email_sent_date is Null
    Order by ou.org_name, v.headline;
    BEGIN
    BEGIN
    FOR vacancies_rec in vacancies_data
    -- build a list of vacancies
    loop
    BEGIN
    l_vacancy_desc := '<br><b>' ||
    vacancies_rec.to_org || '<br>' ||
    vacancies_rec.to_headline || '</b><br>';
    -- l_vacancy_desc :=
    -- vacancies_rec.to_org || ' - ' ||
    -- vacancies_rec.to_headline ;
    l_vacancies_desc := l_vacancies_desc || l_vacancy_desc;
    END;
    END LOOP;
    END;
    l_body := 'To view the content of this message, please use an HTML enabled mail client.'||utl_tcp.crlf;
    l_body_html :=
    '<html>
    <head>
    <style type="text/css">
    body{font-family:  Verdana, Arial, sans-serif;
                                   font-size:11pt;
                                   margin:30px;
                                   background-color:white;}
    span.sig{font-style:italic;
    font-weight:bold;
    color:#811919;}
    </style>
    </head>
    <body>'||utl_tcp.crlf;
    l_body_html := l_body_html || l_vacancies_desc
    || '<p>-----------------------------------------------------------------------------------------------------------------</strong></p>'
    ||utl_tcp.crlf
    || '<p>The above new vacancies have been posted on the <strong>Jobs At Murdoch</strong> website.</p>'
    ||utl_tcp.crlf
    ||'<p>For futher information about these vacancies, please select the following link</p>'
    ||utl_tcp.crlf
    ||'<p> Jobs At Murdoch </p>'
    ||utl_tcp.crlf
    ||'<p></p>'
    ||utl_tcp.crlf;
    l_body_html := l_body_html
    ||' Regards
    '||utl_tcp.crlf
    ||' <span class="sig">Office of Human Resources</span>
    '||utl_tcp.crlf;
    for c1 in (
    select workspace_id
    from apex_applications
    where application_id = 1901)
    loop
    apex_util.set_security_group_id(p_security_group_id => c1.workspace_id);
    end loop;
    apex_mail.send(
    p_to => '[email protected]',
    p_from => '[email protected]',
    p_body => l_body,
    p_body_html => l_body_html,
    p_subj => 'Jobs At Murdoch - new vacancy(s) listed');
    update VACANCIES
    set public_email_sent_date = trunc(sysdate,'DDD')
    where public_email_sent_date is null;
    commit;
    END;
    but still get the error
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    ORACLE_HOME = /oracle
    System name: Linux
    Node name: node
    Release: 2.6.18-194.17.1.el5
    Version: #1 SMP Mon Sep 20 07:12:06 EDT 2010
    Machine: x86_64
    Instance name: instance1
    Redo thread mounted by this instance: 1
    Oracle process number: 25
    Unix process pid: 5092, image: (J000)
    *** 2011-07-12 09:45:03.637
    *** SESSION ID:(125.50849) 2011-07-12 09:45:03.637
    *** CLIENT ID:() 2011-07-12 09:45:03.637
    *** SERVICE NAME:(SYS$USERS) 2011-07-12 09:45:03.637
    *** MODULE NAME:() 2011-07-12 09:45:03.637
    *** ACTION NAME:() 2011-07-12 09:45:03.637
    ORA-12012: error on auto execute of job 19039
    ORA-20001: This procedure must be invoked from within an application session.
    ORA-06512: at "APEX_040000.WWV_FLOW_MAIL", line 290
    ORA-06512: at "APEX_040000.WWV_FLOW_MAIL", line 325
    ORA-06512: at "APEX_040000.WWV_FLOW_MAIL", line 367
    ORA-06512: at "HRSMENU_TEST.VACANCIES_MAILOUT", line 94
    ORA-06512: at line 1
    Can someone please tell me what what stupid thing I am doing wrong? The procedure worked when invokded from SQL Workshop but fails in a DBMS_JOB.
    much thanks Peter

    I think that might help...
    http://www.easyapex.com/index.php?p=502
    Thanks to EasyApex..
    LK

Maybe you are looking for