Stored Procedure issue

I have this stored procedure to check if someone ordered a Cancellation date on the line before cancelling it but when i try to add another condition where it should also check for cancellation code it fails. It works if they are individually used. Any suggestions.
Original Code
If (@Object_Type='17' and @Transaction_Type='U')
Begin
If exists (Select T1.LineNum from RDR1 T1 INNER JOIN ORDR T0 ON T0.DocENtry = T1.DocEntry where T1.linestatus='c' and T1.U_Cancellation IS NULL  and T0.DocEntry= @list_of_cols_val_tab_del)
Begin
set @Error='909'
Set @error_message='You cannot close an Order without a Cancellation Date'
End
End
Changed code
If (@Object_Type='17' and @Transaction_Type='U')
Begin
If exists (Select T1.LineNum from RDR1 T1 INNER JOIN ORDR T0 ON T0.DocENtry = T1.DocEntry where T1.linestatus='c' and T1.U_Cancellation IS NULL  and t1.u_pocancellationcode='01' and T0.DocEntry= @list_of_cols_val_tab_del)
Begin
set @Error='909'
Set @error_message='You cannot close an Order without a Cancellation Date'
End
End

Just try this query :
If (@Object_Type='17' and @Transaction_Type='U')
Begin
If exists (Select T1.LineNum from RDR1 T1 INNER JOIN ORDR T0 ON T0.DocENtry = T1.DocEntry where T1.linestatus='c' and T1.U_Cancellation IS NULL and ISNULL(t1.u_pocancellationcode,'') ='01' and T0.DocEntry= @list_of_cols_val_tab_del)
Begin
set @Error='909'
Set @error_message='You cannot close an Order without a Cancellation Date'
End
End
Hope this help.
Regards,
WhiteWood

