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.

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

    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

  • 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

  • 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.

  • TimeStamp in Stored Procedure for JDBC adapter

    Hi,
    I have a Date Timestamp field (DD/MM/YYYY HH:MM:SS) in my stored procedure (target system), how do I pass an empty value when there is no date coming from the source system.
    I am able to send the date field in the format when I get the date timestamp field in the source message but sometimes the date field will be empty in the source message, where in I have a issue to pass to stored procedure.
    Error details - java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string ORA-06512: at line 1
    Thanks.
    Yeshwanth

    but sometimes the date field will be empty in the source message, where in I have a issue to pass to stored procedure.
    Why not to avoid creating the DATE field in the target when the source is empty or not present? Just make a check on the source field....check if it is not-blank and then only create the target node....if the source field is blank then the target wont be created and hence wont be inserted into the DB....check if this works for you.
    Also check the XML Schema Interpreter (Interpretation of Empty String Values) section from this help section:
    http://help.sap.com/saphelp_nw70/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
    Regards,
    Abhishek.
    Edited by: abhishek salvi on Jul 16, 2010 3:23 PM

  • How to improve stored procedure performance?

    hi,
    Suppose I have a stored procedure which contains 30 insert/update statements. How do I know Stored Procedure is slowly running or don't have any performance issue? how to improve performance?
    Thanks in advance.
    Anujit Karmakar Sr. Software Engineer

    Stored Procedures Optimization Tips
    Use stored procedures instead of heavy-duty queries.
    This can reduce network traffic, because your client will send to server only stored procedure name (perhaps with some parameters) instead of large heavy-duty queries text. Stored procedures can be used to enhance security and conceal underlying data objects
    also. For example, you can give the users permission to execute the stored procedure to work with the restricted set of the columns and data.
    Include the SET NOCOUNT ON statement into your stored procedures to stop the message indicating the number of rows affected by a Transact-SQL statement.
    This can reduce network traffic, because your client will not receive the message indicating the number of rows affected by a Transact-SQL statement.
    Call stored procedure using its fully qualified name.
    The complete name of an object consists of four identifiers: the server name, database name, owner name, and object name. An object name that specifies all four parts is known as a fully qualified name. Using fully qualified names eliminates any confusion about
    which stored procedure you want to run and can boost performance because SQL Server has a better chance to reuse the stored procedures execution plans if they were executed using fully qualified names.
    Consider returning the integer value as an RETURN statement instead of an integer value as part of a recordset.
    The RETURN statement exits unconditionally from a stored procedure, so the statements following RETURN are not executed. Though the RETURN statement is generally used for error checking, you can use this statement to return an integer value for any other reason.
    Using RETURN statement can boost performance because SQL Server will not create a recordset.
    Don't use the prefix "sp_" in the stored procedure name if you need to create a stored procedure to run in a database other than the master database.
    The prefix "sp_" is used in the system stored procedures names. Microsoft does not recommend to use the prefix "sp_" in the user-created stored procedure name, because SQL Server always looks for a stored procedure beginning with "sp_"
    in the following order: the master database, the stored procedure based on the fully qualified name provided, the stored procedure using dbo as the owner, if one is not specified. So, when you have the stored procedure with the prefix "sp_" in the
    database other than master, the master database is always checked first, and if the user-created stored procedure has the same name as a system stored procedure, the user-created stored procedure will never be executed.
    Use the sp_executesql stored procedure instead of the EXECUTE statement.
    The sp_executesql stored procedure supports parameters. So, using the sp_executesql stored procedure instead of the EXECUTE statement improve readability of your code when there are many parameters are used. When you use the sp_executesql stored procedure to
    executes a Transact-SQL statements that will be reused many times, the SQL Server query optimizer will reuse the execution plan it generates for the first execution when the change in parameter values to the statement is the only variation.
    Use sp_executesql stored procedure instead of temporary stored procedures.
    Microsoft recommends to use the temporary stored procedures when connecting to earlier versions of SQL Server that do not support the reuse of execution plans. Applications connecting to SQL Server 7.0 or SQL Server 2000 should use the sp_executesql system
    stored procedure instead of temporary stored procedures to have a better chance to reuse the execution plans.
    If you have a very large stored procedure, try to break down this stored procedure into several sub-procedures, and call them from a controlling stored procedure.
    The stored procedure will be recompiled when any structural changes were made to a table or view referenced by the stored procedure (for example, ALTER TABLE statement), or when a large number of INSERTS, UPDATES or DELETES are made to a table referenced by
    a stored procedure. So, if you break down a very large stored procedure into several sub-procedures, you get chance that only a single sub-procedure will be recompiled, but other sub-procedures will not.
    Try to avoid using temporary tables inside your stored procedure.
    Using temporary tables inside stored procedure reduces the chance to reuse the execution plan.
    Try to avoid using DDL (Data Definition Language) statements inside your stored procedure.
    Using DDL statements inside stored procedure reduces the chance to reuse the execution plan.
    Add the WITH RECOMPILE option to the CREATE PROCEDURE statement if you know that your query will vary each time it is run from the stored procedure.
    The WITH RECOMPILE option prevents reusing the stored procedure execution plan, so SQL Server does not cache a plan for this procedure and the procedure is recompiled at run time. Using the WITH RECOMPILE option can boost performance if your query will vary
    each time it is run from the stored procedure because in this case the wrong execution plan will not be used.
    Use SQL Server Profiler to determine which stored procedures has been recompiled too often.
    To check the stored procedure has been recompiled, run SQL Server Profiler and choose to trace the event in the "Stored Procedures" category called "SP:Recompile". You can also trace the event "SP:StmtStarting" to see at what point
    in the procedure it is being recompiled. When you identify these stored procedures, you can take some correction actions to reduce or eliminate the excessive recompilations.
    http://www.mssqlcity.com/tips/stored_procedures_optimization.htm
    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

  • Problem: PL/SQL + Stored Procedure + Sequence + Trigger + Transaction + Violation Key

    I have a violation key when i insert some datas from a stored procedure. Why ???
    This is my script :
    1) The script of the table :
    CREATE TABLE OLLMULTI (
         IDO int NOT NULL ,
         IDL int NOT NULL ,
         T1 varchar2 (2) NOT NULL ,
         IDR int NOT NULL ,
         Constraint pk_outilsllmulti PRIMARY KEY (IDO, IDL, T1) ,
         Constraint u_outilsllmulti unique (IDR) );
    2) Now, i want to manage automatic increment field on IDR :
    I create a sequence :
    create sequence OLLMULTI_sequence increment by 1 start with 1;
    I create the trigger :
    create or replace trigger OLLMULTI_trigger
    before insert on OLLMULTI
    for each row when (new.IDR is null)
    begin
    select OLLMULTI_sequence.nextval into :new.IDR from dual;
    end;
    3) Now i create my store procedure and, in my procedure i want to insert 6 rows :
    Procedure Insert_OLLMULTI( i_IDO in OLLMULTI.IDO%type)
    is
    pragma AUTONOMOUS_TRANSACTION;
    BEGIN
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,2,'GJ');
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,5,'ND');
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,12,'AC');
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,120,'AH');
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,10,'ZG');
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,5,'RB');
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    rollback;
    raise;
    END;
    END;
    4) The problem :
    The violation key on the constrainst u_outilsllmulti appears sometimes on a randome insert. Never the same !
    Why ? I think that the sequence is the problem... Or is the problem is the "pragma AUTONOMOUS_TRANSACTION" command ?
    Anyone can help me ?

    Two ideas:
    - Is it possible that there are already records in the table that were
    created without using the sequence? A sequence initially starts at 1,
    if you already got data you first have to increment it.
    - May it be that some inserts happen without your procedure? The trigger
    allows to create IDs without using the sequence. Correct, there are already records in my table !!
    Thanks. That's right.

  • What is the problem with this Stored Procedure

    Hi ,
    What is the problem with this Stored Procedure ?Why is it giving errors ??
    CREATE or replace  PROCEDURE getEmpName
    *(EMP_FIRST OUT VARCHAR2(255))*
    BEGIN
    SELECT ename INTO EMP_FIRST
    FROM Emp
    WHERE EMPNO = 7369;
    END ;
    */*

    You don't specify precision in procedure arguments.
    (EMP_FIRST OUT VARCHAR2(255))should be
    (EMP_FIRST OUT VARCHAR2)Since you asked what's wrong with it, I could add that it needs formatting and the inconsistent use of upper and lower case is not helping readability.

  • Why doesn't SSRS like an IF Statement in my SQL Stored Procedure???

    I have multiple IF Statements at the end of my SQL Stored Procedure Process that utilizes a @ReportTypeName Parameter to produce the chosen report result set
    IF @ReportTypeName = 'HMO-POS New To HFHP - No Prior Year Member Spans'
    BEGIN
    SELECT DISTINCT
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Member Contract Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Member Subscriber Member Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Pkg],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Division Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER EFF DATE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER FIRST NAME],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER LAST NAME],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Broker Name],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER ADDRESS 1],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER CITY],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER STATE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER ZIPCODE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE1],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE2],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE3],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER EMAIL],
    CONVERT(VARCHAR,CAST(CONVERT(VARCHAR, [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER YMDBIRTH]) AS DATETIME),101) AS [INDV MEMBER BirthDate],
    FLOOR((CAST (GETDATE() AS INTEGER) - CAST(CONVERT(DATETIME, CONVERT(CHAR(8), [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER YMDBIRTH])) AS INTEGER)) / 365.25) AS [INDV MEMBER AGE]
    FROM [#TempTable_Distinct_Individual_Member_All_Info]
    WHERE (CHARINDEX('HMO',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0
    OR CHARINDEX('POS',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0)
    AND [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR] NOT IN
    (SELECT [#TempTable_Distinct_Individual_Member_Prior_Year_Spans].[INDV MEMBER NBR]
    FROM [#TempTable_Distinct_Individual_Member_Prior_Year_Spans])
    ORDER BY [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR]
    END
    IF @ReportTypeName = 'HMO-POS Renewals'
    BEGIN
    SELECT DISTINCT
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Member Contract Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Member Subscriber Member Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Pkg],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Division Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER EFF DATE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER FIRST NAME],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER LAST NAME],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Broker Name],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER ADDRESS 1],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER CITY],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER STATE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER ZIPCODE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE1],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE2],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE3],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER EMAIL],
    CONVERT(VARCHAR,CAST(CONVERT(VARCHAR, [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER YMDBIRTH]) AS DATETIME),101) AS [INDV MEMBER BirthDate],
    FLOOR((CAST (GETDATE() AS INTEGER) - CAST(CONVERT(DATETIME, CONVERT(CHAR(8), [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER YMDBIRTH])) AS INTEGER)) / 365.25) AS [INDV MEMBER AGE]
    FROM [#TempTable_Distinct_Individual_Member_All_Info]
    INNER JOIN [#TempTable_Distinct_Individual_Member_Prior_Year_Spans]
    ON [#TempTable_Distinct_Individual_Member_Prior_Year_Spans].[INDV MEMBER NBR] = [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR]
    WHERE (CHARINDEX('HMO',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0
    OR CHARINDEX('POS',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0)
    ORDER BY [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR]
    END
    Microsoft Visual Studio and SQL Server Reporting Services did not like this! When I added my dataset and parameters accordingly, my Dataset had no fields...almost as if running the Stored Procedure in the background to get its Metadata was not working. I
    know this works because I tested it as a result of a straight EXEC Command. Why doesn't Microsoft Visual Studio and SQL Server Reporting Services not like this IF? I did end up getting around this by parameterizing the WHERE clause based on the @ReportTypeName
    chosen.
    WHERE (@ReportTypeName = 'HMO-POS New To HFHP - No Prior Year Member Spans'
    AND (CHARINDEX('HMO',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0
    OR CHARINDEX('POS',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0)
    AND [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR] NOT IN
    (SELECT [#TempTable_Distinct_Individual_Member_Prior_Year_Spans].[INDV MEMBER NBR]
    FROM [#TempTable_Distinct_Individual_Member_Prior_Year_Spans]))
    OR (@ReportTypeName = 'HMO-POS Renewals'
    AND (CHARINDEX('HMO',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0
    OR CHARINDEX('POS',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0)
    AND [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR] IN
    (SELECT [#TempTable_Distinct_Individual_Member_Prior_Year_Spans].[INDV MEMBER NBR]
    FROM [#TempTable_Distinct_Individual_Member_Prior_Year_Spans]))
    I appreciate your review and am hopeful for a reply.
    Thanks!

    Hi ITBobbyP,
    I have tested on my local environment and can reproduce the issue, the issue can be caused by the temp table you are using which will also cause the data not display.
    I have use below sample table and record to have a test and details information below for your reference:
    Right click the DataSet to select the "DataSet Properties" and click the query designer to execute the stored procedure by click the "!" to check if you can get the data:
    If you got some error, the issue can be cause by the temp table invalid, so please make sure you have add the query to create and insert  recored to temp table like below:
    CREATE PROCEDURE vickytest0311_1
    @ReportTypeName nvarchar(50)
    AS
    create table #VickyTest
    column1 int,
    column2 varchar(20)
    insert into #VickyTest values (1,'Test1')
    insert into #VickyTest values (2,'Test2')
    insert into #VickyTest values (3,'Test3')
    IF @ReportTypeName ='Test1'
    BEGIN
    select * from #VickyTest
    where Column1=1
    END
    IF @ReportTypeName ='Test2'
    BEGIN
    select * from #VickyTest
    where Column1=2
    END
    GO
    3. I recommend you to not use the temp table and you will not need to add the create and insert statement in the stored procedure.
    4. If you still got no data, please try to click the "Refresh fields" as below:
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Why Dynamic Parameter is not working, when i create report using stored procedure ?

    Post Author: Shashi Kant
    CA Forum: General
    Hi all
    Why Dynamic Parameter is not working, when i create report XI using stored procedure ?
    Only i shaw those parameters which i used in my stored procedure, the parameter which i create dynamic using stored procedure
    is not shown to me when i referesh the report for viewing the results.
    I have used the same procedure which i mention below but can not seen the last screen which is shown in this .
    ============================================================================================
    1. Select View > Field Explorer2. Right-click on Parameter Fields and select New from the right-click menu.3. Enter u201CCustomer Nameu201D as the name for your parameter4. Under u201CList of Valuesu201D select u201CDynamicu201D5. Under the Value column, click where is says u201Cclick here to add itemu201D and select Customer Name from the drop-down list. The dialog shown now look like the one shown below in Figure 1. Click OK to return to your report design.
    Dynamic Parameter Setup6. Next, select Report > Select Expert, select the Customer Name field and click OK.7. Using the drop-down list beside select u201CIs Equal Tou201D and using the drop-down list, select your parameter field (it should be the first field). 8. Click OK to return to your report design and see the parameter dialog.The parameter dialog will appear and show you a dynamic list of values that is updated each time your run your report. It couldnu2019t be easier! In our next tutorial, we will be looking at how to use this feature to create cascading parameter fields, where the values are filtered by the preceding selection.
    Dynamic Parameters in Action
    My question is that whether dynamic parameter is working with storedprocedure or not.
    When i added one table and try to fetch records using dyanmic prameters. after that i am not be able to find the dynamic parameter option when i referesh my report.
    One more thing when i try the static parameter for my report, the option i see when i referesh the screen.
    Please reply soon , it's urgent
    Regards
    shashi kant

    Hi Kishore,
    I have tested the issue step by step by following you description, while the first issue works well in my local environment. Based on my research, this can be caused by the lookup expression or it indeed return Male value based on the logic. If you use the
    expression below, it will indeed only return the Male record. So please try to double-check the record in the two datasets and the expression in your environment:
    =lookup(first(Fields!ProgramID.Value,"DataSet1"),Fields!ProgramID.Value,Fields!Gender.Value,"DataSet2")
    As to the second issue, please try to use the following expression:
    =Count(Lookup(fields!ProgramID.value,fields!ProgramID.value,fields!Gender.value,"DataSet2"))
    Besides, if this issue still exist, in order to trouble shoot this issue more efficiently, could you please post both the .rdl  file with all the size properties to us by the following E-mail address?  It is benefit for us to do further analysis.
    E-mail: [email protected]
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • 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

  • Why recompiling a stored procedure would change returned data?

    We have a web ASP.net application and Oracle database. Everything was working fine for at least last 5 years and now we can't figure out why
    our stored procedures no longer work.
    Here is what huppening
    On our Oracle database if we do SELECT * FROM web_usertable we see every user who can ‘access’ the our system via website.
    user1 is me
    583 user1 null John q us 0 02 605
    670 user2 null Ed      Black us 0 02 693
    Information about me and user2 is in the Oracle.
    The only difference is that I have been in the database for years and user2 is for about one month.
    When I go to the website and ‘enter’ ... Website is calling USP_GETUSERPROFILE that returns all my data. Everything works fine
    When user2 performs exactly the same task no data from Oracle is being returned. (Why NOT??? Data is in the Oracle Table)
    Order of things doesn’t make any difference: I can go 1st and everything would work ... then user2 and his data isn’t working OR he can go 1st and nothing being returned and I go 2nd and everything will work for me.
    Here is what we found and it is only one of many ways we can reproduce this problem:
    I go 1st and everything would work (We know that code and Stored Procedure is working) user2 goes 2nd and no data is returned (Something is wrong)(Why NOT??? Data is in the Oracle Table)
    Without closing any windows or restarting any application or IIS or any other actions … if at this point we simply drop and recreate USP_GETUSERPROFILE all user2 data immediately comes back.
    This issue is not only occurring with user2 data. It appears that any recently added user has this problem.
    It also isn’t limited to the USP_GETUSERPROFILE procedure we found other instances when recompiling a Stored Procedure solved a problem.
    We don't even know where to look. We also suspect that it might have someting to do with .NET because some other stored procedures in our applications being executed by C++ code don't have this problem.
    Edited by: user11296530 on Aug 21, 2009 10:56 AM

    terrn wrote:
    that would do it, I guess
    now the newbie question: within the function block: how do I assign the results va1 and va2 from a select query into the attributes of the object? I couldn't find an example where that's demonstrated (if possible).
    simplified I should have:
    create or replace function my_function(a number, b varchar2) return my_type
    as
    my_obj my_type;
    begin
    -- here:
    select val1, val2 from table1 -- this is always only one row
    -- my_obj := my_type(a,b); -- how do I assign those here?
    return my_obj;
    end
    select my_type(val1,val2) into my_obj
    from table1;Edited by: Toon Koppelaars on Feb 24, 2011 10:16 AM

  • Why stored procedure are listed in back quotes in universe

    Hi,
    We intend to create Universe based upon the Stored Procedures.  In the dialog box where it displays the list of stored procedures available in the database, few procedures are displayed correctly but most of them are displayed in Back Quotes like  `SP_NAME`.
    Can you provide me with some insight why some procedures are displayed in Back Quotes and others are not and will it create some issues if we use these procedures in the universe.
    We are using Business Objects XI release 3.1 and our database is Sybase ASE 12.5

    Hi,
    Thanks for your reply.
    We do not have any special characters in the stored procedure name or in the resultset field name that are returned by the procedures.
    Thanks,

Maybe you are looking for