Adding a stored Procedure to the Report

Hi,
I am developing a report using crystal plugin in eclipse.I have problems in adding a stored procedure to the report .I write the following command in SQL SCRAPBOOK dbo.StoredProcedure @Param1="param1",@Param2="param2",@Param3="None" and run it. It runs successfully ,but when i try to add it to report nothing is being added to it.
I am using a Sybase database and driver(com.sybase.jdbc3.jdbc.SybXADataSource)
Any suggestions regarding this would be of great help.
Thanks in advance
Siva
Edited by: Siva_velicheti on Jun 1, 2010 12:10 PM

Hmm, not sure about stored procedures, but you can get SQL queries to work like below....
@method to get ResultSet from SQL query with user, pwd, and dbConnectionInfo
@param query, scrollType, user, password, dbName, db
@throws SQLException 
@throws ClassNotFoundException
         private static ResultSet getResultSetQueryDBInfo(String query, int scrollType, String user, String password, String dbName, String db)
         throws SQLException, ClassNotFoundException
              String DBUSERNAME =  user;
              final String DBPASSWORD = password;
              final String CONNECTION_URL = "jdbc:oracle:thin:@" + dbName + ":1521:" + db;
              Connection connection = DriverManager.getConnection(CONNECTION_URL, DBUSERNAME, DBPASSWORD);
              DatabaseMetaData meta = connection.getMetaData();
              System.out.println("getResultSetQueryDBInfo - Connected to URL : " + meta.getURL());
              System.out.printf("getResultSetQueryDBInfo - as user: %s\n", meta.getUserName() );
              Statement statement = connection.createStatement(scrollType, ResultSet.CONCUR_READ_ONLY);
              System.out.println("getResultSetQueryDBInfo method - executing query: \n");
              return statement.executeQuery(query);

