Calling another function if upate statement fails

Hi there,
I have written an update procedure and insert procedure. Is there a way of calling another function if the update statement fails? Thanks a lot for your help.
Chris
procedure update_costing(in_period in DATE,
               in_project_id IN VARCHAR2,
               in_user_id IN VARCHAR2,
               in_thu IN VARCHAR2,
               in_fri IN VARCHAR2,
               in_sat IN VARCHAR2,
               in_sun IN VARCHAR2,
               in_mon IN VARCHAR2,
               in_tue IN VARCHAR2,
               in_wed IN VARCHAR2)
     UPDATE TBL_COSTING
          SET
               HOURS_THU = to_date (in_thu, 'HH24:MI'),
               HOURS_FRI = to_date (in_fri, 'HH24:MI'),
               HOURS_SAT = to_date (in_sat, 'HH24:MI'),
               HOURS_SUN = to_date (in_sun, 'HH24:MI'),
               HOURS_MON = to_date (in_mon, 'HH24:MI'),
               HOURS_TUE = to_date (in_tue, 'HH24:MI'),
               HOURS_WED = to_date (in_wed, 'HH24:MI'),
               WHERE PERIOD = in_period
     AND PROJECT_ID = in_project_id
     AND USER_ID = in_user_id;
EXCEPTION
--CALLL HERE THE INSERT FUNCTION WITH SAME DATAMEMBERS
SOMETHING LIKE THIS---
WHEN others then
     insert_costing(in_period, in_project_id, in_user_id ,in_thu,in_fri,in_sat,in_sun,in_mon,in_tue,in_wed ,in_submit);
COMMIT;
END update_costing;

begin
UPDATE statement
IF SQL%ROWCOUNT =0
then
INSERT statement|procedure
end if;
end;
/Hi,
i have a simple doubt over here, i read somewhere that cursor attributes can be used only as long as the cursor is open, then in the above case whiel doing the update operation, oracle implicitly will open an cursor and will do the operation and then will close the cursor, then how does SQL%ROWcount works???please revert...
cheere

