MultiSelect Parameter with Stored Procedure not working

I am using Crystal Reports 2008 and SQL Server 2008. I am using a stored procedure which works with a multiselect in SQL side. I am using a string to table utility function in the where clause with the In statment like below:
WHERE FORMULARY_ID in
--(@FORMULARY_ID)
  (SELECT Extractedtext
   FROM ClarityTST.[rpt].[LHfn_StringToTable]( @FORMULARY_ID, ',') ) 
When I try to use the stored procedure I get an error message:
"The stored procedure cannot accept multiple values. Please ensure that the multiple value is set to False:"
I would like to use it with multiple parameters.

Crystal uses arrays to handle multiple values.  As far as I'm aware, there is no way to get a multi-valued report parameter into SQL (command or SP) directly.  In the past, I have used a "shell" main report that gets the parameters, used Join() to concatenate the selected values into a single string, then pass that to the "main" subreport, and into its SQL or SP.  The SQL than would need to find the database field in the string.  If you make the string passed to the subreport valid SQL for an IN clause, you could do it that way, too.
HTH,
Carl

Similar Messages

  • Oracle Stored Procedure not working

    Hi Guy's,
    I want to connect directly from Visual Composer to Oracle Database 10.2.x.x using Oracle Stored Procedure and JDBC System to demonstrate how easy you can show data vith VC. So I have created a simple Oracle Stored Procedure, a JDBC System with a valid alias, User mapping (Portal User --> Oracle User).
    When I invoke the stored procedure I receive the following error: "Portal request Failed (Could not execute stored procedure)". The Stored Procedure is working fine in Oracle iSQL*Plus.
    Any idea's?
    Thanks,
    Ridouan

    Hi,
    did you use the portal JDBC as it is described here:
    <a href="https://wiki.sdn.sap.com/wiki/display/VC/Cannotseetables">https://wiki.sdn.sap.com/wiki/display/VC/Cannotseetables</a>
    Best Regards,
    Marcel

  • JDBC stored procedure not working in Weblogic 12.1.3

    Hi,
    We are migrating from WLS 12.1.2 to 12.1.3.
    We have a JDBC stored procedure which used to work correctly under 12.1.2. I understand that 12.1.2 uses ojdbc5/ojdbc6 jars (11.2.0.x). After migrating to 12.1.3, the stored procedure is not working.
    We have narrowed it down to the different between 12.1.2 using ojdbc5/6 and 12.1.3 using ojdbc7 jars, though we do not understand what the difference here is.
    Connection connection = getConnection();
    CallableStatement callableStatement = connection.prepareCall("{call RECEIPT_LOG (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
    callableStatement.registerOutParameter("PIO_RECEIPT_LOG_ID", java.sql.Types.INTEGER);
    callableStatement.setLong("PIO_RECEIPT_LOG_ID", 0);
    callableStatement.setString("PIO_DRAWER_NAME", request.getDrawerName());
    callableStatement.setString("PIO_DRAWER_FIRST_NAME", request.getDrawerFirstName());
    callableStatement.setString("PIO_DRAWER_OTHER_NAMES", "");
    callableStatement.setString("PIO_DRAWER_STREET_NO", "");
    callableStatement.setString("PIO_DRAWER_STREET", "");
    callableStatement.setString("PIO_DRAWER_LOCALITY", "");
    callableStatement.setLong("PIO_DRAWER_POSTCODE", 0);
    callableStatement.setString("PI_PAYMENT_TYPE", request.getPiPaymentType());
    callableStatement.setLong("PI_APPLICATION_ID", request.getApplicationId());
    callableStatement.setString("PI_PRIMARY_ID", request.getPiPrimaryId());
    callableStatement.setString("PI_SECONDARY_ID", request.getPiSecondaryId());
    callableStatement.setDouble("PI_AMOUNT", request.getPiAmount());
    callableStatement.setInt("PI_TAX_AMOUNT", 0);
    callableStatement.setNull("PI_VPC_TXNRESPONSECODE", java.sql.Types.VARCHAR);
    callableStatement.setInt("PI_VPC_TRANSACTIONNO", 0);
    callableStatement.setString("PI_VPC_MESSAGE", "");
    callableStatement.setString("PI_VPC_ACQRESPONSECODE", "");
    callableStatement.setString("PI_VPC_RECEIPTNO", "");
    callableStatement.setString("PI_VPC_BATCHNO", "");
    callableStatement.setString("PI_VPC_CARD", "");
    callableStatement.setString("PI_VPC_MERCHTXNREF", "");
    callableStatement.setString("PI_VPC_MERCHANT", "");
    callableStatement.setString("PI_VPC_ORDERINFO", "");
    callableStatement.setInt("PI_VPC_AMOUNT", 0);
    callableStatement.setString("PI_VPC_AUTHORIZEID", "");
    callableStatement.registerOutParameter("PO_RECEIPT_NO", java.sql.Types.VARCHAR);
    callableStatement.registerOutParameter("PO_SOURCE_ID", java.sql.Types.INTEGER);
    callableStatement.registerOutParameter("PO_PAYMENT_METHOD_TEXT", java.sql.Types.VARCHAR);
    callableStatement.registerOutParameter("PO_CREATE_COMMENT", java.sql.Types.VARCHAR);
    callableStatement.registerOutParameter("PO_ERROR_MESSAGE", java.sql.Types.VARCHAR);
    boolean isSuccessful = callableStatement.execute();
    Long receiptLogId = callableStatement.getLong("PIO_RECEIPT_LOG_ID");
    Here, when the callableStatement.execute() is fired, the isSuccessful is false and the output parameter receiptLogId is 0
    Any help appreciated.
    Regards,
    Rahul

    Hi All,
    We still haven't figured out what the problem is with JDBC when using ojdbc7.jar but, as an alternate solution we ported the code to Spring JDBC and got it working.
    Regards,
    Rahul

  • Exec stored procedure from another stored procedure - not working

    Hey, we've got a bunch of .sql files that we run, and some of them are stored procedures. Our programs call the stored procedures from within the .sql files and that works, but we've tried calling a stored procedure from another stored procedure and it won't compile. The syntax looks the same, and we can run that second stored procedure from the SQL*Plus command prompt just fine, so we know it's in there. It doesn't matter whether we type exec or execute in the first stored procedure--it still gives us a compilation error. Here's the relevant bit of the code:
            delete CMHISTORYINDEX;
            commit;
            exec SP_DAILY_TOTAL;
    END SP_DAILY_CLOSING;
    /Here's where we go into SQL*Plus and try to compile it:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning, Real Application Clusters, OLAP and Data Mining options
    SQL> @sp_daily_closing.sql
    Warning: Procedure created with compilation errors.
    SQL> show errors
    Errors for PROCEDURE SP_DAILY_CLOSING:
    LINE/COL ERROR
    34/7     PLS-00103: Encountered the symbol "SP_DAILY_TOTAL" when expecting
             one of the following:
             := . ( @ % ;
             The symbol ":=" was substituted for "SP_DAILY_TOTAL" to continue.
    SQL>We've also tried changing SP_DAILY_CLOSING to lowercase, but it doesn't seem to help. As I mentioned before, we can type that same sort of thing in .sql files that are not stored procedures and the exec is compiled fine and runs correctly. What are we doing wrong?

    In the stored procedure remove "exec" :
            delete CMHISTORYINDEX;
            commit;
            SP_DAILY_TOTAL;
    END SP_DAILY_CLOSING;

  • Stored procedures not working after migrating from 8i to 10g

    The Oracle stored procedures are generating an error following upgrading a ColdFusion web application from Oracle8i to 10g release 2.
    "Error","jrpp-102","05/28/08","13:35:09","insite","Error Executing Database Query.[Macromedia][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'S_DEFAULT_LETTER_SETTING' ORA-06550: line 1, column 7: PL/SQL: Statement ignored The specific sequence of files included or processed is: new_letter.cfm, line: 63 "
    I've been looking at this for about 3 days with a colleague in the office. We can resolve this be recreating the stored procedure with a new name (e.g. adding the suffix "_v2"). Its not really practical for us to do this throughout the system. Anyone know what the root cause might be?
    I'm currently connecting to Oracle10g using SQLTools and Oracle8 client. I've yet to upgrade to Oracle10 client.
    I've tried selecting all the stored procedures and re-compiling them but it appeared to make no difference.

    The Oracle stored procedures are generating an error following upgrading a ColdFusion web application from Oracle8i to 10g release 2.
    "Error","jrpp-102","05/28/08","13:35:09","insite","Error Executing Database Query.[Macromedia][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'S_DEFAULT_LETTER_SETTING' ORA-06550: line 1, column 7: PL/SQL: Statement ignored The specific sequence of files included or processed is: new_letter.cfm, line: 63 "
    I've been looking at this for about 3 days with a colleague in the office. We can resolve this be recreating the stored procedure with a new name (e.g. adding the suffix "_v2"). Its not really practical for us to do this throughout the system. Anyone know what the root cause might be?
    I'm currently connecting to Oracle10g using SQLTools and Oracle8 client. I've yet to upgrade to Oracle10 client.
    I've tried selecting all the stored procedures and re-compiling them but it appeared to make no difference.

  • Package with 2 procedures not working; Please help

    When I try to run the procedures that are in this package manually, each one seperately works. But when I put together these procedures in a package, the second procedure does not work or not updating the table. Any idea why this is creating a problem??
    PROCEDURE UPDATE_CS_ACTIVITY is the one in the below package that does not seems working .. but when i run the procedure manually it works fine.
    Any help in this regard is greatly appreciated...
    Thanx in advance
    Here is the Package code:
    CREATE OR REPLACE PACKAGE BODY UPDATE_ACTIVITY AS
    CSREWORK NUMBER(4);
    CSTRACKOUT NUMBER(4);
    STARTDATE VARCHAR2(20);
    ENDDATE VARCHAR2(20);
    PROCEDURE INSERTVALUES IS
    BEGIN
    DELETE FROM 2DAY_ACTIVITY;
    IF SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),12,2) > 18
    THEN
    STARTDATE := '18:30:00';
    INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSTRACKOUT)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'F';
    INSERT INTO WAFER_2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSREWORK)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'T';
    COMMIT;
    ELSE
    STARTDATE := '06:30:00';
    INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSTRACKOUT)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'F';
    INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSREWORK)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'T';
    COMMIT;
    END IF;
    END INSERTVALUES;
    PROCEDURE UPDATE_CS_ACTIVITY AS
    BEGIN
    INSERT INTO CS_ACTIVITY(STAGESTEPPROD, RESOURCES, CSTRACKOUT, CSREWORK) select MAX(stagestepprod),MAX(resources), max(cstrackout) ,max(csrework) from 2day_activity group by 2DAY_ACTIVITY.stagestepprod,2DAY_ACTIVITY.resources;
    COMMIT;
    END UPDATE_CS_ACTIVITY;
    END UPDATE_ACTIVITY;

    How do you know the procedure is not working?
    You have created a package that has two sub-programs (procedures).
    In order for the sub-programs to execute they must be called, individually.
    You just don't put sub-programs in a package and call the package expecting it to execute all of the sub-programs.

  • Insert Stored Procedure not working

    I'm trying to insert some data, using a stored procedure. I cannot see what seems to be the problem in my procedure.
    PROCEDURE SP_INSPROCDETAILS(I_INITD IN INITIATIVEMASTER.INITIATIVEID%TYPE,
    -- I_INITD = 5414
    I_CNTID IN COUNTRYMASTER.COUNTRYID%TYPE,
    -- I_CNTID = 5
    I_USERID IN USERMASTER.USERID%TYPE,
    -- I_USERID = 5405
    I_DETAIL IN VARCHAR2,
    -- STRING THATWILL COME FROM UI
    -- I_DETAIL = #10414~1234567890~1234567890~test-PONumber~1~1~1~5128~Executor for PO1
    I_DELIMITER_FIRST IN VARCHAR2, -- '~'
    I_DELIMITER_SECOND IN VARCHAR2, - '#'
    O_ERRCODE OUT VARCHAR2,
    O_ERRMSG OUT VARCHAR2)
    IS
    ARR_STRING VAR_TAB;
    ARR_STRING2 VAR_TAB;
    V_ID NUMBER;
    VAR_ESTIMATEDDATE VARCHAR2(500);
    VAR_DODATE VARCHAR2(500);
    V_INITID INITIATIVEDETAILS.INITDETAILSID%TYPE;
    V_INTRANET USERMASTER.INTRANETID%TYPE;
    V_CNT NUMBER;
    V_CREATED PROCUREMENTDETAILS.CREATEDBY%TYPE;
    V_DATE PROCUREMENTDETAILS.CREATEDDATE%TYPE;
    VAR_FLOAT PROCUREMENTDETAILS.POPRICE%TYPE;
    VAR_REPLACE VARCHAR2(500);
    BEGIN
    ---SELECT INITDETAILSID FROM INITIATIVE AND COUNTRY
    SELECT INTD.INITDETAILSID
    INTO V_INITID
    FROM INITIATIVEDETAILS INTD
    WHERE INTD.INITIATIVEID = I_INITD AND ( INTD.COUNTRYID = I_CNTID
    OR INTD.COUNTRYID IS NULL);
    --SELECT INTRANETID FROM USERID
    SELECT U.INTRANETID
    INTO V_INTRANET
    FROM USERMASTER U
    WHERE U.USERID = I_USERID;
    ---CHECKING IF DATA IS PRESENT IN PROCUREMENT TABLE IF PRESNT THEN DELETE AND REINSERT IT
    SELECT COUNT(*)
    INTO V_CNT
    FROM PROCUREMENTDETAILS PC
    WHERE PC.INITDETAILSID = V_INITID;
    IF V_CNT > 0 THEN
    --TAKING THE CREATEDBY AND CREATEDDATE FOR THAT INITIATIVEDETAILSID
    SELECT DISTINCT PC.CREATEDBY, PC.CREATEDDATE
    INTO V_CREATED, V_DATE
    FROM PROCUREMENTDETAILS PC
    WHERE PC.INITDETAILSID = V_INITID;
    DELETE FROM PROCUREMENTDETAILS PC WHERE PC.INITDETAILSID = V_INITID;
    ARR_STRING := PKG_COMMON.SPLIT_LIST_STRING(I_DELIMITER => I_DELIMITER_SECOND,
    I_STRING => I_DETAIL);
    FOR I IN 1 .. ARR_STRING.COUNT LOOP
    IF ARR_STRING(I) IS NOT NULL THEN
    ARR_STRING2 := PKG_COMMON.SPLIT_LIST_STRING(I_DELIMITER => I_DELIMITER_FIRST,
    I_STRING => ARR_STRING(I));
    VAR_DODATE :=ARR_STRING2(3);
    VAR_ESTIMATEDDATE :=ARR_STRING2(8);
    VAR_FLOAT := REPLACE (ARR_STRING2(5),',',NULL) ;
    VAR_REPLACE := REPLACE (ARR_STRING2(6),',',NULL);
    SELECT SEQ_PROCUREMENTDETAILS.NEXTVAL INTO V_ID FROM DUAL;
    INSERT INTO PROCUREMENTDETAILS
    (PROCUREMENTID,
    INITDETAILSID,
    POSMID,
    PONUMBER,
    GL,
    IO,
    POQTY,
    POPRICE,
    POVALUE,
    SUPPLIERID,
    EXECUTOR,
    CREATEDBY,
    CREATEDDATE,
    MODIFIEDBY,
    MODIFIEDDATE)
    VALUES
    (V_ID,
    V_INITID,
    ARR_STRING2(1),
    ARR_STRING2(2),
    ARR_STRING2(3),
    ARR_STRING2(4),
    ARR_STRING2(5),
    ARR_STRING2(6),
    ARR_STRING2(7),
    ARR_STRING2(8),
    ARR_STRING2(9),
    V_CREATED,
    V_DATE,
    V_INTRANET,
    SYSDATE);
    VAR_FLOAT :=NULL;
    END IF ;
    END LOOP;
    ELSE
    ARR_STRING := PKG_COMMON.SPLIT_LIST_STRING(I_DELIMITER => I_DELIMITER_SECOND,
    I_STRING => I_DETAIL);
    FOR I IN 1 .. ARR_STRING.COUNT LOOP
    IF ARR_STRING(I) IS NOT NULL THEN
    ARR_STRING2 := PKG_COMMON.SPLIT_LIST_STRING(I_DELIMITER => I_DELIMITER_FIRST,
    I_STRING => ARR_STRING(I));
    VAR_DODATE :=ARR_STRING2(3);
    VAR_ESTIMATEDDATE :=ARR_STRING2(8);
    VAR_FLOAT := REPLACE (ARR_STRING2(5),',',NULL) ;
    VAR_REPLACE := REPLACE (ARR_STRING2(6),',',NULL);
    SELECT SEQ_PROCUREMENTDETAILS.NEXTVAL INTO V_ID FROM DUAL;
    INSERT INTO PROCUREMENTDETAILS
    (PROCUREMENTID,
    INITDETAILSID,
    POSMID,
    PONUMBER,
    GL,
    IO,
    POQTY,
    POPRICE,
    POVALUE,
    SUPPLIERID,
    EXECUTOR,
    CREATEDBY,
    CREATEDDATE,
    MODIFIEDBY,
    MODIFIEDDATE)
    VALUES
    (V_ID,
    V_INITID,
    ARR_STRING2(1),
    ARR_STRING2(2),
    ARR_STRING2(3),
    ARR_STRING2(4),
    ARR_STRING2(5),
    ARR_STRING2(6),
    ARR_STRING2(7),
    ARR_STRING2(8),
    ARR_STRING2(9),
    V_CREATED,
    V_DATE,
    V_INTRANET,
    SYSDATE);
    END IF ;
    END LOOP;
    END IF ;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    O_ERRCODE := 'E001';
    O_ERRMSG := 'ERROR ' || TO_CHAR(SQLCODE) || ': ' || SQLERRM;
    WHEN OTHERS THEN
    O_ERRCODE := 'E005';
    O_ERRMSG := 'ERROR ' || TO_CHAR(SQLCODE) || ': ' || SQLERRM;
    END SP_INSPROCDETAILS;

    Hi,
    I cannot see what seems to be the problem in my procedure.Hmm.. i cannot see the procedure at all.
    Next time please format your code.
    And you should have mentioned the problem as My procedure does not compile
    When you say problem there are N possibilities (n tends to infinity)
    Anyway, in your case
    I_DELIMITER_SECOND IN VARCHAR2, - '#'What is this doing in teh parameters?
    Either make it as default or comment it completely. like this
    I__DELIMITER_SECOND IN VARCHAR2, -- '#'Hope that helps.
    Regards,
    Bhushan

  • CASE in Stored Procedure Not Working

    Why is this not working?
    SET NOCOUNT ON;
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
    SELECT
    dbo.Components.*,
    CASE ISNULL(dbo.Components.MarkupPrice,0)
    WHEN 0 THEN dbo.Components.Quantity * dbo.Components.UnitCost.
    ELSE dbo.Components.Quantity * dbo.Components.MarkupPrice END AS ExtCost,
    FROM ...
    Error Message
    Msg 156, Level 15, State 1, Procedure procGetReportSpecBook, Line 64
    Incorrect syntax near the keyword 'ELSE'.
    Thanks!

    Please try below instead of THE case when in Your code:
    Case when ISNULL(dbo.components.markupprice,0)= 0
    THEN dbo.components.quantity*dbo.components.unitcost
    Else dbo.components.quantity*dbo.components.markupprice
    End as ExtCost
    OR
    Case when COALESCE(dbo.components.markupprice,0)= 0
    THEN dbo.components.quantity*dbo.components.unitcost
    Else dbo.components.quantity*dbo.components.markupprice
    End as ExtCost
    OR
    Case when dbo.components.markupprice IS NULL
    THEN dbo.components.quantity*dbo.components.unitcost
    Else dbo.components.quantity*dbo.components.markupprice
    End as ExtCost
    Regards, Reshma
    Please Vote as Helpful if an answer is helpful and/or Please mark Proposed as Answer or Mark As Answer when question is answered

  • Stored procedure not working (warning only my second written)

    I am now trying to get my 2nd SP to work. Any help with the problem I'm having would be greatly appreciated. This is not a complicated SP but I am creating dynamic sql. when running in TOAD as a straight SQL I was getting problems with the Execute immediate so I compiled as a SP to see if it resovled. Receiving the following error message:
    ORA-00936: missing expression
    ORA-06512: at "INSPQA.ODS_MODIFER_EXTRACT", line 32
    ORA-06512: at line 2
    Process exited.
    and here is the code
    PROCEDURE ods_modifer_extract AS
         TABLENAME VARCHAR2(100);
         TABLEXREF VARCHAR2(100);
         PERCENT VARCHAR2(3);
         VALUE VARCHAR2(100);
         DESCRIPTION VARCHAR2(100);
         sql_stmt VARCHAR2(1000);
         final_sql_stmt VARCHAR2(1000);
         CURSOR t1 IS
         SELECT XREFTABLE, TABLENAME, PERCENTAGE FROM ODS_MODIFIER_CONTROL;
    BEGIN
    FOR table_rec IN t1 LOOP
    TABLENAME := table_rec.TABLENAME;
         TABLEXREF := table_rec.XREFTABLE;
         VALUE := TABLENAME||'.'||TABLENAME||'ID';
         DESCRIPTION := TABLENAME||'.DESCRIPTION';
         PERCENT := table_rec.PERCENTAGE;
         sql_stmt := 'SELECT '||VALUE||' AS VALUE, '||DESCRIPTION||' AS DESCRIPTION, ';
         sql_stmt := sql_stmt||''''||TABLENAME||''' AS SOURCETABLE, ';
         sql_stmt := sql_stmt||''''||TABLENAME||'ID'' AS SOURCECOLUMN, ';
         IF PERCENT = '100' THEN
              sql_stmt :=sql_stmt||PERCENT||' AS PERCENTAGE ,';
              ELSE
              sql_stmt := sql_stmt||TABLEXREF||'.PERCENTAGE AS PERCENTAGE ,';
              END IF;
         sql_stmt := sql_stmt||' ODS_INSPECTION_EXTRACT.INSPECTIONEVENTID, ODS_INSPECTION_EXTRACT.OCCURRENCEDATE ';
         sql_stmt := sql_stmt||'FROM ODS_INSPECTION_EXTRACT, '||TABLEXREF||', '||TABLENAME;
         sql_stmt := sql_stmt||' WHERE ODS_INSPECTION_EXTRACT.ROOFFEATURESID = '||TABLEXREF||'.ROOFFEATURESID AND ';
         sql_stmt := sql_stmt||TABLEXREF||'.'||TABLENAME||'ID = '||TABLENAME||'.'||TABLENAME||'ID';
         final_sql_stmt := 'INSERT INTO ODS_MODIFIER_EXTRACT VALUES ('||sql_stmt||')';
         EXECUTE IMMEDIATE final_sql_stmt;
    END LOOP;
    END;

    final_sql_stmt := 'INSERT INTO ODS_MODIFIER_EXTRACT
    CT VALUES ('||sql_stmt||')';
         EXECUTE IMMEDIATE final_sql_stmt;
    END LOOP;
    END;Take the VALUES word out of the final_sql_stmt. Should work.

  • Java stored procedure not working

    I have done the following:
    loadjava -user lodonnel/lodonnel@albacore:1521:DEVAN -thin -force -resolver "((* lodonnell) (* public) (* -))" -v c:/usr/lod/java/dev/dbDir/displayStringsDB.jar
    Then:
    CREATE OR REPLACE FUNCTION LODONNEL.getSellingTitleDefinition( sellingID
    NUMBER, week VARCHAR2, netID NUMBER, moduleID NUMBER)
    RETURN VARCHAR2 AS LANGUAGE JAVA NAME
    'com.msa.gabriel.share.displaystrings.util.DatabaseAccess.getSellingTitleDefinition( int, java.lang.String, int, int ) return java.lang.String';
    Variable myString VARCHAR2;
    Call getSellingTitleDefinition( 3247, '02-11-2002', 2, 2) INTO :myString;
    I receive the following error:
    Message 1: ORA-29532: Java call terminated by uncaught Java exception: java.lang.VerifyError: Error detected by bytecode verifier when class was created
    Executing Command:
    Call getSellingTitleDefinition( 3247, '02-11-2002', 2, 2) INTO :myString
    Can someone help me determine where to look for this problem?
    The java classes being loaded do contain references to classes that I have not included in the jar, but from what I read the loadjava command I made should allow this. The code that would run in the procedure will not call any of the referenced classes that are not loaded here.

    I cut out all the functionality, and these are the two classes I am trying to load and run:
    package com.bob.gabriel.share.displaystrings.util;
    import java.sql.SQLException;
    import java.util.HashMap;
    import com.bob.media.displaystrings.util.DisplayStrings;
    public class DatabaseAccess {
    public static String getSellingTitleDefinition( int sellingID,
                                  String week, int
                                  netID, int
                                  moduleID ) throws
         SQLException {
         HashMap databaseArgs = new HashMap();
         databaseArgs.put( "ID", new Integer( sellingID) );
         databaseArgs.put( "WEEK", week );
         HashMap formatterArgs = new HashMap();
         formatterArgs.put( "NETWORKID", new Integer( netID ));
         formatterArgs.put( "MODULEID", new Integer( moduleID ));
         return DisplayStrings.getDisplayString();
    package com.bob.media.displaystrings.util;
    import java.util.Collection;
    import java.util.HashMap;
    import java.sql.SQLException;
    public class DisplayStrings {
    public static String getDisplayString() throws SQLException {
         return "woohoo!";
    * This static method is used as the common interface to return the specified formatted string.
    * @return formatted String to display on a UI
    * @param String - some kind of indicator of class that knows how to retrieve data?
    * @param HashMap - map of args needed to get the requested data.
    * @return formatted String to display on a UI
    * @param HashMap - map of args needed to get the format
    * information of the requested data.
    public static String getDisplayString( String type, HashMap databaseArgs, HashMap formatterArgs ) throws SQLException {
         try
    //      System.out.println( "in getDisplayString" );
    //      DisplayStringsDAO dao = getDAO( type );
    //      System.out.println( "got dao: " + dao );
    //      List data = dao.getUnparsedData( databaseArgs );
    //      System.out.println( "got List of data:" + data );
    //      Formatter formatter = getFormatter( type );
    //      System.out.println( "got formatter" );
    //      formatter.initialize( formatterArgs );
    //      System.out.println( "initialized formatter" );
    //      return formatter.format( data );
         return "got here am ok";
         catch ( Exception e )
         throw new SQLException ( "could not format requested string. " +
                   e.getMessage() );
    I build a jar file for them called displayStrings.jar
    I use the following load command:
    loadjava -user lodonnel/lodonnel@albacore:1521:DEVAN -thin -force -resolver "((* lodonnell) (* public) (* -))" -grant public -v c:/usr/lod/java/dev/dbDir/displayStringsDB.jar
    and the following create function command:
    CREATE OR REPLACE FUNCTION LODONNEL.getSellingTitleDefinition( sellingID
    NUMBER, week VARCHAR2, netID NUMBER, moduleID NUMBER) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'com.bob.gabriel.share.displaystrings.util.DatabaseAccess.getSellingTitleDefinition( int, java.lang.String, int, int ) return java.lang.String';
    When I try this in SQLPlus:
    call getSellingTitleDefinition( 3247, '02-11-2002', 2, 2) into :theString;
    I get this:
    call getSellingTitleDefinition( 3247, '02-11-2002', 2, 2) into :theString
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.VerifyError: Error detected by bytecode verifier when class was
    created
    Classes were compiled and jar build using jdk1.3.1 and using ant.

  • Stored Procedure Not working

    hi !
    I hav a simple SP,
    If @Transaction_type in ('a','u') and @object_type = 77
    Begin
    select @Error = 1, @error_message = 'Budget ***'
    end
    But whenever i do changes(updation) the error is not appearing.
    Does this SP correct?

    Hello,
    The Object_Type and Transaction_Type are both Varchar and should be enclosed in single quote, which you have already done..
    Using the error number and error message in a single SELECT statement is needed for the error to display
    Take a look at this
    IF @object_type IN ('77', '78', '91') AND @Transaction_type IN ('A','U')
    BEGIN
    Select @error = 1, @error_message = 'Budget'
    END

  • Stored Procedure with in param not working

    I have  a stored procedure that works  now I need to use an in Parameter . when I made modification now the stored proc says  "Source does not have a runnable target." I can't seem to figure out what is wrong wit it.
    using SQL developer  version 1.5.5
    here is the  stored proc
    CREATE OR REPLACE
    PROCEDURE STATEMENT_DOMESTIC_TEST
    ( s_date IN statement.statementdate%Type
    ) AS
    BEGIN
    INSERT INTO STATEMENT_DATA
                      (   STATEMENTNUMBER,
                          STATEMENTTOTAL,
                          STATEMENTDATE,
                          BALANCE_FORWARD,
                          CUSTID,
                          CUSTNAME,
                          STATEMENTPURCHASES,
                          STATEMENTPAYMENTS,
                          NOMAILNOPRINT,
                          SOLDTOCOUNTRYNAME,
                          CREDITZEROFLAG,
                          SOLDTOCOUNTRYCODE)
                SELECT  STATEMENTNUMBER,
                        STATEMENTTOTAL,
                        STATEMENTDATE,
                        BALANCE_FORWARD,
                        CUSTID,
                        CUSTNAME,
                        STATEMENTPURCHASES,
                        STATEMENTPAYMENTS,
                        NOMAILNOPRINT,
                        SOLDTOCOUNTRYNAME,
                        CREDITZEROFLAG,
                        SOLDTOCOUNTRYCODE
                            FROM  EROCKS.PS_JWF_STATEMENT
                                  WHERE (statementdate = s_date)and (STATEMENTTOTAL >0)
                                        and (SOLDTOCOUNTRYNAME is null or SOLDTOCOUNTRYNAME='US')
                                        and (TRIM(NOMAILNOPRINT) is null and NOMAILNOPRINT!='99');
    update STATEMENT_DATA H
                        set
                          ( H.REMTO_ZIP,
                            H.REMTO_CITY,
                            H.REMTO_STATE,
                            H.REMTO_MAILNAME,
                            H.REMTO_ADDR1,
                            H.REMTO_ADDR2,
                            H.REMTO_ADDR3,
                            H.SOLDTO_CITY,
                            H.SOLDTO_STATE,
                            H.SOLDTO_ZIP,
                            H.SOLDTO_ADDR1,
                            H.SOLDTO_ADDR2,
                            H.SOLDTO_ADDR3,
                            H.PHONE_PREFIX,
                            H.PHONE_NUMBER,
                            H.COMPANY_NUMBER,
                            H.STATEMENTMISC_CREDIT1,
                            H.STATEMENTMISC_CREDIT2)=
                      (SELECT J.REMTO_ZIP,
                              J.REMTO_CITY,
                              J.REMTO_STATE,
                              J.REMTO_MAILNAME,
                              J.REMTO_ADDR1,
                              J.REMTO__ADDR2,
                              J.REMTO_ADDR3,
                              J.SOLDTO_CITY,
                              J.SOLDTO_STATE,
                              J.SOLDTO_ZIP,
                              J.SOLDTO_ADDR1,
                              J.SOLDTO_ADDR2,
                              J.SOLDTO_ADDR3,
                              J.PHONE_PREFIX,
                              J.PHONE_NUMBER,
                              J.COMPANY_NUMBER,
                              J.STATEMENTMISC_CREDIT1,
                              J.STATEMENTMISC_CREDIT2
                              FROM STATEMENT_HEADER J
                                  WHERE  H.STATEMENTNUMBER= J.STATEMENTNUMBER);
    INSERT INTO EROCKS.STATEMENT_DATA_DETAILS
                      ( INVOICENUMBER,
                      STATEMENTNUMBER,
                      INVOICEDATE,
                      DOC_TYPE,
                      INVOICETOTAL,
                      PURCHASES,
                      PAYMENTS,
                      MISC_CREDIT1,
                      MISC_CREDIT2,
                      BUNUMBER,
                      BUNUMBER_RU,
                      REFERENCE_NUMBER,
                      DESCRIPTION, seq_number)
                        SELECT  H.INVOICENUMBER,
                                H.STATEMENTNUMBER,
                                H.INVOICEDATE,
                                H.DOC_TYPE,
                                H.INVOICETOTAL,
                                H.PURCHASES,
                                H.PAYMENTS,
                                H.MISC_CREDIT1,
                                H.MISC_CREDIT2,
                                H.BUNUMBER,
                                H.BUNUMBER_RU,
                                H.REFERENCE_NUMBER,
                                H.DESCRIPTION,
                                EROCKS.SEQ_STATEMENT.NEXTVAL
                        FROM STATEMENT  H
                            WHERE H.STATEMENTNUMBER IN
                                (SELECT STATEMENTNUMBER
                                    FROM STATEMENT_DOMESTIC);
    END STATEMENT_DOMESTIC_TEST;

    Hello,
    could it be, that you are not connected to a database? This is what the error message suggests.
    You cannot compile or execute a stored procedure without a database connection.
    Regards
    Marcus
    BTW: you should also consider to install a newer version of SQL Developer. The current version is 3.2.2

  • 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 not found when creating a new recordset binding in Dreamweaver CS6 with ColdFusion Server 11

    Stored procedure not found when creating a new recordset binding in Dreamweaver CS6 with ColdFusion Server 11.  I can see the tables and views in the database tab, but no stored procedures.  If I connect to a data source created in ColdFusion Server 6 I am able to see the stored procedures.

    Ben thanks for the reply!
    Yes that is the process I am following:
    In Dreamweaver, open the page that will run the stored procedure.
    In the Bindings panel (Window > Bindings), click the Plus button, and then select Stored Procedure.
    In the Data Source pop‑up menu, select a connection to the database containing the stored procedure
    Enter the ColdFusion Data Source user name and password.
    At this point in the procedure drop down I would get a message that said No Stored Procedure Found.
    Right now it appears to be working, I had to create a new site that pointed to the older CF 6 server's data source and create a page following the process above, then when I went back to the CF 11 site the stored procedures were now populated.  I need to make sure it is pulling from the correct server but right now it appears to be working.
    Thanks
    Dwight

  • Pass a date parameter to Stored Procedure

    Hello friends,
    Can you help to pass a date parameter to Stored procedure from JSP. This is my code:
    In Oracle 9i I have this:
    PROCEDURE SP_EDORES(
    pfechaini IN hist_pol_reclama.hrc_fecha_contabilidad%Type, <-- This is a date field
    pfechafin IN hist_pol_reclama.hrc_fecha_contabilidad%Type, <-- This is a date field
    p_recordset OUT PKG_REP_CIERRE.cursor_type) AS
    In JSP have this:
    CallableStatement stmt = (CallableStatement)conn.prepareCall( "begin PKG_REP_CIERRE.SP_EDORES(?,?,?); end;" );
    stmt.registerOutParameter(3,oracle.jdbc.driver.OracleTypes.CURSOR);
    stmt.setDate(1,Date.valueOf("01-06-2005"));
    stmt.setDate(2,Date.valueOf("30-06-2005"));
    ResultSet rset = (ResultSet)stmt.getObject(3);
    while (rset.next()) {
    %>
    <TR>
    <TD ALIGN=CENTER> <%= rset.getString(1) %> </TD>
    <TD ALIGN=CENTER> <%= rset.getString(2) %> </TD>
    <TD ALIGN=CENTER> <%= rset.getString(3) %> </TD>
    <TD ALIGN=CENTER> <%= rset.getInt(4) %> </TD>
    </TR>
    <%
    The Stored Procedure returns de Result set, however I think does not recognized the date format because I need it with this format dd-mm-yyyy.
    Thanks in advance

    to use Date you will need the oracle package.
    u can try this other solution: use String, not Date
    CallableStatement stmt = (CallableStatement)conn.prepareCall( "begin PKG_REP_CIERRE.SP_EDORES(?,?,?); end;" );
    stmt.registerOutParameter(3,oracle.jdbc.driver.OracleTypes.CURSOR);
    stmt.setString(1,"01-06-2005");
    stmt.setString(2,"30-06-2005");
    ResultSet rset = (ResultSet)stmt.getObject(3);
    while (rset.next()) {
    %>
    if this don't work you can change your PL/SQL to get Strings and do the conversion with TO_DATE in the sql statement.

Maybe you are looking for

  • CD player wont accept blank cd's to record

    Hi, I'm trying to get my disk burner to accept a blank cd for recording music. After I insert the blank cd it whirls around for awhile the just ejects it without any type of pop up saying why it won't accept it. Yes I'm using correct media type. Play

  • Is it possible to define the frame size when capture from MiniDV?

    I am editing a series of tapes which I did not film and don't have the original camera. I am capturing it using my Canon ZR500. When I capture it the frame size is 720 by 480 (3:2). Is there any possibility that by using a different camera I could be

  • API for FND_LOOKUP_VALUES

    Is there an API for FND_LOOKUP_VALUES? I need to create these dynamically for TCA relationship types. Thanks.

  • Reportes de XLR no muestran información

    Hola a todos Tengo un problema al tratar de ejecutar reportes de XL Reporter, no muestran información. Anteriormente el mensaje que aparecía era : "Parametrizaciones de seguridad en Excel prohiben ejecutar XL Reporter" Esto sucedio cuando se actualiz

  • Problems with design view after moving to new imac

    Moved CS4 Dreamweaver from my Mac Mini intel duo to a new i5 Imac last night: suddenly design view is not showing various CSS styles, especially certain links. For example, instead of this: HOME | ABOUT | CONTACT | HELP it will show this in design vi