plsql function call

Hello

I have problems with calling function in CO as follows:

This function takes sysdate as parameter with the data type date and logical in CO as

Date of convertedDate = AM.getOADBTransaction () .getCurrentDBDate ();

System.out.println ("convertedDate" + convertedDate);

If (convertedDate! = null)

{

[Serializable] param = {convertedDate};

String caseno = AM.invokeMethod ("callPlSqlFunction", param) m:System.NET.SocketAddress.ToString ();

throw new OAException (caseno, OAException.INFORMATION);

} else {}

throw new OAException ("Please select sysdate.",

OAException.ERROR);

}

Am:

public String callPlSqlFunction (Date convertedDate) {}

String caseInfo = "";

String stmt = ' START: 1: = UTIL_PKG.caseno_fiscal(:2); end; « ;

CallableStatement cs =

getOADBTransaction () .createCallableStatement (stmt, 1);

try {}

cs.registerOutParameter (1, Types.VARCHAR);

cs.setDate (2, convertedDate);

CS. Execute();

caseInfo = cs.getString (1);

CS. Close();

} catch (Exception e) {}

e.printStackTrace ();

}

Return caseInfo;

}

The issue is at cs.setDate (2, convertedDate)... He does not accept this condition for some reason any.

Help, please.

Thank you

You have this job?

Tags: Oracle Applications