Similar Messages

  • Stored Procedure issue in receiver JDBC synchronous scenario

    Dear Experts,
    Below is the description of the Stored Procedure for my requirement which has 1 input and 7 output.
    CREATE OR REPLACE PROCEDURE emp_det_proc
        p_emp_id IN NUMBER,
        cur_det OUT sys_refCURSOR
    aS
    BEGIN
        OPEN cur_det FOR
        SELECT * FROM EMP_PERSON_VIEW
            WHERE id = p_emp_id;
    END emp_det_proc;
    Inside the procedure , we can see that Select query is done on a VIEW which has some 7 column and these are the output. The data type description of the ID is VARCHAR2 in Oracle Database 11g VIEW, that's why I maintained VARCHAR in Constant mapping at SAP-PI side.
    I am maintaining all the column name present in the view for my JDBC request structure with isOutput and type.
    Below is my JDBC request.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_ECCJDBC_EmpStrdProc_JDBCReq xmlns:ns0="urn:empdet:sap:jdbc:storedprocedure"> 
    - <Statement> 
    - <emp_det_proc action="EXECUTE"> 
    <table>emp_det_proc</table> 
    <ID isInput="true" type="VARCHAR">200178</ID> 
    </emp_det_proc>
    </Statement>
    </ns0:MT_ECCJDBC_EMPStrdProc_JDBCReq>
    I tested with other XSD type like INT/CHAR/ but with the same error.
    Unable to execute statement for table or stored procedure. 'emp_det_proc' (Structure 'Statement') due to java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'EMP_DET_PROC'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    1. I observed that the Key field ID is maintained as NUMBER in Stored Procedure but in the VIEW it is maintained as VARCHAR2.
    Could anyone help me to solve the issue  with any suggestions?
    Regards
    Rebecca

    Dear Ramesh,
    There are change in the datatype of the Stored Procedure Input parameter. Below is the correct procedure description now.
    Select query of the View
    My JDBC structure
    Observation and querry:
    1. In the SP declaration, there is 1 IN parameter which I have  created in JDBC structure as p_moi_id and gave the type as INTEGER.
    Error : JDBC message processing failed; reason Error processing request in sax parser: Error when executing statement for table/stored proc. 'moi_det_proc' (structure 'Statement'): java.lang.NumberFormatException: For input string: "2*********&49"
    I assume since the range of the number is limited . Integers are values up to 2147483647 and the number I am using is greater than this values.
    2. I assume I have not included the parameter cur_det as OUT. Instead I have maintained the COLUMN names of Select query of the view. Should I remove all the Out parameters which represents inside the View.
    3. What could be the Data type equivalent to Oracle sys_refCURSOR in SAP PI?
    Please share you suggestion.
    Regards
    Rebecca

  • Legal consolidation stored procedure issue

    Hye everyone,
    I tried to execute the stored procedure SPRUNCONSO and I have this error. For information I already run the FXtrans and my database is empty. I just inputted the values I needed :
    - The method et the percentage in the ownership application
    - The input rates for LC and TOT_EUR in the Rate application
    - Some values in the Reporting application.
    All the input are on the same entity and on the time 2006.JUL.
    I don't have any flow dimension but if I understand well it's not an obligation.
    Executing SPRUNCONSO [REPORTING],[REEL],[TOT_EUR],[SPSCOPE_250359],[SPLOG_135291]
    SPRunConso Version 7.0.115
    Warning : Nothing Extract From Ownership for OPENING Period 
    *ERROR* CSD-150 Problem extracting Data : C_REPART 
    *ERROR* CSD-160 Problem extracting Data : C_CONSO 
    20060700 - 3 Rows Calculated
    20060700 - 3 Rows Updated
    The weird thing is that unless the failing during the execution the rows are crrectly inserted. If I delete the parameter scope_table the execution is succesfull but there is no rows calculated.
    I hope to be clear.
    Thank you in advance for your Help
    Franck

    Hi again Franck,
    In fact, this message is not necessarily an indication of an error in the script  or data, even though it appears so and is misleading. There is nothing wrong when you receive this except for the fact that I believe it to be a bit confusing for users.
    In summary, regarding the two errors : ERROR CSD-150  and ERROR CSD-160, the underlying error is a known issue and should be fixed in a future release.                                                         
    For now, you can use the provided workaround to get rid of those error messages.
    Hope this answers your question.
    Kind Regards,
    Patrick

  • Stored procedure Issue  in VC - Urgent

    Hi all,
    I am trying to insert a new record in a SQL Server database, using a stored procedure.
    I am inserting this new record from a popup iview, in which the data service is configured.
    But when I try to insert a new record, I am getting an error "No value was assigned to parameter(@ParentId)", where ParentId is the first parameter in my stored procedure.
    I am using flex 2.0 runtime from EP 7.0 SP13.
    Can anyone help me out?
    Thanks and Best Regards
    Shobin

    Hi,
    that field is missing the mapping of the input fileds
    Check the mapping b/w the input form view or the form form where you are inserting the record to dataservice.
    Regards,
    Govindu

  • Stored Procedure issue - why is it breaking?

    I have a VB5 application that calls a package in a 9i database. Frequently the package becomes broken. The application then tries again and it ALWAYS works fine the second time.
    I would like to figure out how this package is getting broken, but since I cannot replicate issue at will, it is a devil to track down.
    Is there any sort of trigger I can apply to figure out why the procedure is breaking?
    Edit: Sorry, wrong forum. I will re-post.
    Message was edited by:
    jlaidlaw

    Start with http://www.pinkmutant.com/articles/Leopard/leospot.html and my mod to Finder's Find at http://www.macosxhints.com/article.php?story=20080229204517495 for what you can change so you can find stuff excluded by the default structure.

  • Java versus PL/SQL Stored Procedure Issues

    I am getting a result that is 30 times slower for Java when compared with PLSQL. Can you tell me if that is normal or am I missing something?
    Thanks in advance for your help,
    Gaurav Pal
    Java Developer,
    SCJP 1.1, SCJP 2, SCJD 2
    Timing results
    ---------------- Java ------------------------
    Total Time taken for 10 calls: 4667
    Result: 466 Time: 466
    ---------------- PLSQL ------------------------
    Total Time taken for 10 calls: 150
    Result: 466 Time: 15
    Java Code
    public static int getCursorCount()
    int count = 0;
    //define iterator for select
    count_iter myIter = null;
    try
    #sql myIter = { SELECT lastname FROM employee };
    while(myIter.next())
    count++;
    myIter.close();
    catch(SQLException excp)
    return count;
    PL/SQL Code
    function get_count_cursor_sf
    return
    number
    is
    cursor count_cursor is
    select lastname from employee;
    v_return_count number := 0;
    v_name employee.lastname%type;
    begin
    open count_cursor;
    fetch count_cursor into v_name;
    while (count_cursor%found) loop
    fetch count_cursor into v_name;
    v_return_count := v_return_count + 1;
    end loop;
    --Return the variable
    return v_return_count;
    end ;
    Calling Code
    public class DBCall
    public static void main(String args[])
    try
    makeJavaCalls();
    makePLSQLCalls();
    catch(Exception excp)
    excp.printStackTrace();
    public static Connection getConnection() throws Exception
    Class.forName("oracle.jdbc.driver.OracleDriver");
    return DriverManager.getConnection("jdbc:oracle:thin:@10.0.0.3:1521:oracleee","rda","rdauser");
    public static void makePLSQLCalls() throws Exception
    int count = 10;
    long time = 0;
    int result = 0;
    while(count > 0)
    Connection conn = getConnection();
    CallableStatement cs = conn.prepareCall("{? = call rda_plsql_pkg.get_count_cursor_sf()}");
    cs.registerOutParameter(1, Types.INTEGER);
    long before = System.currentTimeMillis();
    cs.execute();
    result = cs.getInt(1);
    long after = System.currentTimeMillis();
    time = time + (after - before);
    cs.close();
    conn.close();
    count--;
    System.out.println("---------------- PLSQL ------------------------");
    System.out.println("Total Time taken for 10 calls: " + time);
    System.out.println("Result: " + result + " Time: " + (time/10));
    public static void makeJavaCalls() throws Exception
    int count = 10;
    long time = 0;
    int result = 0;
    while(count > 0)
    Connection conn = getConnection();
    CallableStatement cs = conn.prepareCall("{? = call dorknight.getcursorcount()}");
    cs.registerOutParameter(1, Types.INTEGER);
    long before = System.currentTimeMillis();
    cs.execute();
    result = cs.getInt(1);
    long after = System.currentTimeMillis();
    time = time + (after - before);
    cs.close();
    conn.close();
    count--;
    System.out.println("---------------- Java ------------------------");
    System.out.println("Total Time taken for 10 calls: " + time);
    System.out.println("Result: " + result + " Time: " + (time/10));
    null

    A big contributor to the behavior seen here is that there is a one-time overhead per session (= per database connection) to start the JavaVM and also (in 8.1.6 and earlier) to initialize the SQLJ runtime (via reflection).
    Keeping the same connection for subsequent calls to Java (which is the more typical scenario, anyway) will result in a rather considerable speedup.

  • Issue while invoking a stored procedure in DB2 from Oracle OSB flow

    oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/Test_Project/Application/Project1/TestSP [ TestSP_ptt::TestSP(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'TestSP' failed due to: Stored procedure invocation error.
    Error while trying to prepare and execute the NED.LOGIN_MODULE API.
    An error occurred while preparing and executing the NED.LOGIN_MODULE API. Cause: java.lang.NullPointerException
    ; nested exception is:
    BINDING.JCA-11811
    Stored procedure invocation error.
    Error while trying to prepare and execute the NED.LOGIN_MODULE API.
    An error occurred while preparing and executing the NED.LOGIN_MODULE API. Cause: java.lang.NullPointerException
    Check to ensure that the API is defined in the database and that the parameters match the signature of the API.

    This forum is for issues about WebLogic Connector container itself. You may need to post your issue to other forums such as SOA.
    Thanks

  • Issue with sending mail through java stored procedure in Oracle

    Hello
    I am using Oracle 9i DB. I created a java stored procedure to send mail using the code given below. The java class works fine standalone. When its run from Java, mail is sent as desired. But when the java stored procedure is called from pl/sql "Must issue a STARTTLS command first" error is thrown. Please let me know if am missing something. Tried the same code in 11.2.0.2 DB and got the same error
    Error:
    javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first. va6sm31201010igc.6
    Code for creating java stored procedure: (T1 is the table created for debugging)
    ==================================================
    create or replace and compile java source named "MailUtil1" AS
    import java.util.Enumeration;
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    public class MailUtil1 {
    public static void sendMailwithSTARTTLS(String host, //smtp.projectp.com
    String from, //sender mail id
    String fromPwd,//sender mail pwd
    String port,//587
    String to,//recepient email ids
    String cc,
    String subject,
    String messageBody) {
    try{
    Properties props = System.getProperties();
    props.put("mail.smtp.starttls.enable", "True"); // added this line
    props.put("mail.smtp.host", host);
    props.put("mail.smtp.user", from);
    props.put("mail.smtp.password", fromPwd);
    props.put("mail.smtp.port", port);
    props.put("mail.smtp.auth", "true");
    #sql { insert into t1 (c1) values ('1'||:host)};
    Session session = Session.getDefaultInstance(props, null);
    MimeMessage message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    #sql { insert into t1 (c1) values ('2')};
    InternetAddress[] toAddress = new InternetAddress[1];
    // To get the array of addresses
    for( int i=0; i < toAddress.length; i++ ) { // changed from a while loop
    toAddress[i] = new InternetAddress(to);
    //System.out.println(Message.RecipientType.TO);
    for( int i=0; i < toAddress.length; i++) { // changed from a while loop
    message.addRecipient(Message.RecipientType.TO, toAddress);
    if (cc!=null) {
    InternetAddress [] ccAddress = new InternetAddress[1];
    for(int j=0;j<ccAddress.length;j++){
    ccAddress[j] = new InternetAddress(cc);
    for (int j=0;j<ccAddress.length;j++){
    message.addRecipient(Message.RecipientType.CC, ccAddress[j]);
    message.setSubject(subject);
    message.setText(messageBody);
    message.saveChanges();
    #sql { insert into t1 (c1) values ('3')};
    Enumeration en = message.getAllHeaderLines();
    String token;
    while(en.hasMoreElements()){
    token ="E:"+en.nextElement().toString();
    #sql { insert into t1 (c1) values (:token)};
    token ="ConTyp:"+message.getContentType();
    #sql { insert into t1 (c1) values (:token)};
    token = "Encod:"+message.getEncoding();
    #sql { insert into t1 (c1) values (:token)};
    token = "Con:"+message.getContent();
    #sql { insert into t1 (c1) values (:token)};
    Transport transport = session.getTransport("smtp");
    #sql { insert into t1 (c1) values ('3.1')};
    transport.connect(host, from, fromPwd);
    #sql { insert into t1 (c1) values ('3.2')};
    transport.sendMessage(message, message.getAllRecipients());
    #sql { insert into t1 (c1) values ('3.3')};
    transport.close();
    #sql { insert into t1 (c1) values ('4')};
    catch(Exception e){
    e.printStackTrace();
    String ex= e.toString();
    try{
    #sql { insert into t1 (c1) values (:ex)};
    catch(Exception e1)
    Edited by: user12050615 on Jan 16, 2012 12:18 AM

    Hello,
    Thanks for the reply. Actually I have seen that post before creating this thread. I thought that I could make use of java mail to work around this problem. I created a java class that succesfully sends mail to SSL host. I tried to call this java class from pl-sql through java stored procedure. That did not work
    So, is this not supported in Oracle ? Please note that I have tested this in both 9i and 11g , in both the versions I got the error. You can refer to the code in the above post.
    Thanks
    Srikanth
    Edited by: user12050615 on Jan 16, 2012 12:17 AM

  • Issue with calling a stored procedure as an url in APEX 4.x

    We are migrating from APEX 3.2.1 running oracle 10g and using the oracle http server to APEX 4.02 using the embedded pl/sql (xdb) gateway on Oracle 11g R2. On the old server, we were able to execute a stored procedure call that returned custom xml to an anychart. We granted the procedure execute to apex_public_user.
    However, the exact same code base is not running on the new installation. I am thinking that it is a rights/grant/execute issue but have been unsuccessful in finding the correct resolution anywhere on the web.
    Anyone have any suggestions for my administrators to help resolve this issue?
    Thanks,
    Mark

    Also review this post: 11g EPG - wwv_flow_epg_include_modules  - 403 Forbidden

  • Issue when calling Stored procedure from application

    Dear all,
      Oracle DB version: 11.2.0.3
       OS : RHEL 5.9 64-bit version
      We are trying to execute one of the stored procedure (belonging to oracle DB schema) from our Dotnet application(recites in application server) but it takes more than 30 seconds to fetch the records. The stored procedure is called from application. When we try the same procedure from SQL developer or TOAD it completes within a second. Could anyone suggest on the issue?
    Note: we are calling a remote DB view from our DB.
    No. of records in the view : 49484929 rows
    Thanks in advance,
    Imran Khan

    Thanks Billy for the reply. The following is the function of the .net application which calls the procedure:
    public DataSet ResourceMonitor(String Date, String DateTime, String starttime, String endtime, String Assstarttime, String Assendtime)
    try
    cLog.StartMethod(this, System.Reflection.MethodInfo.GetCurrentMethod().Name);
    Database dbResourceMonitor = null;
    DataSet Resourceset = new DataSet();
    dbResourceMonitor = DatabaseFactory.CreateDatabase();
    DbCommand dbCommand = dbResourceMonitor.GetStoredProcCommand("SP_RESOURCEMONITOR1");
    dbResourceMonitor.AddInParameter(dbCommand, "P_Date", DbType.String, Date);
    dbResourceMonitor.AddInParameter(dbCommand, "P_DateTime", DbType.String, DateTime);
    dbResourceMonitor.AddInParameter(dbCommand, "P_Starttime", DbType.String, starttime);
    dbResourceMonitor.AddInParameter(dbCommand, "P_Endtime", DbType.String, endtime);
    dbResourceMonitor.AddInParameter(dbCommand, "P_AssStarttime", DbType.String, Assstarttime);
    dbResourceMonitor.AddInParameter(dbCommand, "P_AssEndtime", DbType.String, Assendtime);
    //dbCommand.Parameters.Add(BuildRefCursorParameter("DEPRECSET"));
    dbCommand.Parameters.Add(BuildRefCursorParameter("RECORDSET1"));
    dbCommand.Parameters.Add(BuildRefCursorParameter("RECORDSET2"));
    dbCommand.Parameters.Add(BuildRefCursorParameter("RECORDSET3"));
    dbCommand.Parameters.Add(BuildRefCursorParameter("RECORDSET4"));
    return Resourceset;
    catch (Exception ex)
    cLog.LogMessages(this, ex.Message, cLog.eWiproMessageTypes.ErrorType);
    throw ex;
    finally
    cLog.EndMethod(this, System.Reflection.MethodInfo.GetCurrentMethod().Name);
       The stored procedure SP_RESOURCEMONITOR1 has the following DDL:
    CREATE OR REPLACE PROCEDURE SP_RESOURCEMONITOR1
    (     P_Date      IN VARCHAR2,     
          P_DateTime      IN VARCHAR2,     
          P_Starttime     IN VARCHAR2,
          P_Endtime     IN VARCHAR2,
          P_AssStarttime     IN VARCHAR2,
          P_AssEndtime     IN VARCHAR2,
           P_Mode     IN NUMBER,
        RECORDSET1 OUT SYS_REFCURSOR,
        RECORDSET2 OUT SYS_REFCURSOR,
        RECORDSET3 OUT SYS_REFCURSOR,
        RECORDSET4 OUT SYS_REFCURSOR
    )AS
    BEGIN
    OPEN RECORDSET1 FOR
    Select ROLEMASTER.ROLEID,ROLEMASTER.ROLENAME as ResourceGroup,departmentmaster.DEPARTMENTNAME,departmentmaster.departmentid from Rolemaster
    INNER JOIN departmentmaster ON Rolemaster.DEPTID=departmentmaster.DEPARTMENTID
    WHERE 1=1 AND sysdate >=Rolemaster.START_DATE AND sysdate<=Rolemaster.END_DATE AND Upper(RoleMaster.Rolename) not like '%HIGHLOADER%' AND displayinlist=1
    ORDER BY ROLENAME;
    OPEN RECORDSET2 FOR
    select ROM.ROLENAME as ResourceGroup, fn_get_resource_status(p_starttime, p_endtime,RM.Resourceid,RM.DeptID) AS Status,upper(RM.Resourceid)as Resourceid,RM.RoleID,RM.DeptID,TRIM(RM.RESOURCENAME) AS RESOURCENAME,'Detail'As Details,'ResChng'As ResChng,'Calender' As Calender FROM ResourceMaster RM
    --INNER JOIN DEPARTMENTMASTER DM ON RM.DEPTID = DM.DEPARTMENTID
    INNER JOIN ROLEMASTER ROM ON RM.ROLEID = ROM.ROLEID
    where --UPPER (DM.DEPARTMENTNAME) IN ('DISPATCH','TRANSPORT','TRANSPORT RAMP')
    RM.DEPTID in (select DEPARTMENTID from DEPARTMENTMASTER where displayinadmin=1 and active=1)  ;
    if (P_Mode =2) THEN
    OPEN RECORDSET3 FOR
    select * from mobility_attendance_info_v where TRANSACTIONDATE >= TO_DATE(Substr(p_starttime,1, 9) ,'dd-MON-rr') - 1  order by staffno,TRANSACTIONDATETIME Desc;
    END IF;
    OPEN RECORDSET4 FOR
    select rsa.*,planning.flightno,'' As StTime,SUBSTR(rsa.depdt,11,5) as EndTime from resourceallocation rsa inner join planning ON rsa.planningid = planning.planningid
    where TO_TIMESTAMP(rsa.DEPDT,'dd-MON-rr HH24:MI')>=TO_TIMESTAMP(P_DateTime,'dd-MON-rr HH24:MI')  ;
    END SP_RESOURCEMONITOR1;
       The view mobility_attendance_info_v  is a called from a remote DB. Hope it's quite clear.
    Regards,
    Imran Khan

  • Stored Procedure Command issues in CS3

    I've been having a problem using some stored procedures in
    CS3 which had previously worked with no issue in 8.0.2. I'm running
    CS3 on a Mac for ASP & SQL Server 2000.
    The input parameters for the stored procedure are...
    Fieldname: CategoryID (int) length: 4
    Fieldname: Men (bit) length: 1
    Fieldname: Women(bit) length:1
    I have no problem using the Command function to call this
    stored procedure in DW 8.0.2, but in CS3, while I am able to TEST
    the recordset successfully within the Command dialog, when I press
    OK and then attempt to view the field list in the Bindings panel, I
    get this error...
    [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure
    'spCategoryProduct' expects parameter '@Men', which was not
    supplied.
    When I open up the command settings dialog again, Default
    Values and the Runtime Values I entered for the Men and Women bit
    parameter are blank. The only Default Value and Runtime Value
    retained is for the field CategoryID.
    CS3 is able to call other stored procedures which do not
    contain a Bit field type without issue, so I'm curious if this is
    the culprit.
    I have DW8.0.2 still installed on the same system, and have
    been able to call this stored procedure in this older version,
    without any problems.
    Please help!

    Holy thread-resurrection Batman!
    Please open a new dicussion after reading the bi4.0 data access guide: http://help.sap.com/businessobject/product_guides/boexir4/en/xi4sp5_data_acs_en.pdf
    Also, please specify which SP and Patch you are using.
    Regards,
    H

  • Issue with Oracle.sql.NUMBER in Java Stored Procedure

    When we try to make a call to the Oracle.sql.NUMBER(String) inside a java stored procedure and pass values from '01' to '09', it throws java.lang.StringIndexOutOfBoundsException: String index out of range: 3
    We use Oracle 9.2.0.6 - JServer Release 9.2.0.6.0.
    It works fine for other values. Please find below the code used for simulating the issue outside the application. Thanks.
    create or replace and compile java source named testNumber as
    import oracle.sql.NUMBER;
    import java.sql.SQLException;
    public class TestNumber
           public static String convertNumber(String parm) {
                     NUMBER nTest;
                     try {
                             nTest = new NUMBER(parm);
                             return "TRUE";
                     }catch (SQLException sqle) {
                             return "FALSE";
    create or replace function test_number (p_str in varchar2) return varchar2 as
    language Java name 'TestNumber.convertNumber(java.lang.String) return
    java.lang.String';
    select test_number('05') from dual;  - Throws exception ORA-29532: Java call terminated by uncaught Java exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 3
    select test_number('5') from dual; - Works fine
    select test_number('010') from dual; - Works fine

    Siva,
    I'm only guessing, but it could be an Oracle bug, in which case I suggest checking with Oracle Support.
    (You do have a support contract, don't you? ;-)
    Did you try compiling and running your java class "TestNumber" outside the database?
    Class "oracle.sql.NUMBER" should be in Oracle's JDBC driver, I believe.
    Good Luck,
    Avi.

  • DateTime parameter issue with Stored Procedure CR XI

    Hello everyone.
    This error was touched on here previously but no answer provided.
    I am using Crystal Reports XI with SAP's BUSINESS ONE product. I have a report using a SQL Stored Procedure (SQL 2005). It has datetime parameters.
    The Stored Procedure (SP) works fine when executed from within the Management studio. I then created my report, connecting to the SP with an ODBC driver and all was great.
    But the add on being used for the report to be included in B1 requires OLE connectivity. No problem, all my reports (none of the others have SP's though), work fine with OLE.
    So I tried redirecting the report to use the OLE driver. But I get an error.
    I tried creating a new report with the SP using the OLE driver. Same message.
    I get the following:
    Query Engine Error: 'ADO Error Code: 0x80040e14
    Source: Microsoft SQL Native Client
    Description: Incorrect syntax near the keyword 'CONVERT'.
    SQL State: 42000
    Native Error: 156'
    My code does not include the word CONVERT anywhere.
    From what I can find on the web, this is supposedly an issue with the datetime parameter.  But despite a few people posting messages about this, I have yet to find the answer. None of the topics have had a reply that provides the fix.
    It seems to be something specific to OLE, since it works fine in ODBC. I am using SQL NATIVE CLIENT.
    Thanks in advance for any help.
    Mark

    Hi Alex. Thanks.
    One of my colleagues actually suggested a similar thing. He pointed out I should be using the MICROSOFT OLE DB PROVIDER FOR SQL SERVER (I had been doing so but somewhere along the line started using the Native driver).
    And yes, that worked like a charm.
    Thanks for your help.
    Mark

  • Stored Procedure/Variable issue

    Hopefully this is the last issue to work through... but we need to access images stored on another server. We have a stored procedure called 'get_doc' that accesses the image file, and we've successfully tested it with a hardcoded value. A button calls a process that executes the following PL/SQL:
    get_doc (
    p=> 77456);
    However, when I use the same process with a variable on the page (which has the same numeric value of 77456), the procedure says the value of p is Null.
    get_doc (
    p=> :P7_STARTERNUM);
    Any suggestions or advice?
    (Using ApEx 4.0 in IE8)

    CPate  wrote:
    Yes, the connection is correct. And I swapped in the hardcode number, the process does what it is supposed to and returns the image. Swap back in the variable (with to_number as well, just to be sure) and it returns null.
    I tried debugging it and didn't see where P7_STARTERNUM was changed. It just says:
    ..Process "STARTERGET": PLSQL (AFTER_SUBMIT) get_doc (p=&gt; to_number(:P7_STARTERNUM));The trace should look something like:
    0.00275     0.00220     A C C E P T: Request="SAVE"
    0.00484     0.00801     Metadata: Fetch application definition and shortcuts
    0.01291     0.00110     alter session set nls_language="ENGLISH"
    0.01399     0.00069     alter session set nls_territory="UNITED KINGDOM"
    0.01476     0.00084     NLS: CSV charset=WE8MSWIN1252
    0.06085     0.00087     Session State: Save form items and p_arg_values
    0.06173     0.00146     ...Session State: Save "P7_CUSTOMER_ID" - saving same value: "7"
    0.06319     0.00264     ...Session State: Save Item "P7_CUST_FIRST_NAME" newValue="Eugene" "escape_on_input="N"     
    0.33200     0.00090     Processing point: After Submit
    0.33285     0.11813     ...Process "Process Row of DEMO_CUSTOMERS": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:DEMO_CUSTOMERS:P7_CUSTOMER_ID:CUSTOMER_ID|IUD
    {code}
    There should be a session state change like those shown recorded for your <tt>P7_STARTERNUM</tt> item.
    What's the *Display As* type of the <tt>P7_STARTERNUM</tt> item?
    the procedure says the value of p is Null.
    How do you know this?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Issue with Stored procedure

    Hi,
    I am trying to create a stored procedure and am trying to execute it in 2 different ways.. One works and the other throws a syntax error.
    Can you please explain why the first one has issues and the second one works fine? Also please suggest what the correction in first one should be.

    Hi Sammy,
    You cannot compare with Table Variable in your WHERE Clause, instead you have to use SCALAR Variable
    As Justin rightly mentioned you should SCALAR Variable.
    DECLARE var1 INTEGER;
    SELECT YEAR(CURRENT_DATE) INTO var1 FROM DUMMY;
    YEAR1 = select "YEAR","HIKE" from HIKE_YEAR
    WHERE YEAR = :var1;
    Regards,
    Krishna Tangudu

Maybe you are looking for

  • Installation failure-CUCM 8.6.2 on MCS7845i3

    Hello. I was trying to install CUCM 8.6.2 on MCS7845I3 server with correct memory and disk,good battery, up-to-date server firmware, but keep getting this error "Critical Error The hardware you are using is not supported for this product. Installatio

  • How to Edit Web Gallery Output from CS5?

    Hello!  I just upgraded from Photoshop CS3 to CS5.  (Got some scrambling to do to catch up!)  I had been using the old File>Automate>Web Photo Gallery to create galleries for my Web site.  Massaged a little in Dreamweaver MX (I know, I know...) they

  • New MacBook Pro Will Not Charge While in Use

    I'm not sure if this is an issue, however, I have been unable to find more information regarding this, so I thought I'd ask. While plugged in (MagSafe LED=Orange) the computer hovers around the same percentage of charge (i.e. +/-2%), even with very l

  • SmartView - Manage Process - 11.1.2

    Hi, I set up my process workflow hierarchy. i have e.g. user 'bvo' as owner and user 'jhb' as reviewer. In planning as user bvo i normally promte my entity part to bvo and then he can take ownership. However in smartview this is not possible as i get

  • Scripting Window - Text Area?

    Hi everyone, I'm currently implementing Jython in a program I'm writing, and want to implement a Text Area or something similar much like a command prompt - where you can write commands on the bottom line, and your results gets written above it. I wa