Trouble passing Dates into stored procecure

I have a J2EE (WebLogic) application that uses the jDriver to talk to a 9i database (mostly invoking stored procs). Most of the time they work fine, but I have one case in particular that has intermittent problems accepting Date objects.
The stored proc in question accepts 5 IN parameters (NUMBER, DATE, DATE, DATE, NUMBER) and returns one OUT param (VARCHAR). In the Java code, I have 2 Integer and 3 Date objects that I am setting on a CallableStatement to invoke the stored proc.
String SQL_TEMPLATE = "{? = call my_pkg.UPDATE_DATES(?,?,?,?,?)}";
statement = connection.prepareCall(SQL_TEMPLATE);
statement.setInt(2, int1);
statement.setDate(3, date1);
statement.setDate(4, date2);
statement.setDate(5, date3);
statement.setInt(6, int1);
statement.registerOutParameter(1, Types.VARCHAR);
As you can see, at no time am I converting between Date and String. However, sometimes when this code runs and executes the CallableStatement I get the following error:
"literal does not match format string"
I've done a lot of googling and from what I can tell that error should only come up if I was trying to use Strings and convert them to Dates.
The worst part is that this is not consistent. Sometimes it works fine, other times it fails. And when it fails it will continue to fail. Unless I give null for the Date objects, in which case it always seems to work.
I've tried it on different machines and by rebuilding/restarting the app numerous times - for example the most recent tests I did this morning it was working fine the first try, then I just bounced the app server (not Oracle) and then it started throwing the errors again. On a coworker's machine, the app works flawlessly every time (talking to the same DB instance); on another machine it worked at first, then exhibited the problem, but now works flawlessly every time.
I've tried moving to the thin driver which seems to alleviate this problem, but for various reasons that is not a real option at this time - I need to figure out what is wrong using the jDriver (OCI).
Does anyone have any insight as to what the problem could be? I'm desperate and willing to try just about anything at this point.
TIA,
Eric

Some new information that sheds a little bit of light:
I was able to narrow down the usage pattern that creates the problem. I start the app. The first save always works, regardless of which of the three Dates are non-null. After that, subsequent saves that only use non-null values for the same parameters as the first save will work. But if I try to use a real Date where I had originally saved a null, I get the error. If I restart the app, it starts over again.
For example:
A) Start app.
B) Save the form with Date1 and Date2 set, Date3 is null.
C) Go back and try to save the form again, this time with Date1 set, Date2 null, and Date3 set - ERROR.
D) Save the form again, this time going back to Date1 and Date2 set, Date3 is null - success.
I can repeat step D again and again with success. But step C will continue to fail (and other ones like it where I am trying to set a Date where I oringally set a null) until I restart the app.
Reminder: I am using WebLogic's jDriver (their own custom Type-2 JDBC driver that relies on the Oracle OCI client installed on the local machine)