Similar Questions

  • Process: a function call

    Hello

    I wonder what are 'best practices' to call a pl/sql function in the 'processing of the page"->"after submit' events?

    Example:

    I have a plSql function that returns a 'boolean' as the indicator of success/failure of the call. I wonder how I would incorporate the value of (this function) return in "after submit' logic?

    My line of thought is:

    press a button 'create', which calls a function. Now, I guess I need to validate the return value and depending on the result, either display an error message or a success message.

    I have to write my own wrapper in this situation:

    Start

    If the value returned by the function is! Ok then

    raise the error() application;

    end;

    or is there a better way?

    Hi AZZ.

    First you must get rid of your C-like habbits you have a function and (usually) returns 0 if called successfully, otherwise returns something else, and then test the return value and do other things depending on what is returned. In APEX, a process is a block of code that is executed successfully (for example, without exception) or fails and generates an exception. Also note that although it is quite right to put this code in a process

    begin
         null;
    end;
    

    slightly modified code

    begin
         return 0;
    end;
    

    produces a lot of exceptions. This process of page are supposed to simply not to return something but it doesn't matter - fortunately we have a feature how to manage success and error messages. There is a success Message text box where you can place a few generic message or if you want have more personalized it, you can for example create an item hidden on your page like PX_SUCCESS_MSG and set its value somewhere in the process (like: PX_SUCCESS_MSG: = "Bravo, all records deleted") and then use it in your message of success (you should have in your success message window something like "My message success: & PX_SUCCESS_MSG. without quotation marks"). Note that it must be before ampersand and point after the name of the element.

    The same thing with an error message - you can use a generic a handset with the Oracle error message (put there "error: #SQLERRM #") or if you want to have a custom error message, use the API APEX_ERROR https://docs.oracle.com/cd/E59726_01/doc.50/e39149/apex_error.htm#AEAPI2217 in your process.

    Kind regards

    Pavel

  • PLSQL function to return the result of the query

    Dear all,

    Oracle Database SE1 11.2.0.1

    I need to create a plsql function which should accept SQL as a parameter, execute it and return the result set.

    Is this possible?

    Madhu.149 wrote:

    I need to create a plsql function which should accept SQL as a parameter, execute it and return the result set.

    Be careful - results games indicate a set of data stored in memory. This is not what are sliders. This isn't how Oracle should be used.

    Imagine that you implement such a result set function - which, on average, requires 1 MB of memory (private server) to store the results of the SQL query. A 100 users mean a 100 MB of memory required server. This is not suitable. Not at all. Never.

    The correct back 'thing' is a handle to SQL cursor (called a ref cursor in this case). A SQL cursor is a "program" - that the appellant runs via the fetch command and generates one or more lines accordingly. Appellant repeatedly runs this slider through calls to fetch until this slider found and returns all rows affected (using consistent readings).

    If you want an abstraction interface that the client can call via PL/SQL code in the database, so this crafting optimal SQL interface, creates the SQL cursor and returns the handle of the cursor (via the ref cursor data type) to the client.

  • This plsql function is considered ok?

    This plsql function is considered ok?  The reason that I ask is that the results are different when called within a packet vs appeal during a procedure.  I don't know if this is a bug or if it is illegal.

    CREATE OR REPLACE package body test as
    
    function test return varchar2 is
    begin
    htp.prn('ABCDEF');
    return 'xyz';
    end;
    
    
    end;
    
    
    

    When this function is called inside a package, the string 'ABCDEF' will appear out of sequence.   I think it's because of the in-Lining, 11 g the function at compile time.

    Whereas, when the function is called during a procedure the string 'ABCDEF' appears in the browser html properly.

    The service is technically do stuff how to output data from htp.prn, then Oracle can judged illegal.  I have a very good reason for wanting this feature, so before you take a different approach, I wanted to ask around.

    The question is how the statements are executed by the PL/SQL engine.

    Consider the statement:

    HTP.p (' test1 ' |)  FuncTest() ' | 'test2');

    To run it, all nested 'objects' must be resolved and executed first. Think of the execution path inside-to-outside.

    If FuncTest() is executed first. He puts a string into the buffer of HTP. The result of the function is concatenated and created a unique string literal. This literal is now the parameter in the call to htp.p (). Who then adds, after FuncTest(), a string to the buffer of HTP.

    I disagree with your statement that it behaves differently in the procedures as packages. I created 3 test cases for the foregoing. Anonymous block (run immediately the text code execution). Individual objects (separate procedure and function). Single object (procedure and function wrapped in a box).

    Each product, as expected, the same result.* how the engine of PL/SQL treats the path of execution of instructions, does not change because the statement is in a packed and not a stand-alone procedure.

    * 11.2.0.2 using SST 11 g Server (Apache v2 and v2 mod_plsql).

  • ERR-9131 error in the body of PLSQL function for default code point, the point =

    Hi all


    I am filling a field element of text in two different ways, but on the same page:

    1 - the page is called to change the values inside-> value of the element comes from field of database

    2 - the page is called to insert new values-> value of the element comes from a calculated function that returns a default value

    Point features:

    Source->

    always replace any existing value in session state

    database column

    -> Default

    -----------------------------------------------------------------------------------------------------------------------------
    default value
    ------------------------------------------------------------------------------------------------------------------------------
    DECLARE
    NUMBER OF THE LINHA;
    gene number;
    i_emp varchar2 (32000);
    v_sql2 varchar2 (32000);
    BEGIN
    i_emp: =: P62_EMP_COD;

    IF: P62_RDD_LIN IS NULL THEN
    LINHA: = 1;
    ON THE OTHER
    LINHA: =: P62_RDD_LIN;
    END IF;

    v_sql2: =' select '. i_emp |'. Grh_1_utils. GRHFU_RUB_DEFAULT ('|: P62_ENT_COD |', 'R' ' |: P62_REM_COD |', 1, 1000000, to_date null, "D", ("' |: P62_DAT_INI |")) (', "DD/MM/YYYY"),' | LINHA |') the double ';

    EXECUTE IMMEDIATE v_sql2 INTO gene;
    COMMIT;

    return deciphered;
    end;
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    default value - body of the PL/SQL function




    The error I get is:



    ORA-00936: lack of expression

    ERR-9131 error in PLSQL function for default code point body, item = ITEM_TO_POPULATE



    Something is wrong with my function or is a different, better way to do this?


    Cordially Pedro.

    Hello

    You can do some tests?
    (1) try to make this code first (to make sure that the P62_EMP_COD is not null when running):

    DECLARE
    LINHA NUMBER;
    defeito number;
    i_emp varchar2(32000);
    v_sql2 varchar2(32000);
    BEGIN
    i_emp := :P62_EMP_COD;
    
    IF :P62_RDD_LIN IS NULL THEN
    LINHA:=1;
    ELSE
    LINHA := :P62_RDD_LIN;
    END IF;
    
    v_sql2:='select '||i_emp||'.Grh_1_utils.GRHFU_RUB_DEFAULT('||:P62_ENT_COD||',''R'','||:P62_REM_COD||', 1 , 1000000,''D'',null,to_date('''||:P62_DAT_INI||''',''DD/MM/YYYY''),'||LINHA||') from dual';
    
    EXECUTE IMMEDIATE v_sql2 INTO defeito;
    COMMIT;
    
    return defeito;
    end;
    

    (2) then you can try to change your source, by changing 'replacement always of value that exists in the session state' "only when null.

    (3) enter your variable dynamic SQL code and check it out:

    DECLARE
    LINHA NUMBER;
    defeito number;
    i_emp varchar2(32000);
    v_sql2 varchar2(32000);
    BEGIN
    i_emp := :P62_EMP_COD;
    
    IF :P62_RDD_LIN IS NULL THEN
    LINHA:=1;
    ELSE
    LINHA := :P62_RDD_LIN;
    END IF;
    
    v_sql2:='select '||i_emp||'.Grh_1_utils.GRHFU_RUB_DEFAULT('||:P62_ENT_COD||',''R'','||:P62_REM_COD||', 1 , 1000000,''D'',null,to_date('''||:P62_DAT_INI||''',''DD/MM/YYYY''),'||LINHA||') from dual';
    return v_sql2;
    EXECUTE IMMEDIATE v_sql2 INTO defeito;
    COMMIT;
    
    return defeito;
    end;
    

    (4) prevent your run immediate code of SQL Injections using the link:

    DECLARE
    LINHA NUMBER;
    defeito number;
    i_emp varchar2(32000);
    v_sql2 varchar2(32000);
    BEGIN
    i_emp := :P62_EMP_COD;
    
    IF :P62_RDD_LIN IS NULL THEN
    LINHA:=1;
    ELSE
    LINHA := :P62_RDD_LIN;
    END IF;
    
    v_sql2:='select '||i_emp||'.Grh_1_utils.GRHFU_RUB_DEFAULT(:1,''R'',:2, 1 , 1000000,''D'',null,to_date(:3,''DD/MM/YYYY''),:4) from dual';
    
    EXECUTE IMMEDIATE v_sql2 INTO defeito USING :P62_ENT_COD, :P62_REM_COD, :P62_DAT_INI, LINHA;
    COMMIT;
    
    return defeito;
    end;
    

    Best regards, Kostya Proskudin

  • Tecra A9 tcrdmain.exe Vista Runtime error R6025 pure virtual function call

    At the start of Vista, I get the following runtime error:

    Program c:\program files\toshiba\flashcards\tcrdmain.exe

    + R6025

    + pure virtual function call.

    Concerning

    Friend Nel

    Hello

    I see that this error is due to the flashcards\tcrdmain.exe.
    This flashcard application belongs to the Toshiba Vista Package added value and I think you should try to reinstall this package again.

    First, he must remove the old system VAP. Download the most recent PPV from the European driver Toshiba page, then reinstall it.

    Good luck

  • XNET Config read to fill in when a certain arbid is received (i.e. return of function call when the msg is received)

    The API XNET-CAN allows to hardware configuration such that a call to read the framework/signal does not return until the message is received (no need to query the buffer, call to the function is as an event... function returns when a message is received) or if a time-out occurs).  I don't really want to query for data, unless I absolutely have to.  My plan is to have parallel code to wait for a specific message to receive and respond (should be very fast!) whil a different loop receives all other executives.

    A time-out of the reading function call would work pretty good, but it doesn't seem to work (see extracts attached).  The value of timeout only seems to work (no error property) is a value of 0 seconds.

    Thank you

    Todd

    Change of a single point of session for a queued session.

  • How does the library function call Labview? Can I emulate using C++?

    Hi all. I recently finished writing a dll CUDA for LabView, and now I'm in the steps of optimization of code, memory management, etc. BUT since my code depends on the entries of Labview (lots of data under types of specific data as table manages and Clusters labview) I can't use the CUDA Profiler or the Profiler VC ++ on the DLL. What I intend to do runs labview and then out of all data entry for the DLL in a binary file and then add an additional function in my code that will read in the binary file, allocate and assign variables to their respective positions, and then call the specific DLL function in Labview. In the end, this miniature function will act as the library function call to my specific group of data entries.

    In any case, I started to make this purchase all my data entry of cluster and it comes out in a binary file. And then I started the initialization of the handles of labview, allocating memory and begins to write the binary data in the memory and it works for integers (ints), floats, etc., but I'm confused on how it works with table handles!

    Some examples of code:

    Sets the Handle for table 1 d for INT
    typedef struct {}
    int length;
    int val [1];
    to access the value in a row-online val [Online]
    } Array1dInt, * Array1dIntHandle;

    int main()
    {
    Array1dIntHandle x = new Array1dInt *;
    (* x) = new Array1dInt;

    ifstream file ('TESTDATAIN.dat', ios: in | ios::binary);

    If (file.is_open ())
    {
    file ((char *) &(*x)-> length, sizeof;)
    file ((char *) &(*x)-> val [0], sizeof (int) *(*x)-> length);

    LabviewSpecificFunction (x);
    leader. Close();
    } else
    {
    < "file="" did="" not="" open!"=""><>
    }
    return 0;
    }

    __declspec(dllexport) LabviewSpecificFunction (Array1dIntHandle x)
    {
    ...
    }

    However, my program crashes when the table is nominally big, and it is expected, because if we look at the Array1dHandle, it has allocated only enough memory to 1 item of value! YET, somehow, in its magical and mysterious labview is capable of making val [1] be val [HOWEVERMANYYOUWANT], even if C++ 101 says that val [1] is a constant pointer, and even if I dynamically allocated memory another somwhere, I would never be able to put these data in this round!

    Can you explain, or maybe even write example on how I can fool my program into thinking that the binary code comes from labview, so I can then run my program independent of allowing me to profile the functions inside labview?

    I hope that this question is clear and my sample code is also clear, but I'm happy to answer any questions that relate to this.

    Thank you all!

    I think that I thought about it.

    Array1dIntHandle x = new Array1dInt *;
    int tempsize;
    file ((char *) & tempsize, sizeof;)
    (* x) = (Array1dInt *) malloc (sizeof (int) + sizeof (int) * tempsize);
    (* x)-> length = tempsize;
    file ((char *) &(*x)-> val [0], sizeof (int) *(*x)-> length);

    Well enough, you will need to make the handle, and then make a new Array1dInt * for him, then read in the length of the array in a temporary variable. Then use this information to then malloc memoery quantity you need for the table and pass this place on the handle. Now the handle will point to the size of the memory and you will be able to access the memory in the format, you've done the handle. Badabing badaboom

  • Make sure that wire you all the inputs and outputs of your node library function call?

    This document says "make sure that wire you all the inputs and outputs of your node library function call.

    http://digital.NI.com/public.nsf/WebSearch/7253D2F0D91F68058625752F005AB672?OpenDocument&submitted&&...

    But all the terminals on the right side of the call library node considered "outputs" referred to in the foregoing statement?

    This same document continues to show the right way to allocate memory with this illustration and in the illustration, the right "outputs" are left without junctions.

    Am I right in assuming that the only terminals that count as outputs, those who use the code of the DLL (modify) as output?  If it is true, then all other terminals output associated with the values entered alone so don't really account as outputs, correct?

    In the parameter call-library configuration screen there is a "Constant" check box and the help that he wrote "indicates whether the parameter is a constant."  What is this box? for me in the setup of the DLL call

    Finally, assuming that a call from the DLL that is supposed to write in these five outputs, is it legitimate to use constants like this to book a space of memory for the output values?

    How about if local variables associated with the output terminals are used instead?

    Despite the linked document, it is necessary to connect the corresponding entry for simple scalar output parameters (for example a digital). LabVIEW automatically allocate memory for them. If you do not want the entries for all the output wire anyway, there should not be no difference between a constant and a local variable; I would use a constant to avoid useless local variables.

    For settings that are only entries, there is not need to connect the outlet side. It's a bit simplistic since all parameters are entered only and get one result (other than the return value), you pass a memory address and modify the content to this address, but LabVIEW manages this dereferencing pointer for you. If you want to really get into the details, learn more about pointers in C.

    The "Constant" check box acts as the qualifier "const" on a c function parameter. It tells the compiler that the function you are calling will not change this setting. If you call a function prototype includes a const parameter, then you must mark this as a constant parameter when you configure the call library function node. Otherwise, I wouldn't worry on this subject.

  • Questions MathScript Matlab function calls

    I have a question about the m-script function call (MATLAB) in Mathscript Labivew 2009. I have attached my buggy vi for an example:

    1. I called a function 'remodel (Sigma0, [O O Q M])"in Mathscript, it gave me a syntax error, but not in Matlab R2009b. I guess that it does not tolerate a great deal of input parameters. Any idea as how use the reshape feature in Mathscript?

    2. Another problem is that I've defined a function m-script with 2 parameters, in Matlab, I can call the function with a single parameter provided, however in Mathscript, system reports error if I only provided 1 parameter to a function of 2 parameters. Any idea as how to cope with this problem?

    Because I have a lot of code in the format m-script, I don't want to rewrite a lot of new code.

    Thanks for any help.

    Hi aggressor.

    Indeed there is a small difference in the matlab function and labview mathscript reshape function reshape. The difference is that Matlab is considered always any 2D array from the perspective of lines... where LabView considered from the perspective of columns... that is, if a table 2D likeX = [has and b, c and d] is here and the (x, 1, 4) reshape in labview will give out like a, c, b, d in an array, matlab, the output will be has b, c, d in a table.

    And in Labview syntax you gave will certainly give a syntax error. Please visit the labview syntax help.

    Thank you and best regards,

    srikrishnaNF

  • How to use the node function call library for a function in the dll with the data SUB type

    Hi all

    I would ask for your kind help

    I am facing a problem with the call library node.

    I have a C++ (stdcall) function, which has Sub as data type

    XXXX error code (hwnd, lid, getValue, * Sub data1, * Sub data2)

    data1 and data2 types are constantly changing based on the value of 'getValue '.

    Mainly I can use the call library node several times and adapt each node according to the types of data data1, data2 and extract the values and use in the code. Here is no question. Real question is:

    My question:

    How can I use a node of library time call and make a case according to the 'getvalue', who will control the data1, data2 data type. Here I really seeking solutions.

    My tests:

    I used varaints as entry to the libray call node of the data1, data2 and selected parameters in the call libraby node as "Adapt to type. Here labview just crashed.

    I appreciate your suggestions to feedbackand.

    Thank you

    Karine

    You must allocate enough space for data1 and data2, and then pass a pointer to this space. An easy way to do this is the function to initialize table. Set the U8 type and size for the number of bytes required. Pass this array to the function as a pointer of table data.

    After the function call returns, you need to extract the data in the table. You can do it manually, but a simple approach is to use the array of bytes to a string. Then, in a housing structure, use Unflatten chain to convert the string to the correct data type. This method also converts the "endianness" which will be probably necessary; Be sure to only set all entries for unflatten correctly.

  • How to extract a macro function call arguments

    Hi all

    I need help related to Macros in C.

    This is my code:

    #ifndef checkTrace
    #define checkTrace (CAFC) if (1) {printf ("function called checkTrace is :") ;}
    #endif

    I am looking for is:

    Suppose that is called checkTrace (getchar ()); I want to print 'GetChar () is called from checkTrace macro.

    Like this whatever the button func called by the macro checkTrace, I want to print the message as above mentioning the button func called by checkTrace()

    Any body let me know how I can do this in CVI?

    Any help will be greatly appreciated.

    Thank you

    Herald

    I think what you need is the operator "stringification": #.

    Check this box:

    #define checkTrace (CAFC) if (1) {printf ("function called checkTrace is: ' %s", #fCall) ;}}

    checkTrace (getchar ())

  • Function calls multithreaded suddenly causing blockages

    I'm having a problem with function calls from multiple threads. There are two threads that everyone calls a function called save_program, including a DDCChannelHandleGroup and and a certain structure "show pulse" moved. The problem I have is that after that I called him save_program of one of the sons, it crashes when I try to call from the other thread. There are three contexts for this - two in the main thread and the other in the thread of data acquisition.

    If I call the save_program of one of the contexts in the main thread, the program crashes when I try to call it in the thread for the acquisition of data and vice versa. No problem since the two contexts in the same thread. I put a breakpoint in the function call and the first part of the executable code in save_program (declaration of variable initialized to NULL), and the program freezes between these two breakpoints. I checked and always executed entirely complete in each of the threads AND the call of CmtExitThreadPoolThread() also runs very well. I also locked up all instances of save_program in CmtGetLock/CmtReleaseLock calls without success. Oddly, these calls used to cause no problems with the exact configuration of multithreading even. I don't know what has changed.

    Hi PaulGanssle,

    It is very possible that you have already encountered a problem experienced in LabWindows/CVI where transactions must be completed before calling SaveFile.  I have included a link below that talks a little more about this problem.

    http://zone.NI.com/DevZone/CDA/tut/p/ID/12323#281013_by_Category

    It is a question that has been reported and is managed by R & D.  From now on, it is not a fix available but I hope we can find a work around that will work for your application.

    Please let me know if you have any other questions.

    Kind regards

    Kyle S

  • Writing DAQmx invoke node leads to a runtime error (R6025 - pure virtual function call)

    I have a request in which a Subvi DAQmx writing calls calling node (shift of writing and reading NumChans).

    When I launch LabVIEW and the main VI a first run, everything works fine. When I run a second time, LabVIEW crashes with a runtime to Scripture DAQmx error call node:
    R6025 - pure virtual function call

    The LabVIEW failure log file contains the following lines:
    c:\builds\penguin\labview\branches\Saturn\dev\source\compiler\allocsup.cpp(662): DWarn: dataspace moved running!
    $Id: //labview/branches/Saturn/dev/source/compiler/allocsup.cpp#18 $

    Anyone has any idea how this accident could be avoided?

    Problem solved: we have just removed the line NumChan (read) from the node to invoke and readded it again. Now, it works fine.

  • Write failed with getting Sonic error R6025-Pure Virtual Function Call

    After midway to burn a DVD, Sonic fails and know that it is a R6025 Pure virtual function call and refers to commonfiles\sonicshared\sonciecentral\main\mediahub.exe.  I had several problems with this program. Is there a way to remove it and then reload it?  I don't have a disk for it.  Thank you

    Hello cmd_078m,

    Where you installed the program Sonic of origin? You can uninstall it, but it will remove the program and you will need the original media to reinstall.

    You can check with Sonic for replacement disks or you can install any other CD burning software.

    Thank you

    Marilyn

Maybe you are looking for