Subreport using the same Stored Procedure

I have a main report and a subreport that uses the same stored procedure. The stored procedure has 12 parameters and what I want to avoid is the user having to enter the same parameter values twice. When I created the subreport I put in the parameters + one field, the employee id field so that I could just test it on one employee.
After I entered the subreport into the main report, when I got to refresh the data, it's asking for params for BOTH reports. Is there any way to get around this? Because of the way the stored procedure returns the data, I had to create a subreport instead of just fitting it into one of the footers. I've looked at the subreport link and added the employee id as the key. When I ran it the first time, it returned the wrong date range on the sub.
Help! this thing is Way passed due!!

Right click on the sub report and choose change sub report links
Top left pane contains your main report parameters use > to add
In the bottom left corner of that dialog then scroll down until you see the corresponding sub report parameter
Repeat for each parameter
This should then take the main report params and pass into the sub report

Similar Messages

  • To execute the same stored procedure multiple times

    Suppose I have this :
    select distinct batch_id, submit_date from batch where date > xxx;
    Gives me :
    301
    305
    306
    Currently, I have a stored procedure PROC_A that has 3 cursors all of which have a field called batch_id(which ofcourse exists in the above batch table). Hence, when I run as of today
    EXECUTE PROC_A;
    This could process an unpredictable set of batch ids. I am looking to avoid this.
    What I am trying to achieve here is :
    When I do,
    select distinct batch_id from batch where date > xxx;
    301
    305
    306
    For each of the above values, I want to call the PROC_A exclusively. In other words, by one shot, I want this procedure to be invoked 3 times, each time processing just one batch_id one after another (rather than passing those 3 values to the procedure and having it execute just once !). I also want to avoid using the batch table anywhere inside the stored procedure PROC_A.
    How do I achieve this ? If another stored procedure can call PROC_A, I am okay with including the batch table there.

    What about an executed_date field on the table and a "where rownum=1" in the cursor?
    proc_a
    begin
         begin
              select batch_id
              into b_id
              from batch ...
              where date > xxx
                   and date > last_executed
                   and rownum = 1;
         exception
              when NO_DATA_FOUND then
                   return;
         end;
         exec(b_id);
         update batch
         set last_executed = sysdate
         where bacth_id = b_id;
         return;
    end;Bye Alessandro

  • Multiple runs of same stored procedure

    I am an SSIS newbie so please excuse how little I know.
    We have a manual job that I would like to automate in SSIS.
    We run the same stored procedure six times with different parameters. Each run creates a csv file that we load into excel and then mail the attachments to the user. Can SSIS run the SP, and in a send mail task, send the six outputs?

    You seem to imply that your stored proc is also creating the CSV with data. Usually I'd just let the stored proc populate a staging table with the data and let SSIS tasks to handle the export to CSV and the email part.
    You can use an SSIS Execute SQL Task to run the stored proc with parameters. Then use an SSIS Data Flow Task (DFT) to export data to a CSV and use Send Mail Task (SMT) to send the CSV as an attachment. The path to the CSV file needs to
    be in an SSIS variable. This variable can be populated via a config file, parameters or expression. The destination File Connection and the SMT will use this variable to set their File Path and Attachment properties respectively.
    - Aalamjeet Rangi | (Blog)

  • How is posible to execute in very different periods the same stored proc ?

    Hello,
    I call a store procedure many times on the same session. First 10 executions take place in 30 sec; next calls take 5 sec each.
    This behavior is constant. I think it has to do with the statistics computed by Oracle, but how can I improve first
    executions, too ?
    Thank you,
    Lucian Davitoiu

    It might be.
    Anyway, it is strange that long times are obtained for 10 consecutive executions. Starting with 11st execution, it's period is 6 times shorter. Does it need 10 execs to keep it in memory ?
    On the other hand, this is happening on session level. I mean, I have 2 session; on first session stored procedure executes in 30 secs and, in the same time, on the second session the same stored procedure executes in 5 secs (only because the second session already executed stored procedure 10 times). I think, if procedure would be in memory it will be a global area, and both sessions will execute the proc in the same amount of time, isn't it ?
    Most important is how I might control this behavior ?
    Thank for your ideas,
    Lucian Davitoiu

  • If two people use one computer, but we have separte itunes accounts, Apple ID, and icloud will my apps I get be stored in their account too since we are using the same computer?

    If two people share the same computer, but have separate itunes account, Apple ID, and icloud and one of them downloads an app will it also go into the other persons account since y'all use the same computer

    If you  have separate user accounts on the computer, then your downloaded apps are stored in your iTunes Library. See the following for dealing with having multiple users on the same computer: How to use multiple iPhone, iPad, or iPod devices with one computer.
    Using More than One iDevice on the Same Computer
    This applies mainly to couples who are adding another device and do not want their email, messages, etc. being duplicated on both devices. To begin read: How to use multiple iPhone, iPad, or iPod devices with one computer. You need to establish a separate Apple ID and password for whomever will use the new iDevice. See Apple - My Apple ID and Frequently asked questions about Apple ID. The easiest way is to do this on the computer using iTunes: iTunes- How to set up an Apple ID within iTunes.
    On the computer create a new user account for the person with the new iDevice. This will be the user account that person will always use. He/She will no longer use the other user account. This way that person will have a separate iTunes Library
    Start by transferring the new device(s) to a new account along with all your data.  Save any photo stream photos that you want to keep to your camera roll (unless they are already in the camera roll) by opening your Photos app, tap on Albums icon at the bottom. Now, tap on My Photo Stream album; tap Select; tap on the photos you want to select;, tap the share icon (box with upward facing arrow) in the lower left corner; then tap Save to Camera Roll.
    If you are syncing notes with iCloud that you want to keep then you need to open each of your notes and email them to yourself. Later you can copy and paste the text into new notes created in your new account.
    Tap on Settings > iCloud > Delete Account (only deletes it from this device, not from iCloud; the person keeping the current account will not be affected,) provide the password to turn off Find My Phone and choose Keep on My iDevice when prompted.  Sign in with a different Apple ID to create your new account. Choose Merge to upload your data.
    Once you are on separate accounts, you can each go to icloud.com and delete the other person's data from your account.
    Note: The essence of the above was created by user, randers4. I
    have made substantial changes to improve readability and syntax.

  • How to find the columns and tables used in a stored procedure?

    Hi,
    Can someone suggest how to find the columns and tables used within a stored procedure?
    Thanks
    VBK

    For example:
    SQL> create or replace
      2    procedure p1
      3      is
      4          cnt number;
      5      begin
      6          select count(*) into cnt from emp;
      7  end;
      8  /
    Procedure created.
    SQL> select  referenced_owner,
      2          referenced_name
      3    from  dba_dependencies
      4    where owner = 'SCOTT'
      5      and name = 'P1'
      6      and referenced_type = 'TABLE'
      7  /
    REFERENCED_OWNER               REFERENCED_NAME
    SCOTT                          EMP
    SQL> SY.

  • Using the same subreport twice

    I'm trying to use the same subreport twice in the same
    report, passing it different parameters that modify its query, but
    I keep getting a data binding error. I'm pretty sure what's causing
    it is the fact that I'm using the same subreport twice because if I
    save a copy of the same subreport with a different name and include
    it instead of repeating the same subreport things work fine. Any
    good reason why using the same subreport twice shouldn't work, or
    any solution t o this problem?

    Most certainly - you add the second audio track to the second audio stream for the track (A2). You can then set your menu buttons to play the track with either version of the audio. This is generally how things are done when there is a directors commentary, or where there are different types of audio (say, Dolby 5.1 and a standard stereo track for the same footage) that the viewer can choose between.
    Have a read of this, too:
    http://www.editorsbin.com/authoring/setupandresume.html
    There's a lot of additional info there to help you on your way.

  • When i syncronize my iphone and ipad to the icloud using the same apple-id, are they stored under seaparate accounts?

    Is there  a risk that when I make a backup from one device, it overwrites the stored data from thoe other device?
    If I want to restore my iPhone and my iPad from the iCloud, will they be restored from the same stored data or from separate data?

    Ok, great news.
    Thank you!

  • My ipod touch 4g will not restore, there's no problems with my pc as i recently set up an ipad the following day using the same procedure

    Hi, can someone please help? My sons new ipod touch 4g is not responding to any attempts at restore, and is not recognized in itunes or my computer. My laptop is working ok as it originally set up the ipod but when i connected it again it told me there was an update available, that's when it all went pear shaped. Just two days later we purchased an ipad which we had no problem with syncing on the same laptop using the same usb port. I can't even charge the ipod as the screen does not change from the 'connect to itunes' symbols. I've also tried charging it on a docking station, to no avail. I've done everything that's been suggested in the forums so if anyone knows anything, please let me know!

    Error 1604: This error is often related to USB timing. Try changing USB ports, uninstalling and reinstalling USB ports, and other available USB troubleshooting steps (troubleshooting USB connections, device not recognized properly, computer won't recognize a FireWire or USB device). If you are using a dock, bypass it and connect directly to the white Apple USB dock connector cable. If the issue persists on a known-good computer, the device may need service.
    If the issue is not resolved by USB isolation troubleshooting, and another computer is not available, try these steps to resolve the issue:
    Connect the device to iTunes, confirm that the device is in Recovery Mode. If it's not in Recovery Mode, put it into Recovery Mode.
    Restore and wait for error 1604.
    When prompted, click OK.
    Close and reopen iTunes while iPhone remains connected.
    iPhone should now be recognized in Recovery Mode again.
    Try to restore again.
    If the steps above do not resolve the issue, try restoring using a known-good USB cable, computer, and network connection.
    Above is from:
    iTunes: Specific update-and-restore error messages and advanced troubleshooting

  • Different session used when calling stored procedure from form

    after commiting data in a form to a table, a stored procedure is called that inserts the data written to the table into several other tables. Some columns in the original table are updated - no commit is issued in the procedure. On returning from the procedure the form is re-queried but the updated columns don't contain the updates. This seems to imply that the stored procedure is running as a different session to the one of the form.
    Is this the case? Can we make the form and the stored procedure use the same session so that the data is available in both without having to commit in the procedure?

    No. They should be within one session unless you explicitly open a new session.
    The reason why you dont see updates of the data block when you requery is probably the changes on the form never go to the back end. I think first you have to make sure data changes go to db table. You can do a commit_form before calling the stored procedure and open up another session (e.g. sqlplus) to check the data in the table changed or not.

  • SAPCL Having more than one DB2 use the same trace directory.

    Hello,
    Looking at the DBACOCKPIT SAP Collector settings panel, we have all of the DB2 subsystems that run in a given LPAR use the same trace directory.  (HFS path of trace directory.)
    In our case, that directory is /usr/sap/saposcol/traces.  This means that we have trace files called db2cl* from all of our alert routers running on an LPAR in the same directory.  It is a little confusing, but we can handle it.  The question I have is that there is a cmds.alr file in that same directory.  The contents of that file seem to change occasionally.  At times throughout the day, the file seems to be contain information related to the five alert routers using that trace directory.  Is it OK for the contents of this file to change?
    Another question I have is related to the sapcl file that is in this directory.  The timestamp on this file seems to change periodically.  Sometimes the file size changes.  Note 958252, the SAPCL FAQ says "The trace directory is required to save errors or trace files and to start the alert router. To start the alert router, the system loads the executable SAPCL from the database, saves it temporarily in the trace directory and starts it in USS."
    With 5 alert routers, sharing the same trace directory, you could end up with 5 sapcl executables that get changed around based on what a particular alert router needs.
    Would it be better to point each alert router to a different trace directory?
    Thanks,
    Ron Foster

    Hello,
    There are two configuration parameters in transaction DBACOCKPIT -> u201CSAP Collector Settingsu201D to determine the SAPCL directories.
    HFS path of collector:
    This is the directory, where the files u201CDBRM.db2cldbu201D and u201Csapdb2clu201D are located. The two files are used during installation of SAPCL and u201Ccopiedu201D into two targets:
    A) Linked into DB2 Load library to be used as the stored procedure SAPCL.
    B) Stored into a database table to be used as Alert Router.
    This directory is accessed during installation only. Not during runtime.
    HFS path of trace directory:
    This is the directory, where trace files are stored of the stored procedure SAPCL and the Alert Router. In addition, this is used during startup of the Alert Router. Startup of the Alert Router is done by the following steps:
    1. Unload the Alert Router executable out of the database table into the file u201Csapclu201D.
    2. Creating the Alert Router parameter file u201Ccmds.alru201D. E.g. it contains the SSID.
    3. The executable sapcl is started and the name of the Alert Router parameter file is used as the input parameter of sapcl to determine the behavior. E g.  /u/sapr3/s12run/trace/sapcl /u/sapr3/s12run/trace/cmds.alr
    To keep the input parameters files separate for each SSID, it is recommended to have a trace directory for each SSID. It is also recommended to have a trace directory for each DB2 member of a data sharing group. However, this is just a recommendation. Every time, an Alert Router is stared, the files u201Csapclu201D and u201Ccmds.alru201D are recreated and overwrite the existing files. After startup of the Alert Router, the two files are no more used.
    In the case, where you are using different patch levels or versions of SAPCL and you are using the same trace directory for all SSIDs, it is very likely, that you see different sizes of the file u201Csapclu201D. This is because different patch levels or versions of SAPCL have different sizes and you always see the file size of the most recent stared Alert Router.
    In case, that two Alert Routers are stared at the exactly same time, it could end up in problems.
    Here is an example of the contents of cmds.alr of a two way data sharing group with the SSIDs SGC1 and SGC2 with a shred directory /u/sapr3/jotrun:
    ssid=SGC1 sqlid=SAPJOT planname=CSAPCL FKTID=13 ACE=0 DBTRACE=0 TRACE=0 TRCDIR=/u/sapr3/jotrun/traceSGC1 GUID=4D0685A211780174E10080000A11C971
    ssid=SGC2 sqlid=SAPJOT planname=CSAPCL FKTID=13 ACE=0 DBTRACE=0 TRACE=0 TRCDIR=/u/sapr3/jotrun/traceSCG2 GUID=4D0685C411780174E10080000A11C971
    You can see, that almost all parameters are the same, except u201Cssidu201D and u201CTRCDIRu201D. TRCDIR come from the SAP Collector Settings parameter u201CHFS path of trace directoryu201D. Please note that there is not slash between u201Ctraceu201D and u201CSGCu201D. The directory name is u201CtraceSGC1u201D and u201CtraceSGC2u201D.
    Regards
        Dirk
    Dirk Nakott, IBM, DBACOCKPIT development

  • How to use the same apple id on two different iphones with different sync?

    Hi all,
    I own an iPhone 4s for personal use. Soon my company is going to give me a business phone and I can choose to have another iPhone. I'd love it but I don't know if what I wanna do is possible.
    Let's say I will have iPhone P (personal) and iPhone B (business) and Apple ID MyID.
    At the moment on iPhone P with account MyID I have application App1, App2, ... App9, I have contacts Cont1, Cont2, ...Cont9, I have songs Song1, Song2, ... Song9. All these are synced on my personal PC via iTunes and stored in the iCloud.
    When I'll get iPhone B I'd love to be able to use on it my Apple ID MyID and to sync it with my business PC (so NOT the same one I use for iPhone P).
    The configuration I'd love to have would be the following.
    iPhone P
    - Applications: App1, App2, App3, App8, App9
    - Contacts: Cont1, Cont2, ... Cont9
    - Songs: Song1, Song2, ... Song9
    iPhone B
    - Applications: App4, App5,App6, App7, App8, App9, App10 etc.
    - Contacts: Cont1, Cont2, Cont10, Cont11, ..., Cont20
    - Songs: Song1, Song2, Song10, Song11, ... Song20
    So will it be possible using the same Apple ID MyID on both iPhones to have this configuration? Some apps, contacts and songs in common and some differents?
    If so, how should I configure the two iPhones and the two PCs?
    Kind regards.

    If you use the same Apple ID for iCloud on each device, yes. However, you can use the same Apple ID for iTunes content on each device, but different Apple ID's for iCloud, iMessage, FaceTime, etc., on each device. That way, you can have whatever iTunes content you want on each phone, but keep all of the other data separate. You can create another Apple ID here:
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/wa/createAppleId?loca lang=en_US
    Must be a verified email address.

  • Two commands in the report using the same parameter - fail under Java

    I have a report that contains 2 SQL commands.
    Both of these commands use one parameter X of type Number in their 'WHERE' clause.
    When i'm viewing the report in CR 2008, i'm asked for a value of this parameter and all data is filled in the report - OK
    The problem occurs when the same report is printed through Crystal Java Runtime:
    Report is printed without data! - it's empty.
    What we noticed in the debug information thrown by the Crystal libraries is that parameter value is set only in one of these commands:
    Original statement 1:
    select a.something
    from ANM_T a
    where a.anmid = {?PARAMETER01Id}
    Original statement 2:
    SELECT * from ANM_T a
    WHERE  a.anmid={?PARAMETER01Id}
    OUTCOME of Statement 1:
    select a.something
    from ANM_T a
    where a.anmid = 0
    OUTCOME of Statement 2:
    SELECT * from ANM_T a
    WHERE  a.anmid=9825
    In above example we may see that crystal set the value only in the second statement - first one got 0 - i suspect its some default value.
    Parameter in the Java code is set in the right way. In case of using only one statement it works. If we use two separate parameters (whose values are equal ) it also works.
    // we have also the loop over the parameters
    ParameterFieldController paramFieldController =
                    report.getDataDefController().getParameterFieldController();
    paramFieldController.setCurrentValue( "", paramName, paramValue );
    What is strange for me is that Crystal Reports enables to use the same parameter in two commands but if you edit one of them you may change the type of this parameter for a command ( for example from Number to String) but the parameter type in the second command remains unchanged ( it's strange because in my opinion it is the same parameter). In the Field Explorer under the Parameter Fields i still see one parameter of type used in the second command.

    Hello all,
    We have prepared some sample code to illustrate the issue.
    We have modified the sample application (Link: [http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/c07fec3e-3e11-2c10-1991-8c0fb0b82b75]) to that it also changes the parameter value. Parameter is used in two commands saved in report.
    The code changing the parameters value looks like this:
    private static void changeParameters(ReportClientDocument reportClientDoc) throws ReportSDKException {
              DataDefController dataDefController = reportClientDoc.getDataDefController();
            Fields fields = dataDefController.getDataDefinition().getParameterFields();
            for( int i = 0; i < fields.size(); i++ ){
                Field field = (Field)fields.getField( i );
                if( field.getKind() == FieldKind.parameterField ){
                            setParameter( ((ParameterField)field).getName(), "9825" , reportClientDoc);          
    private static void setParameter( String paramName, String paramValue, ReportClientDocument document ) throws ReportSDKException {
         ParameterFieldController paramFieldController =
                    document.getDataDefController().getParameterFieldController();
         paramFieldController.setCurrentValue( "", paramName, paramValue );
    We have tried the following codes to change the connection info used in commands:
    Attempt 1
              Tables tables = databaseController.getDatabase().getTables();
              //Set the datasource for all main report tables.
              for (int i = 0; i < tables.size(); i++) {
                   ITable table = tables.getTable(i);
                   //Keep existing name and alias.
                   table.setName(table.getName());
                   table.setAlias(table.getAlias());
                   //Change connection information properties.
                   IConnectionInfo connectionInfo = table.getConnectionInfo();
                   //Set new table connection property attributes.
                   connectionInfo.setAttributes(propertyBag);
                   //Set database username and password.
                   //NOTE: Even if these the username and password properties don't change when switching databases, the
                   //database password is *not* saved in the report and must be set at runtime if the database is secured. 
                   connectionInfo.setUserName(DBUSERNAME);
                   connectionInfo.setPassword(DBPASSWORD);
                   connectionInfo.setKind(ConnectionInfoKind.SQL);
                   table.setConnectionInfo(connectionInfo);
                   //Update old table in the report with the new table.
                   databaseController.setTableLocation(table, tables.getTable(i));
                   //databaseController.setTableLocation(tables.getTable(i), table);
    Attempt 2
             newConnectionInfo.setAttributes(propertyBag);
             connectionInfo.setUserName(DBUSERNAME);
             connectionInfo.setPassword(DBPASSWORD);
             //preserve subreport links
             SubreportController src = doc.getSubreportController();
             Map<String, SubreportLinks> linkMapper = new HashMap<String,SubreportLinks>();
             for(String subreportName : src.getSubreportNames()){
                 linkMapper.put(subreportName,
                     (SubreportLinks) src.getSubreportLinks(subreportName).clone(true));
             //If this connection needed parameters, we would use this field. 
             Fields<IParameterField> pFields = doc.getDataDefController().getDataDefinition().getParameterFields();
             replaceConnectionInfos(doc.getDatabaseController(), newConnectionInfo, pFields);
             IStrings strs = src.getSubreportNames();
             Iterator<String> it = strs.iterator();
             while (it.hasNext()) {
               String name = it.next();
               ISubreportClientDocument subreport = src.getSubreport(name);
               pFields = subreport.getDataDefController().getDataDefinition().getParameterFields();
               replaceConnectionInfos(subreport.getDatabaseController(), newConnectionInfo, pFields);
             //reconnect subreport links since when using replaceConnection links are erased
             for(String subreportName : src.getSubreportNames())
               src.setSubreportLinks(subreportName, linkMapper.get(subreportName));
    private static void replaceConnectionInfos(DatabaseController aDc, IConnectionInfo aNewConnInfo, Fields<IParameterField> aParameterField) throws ReportSDKException {
             ConnectionInfos cis = aDc.getConnectionInfos(null);
             for (IConnectionInfo oldConnInfo : cis)
               aDc.replaceConnection(oldConnInfo, aNewConnInfo, aParameterField, DBOptions._useDefault
                   + DBOptions._doNotVerifyDB);
    In both cases, the observed problem occurred. In one query the parameter was set properly, while on the other it was set to 0 (or empty string in case of string parameters). What is more, no data appeared on the print.
    Do you happen to know the reason of this issue?How can we fix the problem?
    Best regards
    Mateusz Błaż

  • Can I use the same iTunes library on 2 macs?

    I have 2 macbooks. The audio files are stored on the external harddrive.
    Does each macbook has to have its own library or can they be using the same library -- and always display the same playlists, etc.?
    How do I do that?
    Thanks,
    Sasi

    Keep all the files for the library on the ext HD. This includes the Album Art, iTunes Library file, .xml files etc.
    This way any time you are opening the library it will have all the files available. Hold down the 'option' key when launching iTunes and direct the Mac to the ext HD.
    MJ

  • Can multiple APEX application use the same parsing schema?

    Hi,
    I have 4.2 APEX thru pl/sql Gatewat, 11gr2 DB and using theme 24.
    Due to the APEX limitation for version control I would be splitting 1 big ERP applications into 24 different APEX applications and each application would be considered as 1 unit for version control.
    I have about 800 tables and I would assume that all of these would need to be stored in 1 schema since a lot of these table are linked thru FK.
    Can I have multiple APEX APPS using the same parsing schema? or is there a better way to do this?
    Thanks in advance!

    Hi,
    Multiple applications can have same (one) parsing schema.
    You can test that on e.g. apex.oracle.com, where normally you have only one schema and you create multiple applications and all use that same schema.
    Regards,
    Jari
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai
    Edited by: jarola on Jan 28, 2013 7:15 PM

Maybe you are looking for

  • Ipod nano 5th g will not shut down properly - did a full restore - help

    Hi, We have a Nano 5th generation. We are having trouble turning it off. I did a full restore and it still has the problem. It actually seems that the lower part of the wheel is not working correctly. We had trouble pausing - but I got it to pause by

  • Gl account is set to profit center mandatory

    Hi All, which table can get the data of the GL account is to profit center mandatory ( i.e from tcode OBC4 )

  • IDES ECC 5.0, BW, FI, HR

    Hi, I am new to SAP world and looking for IDES ECC 5 so I can learn SAP better. Please share your IDES ECC 5 with installation documentation. I am willing to pay a price via paypal. Please email me at [email protected] Please help. Thank you so much.

  • Building a "Wizard" Form

    Hi, I'm not a Forms expert, but I was wondering if the following is possible: building a generic Form that has the Windows-Wizard look-and-feel, and controls the order in which other Forms are displayed and which data is passed between the Forms disp

  • No HTML validation of spry

    Hi After inserting a spry xml, and validating the page in Dreamweaver, I got the following msg: <the tag "div" doesn't have an attribute: "spry:region" in currently active versions [XHTML 1.0 Transitional]> <the tag "th" doesn't have an attribute: "s