Similar Messages

  • Function call another function variable

    Is it possible to call another function variable?
    Below is my Script:
    f2();
    function f1() { 
      var v2 = 1; 
    function f2(v2) { 
      var v3= 2; 
      alert(v2);

    Hi creativejoan0425,
    Some additional notes:
    > Is it possible to call access another function variable?
    No, it isn't. A local variable only lives in the scope of the function (body) where it is declared. In that sense any local variable should be considered private—in OOP terms.
    pixxxel schubser's solution is based on setting a global scope for the variable myA, so it is visible from every place of your code.
    Another solution could be implemented using JS closure mechanism. You can create a local scope (in an anonymous function which is executed once) then return your main function and additional helpers from that scope. All inner functions have then access to the local variables that have been declared in the scope. For example, you can create your function f1 and attach a getter function to it, as follows:
    var f1 = (function(/*anonymous*/__)
        // Local variable to be nested in the closure
        var v1;
        (__ = function(/*optional init value*/x)
            // Here is your *actual* function
            // do what you want with v1
            v1 = 'undefined'!=typeof x ? x : Math.random();
        ).getVar = function()
            // Here is your getter
            return v1;
        return __;
    var f2 = function()
        alert( f1.getVar() );
    // Process
    f1('init');
    f2();           // => 'init'
    f1();
    f2();           // => some random number
    f1();
    f2();           // => another random number
    // etc
    This way v1 remains almost private but the outer code can read it through f1.getVar().
    Anyway this seems to me a complicate approach for a basic script that probably does not require high security level. Another option, really easy to set up, is to use the fact that a function is an object. Instead of declaring a local variable, just handle v1 as a (public) member of f1, as follows:
    var f1 = function F(/*optional init*/x)
        // Do something with F.var
        F.v1 = 'undefined'!=typeof x ? x : Math.random();
    var f2 = function()
        alert( f1.v1 );
    f1('init');
    f2();          // => 'init'
    f1();
    f2();          // => some random number
    f1();
    f2();          // => another random number
    That's it!
    > why every function need to return?
    No, return is not required. By default, any function that has no return statement will simply return undefined.
    @+
    Marc

  • Call C function in SQL statement

    dear all
    I want to know how i can call C function in SQL statement where clause

    http://asktom.oracle.com/pls/ask/f?p=4950:8:80100593788949622::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:934029542973

  • Unable to call local function in select statement.

    Hi all,
    I am unable to call the local function in select statement in below scenario.
    DECLARE
    l_cnt NUMBER;
    FUNCTION FUN1 RETURN NUMBER
    AS
    BEGIN RETURN 2;
    END;
    BEGIN
    SELECT FUN1 INTO l_cnt FROM DUAL;
    DBMS_OUTPUT.PUT_LINE(l_cnt );
    END;
    /Any alternate way to call local function in select statement?
    Thanks
    Ram.

    Hi,
    Sorry, you can't call a locally defined function in a SQL statement, even if that SQL statement is in a PL/SQL block where the function is in scope.
    This applies to packages, also. If a function is not declared in the package spec, but only in the package body, then you can't call it from SQL statements in the package body.
    Why do you want a locally defined function? Why not a function defined outside the procedure?

  • Can a function module call another function module

    Can a function module call another function module:-
      within the same function group
    (ii)  within different function  groups

    Hi,
    We can call function from another function. If there is a function which is like a calculator and all the operations are from different functions then we have to call the functions from the calculator function for different functions.
    If all the function are from same function group, Then the data is globally available to all the functions with in the group.
    Otherwise we have to declare the data definitions for each of the functions if they are in different function groups.  
    Yes it is possible to call a function module from another function module:-
    within the same function group
    (ii) within different function groups
    Reward.

  • Temp table gets deleted when calling another function

    Hello Everyone
    I am using temporary tables which gets deleted on commit to workaround a multiset union (which doesnt work on Oracle 9). Now, this table somehow gets deleted (the content) during execution of my stored procedure but there is no delete or commit statement.
    Here is what I am doing
    start
    delete temp table (just to be sure)
    prepare array
    loop array {
    output count of temp table
    a = some other function(...)
    output count of temp table
    insert stuff I need to temp table
    output count of temp table
    end
    The output is giving me (example). The correct result would be 140 at the end
    0
    0
    100
    0
    40
    I checked all further function calls, there is no delete or commit, just some objects are created (and collections) which are then processed and returned.
    Could it be that there is a automatic commit or something like that?
    Thanks
    Edited by: maschlegel on Jan 26, 2009 6:36 AM
    Edited by: maschlegel on Jan 26, 2009 6:37 AM
    Edited by: maschlegel on Jan 26, 2009 6:38 AM

    just some objects are created (and collections) which are then processed and returneAll DDL statements issue COMMITs implicitly - once before the statement is processed and once after. (so any data changes are committed even if the DDL statement fails).
    This is just one reason why it is such a bad idea to stick DDL statements in the middle of transactions.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Problem in Calling a function in sql statement.

    hi,
    I am having a function ops_safex_utl.EDIT_ASSC_CNTR_LOG(id number);
    when i am trying to use this inside a sql statement as shown below, it is giving error (exception part inside the function).
    SQL> select ops_safex_utl.EDIT_ASSC_CNTR_LOG(688) from dual;
    OPS_SAFEX_UTL.EDIT_ASSC_CNTR_LOG(688)
    -1 (-- exception )
    when i am trying to call this function using a PL/SQL Block then it is woking fine as shown below.
    SQL> DECLARE
    2
    3 x NUMBER(2);
    4
    5 BEGIN
    6
    7 x := ops_safex_utl.EDIT_ASSC_CNTR_LOG(688);
    8
    9 dbms_output.put_line('x '||' '||x);
    10
    11 END;
    12 /
    hi
    insert into ops_assc_cntr_log
    insert into ops_ac_ex_gratia_log
    insert into ops_ac_sls_dlvry_slab_dtls_log
    insert into ops_ac_sls_dlvry_slab_dtls_log
    insert into ops_ac_sls_dlvry_slab_dtls_log
    insert into ops_ac_sls_dlvry_slab_dtls_log
    insert into ops_ac_sls_dlvry_slab_dtls_log
    insert into ops_ac_spl_acct_dtls_log
    insert into ops_ac_spl_acct_slab_dtls_log
    insert into ops_ac_spl_acct_slab_dtls_log
    insert into ops_ac_spl_acct_slab_dtls_log
    insert into ops_ac_spl_acct_dtls_log
    insert into ops_ac_spl_acct_slab_dtls_log
    insert into ops_ac_spl_acct_slab_dtls_log
    insert into ops_ac_spl_acct_slab_dtls_log
    update ops_assc_cntr
    success
    x 0
    PL/SQL procedure successfully completed.
    when i am trying to run the SQL statement it is returning a exception from the function.
    SELECT ops_safex_utl.EDIT_ASSC_CNTR_LOG(688) from dual --it is returning -1 (i.e exception).
    My sql client version is 9.2.0.1.0. and my data base version is 10.2.0.2.0.
    Please advice.

    Could you post the exception handler within the function.
    It sounds like you return -1 if you experience an error - it would be easier to determine the cause of the problem if you return the Oracle error details, E.g:
    EXCEPTION
       WHEN OTHERS THEN
          RETURN dbms_utility.format_error_backtrace;This will then return a meaningful error, identifying exactly what is causing the error to be generated.

  • Calling SQL function in SQL query fails

    Hi There,
    I am trying to execute INSERT INTO XML_DATA (NAME, DATASIZE, DATA) VALUES (?,?,XMLType('?')) using ODBC C
    SQLBindParameter APIs.
    If I execute the INSERT INTO XML_DATA (NAME, DATASIZE, DATA) VALUES (?,?,XMLType('<name>milind</name>')) works fine.
    Can anybody please help me out here?
    Thanks,
    Milind
    /* blob.c
    * The following C code demonstrates how to read an input file, piecewise
    * (in chunks), and write it into a BLOB or LONG RAW column in the database.
    * It then reads that BLOB or LONG RAW data, piecewise, from the database
    * and writes it back to the OS as an output file that you specify.
    * Enter the following SQL statement via SQL*Plus to create the table
    * 'images_data' for use with this sample. Make sure you log into
    * Oracle as a user appropriate for running this example.
    * For BLOB, use the following table:
    * CREATE TABLE images_data (
    * name VARCHAR2(100),
    * imagesize NUMBER,
    * image BLOB);
    * For LONG RAW, use the following table:
    * CREATE TABLE images_data (
    * name VARCHAR2(100),
    * imagesize NUMBER,
    * image LONG RAW);
    * Change the connection information at the beginning of the procedure OpenOra
    * to your DSN, username and password.
    * To run this program, open a Command Prompt and use the following syntax:
    * Syntax: <program_name> <infile_name> <outfile_name>
    * Example call: C:\> blob my_photo.jpg copy_of_my_photo.jpg
    #include "stdafx.h"
    #include <stdio.h>
    #include <io.h>
    #ifndef NUTC
    #include <windows.h>
    #endif
    #include <sql.h>
    #include <sqlext.h>
    #ifdef NUTC
    #include <sys/types.h>
    #include <sys/stat.h>
    #endif
    * Global variables
    HENV hOdbcEnv = NULL; /* Environment handle */
    HDBC hDbConn = NULL; /* Connection handle */
    int sr; /* Return value */
    #define BUFSIZE 32020 /* Chunksize */
    * Connect routine
    void OpenOra()
    char szDSN[] = "XY10g2"; /* Data Source Name (DSN) */
    char szUID[] = "odbc1"; /* Username */
    char szAUTH[] = "pdmuser"; /* Password */
    * Allocate environment handle
    sr = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &hOdbcEnv);
    if (sr != SQL_SUCCESS)
    printf ("Error allocating environment handle\n");
    * Set the ODBC Version
    sr = SQLSetEnvAttr(hOdbcEnv, SQL_ATTR_ODBC_VERSION,(SQLPOINTER)SQL_OV_ODBC3, SQL_IS_INTEGER);
    if (sr != SQL_SUCCESS)
    printf ("Error setting ODBC version\n");
    * Allocate connection handle
    sr = SQLAllocHandle (SQL_HANDLE_DBC, hOdbcEnv, &hDbConn);
    if (sr != SQL_SUCCESS)
    printf ("Error allocating connection handle\n");
    * Connect
    sr = SQLConnect(hDbConn, (UCHAR *)szDSN, SQL_NTS,(UCHAR *)szUID, SQL_NTS, (UCHAR *)szAUTH, SQL_NTS);
    if (sr != SQL_SUCCESS)
    printf("Connection failed\n");
    * Disconnect routine
    void CloseOra()
    * Disconnect and free connection and environment handles
    sr = SQLDisconnect(hDbConn);
    if (hDbConn != SQL_NULL_HANDLE)
    SQLFreeHandle(SQL_HANDLE_DBC, hDbConn);
    if (hOdbcEnv != SQL_NULL_HANDLE)
    SQLFreeHandle(SQL_HANDLE_ENV, hOdbcEnv);
    * Read INFILE into the database and read data back out and save as OUTFILE.
    void readCertImage(char read_name, long filesize, char write_name)
    SQLCHAR iSqlCmd[300] = "INSERT INTO XML_DATA (NAME, DATASIZE, DATA) VALUES (?,?,XMLType('?'))";
    SQLCHAR iSqlCmd1[300] = "SELECT DATA FROM XML_DATA WHERE NAME = ?";
    FILE ifile, ofile; /* File pointers */
    time_t startTime, endTime;
    time_t startTimeIO, endTimeIO;
    int IOtime = 0;
    unsigned char buf[BUFSIZE]; /* Buffer to hold chunk */
    unsigned char buf1[BUFSIZE]; /* Buffer to hold chunk */
    SQLINTEGER type[3]; /* Type of data */
    SQLPOINTER pToken; /* Which column is piecewise */
    HSTMT hstmt = NULL; /* Statement handle */
    long i; /* Byte Counter */
    long count; /* Piecewise Counter */
    long rd; /* Amount to read */
    * Log on
    OpenOra();
    ifile = fopen(read_name, "r"); /* Open the file for reading in ASCII mode */
    * Allocate statement handle
    sr = SQLAllocHandle(SQL_HANDLE_STMT, hDbConn, &hstmt);
    if (sr != SQL_SUCCESS)
    printf("Error allocating statement handle\n");
    * Prepare insert statement
    sr = SQLPrepare(hstmt, iSqlCmd, SQL_NTS);
    if (sr != SQL_SUCCESS)
    printf("Error preparing insert statement\n");
    * Bind Parameters
    /* Name of BLOB */
    sr = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 0, 0,read_name, strlen(read_name), &type[0]);
    if (sr != SQL_SUCCESS)
    printf("Error binding name variable\n");
    /* Size of BLOB */
    sr = SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_NUMERIC, 0, 0,&filesize, 0, &type[1]);
    if (sr != SQL_SUCCESS)
    printf("Error binding length variable\n");
    * As this will be a piecewise insert do not need to pass a buffer here.
    * Instead pass the parameter number for identification purposes.
    /* BLOB data */
    sr = SQLBindParameter(hstmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, 0, 0,(SQLPOINTER)3, 0, &type[2]);
    if (sr != SQL_SUCCESS)
    printf("Error binding data variable\n");
    type[0] = SQL_NTS; /* Null terminated string */
    type[1] = 0; /* Ignored for numbers */
    type[2] = SQL_LEN_DATA_AT_EXEC(filesize); /* Data at execution time */
    time( &startTime );
    * Execute the insert
    sr = SQLExecute(hstmt);
    if (sr == SQL_NEED_DATA)
    printf("\nAbout to perform piecewise insert of data\n\n");
    else if (sr != SQL_SUCCESS)
    printf("Error executing insert statement\n");
    * Retrieve the pointer to the buffer containing the address
    * of the location where the source BLOB will be sent
    sr = SQLParamData(hstmt, &pToken);
    if (sr != SQL_NEED_DATA)
    printf("Error - no piecewise operations required\n");
    * Write the data in BUFSIZE chunks
    i = 0; /* Initialize bytes inserted
    count = 0; /* Initialize pieces/chunks inserted */
    do
    count++; /* Increment chunk number */
    * If remaining bytes to read is greater than BUFSIZE,
    * read another BUFSIZE chunk. Otherwise, read remaining
    * chunk of bytes (which will be less than BUFSIZE)
    if (filesize - i >= BUFSIZE)
    rd = BUFSIZE;
    else
    rd = (filesize - i);
    printf("%5ld:%10ld - About to write %ld bytes to the database\n",count,i,rd);
    * Reads one rd sized chunk of data into buffer from source file (BLOB)
    time( &startTimeIO );
    fread(buf, rd, 1, ifile);
    time( &endTimeIO );
    IOtime = IOtime + (endTimeIO - startTimeIO);
    * Sends the contents of the buffer to the ODBC driver
    SQLPutData(hstmt, buf, rd);
    /* Recalculate total bytes sent */
    if (filesize - i >= BUFSIZE)
    i+= BUFSIZE;
    else
    i+= (filesize - i);
    } while (i < filesize);
    /* Check to see if all data has been sent */
    sr = SQLParamData(hstmt, &pToken);
    if (sr == SQL_NEED_DATA)
    printf("Error - still need data\n");
    printf("%5ld:%10ld - Done writing data\n",++count,i);
    time( &endTime );
    printf("BLOB Write completed StartTime: %d, EndTime: %d, IOTime: %d in seconds.\n", endTime, startTime, IOtime);
    printf("BLOB Write completed in %d seconds.\n", (endTime - startTime) - IOtime);
    fclose(ifile); /* Close the INFILE */
    printf("\nData inserted into database\n\n");
    * Now read the data back. Reuse the previous statement handle.
    SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    sr = SQLAllocHandle(SQL_HANDLE_STMT, hDbConn, &hstmt);
    if (sr != SQL_SUCCESS)
    printf("Error allocating statement handle\n");
    * Prepare select statement, bind variable and execute
    sr = SQLPrepare(hstmt, iSqlCmd1, SQL_NTS);
    if (sr != SQL_SUCCESS)
    printf("Error preparing select statement\n");
    sr = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 0, 0, read_name, strlen(read_name), &type[0]);
    if (sr != SQL_SUCCESS)
    printf("Error binding name variable\n");
    time( &startTime );
    sr = SQLExecute(hstmt);
    if (sr != SQL_SUCCESS)
    printf ("Error executing insert statement\n");
    ofile = fopen(write_name, "w"); /* Open the file for writing in ASCII mode */
    sr = SQLFetch(hstmt);
    if (sr != SQL_SUCCESS)
    printf ("Error fetching data\n");
    * Read the data in BUFSIZE chunks.
    i = 0; /* Initialize bytes inserted */
    count = 0; /* Initialize pieces/chunks inserted */
    memset(buf, NULL, BUFSIZE);
    do
    * Retrieve a BUFSIZE chunk of data into the buffer
    sr = SQLGetData(hstmt, 1, SQL_C_CHAR, buf, BUFSIZE, &type[2]);
    if (sr == SQL_ERROR)
    printf("Error fetching data\n");
    break;
    time( &startTimeIO );
    count++; /* Increment chunk number */
    /* Determine if this is a full chunk or the last chunk */
    if (filesize - i >= BUFSIZE)
    printf("%5ld:%10ld - About to write %ld bytes to file\n",count,i,BUFSIZE);
    fwrite(buf, BUFSIZE, 1, ofile); /* Write BUFSIZE chunk to file */
    else
    printf("%5ld:%10ld - About to write %ld bytes to file\n",count,i,filesize-i);
    fwrite(buf, filesize-i, 1, ofile); /* Write remaining chunk to file */
    time( &endTimeIO );
    IOtime = IOtime + (endTimeIO - startTimeIO);
    /* Recalculate total bytes retrieved */
    if (filesize - i >= BUFSIZE)
    i+= BUFSIZE;
    else
    i+= (filesize - i);
    } while (sr == SQL_SUCCESS_WITH_INFO);
    printf("%5ld:%10ld - Done writing file\n",++count,i);
    time( &endTime );
    printf("BLOB Read completed StartTime: %d, EndTime: %d, IOTime: %d in seconds.\n", endTime, startTime, IOtime);
    printf("BLOB Read completed in %d seconds.\n", (endTime - startTime) - IOtime);
    fclose(ofile); /* Close the OUTFILE */
    printf("\nData written to file\n");
    * Log off
    SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    CloseOra();
    * Main routine
    void main(argc, argv)
    int argc; /* Number of command line arguments */
    char argv[]; / Array of command line arguments */
    long filesize = 0; /* Size of INFILE */
    FILE ifile; / Pointer to INFILE */
    #ifdef NUTC
    struct stat statbuf; /* Information on a file. */
    #endif
    /* Check for the proper number of command line arguments entered by user */
    if (argc != 3)
    printf("\nCommand line syntax: <program_name> <infile_name> <outfile_name>");
    printf("\n Example call: blob input.exe output.exe\n");
    exit(1);
    /* Open INFILE */
    if( (ifile = fopen(argv[1], "rb" )) == NULL )
    printf( "\nThe file '%s' could not be opened\n",argv[1]);
    exit(1);
    else
    printf( "\nThe file '%s' was opened successfully\n",argv[1]);
    #ifdef NUTC
    /* Determine length of the INFILE */
    if (fstat(fileno(ifile), &statbuf) == 0)
    filesize = statbuf.st_size;
    else
    filesize = 0;
    #else
    filesize = filelength(fileno(ifile));
    #endif
    printf( "The file is %d bytes long\n",filesize);
    /* Close INFILE */
    fclose(ifile);
    /* Insert and retrieve BLOB */
    readCertImage(argv[1], filesize, argv[2]);
    }

    During binding, strings are generally skipped. As such, you should first try replacing XMLType('?') with XMLType(?). You don't need to specify '?' because the system knows the proper type from your SQLBindParameter call.
    Also, you should try replacing:
    sr = SQLBindParameter(hstmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, 0, 0,(SQLPOINTER)3, 0, &type[2]);
    with
    sr = SQLBindParameter(hstmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_LONGVARCHAR, 0, 0,(SQLPOINTER)buf, BUFSIZE, &type[2]);

  • Weird error when calling AS function to switch state from embedded HTML page

    Hey everyone,
    I'm developing an application that has 5 states in it. The
    welcome state is set by default. I wrote a function called
    changeState that looks like this:
    internal function changeState(sState:String):void
    currentState = sState;
    Now, inside the registration state, there is an mx:HTML
    component named htmlReg with the following attribute:
    htmlDOMInitialize="htmlReg.htmlLoader.window.changeState =
    changeState;"
    Inside the plain handcoded HTML web page that's loaded,
    there's a button that looks like this:
    <button onClick="changeState('Welcome')">Back to
    Welcome</button>
    The idea being, when the user clicks the HTML button, it
    calls the AS function changeState('Welcome') and the user gets
    taken back to the welcome screen.
    The good news is that when I click this button, it works
    fine, and I'm taken back to the welcome state.
    The bad news is that when I then switch to another state
    (using an mx:Button in the welcome state), I get the following
    error:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at flash.html::HTMLLoader/onFocusOut()
    I'm having trouble figuring out why this is happening, and
    what to do about it.
    Two additional data points:
    1) If I add an mx:Button to the registration state with a
    click="changeState('Welcome')" handler, it works as expected and I
    don't get an error. I only get this error when clicking the HTML
    button, which calls the same function in the same way.
    2) If I move the mx:HTML component out of the registration
    state and into the main application, I don't get this error any
    more (and the HTML state change button still works as expected).
    Anybody have any clues or ideas as to what might be
    happening? Or ideas as to what I might try to collect more data
    points? Or even workarounds to accomplish the same task in a
    different way?
    Thanks in advance.

    Probably what is happening is that when you change states,
    the HTML control is removed from the stage. However, the HTMLLoader
    (which is wrapped by mx:HTML) does seem to know that it has been
    removed, and losing focus, it's internal handler for the focusOut
    event access some property that requires it to be on the stage --
    hence the null object reference.
    You should report this bug at
    http://www.adobe.com/go/wish
    and provide a sample that demonstrates the issue.
    A workaround might be to change the focus to another object
    with stage.assignFocus() before you change states.

  • Application calling another application not using states

    I have a project  and within two applications.
    1 - I have a main  application, and it got a button that will call my other application,  which is within the same project.
    2 - I do not  intend to use the states, by mixing the code too.
    3 - Is there a way to create a call to another  application is similar to what is done in PopUpManager?
    tks

    Does the called component have to be an Application. If not, you can create a cutom component (extending from any other Flex container except Application) that holds everything you require and instantiate in your original Application on the Button Click.
    If you must have an Application, you can create a separate project for the second application and compile it into a SWF. You can then load this SWF from the SWFLOADER Flex control on Button Click.

  • How to get the main funciton name when calling another function inside?

    for eg, one RFC named A,inside A,a funtion B is called.when the processing is at B now,how can i get the main RFC name(A)?
    any help will be much appricated.

    > just see SM50,there is a column called 'Report',it shows the program id the proess is now processing.but i don't know its main program or say it 'the process's first excuting program',how can i get it programmatically?
    I'm still not sure to understand. The program in SM50 is the current main program (not the first). It is stored in SY-REPID system variable. Or use this code:
    DATA lt_callstack_long TYPE abap_callstack.
    DATA ls_callstack_long TYPE LINE OF abap_callstack.
    CALL FUNCTION 'SYSTEM_CALLSTACK'
          IMPORTING
            callstack    = lt_callstack_long.
    READ TABLE lt_callstack_long INDEX 1 INTO ls_callstack_long.
    WRITE : / 'current main program is:', ls_callstack_long-mainprogram.
    If you want to know the frame program (the first called), use SY-CPROG, or use this code:
    DATA lt_callstack_long TYPE abap_callstack.
    DATA ls_callstack_long TYPE LINE OF abap_callstack.
    CALL FUNCTION 'SYSTEM_CALLSTACK'
          IMPORTING
            callstack    = lt_callstack_long.
    " read last line = first called program
    DESCRIBE TABLE lt_callstack_long. "to make sy-tfill = number of lines
    READ TABLE lt_callstack_long INDEX sy-tfill INTO ls_callstack_long.
    WRITE : / 'First main program is:', ls_callstack_long-mainprogram.

  • Calling another function from run function

    Dear All,
    Below is my skeleton of multithread programme. I am now going to implelment a new function to do the processing rather then over crowding my run fuctnion. Where exactly must I define the myNewFunction in the same class as ConnectionHandler or create a new class? What would be right? I saw some place you need to put the word static what is it?
    class ConnectionHandler implements Runnable {
         public void run() {
          callMyNewFunction()
    }

    Dear Jverd,
    Basically below is code skeleton. So below the big T is new Thread(new ConnectionHandler(socketConn1)).start(); correct and the small t is the run function correct? So my question is that if via the run function I call some other function will that have impact on the memory allocation or shall I leave all my codes in the run function itself? I hope I am clearer now.
    public class commServer {
       public static void main(String[] args) {
          try {
               final ServerSocket serverSocketConn = new ServerSocket(9000);
              while (true)
         try
         Socket socketConn1 = serverSocketConn.accept();
                    new Thread(new ConnectionHandler(socketConn1)).start();                          
         catch(Exception e)
         System.out.println("MyError:Socket Accepting has been caught in main loop."+e.toString());
         e.printStackTrace(System.out);
          catch (Exception e)
             System.out.println("MyError:Socket Conn has been caught in main loop."+e.toString());
             e.printStackTrace(System.out);
             //System.exit(0);
    class ConnectionHandler implements Runnable {
        private Socket receivedSocketConn1;
        ConnectionHandler(Socket receivedSocketConn1) {
          this.receivedSocketConn1=receivedSocketConn1;
       //@Override
       public void run() {
          Connection dbconn = null;
          BufferedWriter w = null;
          BufferedReader r = null;
          try {
             PrintStream out = System.out;
                BufferedWriter fout = null;
             w =  new BufferedWriter(new OutputStreamWriter(receivedSocketConn1.getOutputStream()));
             r = new BufferedReader(new InputStreamReader(receivedSocketConn1.getInputStream()));
             int m = 0, count=0;
             String line="";
             String n="";
             //w.write("$PA\n");
             //w.flush();
             while ((m=r.read()) != -1)
                      ///**DB processing here.
                      n="";
          catch (IOException ex) 
               System.out.println("MyError:IOException has been caught in in the main first try");
               ex.printStackTrace(System.out);
          finally
            try
                 if ( w != null )
                        w.close();
                 else
                      System.out.println("MyError:w is null in finally close");
            catch(IOException ex){
               System.out.println("MyError:IOException has been caught in w in finally close");
               ex.printStackTrace(System.out);
    }

  • Calling an OA Function from another function

    Hi,
    I need to create a link in a function that calls another function.
    I've created a new Item 'Static Styled Text' writing in the destination URL 'OA.jsp?OAFunc=FUNCTION_NAME&pPersonID=&pFromMenu=Y'.
    I am able to connect to the Function but the person_id parameter passed is not the right one.
    To be clear I'll write down an example. I am a super user and in FUNCTION A I query an employee and enter in the function. Subsequently I click on the link I've created to view this employees information in FUNCTION B. Instead it queries my information, passing my person_id.
    Can someone help?
    thanks

    You would need to get hold of the person id of the employee you queried, this may be a VO attribute
    Once you get the person Id, you would need to set the URLs parameter value to this value.
    so the URL when you are in the next pahe would look like
    http://<server:port>/../OA.jsp?OAFunc=FUNCTION_NAME&pPersonID=<the value you passed>&pFromMenu=Y
    Thanks
    Tapash

  • In Captivate 7, how can I call another action from within an action?

    I have a conditional action called FakeSuccessRewind. Now I need to call another function called ShowGrayBalloons02 from within its Else statement, but I couldn't find something like "Execute Advanced Action." Can anybody share some tips here? Thanks!
    Below are screenshots of my two actions:
    1) FakeSuccessRewind (if/else). Here I need to call the 2nd action from the Else statement, underneath the statement Go to the next slide.
    2) ShowGrayBalloons02. Note this function has five seperate runs when the variable is decrementing from 5-1.
    Thanks a lot!
    Melissa

    You can't, you need to add the other action into the first one.

  • PL/SQL Function in Select statement

    Hi
    I am calling a function in select statement. The query works in Toad and PL/SQL developer except SQL plus and disconnecting Oracle connection.
    The error is “ERROR at line 1: ORA-03113: end-of-file on communication channel”.
    When I called the same query from BC4J View Object the error message is “java.sql.SQLException: No more data to read from socket”.
    Can any one advise me please?
    Thanks
    Srini

    Srini
    I've seen similar cases in the past with 9.2.0.x (x <= 5). What Oracle version are you using? It's worth checking the bug database (I can't just now - I don't have a valid support id in my current contract). And as Warren says, post your SQL query.
    HTH
    Regards nigel

Maybe you are looking for

  • External monitor Pavilion 23-b210ed

    Hi, I have an HP Pavilion 23-b210ed Is it possible to use an external monitor on my all in one pc? the pc dont hase a video output, but is it posible to use an external video card ore something? do you recomond a product? looking forward fore your an

  • 10.2.1 now cant drag and drop

    Hi all just updated a few days ago and now cant drag and drop into my itunes but i can drag and drop onto my ipiod or iphone....any ideas i think ive tried everything

  • Convert Amount in Numbers into Amount in Words

    Hello everyone, I am tasked to draft format for our company's check printing layout using Numbers/Pages, I already did but since the existing format was just manual inputted by the users, it always resulting to typographical errors on our printed che

  • Display Exuection Plan in GUI

    Is there a way I can see the execution plain like MS SQL Server way, in GUI mode?

  • When running Junit for AMImplTest, service invocation fails due to security

    We have a Junit to test an AM java method. Part of the logic is to retrieve a cost using a service. We are using the Service Factory to perform the call and have the credential set in the connections, so when it is deployed, the credentials will be u