Similar Messages

  • Dynamically passing data into a running while loop from a DAQ assist. in an ouside while loop

    Hello,  I'm currently a student working on a senior project and I'm trying to do a state machine that will turn off and turn on a compressor depending on time and coprocessor failure. 
    In the run state, wich is #1 on the case structure box I placed the DAQ assist.  Which takes in data from an accelerometer.  If the accelerometer's value is above the limit four times it will end the loop or if the time runs out it will end the loop. 
    The problem I am having is that i need to run four compressors.   I was thinking about having four case structures all within the outside loop, but I can only have the DAQ assist in one location.  This means that I now have to move the DAQ assist out of the run loop or run all four compressors in the one case structure.  If i remove the DAQ assist.  I can only get it take in data once when the loop starts and never again.  I understand why, but is there a way to dynamically pass data froma  DAQ assist.  into a running loop? 
    Also on a side note, i can't find a tutorial on how to really create a state machine using Enums.  Does any one know where to find this. 
    I have attached my curent program.
    Thank you for your help,
    Ryan
    Attachments:
    TEST STAND STATE MACHINE 2-28-07.vi ‏288 KB

    in labview choose file->new... then pick standard state machine and there are instructions.
    you can create a custom control and either use an enum, text ring or menu ring.  Edit the values and then save the control and drop into your vi and you can wire this to your case structure
    - James
    Using LV 2012 on Windows 7 64 bit

  • Passing data into a variable

    Hi, 
    All I want to do is pass numerical data into a variable, and then access it later. 
    Specifically, I use the Read Vector Space Position VI to find the X and Y positions of my motors. When I press a button, I want the X and Y position at that moment to be saved, so that I can access this information later.
    I would like to do this in a subVI.
    I have read tutorials on functional global variables, but so far they have been quite confusing. Specifically I do not know how to place/use uninitialized shift registers. 
    If someone could create a simple example code, that would be extremely helpful. I am using Labview 2011.
    Thanks

    Action Engine <- must read nugget
    If you don't understand shift registers...
    3 Hour Introduction
    6 Hour Introduction
    LabVEW Basics
    Self Paced training for students
    Self Paced training beginner to advanced, SSP Required
    LabVIEW Wiki on Training
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to pass date into a sp?

    Hi,
    Could anybody know how to pass a parameter of type date into a
    sp? Below are something I tried:
    1.
    create or replace package empTest AS
         PRAGMA SERIALLY_REUSABLE;
         TYPE curType IS REF CURSOR;
         function Details (
              hd date)
              RETURN curType;
    END;
    CREATE OR REPLACE PACKAGE BODY empTest AS
         PRAGMA SERIALLY_REUSABLE;
    function Details (
              hd date)
              RETURN curType IS
              sum_cv curType;
         err_num NUMBER;
         err_msg     VARCHAR2(200);
         sql_statement VARCHAR2(3000);
    BEGIN
    DBMS_OUTPUT.PUT_LINE(hd);
         sql_statement :=' SELECT * from emp where hiredate <
    to_date(''hd'', ''Dd-Mon-YY'') ';
    DBMS_OUTPUT.PUT_LINE(sql_statement );
         OPEN sum_cv FOR sql_statement ;
         IF NOT sum_cv%ISOPEN THEN
              OPEN sum_cv FOR sql_statement;
         END IF;
         RETURN sum_cv;
    END Details ;
    END;
    RUN      EXEC      :CV := empTest.Details('10-DEC-01');
    ORA-01858: a non-numeric character was found where a numeric was
    expected
    2. sql_statement :=' SELECT * from emp where hiredate <
    to_date(hd) ';
    Run in the same way:
    ORA-00904: invalid column name
    3. sql_statement :=' SELECT * from emp where hiredate < to_date
    (''hd'') ';
    Run in the same way:
    ORA-01858: a non-numeric character was found where a numeric was
    expected
    Thanks

    Use the call syntax ...
    empTest.Details(to_date('10-DEC-01','DD-MON-RR'));
    .. or better yet ...
    empTest.Details(to_date('10-DEC-2001','DD-MON-YYYY'));
    As you are passing a date you do not need to use the to_date function in the cursor SQL statement.

  • Passing Data into Subreport

    Hello,
    I am using Crystal 10. I am wondering if it is possible to pass data from a report into a subreport for calculations.
    Thank you.

    Hi Sabian,
    You can pull sub report information and use in main report, while getting the data from sub report to main please take care of the following :
    --Your sub report should be placed above your calculations in main report. ie. after processing of your sub report only you get data into your main report.
    --While writing formulas in sub report or in main report you will have to use Whileprintingrecords; to get get data into your shared variables. Eg:
    Whileprintingrecords;
    shared numbervar x;
    x:=x+fieldvalue;
    --When you create a formula in sub report it should be plced on your sub report, use the same variable name while creating a formula in main report.
    Make sure that the shared variable which you are calling in the main report should be in the below section of the sub report. If you want to pass the sub report to the main report in the same section then insert section below the sub report
    Hope this helps
    Regards,
    Shweta

  • Passing data into event

    Simple Question: I have text controls that I wish to take values from when a button is pressed. Using Events, how do I get values and store them...

    Are the values needed in any other portion of the program other than when the button is pressed? If not, you could place the controls within the event structure so that their values are only read when the button controlling the event structure is read. Note, though, that if the values are passed from the event structure to other portions of the program you need to determine the best approach for passing data when the button is not pressed (perhaps passing through a value from the last event).
    In the event that the controls are needed in other parts of the program separate from the event structure you can use local variables to read the current value of the controls.
    I hope this helps.
    John

  • Getting error message when passing data into table: Primary Key

    Getting an error in a process that is feeding the invoice creation in SAP, violation of PRIMARY KEY constraint 'INV1_Primary', cannot insert duplicate key in object 'INV1'. I assume this is due to duplicate key values being passed into the table INV1, however I get this error even when I am passing unique record combinations of the key fields docentry and linenum. This is on 2005A SP01.
    Thanks

    Hi Peter,
    Could you provide a code sample of the routine that is causing the error please?
    It sounds like a data corruption issue (though it could possibly be a bug in the DI API). I recommend you speak to SAP support. There is a utility that can validate the document numbering but you'll need to speak to SAP support before you run this as it can have other negative effects, depending on the state of your data. They may ask for a copy of your database to test.
    Kind Regards,
    Owen

  • Trouble passing variable into package

    I am having an issue reading a variable in a script task that I'm passing in from a windows service. I should be able to pass the param in from .NET and load it into one of my package vars right? The windows service is a file watcher service.
    Windows Service code
                        Package pkg;
                        Application app;
                        DTSExecResult pkgResults;
                        Variables vars;
                        app = new Application();
                        pkg = app.LoadPackage(pkgLocation, null);d because I log it to a log file.
                        vars = pkg.Variables;
                        vars["User::FileName"].Value = sFileName.ToString();
                        pkgResults = pkg.Execute(null, vars, null, null, null);
    The sFileName variable in the service is populated because I write it to a log file.
    In the package I list the FileName variable as read/write. Have checked the spelling.
    package code snippet:
          public void Main()
          //get file and path info
          string sFileName = Dts.Variables["User::FileName"].Value.ToString();
    the package fires but the variable is empty and I log an exception to the sysssislog:
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.  Parameter name: length    
    at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)     at ST_5a4733488a6149abb109d633296e2c38.csproj.ScriptMain.Main()     --- End of inner exception stack trace ---    
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)     at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)    
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)     at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object
    target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)     at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
    I cannot find what the issue is. In the package I log to a text file the value of FileName variable and as expected it is empty.
    I appreciate your help wit

    The scripting task which is designed to retrieve the file name from the package var User::FileName is listed in the scripting tasks read/write variables and it is a package level variable. Is that what you mean by "expects" Arthur? If so then yes. But is
    there a property setting on the script task that has to be set?
    I could use the config file but the file name changes daily with a date stamp suffix. I could also just sweep the directory when the file watcher executes the package but that all seems so sloppy considering that I should be able to pass the filename in
    as a variable.
    Thanks for talking through this with me. I appreciate it.

  • Passing data into BOX of a script

    Hi ,
    I have designed one script and in that i have created a BOX .
    In print the BOX is displaying . I want to pass some data ( some variable )into that BOX . How can i do that .
    Regards
    Sarmistha

    Hi,
    You can achive it by giving dynamically in SE71 screen.
    eg:
    ADDRESS
    /: BOX FRAME '10' TW
    /: ADDRESS
    /: TITLE &ITAB-ANRED&
    /: NAME &ITAB-NAME1&
    /: STREET &ITAB-STRAS&
    /: POBOX &ITAB-PFACH&
    /: CITY &ITAB-ORT01&
    /: POSTCODE &ITAB-PSTLZ&
    /: COUNTRY &ITAB-LAND1&
    /: REGION &ITAB-REGIO&
    /: FROMCOUNTRY &ITAB-LAND1&
    /: ENDADDRESS
    FOOTER
    /* footer
    /: INCLUDE ZS_TEXT OBJECT TEXT ID ST LANGUAGE EN
    /: BOX FRAME '10' TW
    /: DEFINE &V_NAME1& = 'PRINT PROGRAM'
    /: DEFINE &V_NAME2& = ' '
    /: PERFORM SUB_NAME IN PROGRAM ZS_SCRIPT04
    /: USING &V_NAME1&
    /: CHANGING &V_NAME2&
    /: ENDPERFORM
    P2 &V_NAME2&
    THIS IS <C1>&ITAB-KUNNR&</> INFORMATION
    GRAPH1
    /: BITMAP 'ENJOY' OBJECT GRAPHICS ID BMAP TYPE BCOL
    MAIN
    /* THIS IS CUSTOMER INFORMATION
    /: BOX FRAME '10' TW
    /: TOP
    ,,SALES DOCUMENT,,CREATION DATE,,DOCUMENT TYPE,,NETVALUE RATE
    /: ENDTOP
    Element ITEM DATA
    /: BOX XPOS '16.0' CH WIDTH '0' CH HEIGHT '50.0' LN FRAME '10' TW
    /: BOX XPOS '30.0' CH WIDTH '0' CH HEIGHT '50.0' LN FRAME '10' TW
    /: BOX XPOS '44.0' CH WIDTH '0' CH HEIGHT '50.0' LN FRAME '10' TW
    ,,&ITAB-VBELN&,,&ITAB-ERDAT&,,&ITAB-AUART&,,&ITAB-NETWR&
    Thanks and regards,
    Sarada

  • HFM to pass data into Essbase

    Hi
    One of my clients requirment is to pass the data from HFM into Essbase after doing teh journal entries. Is EIS the only way or is there a better way of synchronizing HFM and Essbase together. Also, if EIS is included with teh license deal with Essbase and HFM

    HFM has the internal feature to eliminate at a common parent point, so that sales data remains at lower levels.
    If you use pre Sys9 HFM and Essbase, without any ELT tools, how can you replicate HFM elimination feature inside essbase using HFM base data?
    Does a calc shell exist to traverse ragged hierarchies to do the same elimination in essbase?

  • Passing parameter into stored procedure

    Hi guys,
    I have a big problem here passing as a parameter in stored
    procedure.
    If i pass as a parameter in where clause it is working fine.
    Whenever i pass the parameter in order by it was not working..
    How to implement this issue????
    Here i am giving the example for package:
    PACKAGE XTRA.TEST_STATUS
    AS
    TYPE GenericCurTyp IS REF CURSOR;
    PROCEDURE SP_MAIN
    ( insortgroup IN VARCHAR2,GENERAL_CUR IN OUT GenericCurTyp);
    END TEST_STATUS;
    PACKAGE BODY XTRA.TEST_STATUS
    AS
    PROCEDURE SP_MAIN
    ( insortgroup IN VARCHAR2, GENERAL_CUR IN OUT GenericCurTyp
    ) AS
    BEGIN
    OPEN GENERAL_CUR FOR
    select last_name,first_name from applicant Order By insortgroup;
    END SP_MAIN;
    END TEST_STATUS;
    Passing as a parameter i am getting the below details.
    LAST_NAME FIRST_NAME
    ASFSDAF DASDFASF
    Ad DASD
    Adams John
    DANA WITEST
    If i hot code the parameter insortgroup to last_name
    i am getting the below values:
    LAST_NAME FIRST_NAME
    'ANNUNZIO GIANCOLA GABRIEL
    0'BRIEN ARMA
    0120453EZ ESTANISLAO
    082479 ELIZABETH
    Thanks,
    Rao

    CREATE OR REPLACE PACKAGE xtra.test_status
    AS
      TYPE GenericCurTyp IS REF CURSOR;
      PROCEDURE sp_main
        (insortgroup IN     VARCHAR2,
         general_cur IN OUT GenericCurTyp);
    END test_status;
    CREATE OR REPLACE PACKAGE BODY xtra.test_status
    AS
      PROCEDURE sp_main
        (insortgroup IN     VARCHAR2,
         general_cur IN OUT GenericCurTyp)
      AS
        select_statement VARCHAR2 (4000) := NULL;
      BEGIN
        select_statement :=
        'SELECT   last_name,
                  first_name
         FROM     applicant
         ORDER BY ' || insortgroup;
        DBMS_OUTPUT.PUT_LINE (select_statement);
        OPEN general_cur FOR select_statement;
      END sp_main;
    END test_status;

  • Pass Data Into Second View Controller

    *My Setup:*
    I have a tab-bar program; I'm currently focusing on one tab, which has a nav controller
    The root controller works as expected. In one of the table view selection methods (didSelectAccessoryButtonAtIndex, or something similar), I initialize one of my classes, which is a subclass of UIViewController with an alloc and custom init. Then I use the pushViewController to push an instance of that class onto the view stack.
    *My Issue:*
    I can't figure out how to pass the data from my first level controller to the second. I'm using a custom init method, which is an instance method because I have to pass an instance of a view controller to the pushViewController method. The data isn't getting to the second level controller, as verified by some NSLogs.
    *Pseudo code:*
    FirstViewController.m:
    -(void)accessoryButtonPressedAtSomeIndex {
    SecondViewController *svc = [[SecondViewController alloc] initWithString:@"Some string"];
    pushViewController: svc
    SecondViewController.m:
    @synthesize string;
    -(id)initWithString:(NSString *)someString {
    self.string = someString;
    NSLog (@"string = %@", someString);
    return self;
    The NSLog returns NULL.
    Obviously some of the code isn't valid, but I don't remember the exact methods. I can post the real code if necessary, but there are a lot of "dependencies" between files. Everything else (pertaining to this problem, although there are some other bugs in my app that I'd appreciate help on too) works. Any suggestions?

    Hello musicwind95
    Two suggestions :
    1) Didn't you forget to do
    if (self = [super init] )
    return self;
    in an init method ?
    Otherwise there is nothing to handle your string
    2) Put a breakpoint and trace ..

  • How do I pass data into a sub vi?

    Hi, I'm trying to pass an integer value into a sub vi that displays this value on a tank indicator. I've connected the tank indicator in the sub vi to one of the terminals but in the calling vi it seems to see the terminal as an output not an input. I can't find any way of selecting whether the terminal is an input or an output. How do I change the terminal to an input?
    I'm using LabView7.0 Express on a Mac.
    Hope you can help.
    Dave G.

    In the attached VI, the user enters a start run value, and that value iterates when the attached device, a Lab Jack, detects the leading edge of a 5 V square wave. There's also an elapsed time function. On its own, the VI executes as intended, but when implemented as a sub VI, indicators wired to the appropriate nodes on the icon in a while loop do not update with execution (i.e. elapsed time, run, and start program numeric indicators don't continually update.) However, when I look at the front panel of the sub VI, the indicator values are continually updated. I've read the help documents about refnum, references, and property nodes; how do I implement these tools to display continually updated values generated by the sub VI in the front panel of a VI?
    Attachments:
    GPIC Simulation 5.zip ‏40 KB

  • Passing data into SRM

    Hi
    We have a scenario where we are using the SRM business package in EP 6.0 and we have a requirement to pre-polupate a basic data field ( PO Type ) for the basic data screen in the Shop iView.
    We want to send this data from the Portal , possibly using a webdynpro application.Has anyone done something like this before ? Any ideas ?
    Regards,
    Muinul

    Action Engine <- must read nugget
    If you don't understand shift registers...
    3 Hour Introduction
    6 Hour Introduction
    LabVEW Basics
    Self Paced training for students
    Self Paced training beginner to advanced, SSP Required
    LabVIEW Wiki on Training
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

Maybe you are looking for