Similar Messages

  • Adding a stored procedure to the master database?

    I have a SQL server instance being used as our data warehousing environment. The instance consists of several databases that I am snapshotting as part of our high availability strategy for data. I've created a stored procedure that takes the source database
    as an argument and that will create a new snapshot when a new one needs to be created and will also automatically remove the old snapshot. It also updates some synonym tables that point to the new snapshot but that might not be an important detail.
    I would like to have the stored procedure stored some place global to all of the databases that I am routinely snapshotting, but that would mean putting it in the master database. Although having it there makes things significantly better in terms of usability,
    it seems like there's something wrong with putting any stored procedures in the master database. Am I wrong? Is it OK to put stored procedures there in situations like this?

    Yes Database snapshot. We're using it to make our data more available so that when we're refreshing the underlying database we can still access the previous version of the data. Otherwise our reports and applications won't have access to the data or will
    get partial data sets. We don't intend to use it for DR or as a backup.
    ok. if it is for temporary purpose, it will work..
    you can create one master procedure and do that - master database. but you need to make sure you point your applications/reports to the snapshot database and not actual database
    Hope it Helps!!

  • How to execute an stored procedure from the Report Region

    Have stored procedure "LER_KRONOS_PAYCODE_HOURS_P" compiled and ready.
    (previously tested)
    Region Source:
    DECLARE
    v_SITE_ID VARCHAR2(8);
    v_SDATE VARCHAR2(8);
    v_EDATE VARCHAR2(8);
    v_LEVEL3 VARCHAR2(60);
    BEGIN
    v_SITE_ID :=P4_SITES_LOV;
    v_SDATE :=P4_SDATE;
    v_EDATE :=P4_SEDATE;
    v_LEVEL3 :=P4_LEVEL3;
    EXECUTE LER_KRONOS_PAYCODE_HOURS_P(v_SITE_ID,v_SDATE,v_EDATE,v_LEVEL3);
    END;
    Error When run the page:
    ORA-06550: line 11, column 12: PLS-00103: Encountered the symbol "LER_KRONOS_PAYCODE_HOURS_P" when expecting one of the following: := . ( @ % ; immediate The symbol ":=" was substituted for "LER_KRONOS_PAYCODE_HOURS_P" to continue.

    You need the execute keyword only when you run it directly from sqlplus.. that will tell sqlplus to append the keyword begin and end after the procedure call.
    Example.
    SQL > exec proc1 (input1);
    will tell sqlplus to run it as a block.. saying
    sql> Begin
              proc1(input1);
          end;Inside the procedure , in your code, you dont need the execute keyword.
    But, why do you want to execute a procedure inside the source for a report region..?

  • Calling a stored procedure in crystal report

    I am using crystal reports 11 on the front end connected to mssql server in the back end and i have a stored procedure written in mssql and has a view created. i want to know how do i call a stored procedure from crystal report when i run my report and how to pass the values from my prompt to the stored procedure

    As long as the stored procedure returns a result set, the procedure should look and act just like table and the report will know what parameters are need to execute the procedure.  If this does not answer your question, please provide more specifics.

  • Stored Procedure for Crystal Reports

    Hi All,
    I developed this test stored procedure to see wheather we could a stored procedure for crystal reports. It compiled without any problem, but when I run it, it gives me error message. Here is the stored Procedure..
    CREATE OR REPLACE PROCEDURE WOLD1SIM.TEST_PROCEDURE(
    TEST_CURSOR IN OUT TEST_PACKAGE.TEST_TYPE,
    TEST_PARAMETER IN TEST_TABLE.ID%TYPE)
    AS
    BEGIN
    OPEN TEST_CURSOR FOR
    SELECT *
    FROM TEST_TABLE
    WHERE TEST_TABLE.ID = TEST_PARAMETER;
    END TEST_PROCEDURE;
    And
    This is the error message..
    ERROR at line 2:
    ORA-06550: line 2, column 1:
    PLS-00201: identifier 'TEST_PROC' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    I have created the package sucessfully.
    I was wondering If any one of you can advice me where I am making the mistake.
    Thank you

    CREATE OR REPLACE PROCEDURE WOLD1SIM.TEST_PROCEDURE(TEST_CURSOR IN OUT TEST_PACKAGE.TEST_TYPE,
                                                         TEST_PARAMETER IN TEST_TABLE.ID%TYPE)
    ...you have 2 parameters in your procedure WOLD1SIM.TEST_PROCEDURE(). you should also use two parameters when you execute the procedure.

  • Using Stored Procedure Universe in Reports

    Hi Friends,
    I got some issues using SP's in Universe and WebI Report.
    Case #1:
    Can we execute dynamic SQL using stored procedure universe..?
    I use SQL server as the DB for my reports.I created a SP which will execute on getting a input value from the user.This input value will frame the SQL dynamically in the SP.for executing the dynamic SQL i use sp_executesql inside the SP.The SP wexecutes successfuly in the DB but when i try executing it in the Universe i get a error message as follows: "Exception : DBD,[Microsoft][SQL SErver Native Client 10.0][SQL Server]Incorrect syntax  nesr 'FROM'.State:42000"
    The script i used for creating SP for your reference:
    CREATE PROCEDURE P_S_GetCodeValueList
              @s_table nvarchar(75)
    as
    begin
              declare @s_sqlCommand nvarchar(1000)
              declare @s_tablename nvarchar(75)
              declare @s_code nvarchar(75)
              set @s_tablename=@s_table
              set @s_code = '*'
              set @s_sqlCommand= 'SELECT ' + @s_code + ' FROM ' + @s_tablename
              exec sp_executesql @s_sqlCommand
    end
    Case #2:
    AIl also tried creating reports using the SP Universe which needs to get the parameter when the user refesh the report.
    But every time the report is refreshed the report fetches the data which was produced when the SP is executed in the Universe for the first time.
    I need to get the prompt in the report , to which the user could give a value and the SP gets executed for that value.
    Is there any option in BO to do this?
    It will be very helpful if you could give me some work arounds on this.
    Regards,
    Sugumar

    Hi Sugumar,
    I can answer you for your 2nd question:
    When you create the Stored procedure in the Universe and test it on retreiving data by inserting variable input you can check if the user could insert new value for the SP parameters.
    Hope this helps!
    Regards
    Giuseppe

  • Using Oracle Stored Procedure in Interactive Reporting

    Hello,
    i'm trying to use Oracle Store procedure in Interactive reporting but all i get are errors.
    My env:
    Interactive Reporting 9.3.1
    Oracle Database 10.2
    I created OCE as ODBC/OBDC. Tables are returned and Stored Procedure entry is enabled.
    If i use "microsoft ODBC for Oracle" i can see stored procedure list but i get this error:
    SQL API: [SQLExecDirectW], SQL RETURN: [-1], SQL STATE: [42000], SQL NATIVE ERROR: [6550], SQL MESSAGE: [[Microsoft][ODBC driver for Oracle][Oracle]ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'TEST_PDC_RECORDSET'
    If i use Oracle's odbc i get: "Error in function sequence".
    If i use Merants (5.2) odbc i cannot retreive stored procedure list. (list is empty)
    Note.
    My stored procedure works (tested via sqlplus).
    thank u daniele

    Returning (or sending in) multiple rows directly from (or to) a stored procedure is not currently possible. I have been in contact with SAP on this subject earlier, and they suggest using a web service to do the job. I used this as a work around, calling the stored procedure from a web service. I send in VC tables to this web service, and this in turn contacts my stored procedure.
    The problem is related to the connector framework in the J2EE environment.
    I am on 7.0 sps 17
    If you use stored procedure single value parameters of type varchar, number ... then VC has no problem communicating with your procedures.
    Good luck
    Henning Strand

  • Using stored procedures within Crystal Reports

    Hello all,
    Background Information:
    I am trying to teach myself how to execute a stored procedure within Crystal Reports.  This is an aspect of Crystal that my work group has not utilized before and we're trying to gather information on the subject.  We use Oracle to create and execute functions and procedures all the time, but I've never tried this within Crystal.
    I use the "Add Command" functionality within Crystal on most of my reports so that I can taylor the sql to the report.  I find this easier to do versus using the ODBC connection to the tables and writing the code through the Crystal Reports wizard.  I also frequently use functions within these sql statements that are inserted in the Add Command.
    What I'm trying to achieve:
    I have a report that needs to run as a "trial", and then later as a committed "run".  This is for a monthly billing system.  Essentially, the user will run the report as the "trial", preview the data, make any necessay corrections, and then later, run the actual billing run.  Within my application, the bills are not actually marked as "billed" until they are actually "billed', if that makes sense.  As a result, the "trial" report will need to mark the bills as "billed", generate the report, and then rollback the data (so that the bills are not "billed".  Once the actual billing reports are ran, the same report will run, but with a "commit" at the end of the report so that the bills are now "billed".
    I'm trying simple tests and failing (i.e. taking baby steps to learn what capabilities Crystal has):
    I created as simple of a procedure as I can envision.  This procedure inserts the word "test" in one of my fields for a provided account number.  When I try to run this procedure via Crystal (via New Report ->History->My ODBC Database link->Stored Procedures), Crystal asks for the account number parameter, as it should.  But I then receive the error message:
    Database Connector Error: '42000:[Microsoft][ODBC driver for Oracle]Syntax error or access violation'
    The existing ODBC connection has work great for years and years to retrieve data from tables, but this is the first time I've tried to utilize procedures.  Can anybody help?  And can anybody explain what the Stored Procedures link is supposed to do?  Am I going down the right path?
    thanks,
    Noel

    Hello,
    Make sure the Oracle client install path is in the PATH statement. And also make sure you are using an IN/OUT cursor. CR only reads the last SELECT statement. Search the Documents area on how to create a Stored Procedure.
    Also, if you are using CR XI ( 11.0 ) then upgrade to CR XI R2 and apply all service packs ( SP 6 ). Go to this link: http://www.sdn.sap.com/irj/boc and download the trial version of CR XI R2 and use your XI keycode, then apply the patches which you can get to by clicking on the BusinessObjects tab above, then Downloads.
    Direct link to the Trial version: http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
    It may fix your issue also.
    Thanks again
    Don

  • Adding a push button on the report toolbar

    adding a save button on the report toolbar, so that after clicking the button, the data fetched on the report will be stored in the application server.

    Hi
    to automate this process ,best way is to create a Z rport and there u can submit this sap standard report and get its output into an Internal table and then u can write this internal table to application server via following demo code -
    this is code for both (download /upload),u can not use CG3y and CG3z as u want to do it as a background job ..
    *& Report ZGILL_AS *
    REPORT ZGILL_AS message-id rp .
    tables: pa0001,pa0002.
    select-options s_pernr for pa0001-pernr no intervals MODIF ID XYZ.
    parameters: p_dwnld AS CHECKBOX ,
    p_upld AS CHECKBOX DEFAULT 'X'.
    parameters: P_DSNI(75) TYPE C MODIF ID ABG DEFAULT
    '/usr/local/sapdata/amit.dat' LOWER CASE.
    data: begin of itab occurs 0,
    pernr(8),
    sp1(1) value ',',
    werks(4),
    sp2(1) value ',',
    persg(1),
    sp3(1) value ',',
    persk(2),
    end of itab.
    data: s_eof(3).
    start-of-selection.
    if p_upld = 'X'.
    OPEN DATASET P_DSNI FOR OUTPUT IN LEGACY TEXT MODE.
    PERFORM FETCH_DATA.
    STOP.
    elseif p_dwnld = 'X'.
    OPEN DATASET P_DSNI FOR INPUT IN LEGACY TEXT MODE.
    IF SY-SUBRC NE 0.
    MESSAGE E016 WITH
    'Error opening seq. file, RC:' SY-SUBRC.
    EXIT.
    ENDIF.
    CLEAR S_EOF.
    DO.
    PERFORM FETCH_file.
    IF S_EOF EQ 'YES'. stop. ENDIF.
    ENDDO.
    endif.
    END-OF-SELECTION.
    if itab[] is not initial.
    perform print_file1 tables itab.
    else.
    write:/ 'No records exists'.
    endif.
    *& Form FETCH_DATA
    text
    --> p1 text
    <-- p2 text
    FORM FETCH_DATA .
    SELECT * FROM PA0001 WHERE PERNR IN S_PERNR.
    MOVE-CORRESPONDING PA0001 TO ITAB.
    TRANSFER ITAB TO P_DSNI.
    APPEND ITAB.
    ENDSELECT.
    CLOSE DATASET P_DSNI.
    ENDFORM. " FETCH_DATA
    *& Form FETCH_file
    text
    --> p1 text
    <-- p2 text
    FORM FETCH_file .
    READ DATASET P_DSNI INTO itab.
    append itab.
    clear itab.
    IF SY-SUBRC NE 0.
    S_EOF = 'YES'. EXIT.
    ENDIF.
    ENDFORM. " FETCH_file
    *& Form print_file1
    text
    -->P_ITAB text
    FORM print_file1 tables P_ITAB structure itab .
    write:/2 'EmpNo',
    14 'Personnel Area',
    34 'Emp Group',
    47 'Emp SubGroup'.
    skip 1.
    loop at p_itab.
    write:2 p_itab-pernr,
    14 p_itab-werks,
    34 p_itab-persg,
    47 p_itab-persk.
    skip 1.
    endloop.
    ENDFORM. " print_file1
    <b>Reward if usefull</b>

  • How to rename stored procedure on existing report

    I've got several reports that are based on stored procedures starting with the prefix qRpw.  I needed to change the name only of these stored procedures. The actual code within and all the data that the report is bound to stays the same.
    so say the stored procedure the report is tied to is qRpwStoredProc - I need to change the name to qRpStoredProc
    How can I simply change the stored procedure's name without having to start over with the report? 
    TIA
    Harry

    In set datasource Highlight SP in top pane, find the new SP in the lower pane and high light then click update.
    You will need to rename SP in Database expert as it will retain alias of original name.
    Ian

  • Error connecting to stored procedure in crystal report

    Hello
    I'm using crystal reports 2008 with the latest service pack.
    i'm trying to access stored procedure using the mysql jdbc driver 5.17. The crystal report has been designed which works fine with a login that created the stored procedure but when i try to run with another login that will used to run the crystal reports
    The login has access to execute the stored procedure but entered in the crystal report it complains about
    "User does not have access to metadata required to determine stored procedure parameter types. If rights cannot be granted, configure with {noAccessToProcedureBodies=true} to have driver generate parameters that represent INOUT strings irregardless of actual paramter types"

    Hi Sharon
    Thanks for response.
    I have checked that the user has permission to read and write. When i try and execute the stored procedure in the database by login with the user, it runs fine.
    When i try and call the stored procedure from crystal reports it throws that error message.
    regards
    Naresh

  • Stored procedure ignore the synonym

    I have defined 2 user : usr1 and usr2 and I have 2 table table1 and table2.
    I define one synonym for table1 that for the usr2 is link to table2.
    If I run sqlplus80 connect whit usr1 and I execute 'Select * from table1'
    the query run correctly on table1.
    If I run sqlplus80 connect whit usr2 and I execute 'Select * from table1'
    the query run correctly on table2.
    After I wrote a stored procedure with the same query.
    If I execute the strored procedure from sqlplus80 connect with usr1 It work correclty with table1.
    If I execute the stored procedure from sqlplus80 connect with usr2 It don't work because contine to work with table1, it seem that don't use the synonym.
    Can someone help me ?

    Please repost this question in the appropriate section of the Discussion Forum.
    This forum is for general suggestions and feedback about the OTN site. For technical question about an Oracle product,
    You can also use our new offering called OTN Service Network:
    For Oracle Advice/Minimal Support (fee based) on Reports, Forums,
    SQL*Plus, and PL/SQL, please go to: http://www.oracle.com/start/otnServiceNetwork/intro.html?src=9123 86&Act=6
    For customers with paid support (Metalink) please go to:
    http://www.oracle.com/support/metalink

  • Added new key figure in the report

    Experts,
    I have added new key figure in the report .If i display this key figure value in the report it is populating correct value with ERROR(example 22.5 ERROR).The report is on the multiprovider .i have check the value for this in multiprovider it is populating correctly .There is no calculation in the report for this .While extracting in to report i am getting this. Help me to resolve this issue.
    Thanks
    Murali

    Hi,
    I have already created a formula like NODIM(Key field).that only i am using .
    and mapping I did in this way. I went to multiprovider and I have selected this key figure and right click and select (assign) then I have click on create proposal for all infoobjects option.
    Please suggest any thing need to do.
    I am sorry .I did not understand the lonterm solution suggested by you .what is UOM .Please tell me how to map.can you pls tell me clearly please
    Thanks
    Murali

  • Java web service to invoke a stored procedure in the database

    Hi
    Does anybody have a example Java web srevice to invoke a stored procedure in the database
    regards
    Edited by: hrishy on May 20, 2011 12:11 AM

    hrishy wrote:
    Thanks i have modified the title so its easy to comprehendWrite the two parts mentioned above and post if you get problems with your code.
    First write code that calls the stored procedure and test that to make sure that it works.
    Then write a simple webservice and test it out to make sure it works. The integration should be trivial after that.

  • Database Connector Error when trying to add a stored procedure to my report

    I am trying to add a stored procedure to my report and come up with this error Database Connector Error: 'Cannot obtain error from server.'.  This is in any of our environments, and with any stored procedure.  I am able to connect to tables and views without error.  I'm using Crystal Reports 2008.  Any help would be appreciated.   Thanks

    The following SAP Note might help you
    [http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303331333633393335%7D.do]
    regards,
    Raghavendra.G

Maybe you are looking for

  • When I try to download the latest version of itunes it keeps saying there is an error and won't download. What do I do!?

    I am trying to get iOS 5 on my ipad but there is no update tab on it so I was told to do it on itunes and I need to download the latest version but it won't.

  • 5300 rebooting over and over - Is it dead?

    Hi friends... I'm brazilian and I have a new 5300 RED from Thailand. It was Ok for 3 days... Yesterday I was checking the microSD and, after removing it, the phone do not starts any more. It show the nokia hands, even update the time by de operator,

  • Adobe Professional XI download

    Adobe Professional XI download - Full versus Standard (recommended for most users) download option.  What additional capabilities/features does the full provide over the standard?  What's the difference?

  • Need help with Volume Slider

    Hi All, I created a graphic to simulate a volume slider. Its working, but i want a movieclip graphic (vol_switch) to follow the mask. It is only following it after i release the mouse. i cannot figure out how to have it follow on the mouse drag witho

  • TextFields

    i want to set a maximum size for a text field. for example it is 3 and after it gets 3 characters the pointer must pass to the next text field. how can i do that?