[Interface] - Passing variety parameters/input to PL/SQL report

Hi,
I've the PL/SQL report which can allow passing in the parameter, i use '&'.
the report is given to the end user who do not have the IDE for PL/SQL. the machanism of the report is generated into the spool file and import into excel format.
now i am wondering how to create a tool using SQL or PL/SQL to allow the end user to choose the parameter(s) dynamically and passing into the PL/SQL to generate the report based on the input selected.
the parameters like below:
package code :
week no :
year :
department :
all the above parameters, the data would be selected from the existing lookup table. the user is allow to select more than 1 input for specified parameter for instance i want to spool report for week 1 until week 5.
pls advise any solution on this topic. thanks

hi scoot,
thank for reply.
yep, i'm using sql*plus and also sql navigator 4.0 .
the user don't have the software to interact. i'm thinking of build an simple interface using VB and passing in the parameter then initiate the sql*plus to run the program in background mode.
but if you have any other solution which not need to use other software to wirte such program , pls let me know immediately. thank

Similar Messages

  • Set parameters input automatically in my report and connection to my base

    Hello
    this my programmes , it work it's ok ( see bottom of the page )
    Now i have a rapport rpt with a input edit (example number customer )
    I want by my file jsp that the number customer display automatically
    in my rapport rpt ( variable string or integer or date) and after validate automaticcaly
    and connection to my database automartically ( database oracle 8 user and paswword)
    (by example with my url , i pass a parameters input and automatically i will see
    the rapport rpt ) it's possible , How to make in jsp ?
    thanks to help me
    regards
    Michel
    Ps : Notes fresh  for the connection in my database oracle
    i have modified CrystalReportViewer.jsp but i have an message
    "Information is needed before this report can be processed " why ?
    <%@ page import="com.crystaldecisions.report.web.viewer.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
    <%
    CrystalReportViewer viewer = new CrystalReportViewer();
    ConnectionInfos connInfos = new ConnectionInfos();
    IConnectionInfo connInfo1 = new ConnectionInfo();
    connInfo1.setUserName("user");
    connInfo1.setPassword("pass");
    viewer.refresh();
    Object reportSource = session.getAttribute("reportSource");
    viewer.setReportSource(reportSource);
    viewer.setDatabaseLogonInfos(connInfos);
    viewer.setEnableLogonPrompt(false);
    viewer.processHttpRequest(request, response,getServletConfig().getServletContext(), out);
    viewer.dispose();
    %>
    this programmes are ok (but now i search to display a variable on my report)
    via url
    http://pa-81b36a7e9d/businessobjects/enterprise11/desktoplaunch/opendoc/view_report.jsp?sdoc=axeriatest&user=Administrator&pass=&cms=pa-81b36a7e9d
    CrystalReportViewer.jsp
    <%@ page import = "com.crystaldecisions.report.web.viewer.*"%>
    <%
         CrystalReportViewer viewer = new CrystalReportViewer();
         viewer.setName("CrystalReportViewer");
        viewer.setOwnPage(true);
        //Enable Active-X print mode. 
        viewer.setPrintMode(CrPrintMode.ACTIVEX);
        //Obtain report source of the report that the viewer will display.   
        Object reportSource = session.getAttribute("reportSource");
        viewer.setReportSource(reportSource);
        viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
    %>
    view_report.jsp
    <%
    Applies to Versions:     XI
    Creation Date:     Febuary 28 2005
    Description:
                             This sample to demonstrates how to view a Crystal Report on demand in
        *                         the zero-client DHTML viewer. 
    Author:               CW.
    %>
    <%@ page import = "com.crystaldecisions.sdk.occa.infostore.*,
                       com.crystaldecisions.sdk.plugin.desktop.common.*,
                       com.crystaldecisions.sdk.framework.*,
                       com.crystaldecisions.sdk.occa.security.*,
                       com.crystaldecisions.sdk.exception.SDKException,
                       com.crystaldecisions.sdk.occa.managedreports.IReportSourceFactory,
                       java.util.Locale,
                       com.crystaldecisions.sdk.occa.report.reportsource.IReportSource"
    %>
    <%@ include file = "logonform.jsp" %>
    <%
         String cms             = request.getParameter("cms");
         String user             = request.getParameter("user");
         String pass             = request.getParameter("pass");
         String sdocName       = request.getParameter("sdoc");
         try {
             //If logon information is required, display the logonForm and exit.
              //Create a special logon form that requests 2 Report Names
              //(code for LogonForm class is included).
              LogonForm logonform = new LogonForm(response, request, LogonForm.REPORT_NAME);
              //if (logonform.display_if_needed()) return;
              // ici doit recuperer le nom du document
              logonform.reportname[0] =  sdocName ; //"diagramme";
              //Log in.
              IEnterpriseSession enterpriseSession = CrystalEnterprise.getSessionMgr().logon(user,pass,cms,"secEnterprise");
             //Grab the InfoStore from the httpsession
             IInfoStore infoStore = (IInfoStore)enterpriseSession.getService("", "InfoStore");
             //Query for the report object in the CMS.  See the Developer Reference guide for more information the query language. 
             IInfoObjects oInfoObjects = (IInfoObjects)infoStore.query("SELECT TOP 1 * " +
                                                                                     "FROM CI_INFOOBJECTS " +
                                                                                "WHERE SI_PROGID = 'CrystalEnterprise.Report' AND SI_INSTANCE=0 AND SI_NAME='" + logonform.reportname[0] + "'" );
             if (oInfoObjects.size() > 0) {
                  //Retrieve the latest instance of the report
                  IInfoObject oInfoObject = (IInfoObject) oInfoObjects.get(0);
                  //Use the PS report factory to obtain a report source that will be processed on the Page Server.   
                  IReportSourceFactory factoryPS = (IReportSourceFactory)enterpriseSession.getService("PSReportFactory");
                  Object reportSource = factoryPS.openReportSource((oInfoObject), Locale.ENGLISH);
                  session.setAttribute("reportSource", reportSource);
                  //View the report in the standard DHTML viewer.        
                  response.sendRedirect("CrystalReportViewer.jsp");
             else {
                  out.println("Report " + logonform.reportname[0] + " not found.");     
        catch(SDKException sdkEx) {
              out.println(sdkEx);  
    %>
    logonform.jsp
    <%!
    /**************************** class LogonForm ***************************
    This logon form is used to gather the logon information needed
    to login to Enterprise
    private class LogonForm {
         HttpServletResponse response;
         HttpServletRequest request;
         int num_reports_needed = 1;
         String[] reportname;
         public static final int NONE = 0;
         public static final int REPORT_NAME = 1;
         public static final int REPORT_NAME_X2 = 2;
    Constructor - Save the response and request objects
         LogonForm(HttpServletResponse response, HttpServletRequest request)
              //this.response = response;
              //this.request = request;
    Constructor with options - Add some optional boxes to request other
                               input from the user such as reportnames.
         LogonForm(HttpServletResponse response, HttpServletRequest request, int extra_requests) {
              this.response = response;
              this.request = request;
              switch (extra_requests) {
                   case NONE:
                        break;
                   case REPORT_NAME:
                        num_reports_needed = 1;
                        reportname = new String[1];
                        break;
                   case REPORT_NAME_X2:
                        num_reports_needed = 2;
                        reportname = new String[2];
                        break;
    %>

    oh thanks but i have an error on this example  Viewingview_report_parameters
    but where is my connection to my database in file jsp ?
    thanks
    windows
    CMS  NAme  = MyCMS
    user = myuser
    pass = password
    aut = enterprise
    doc = my doc
    ok
    after enter values : i Put my values
    ok
    after click on button view report this is error
    Etat HTTP 500 -
    type Rapport d'exception
    message
    description Le serveur a rencontré une erreur interne () qui l'a empêché de satisfaire la requête.
    exception
    org.apache.jasper.JasperException
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    cause mère
    java.lang.NullPointerException
         org.apache.jsp.opendoc.CrystalReportViewer_jsp._jspService(CrystalReportViewer_jsp.java:80)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note La trace complète de la cause mère de cette erreur est disponible dans les fichiers journaux de Apache Tomcat/5.0.27.
    Apache Tomcat/5.0.27

  • How to pass a bind variable from one SQL Report to Another

    Hello~
    I've created a link on one SQL Report page (Page 1). I would like a value from Page 1 used in the SQL on Page 2 to determine the result set. The Where Clause in SQL Query containing the bind variable is as follows:
    AND hp.party_name     = ':District_Account'
    When I run Page 1 and click on the link to execute Page 2, I get 'No Data Found'. The setup of the link is as follows:
    Column_Name = District_Account
    Link Text = #District_Account#
    Target = Page in this application
    Page = 2
    I'm a rookie working in V1.6...any help would be greatly appreciated!
    Thanks,
    Becky

    I don't see any parameter being passed in that URL. A little sample: http://htmldb.oracle.com/pls/otn/f?p=33203:4<br>
    when you click on the edit link the URL looks like this:<br>http://htmldb.oracle.com/pls/otn/f?p=33203:5:16073998852455071705::NO:5:P5_TABLE_NAME,P5_OWNER:PRESIDENTS_THEMES%2CBLUETEST<br><br>
    where P5_TABLE_NAME and P5_OWNER are the items and PRESIDENTS_THEMES and CBLUETEST are the values.<br><br>
    The SQL on the filtered report looks like:<br>
    SELECT *
    FROM all_tab_cols
    WHERE table_name = :P5_TABLE_NAME
      AND owner = :P5_OWNER<BR><BR>

  • Passing Mulitiple Parameters in a Drill Down Report

    Hi,
    I can pass single parameter in a Drill Down Report..
    But i cant passes more then one parameter at same time,,
    Example.
    First I tried Dates passes to another Report its work
    srw.run_report('report=D:\REPORTS\LIST_OF_DISBRUSTMENTS destype=screen paramform=yes
    SDATE='||TO_DATE(:SDATE)||'');
    Now I want SDATE with 2 other parameters that are
    Acct_MGR and EDATE...how can i use them in Drill Down Report..
    I tried as Much I can but Parameter hasnt pass properly.

    did you try using + sign, e.g.
    .....+Acct_MGR=:acmgr+EDATE=:enddate

  • How to pass multi-value input parameter to SQL command

    I'm having trouble following the threads related to passing multi-value parameters to a SQL command.
    I need more details on the work-around that exists for using a dummy main report to GET the input parameters and pass them to a subreport parameter that uses the input parameters in its sql command WHERE clause.
    So far the main report prompts user to enter badge numbers into a multi-value string type parameter field called badgeNumber.
    The main report getRequesters command executes the following SQL:
    SELECT requester FROM lawprod.requester WHERE lawprod.requester.requester IN  '{?badgeNumber}'
    order by requester
    The main report also contains a formula called requesterList that concatenates the input parameters and separates the values with commas:  (Join ({?badgeNumber}, ", ")  
    So if user enters badge numbers 1 and 2 and 3 the value of requesterList is 1, 2, 3
    From the main report I've used the Insert Subreport command to choose an existing report, and used the link tab to link @requesterList to ?requester; where ?requester is a multi-value parameter that is used in the subreport's SQL query as shown below:
    WHERE (lawprod.ictrans.update_date <=  {?endDate} AND
           lawprod.ictrans.update_date >= {?startDate} AND
           lawprod.ictrans.doc_type = 'IS' AND
           lawprod.ictrans.system_cd = 'RQ' AND
           lawprod.mmdist.posting_type = 'O1')
          AND
          (lawprod.ictrans.company = lawprod.mmdist.company AND 
           lawprod.ictrans.system_cd = lawprod.mmdist.system_cd AND
           lawprod.ictrans.location = lawprod.mmdist.location AND
           lawprod.ictrans.doc_type = lawprod.mmdist.doc_type AND
           lawprod.ictrans.document = lawprod.mmdist.doc_number AND
           lawprod.ictrans.shipment_nbr = lawprod.mmdist.doc_nbr_num AND
           lawprod.ictrans.line_nbr = lawprod.mmdist.line_nbr AND
           lawprod.ictrans.component_seq = lawprod.mmdist.component_seq)
          AND
          (lawprod.ictrans.company = lawprod.reqline.company AND 
           lawprod.ictrans.document = lawprod.reqline.req_number_a AND
           lawprod.ictrans.line_nbr = lawprod.reqline.line_nbr AND
           lawprod.reqline.company = lawprod.reqheader.company AND
           lawprod.reqline.req_number = lawprod.reqheader.req_number)
           AND
           (lawprod.reqheader.requester in '{?requester}')
    Following execution of the main report, Crystal appears to prompt for three values as expected: badge numbers for the main report, and start and end dates needed by the subreport.   I can't figure out why Crystal XI returns no data. Can anyone explain what I'm missing?
    Edited by: Patricia Sims on Sep 21, 2009 9:30 PM

    The reason no data is returned is that the multiple values are not (properly?) passed to the main report's SQL.  The main report's SQL should be (MS SQL):
    select 1 as dummy
    This causes exactly one record to be returned, which will basically be ignored (except the fact that it will drive the subreport; any query that returns only 1 record will suffice...).
    Change the concatenation of the selected values to be (basic syntax):
    formula = "|" + join({?badgeNumber}, "|") + "|"
    The leading and trailing vertical bars are important (otherwise a database value of 1 might match a selection of 123).
    Pass the concatenated string as the parameter value to the subreport.  In your subreport, select records on (basic syntax):
    formula = (instr({?sr-badgeParam}, "|"+cstr({requester},"0") + "|") > 0)
    (assumes is numeric in the database, and is integer; modify or eliminate cstr() if otherwise...)
    Put your subreport on the detail format of the main report, and you're all set...
    HTH,
    Carl

  • Passing Parameters to Procedure based sub report thru JRC

    Hi
    I am using storedprocedure based main report with a subreport and i am trying to invoke these reports with JRC.
    I am passing parameters to main report then it is asking parameters for subreport then i placed following statement by placing subreport name
    param2.setReportName("detailed_aging_report_wk.rpt");
    but after using this statement it is prompting for main report parameters.
    How i can pass the same parameter values to both main and sub reports?
    Thankyou.

    Here is a snippet code that demonstrates how to pass a parameter to a subreport, you can accommodate it and test it and see if you still have the same behaviour. What you need to do is to add the code to set the parameter of the main report.
    <%
    /* Applies to: XI
    * Date Created: April 4, 2005
    * Description:     This sample demonstrates how to pass parameters to a report that
    *                    contains a subreport using the Crystal Reports Java
    *                    Reporting Component (JRC) SDK.        
    * Author: HP, CW
    try {
         //check to see if the report source already exists
         Object reportSource = session.getAttribute("reportSource");
         //if the report source has not been opened
         if (reportSource == null)
              //---------- Create a ReportClientDocument -------------
              ReportClientDocument oReportClientDocument = new ReportClientDocument();
              //---------- Set the path to the location of the report soruce -------------
              //Open report.
              oReportClientDocument.open("jrc_set_subreport_parameters/jrc_set_subreport_parameters.rpt", 0);
              //Get the report source
              reportSource = oReportClientDocument.getReportSource();
              //Cache report source. 
              //This will be used by the viewer to display the desired report.
              session.setAttribute("reportSource", reportSource);
         //---------- Create the Parameter Field Objects -------------
        //Create a Fields collection object to store the parameter fields in.
        Fields oFields = new Fields();
        //----------- Initialize the parameter fields ----------
        //Set the name and value for each parameter field that is added.
        //Values for parameter fields are represented by a ParameterFieldDiscreteValue
        //or ParameterFieldRangeValue object.
        //NOTE: Be sure to map the names of the parameters and their
        //respective types against the correct type that the parameter
        //field values was defined to accept in Crystal Reports.
        //NUMBER VALUE PARAMETER. 
        Integer numberValue = new Integer("55");
        //STRING VALUE PARAMETER.
        String stringValue = "String parameter value.";
        //BOOLEAN VALUE PARAMETER.
        Boolean booleanValue = new Boolean("true");
        //DATE VALUE PARAMETER.
        Calendar calendar = Calendar.getInstance();
        calendar.set(2004, 1, 17);
        Date dateParamVal = calendar.getTime();
        //DATE-TIME VALUE PARAMETER.
        Calendar calendar2 = Calendar.getInstance();
        calendar2.set(2002, 5, 12, 8, 23, 15);
        Date dateTimeParamVal = calendar2.getTime();
        //CURRENCY VALUE PARAMETER.
        Double currParamVal = new Double(555.99);
        //TIME VALUE PARAMETER.
        Calendar calendar3 = Calendar.getInstance();
        calendar3.set(2002, 5, 12, 13, 44, 59);
        Date timeParamVal = calendar3.getTime();
        //Set all of the parameter values using the utility function.
         //Since we are passing parameters to the subreport, it is here that we set the
         //subreport name; if you are not passing a parameters to a subreport, the
         //report name will be an empty string
         setDiscreteParameterValue(oFields, "NumberParam", "SubreportA", numberValue);
        setDiscreteParameterValue(oFields, "StringParam", "SubreportA", stringValue);
        setDiscreteParameterValue(oFields, "BooleanParam", "SubreportA", booleanValue);
        setDiscreteParameterValue(oFields, "DateParam", "SubreportA", dateParamVal);
        setDiscreteParameterValue(oFields, "DateTimeParam", "SubreportA", dateTimeParamVal);
        setDiscreteParameterValue(oFields, "CurrencyParam", "SubreportA", currParamVal);
        setDiscreteParameterValue(oFields, "TimeParam", "SubreportA", timeParamVal);
        //Push Fields collection into session so it can be retrieved by the viewer and set
        //at view time.
        session.setAttribute("parameterFields", oFields); 
         //Redirect to the viewer page to render the report
         response.sendRedirect("CrystalReportViewer.jsp");
    catch(ReportSDKException sdkEx) {
         out.println(sdkEx);
    %>
    <%!
    * Utility function to set values for the discrete parameters in the report.  The report parameter value is set
    * and added to the Fields collection, which can then be passed to the viewer so that the user is not prompted
    * for parameter values. 
    private void setDiscreteParameterValue(Fields oFields, String paramName, String reportName, Object value) {
         //Create a ParameterField object for each field that you wish to set. 
        ParameterField oParameterField = new ParameterField();
        //You must set the report name.
        //Set the report name to an empty string if your report does not contain a
        //subreport; otherwise, the report name will be the name of the subreport
        oParameterField.setReportName(reportName);
        //Create a Values object and a ParameterFieldDiscreteValue object for each
        //object for each parameter field you wish to set.
        //If a ranged value is being set, a ParameterFieldRangeValue object should
        //be used instead of the discrete value object.
        Values oValues = new Values();
        ParameterFieldDiscreteValue oParameterFieldDiscreteValue = new ParameterFieldDiscreteValue();
        //Set the name of the parameter.  This must match the name of the parameter as defined in the
        //report.
        oParameterField.setName(paramName);
        oParameterFieldDiscreteValue.setValue(value);
        //Add the parameter field values to the Values collection object.
        oValues.add(oParameterFieldDiscreteValue);
        //Set the current Values collection for each parameter field.
        oParameterField.setCurrentValues(oValues);
        //Add parameter field to the Fields collection.  This object is then passed to the
        //viewer as the collection of parameter fields values set.
        oFields.add(oParameterField);
    %>
    Cheers

  • Dynamic SQL report  on Oracle apex4.0

    Hi Everyone,
    I have two reports in one page.One is the Interactive and other is Sql report. Based on the selection of the row(using checkbox) in the interactive report, the sql report has to display the selected columns.
    Note :The report has to be loaded whenever a row is selected and without submitting a button
    Can anyone please suggest?
    I am using oracle Apex4.0
    Regards
    Raj

    I believe you store the values in the checkboxes. For example, your Interactive Report query looks like:
    SELECT '<input type=checkbox value='||OBJID||' />' AS CHECKBOX, T.*
    FROM SOME_TABLE T
    and in "Report Atributes" the CHECKBOX is displayed as "Standard Report Column".
    *1.Create a hidden check list input field.*
    It will store a list values of selected checkboxes. make it long enough, eg. 1000.
    Let's say the input name is: P000_X_CHECK_LIST
    *2. Create Dynamic Action*
    This dynamic action is supposed to fill in the P000_X_CHECK_LIST with a list of values, separated by ":" character.
    These values will be an input for the SQL report.
    Name: Update Check List
    Event: Change
    Selection Type: jQuery Selector
    jQuery Selector: input:checkbox
    Action: Set Value
    Set Type: JavaScript Expression
    function check_list() {
    var n = "";
    $(":checked").each( function () {
    n = n + (n === "" ? "" : ":") + $(this).val();
    return n;
    check_list();
    Selection Type: Item(s) - P000_X_CHECK_LIST
    *3. Adjust the "SQL report" query with this magic formula*
    AND SEARCHED_ITEM IN (
    SELECT item
    FROM (SELECT REGEXP_SUBSTR (str, '[^:]+', 1, LEVEL) item
    FROM (SELECT :P000_X_CHECK_LIST str
    FROM DUAL)
    CONNECT BY LEVEL <= length (regexp_replace (str, '[^:]+')) + 1)
    for example:
    SELECT O.*
    FROM SOME_OTHER_TABLE O
    WHERE SEARCHED_ITEM IN (
    SELECT item
    FROM (SELECT REGEXP_SUBSTR (str, '[^:]+', 1, LEVEL) item
    FROM (SELECT *:P000_X_CHECK_LIST* str
    FROM DUAL)
    CONNECT BY LEVEL <= length (regexp_replace (str, '[^:]+')) + 1)
    *4. Adjust the Dynamic Action:*
    Advanced: Event Scope: "live"
    *5. Add one more True action to the Dynamic Action:*
    Action: Refresh
    Selection type: Region
    Region: The region of the "SQL report".
    Volia!
    Best regards,
    Krzysztof

  • Passing user parameters in interface

    Hi,
    How do I implement interface that accepts user parameters?

    Thanks for the response. :).
    Hereunder is what I want to achieve:-
    I have written two interfaces to do the loading from table (SQL) and file (txt), schema definition for both is the same, and data is different. The target is same for both.
    I want to make the interface generic by passing an input variable @i
    if @i = 1 then load from table
    if @i = 2 then load from file
    Is it achievable in ODI?

  • Passing URL parameters to PL/SQL Pages

    Hi,
    I want to pass parameters from url to the PL/SQL page . How is this possible?
    http://myserver/pls/portal/url/PAGE/page_group/page/testplsqlpage?course_ref=##COURSE_ID##&staff_ref=##STAFF_ID##
    I will to received course_ref and staff_ref in the PL/SQL page and pass the values to SQL query so that its filtered.
    Can pls anyone guide me? If there is any alternate way or there is sample code pls let me know
    Many Thanks
    Ganesh

    Hi Mick,
    Thanks for your reply. However my problem is still not resolved.
    I have created a Omniportlet with lists the staff details. When I click on the staff link I am passing to parameters as follows
    http://servername/pls/portal/url/PAGE/CCM_MIS_PORTAL/TUTOR_HOME/Course_Info?Param1=10017031/M2523&Param2=001434
    on the receving page I have a omni portlet which must receive these 2 parameters and pass it on to the query and filter the results.
    On the received page I have created 2 page parameters (Param1 and Param2)
    I have assigned these 2 paramaters to the portlet paramers through page parameters' section
    on the omni portlet in the query I have created 2 bind variables (p1, p2) and the default value of the bind variable is set using ##Param1## and ##Param2## so the received values from page is passed to to bind variable and hence to the query.
    However the omni portlet is not received the parameters and I can not figure out whats wrong?
    Is there any problem with my URL (guide says I should use relative URL)
    Please help

  • Passing parameters from Excel to SQL stored proc. to analyse resultset in PowerPivot

    Hi,
    Not sure if I posted this question at the right forum ...
    I would like to implement the following scenario:
    - Enter parameters @startdate and @enddate in cells in an Excel worksheet (i.e. cell A2 has the value for the startdate parameter; cell B2 has the value for the endate parameter).
    - Pass these parameters to a SQL stored procedure (using MSQuery?). See below.
    - Calling stored procedure in PowerPivot to get the resultset in PowerPivot.
    The SP calls some functions in SQL Server. See below.
    I have read several posts on several forums but I can't get the parameters from Excel (MSQuery?) to the SP.
    What's the best way to have PowerPivot picking up the resultset from the SP?
    How do I get the Excel cells A2 and B2 to the SP below?
    SP:
    USE [Test]
    GO
    /****** Object: StoredProcedure [dbo].[_Pink_SP_CapaciteitTest] Script Date: 29-7-2014 15:41:04 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[_Pink_SP_CapaciteitTest]
    @startdate DATETIME,
    @enddate DATETIME
    AS
    BEGIN
    SET NOCOUNT ON
    SET DATEFIRST 1
    DECLARE @TempCapacity TABLE
    ResourceNo INT,
    ResourceName NVARCHAR(60),
    JobCode NVARCHAR(12),
    JobDescription NVARCHAR(50),
    CostcenterCode NCHAR(8),
    CostcenterDescription NVARCHAR(50),
    CostcenterClass NVARCHAR(30),
    CostcenterClassDescription NVARCHAR(60),
    Date DATETIME,
    Weekday INT,
    WeekNo INT,
    Month INT,
    Year INT,
    Capacity FLOAT,
    ConsultancyTot FLOAT,
    ConsultancyTotReserved FLOAT,
    Sick FLOAT,
    Doctor FLOAT,
    Pregnant FLOAT,
    Vacation FLOAT,
    VacationCancellation FLOAT,
    SpecialLeave FLOAT,
    CompHours FLOAT,
    Support FLOAT
    INSERT INTO @TempCapacity
    SELECT h.res_id AS ResourceNo,
    h.fullname AS ResourceName,
    h.job_title AS JobCode,
    j.descr50 AS JobDescription,
    h.costcenter AS CostcenterCode,
    cc.oms25_0 AS CostcenterDescription,
    ccc.CostcenterClassCode AS CostcenterClass,
    ccc.Description AS CostcenterClassDescription,
    CONVERT(VARCHAR(10), t.datum, 105) AS [Date],
    DATEPART(DW, t.datum) AS [Weekday],
    (SELECT [dbo].[ISOWeekNumber] (t.datum)) AS WeekNo,
    MONTH(t.datum) AS [Month],
    YEAR(t.datum) AS [Year],
    (SELECT ROUND([dbo].[HRCapacityHours] (h.res_id, t.datum, t.datum), 2)) AS Capacity,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (50, h.res_id, t.datum, t.datum + 1), 0)) AS ConsultancyTot,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (51, h.res_id, t.datum, t.datum + 1), 0)) AS ConsultancyTotReserved,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (9538, h.res_id, t.datum, t.datum + 1), 0)) AS Sick,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8531, h.res_id, t.datum, t.datum + 1), 0)) AS Doctor,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (9924, h.res_id, t.datum, t.datum + 1), 0)) AS Pregnant,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8501, h.res_id, t.datum, t.datum + 1), 0)) AS Vacation,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8551, h.res_id, t.datum, t.datum + 1), 0)) AS VacationCancellation,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8511, h.res_id, t.datum, t.datum + 1), 0)) AS SpecialLeave,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (9518, h.res_id, t.datum, t.datum + 1), 0)) AS CompHours,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (3200, h.res_id, t.datum, t.datum + 1), 0)) AS Support
    FROM humres h (NOLOCK)
    LEFT OUTER JOIN hrjbtl j (NOLOCK) ON h.job_title = j.job_title
    LEFT OUTER JOIN kstpl cc (NOLOCK) ON h.costcenter = cc.kstplcode
    LEFT OUTER JOIN CostcenterClasses ccc (NOLOCK) ON cc.Class_01 = ccc.CostcenterClassCode AND ccc.ClassID = 1
    CROSS APPLY (SELECT * FROM [dbo].[AllDays] (@startdate, @enddate)) t
    WHERE h.ldatindienst <= t.datum
    AND ISNULL(h.ldatuitdienst, t.datum) >= t.datum
    AND h.fullname NOT LIKE '%inhuur%'
    AND h.emp_type IN ('E', 'C')
    AND h.job_title IN ('F09CONS', 'F09PRIN')
    ORDER BY h.fullname,
    t.datum
    SELECT * FROM TempCapacity
    END
    Thanks!

    Hi,
    According to your description, I think you want to call a store procedure in PowerPivot with the parameters which are stored in the cells of an Excel workbook.
    Are you using the PowerPivot add-in in Excel or PowerPivot in SQL Server?
    This forum is to discuss problems of Office development such as VBA, VSTO, Apps for Office .etc. If you are using Excel PowerPivot, since it is an add-in for Excel and it doesn't publish API for us, we cannot automatically call a stored procedure in Excel.
    We can get the data from Cells A2 and B2 with code, but it's hard to set it as the parameters of a SP when calling it from PowerPivot. About calling a SP from Excel manually, you could post in
    Excel IT pro forum for more effective responses.
    If you are using PowerPivot in SQL Server, I'm afraid your issue is more related to the feature of PowerPivot. We can get data from SQL Server database into Excel workbook, but I'm not sure whether we can get data from Excel cells in SQL Server. So I suggest
    you posting in
    SQL Server PowerPivot forum for more effective responses.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Passing System Parameters to sqlplus_exec_template.sql

    Hey All,
    I am running into problems passing system parameters to a SQL Loader mapping from within a shell script, and I hope someone can pick out what I am doing incorrectly. My call is as follows:
    @sqlplus_exec_template.sql OWB9204_RT PlatformSchema SQL_LOADER $2 "data_file_name=$DATA_NAME,log_file_name=$DATA_NAME.log" ","
    Here is the result:
    Stage 1: Decoding Parameters
    | location_name=PlatformSchema
    | task_type=SQLLoader
    | task_name=INTF_FILENAME_LDR
    Stage 2: Opening Task
    | l_audit_execution_id=152832
    Stage 3: Overriding Parameters
    | data_file_name%SYSTEM='filename_0501050745.dat'
    declare
    ERROR at line 1:
    ORA-20016: The specified parameter information is invalid
    ORA-06512: at "OWB9204_RT.WB_RTI_EXCEPTIONS", line 82
    ORA-06512: at "OWB9204_RT.WB_RTI_EXECUTION", line 514
    ORA-01403: no data found
    ORA-06512: at "OWB9204_RT.WB_RT_EXECUTION", line 54
    ORA-06512: at "OWB9204_RT.WB_RT_API_EXEC", line 187
    ORA-06512: at line 32
    ORA-06512: at line 134
    ORA-06512: at line 164
    ORA-06512: at line 214
    I am using the system parameters defined in Note 292399.1, and I have tried several variations on syntax. Any help would be greatly appreciated.
    David

    Well, I answered my own question. It appears that even though note 292399.1 lists data_file_name and log_file_name, they are not modifiable at execution using sqlplus_exec_template. Only those parameters modifiable at execution time using the Deployment Manager can be changed. I tested this using BINDSIZE=5000000, and it ran without a problem.

  • Pass Checkbox Parameters from HTML Form to a stored procedure

    I'm still looking for a solution to my forms problem. FYI, I'm not using Applications Express to build my application--I'm using straight PL/SQL. I need to know how to pass checkbox parameters from my Web form. I'm allowing folks to select one or more checkboxes on a form that will call a delete function to delete the selected records. What I read in Oracle's "Database Application Developer's Guide - Fundamentals" isn't helpful to me. If someone would point me to some examples, maybe I could see what I'm doing wrong. Here's what was written in "Database Application Developer's Guide - Fundamentals":
    All the checkboxes with the same NAME attribute make up a checkbox group. If none of the checkboxes in a group is checked, the stored procedure receives a null value for the corresponding parameter.
    If one checkbox in a group is checked, the stored procedure receives a single VARCHAR2 parameter.
    If more than one checkbox in a group is checked, the stored procedure receives a parameter with the PL/SQL type TABLE OF VARCHAR2. You must declare a type like this, or use a predefined one like OWA_UTIL.IDENT_ARR. To retrieve the values, use a loop:
    CREATE OR REPLACE PROCEDURE handle_checkboxes ( checkboxes owa_util.ident_arr )
    AS
    BEGIN
    FOR i IN 1..checkboxes.count
    LOOP
    htp.print('&lt;p&gt;Checkbox value: ' || checkboxes(i));
    END LOOP;
    END;
    SHOW ERRORS;

    I'm not sure I understand what your issue is.
    If your web form has the following checkboxes defined all with the same name:
    <input type="checkbox" name="attrib" value="1">one</input>
    <input type="checkbox" name="attrib" value="2">two</input>
    <input type="checkbox" name="attrib" value="3">three</input>Then you would create and register a procedure to handle the form submission that has a parameter with the name attrib of type owa_util.ident_arr e.g.:
    create or replace procedure handle_form(attrib owa_util.ident_arr) as
      iter number;
    begin
      for iter in attrib.first .. attrib.last loop
        -- do something with attrib(iter)
      end loop;
    end;
    /Now the one problem with this handler (or any form handler for that matter) is that if the user selects none of the check boxes, or no value for any of the expected parameters, the handler would be called with some parameters missing or with out any parameters passed to it, and the call will error out.
    To get around that you need to provide default values for all the parameters passed to your handler including the ident_arr parameters, however with ident_arr parameters that's difficult to do with standalone procedures. If you place your procedure in a package you can define package level variables of the appropriate types that can be used as default values:
    create or replace package my_web as
      empty_arr owa_util.ident_arr;
      procedure handle_form(attrib owa_util.ident_arr := empty_arr);
    end my_web;
    create or replace package body my_web as
      procedure handle_form(attrib owa_util.ident_arr := empty_arr) as
        iter number;
      begin
        for iter in attrib.first .. attrib.last loop
          -- do something with attrib(iter)
        end loop;
      end;
    end my_web;
    /now when you hit the situation where the user doesn't select any check boxes, the call to handle_form won't err out due to missing parameters, and the empty_arr won't have any elements to iterate over so the loop in the procedure body will be fine and you will be able to retrieve each selected check box value from the attrib array when you iterate over it.

  • Passing in parameters to Data Instance

    Hi
    I read in OSM 7.2 Release Notes on vf:instance :
    You can now add explicit parameter values from within an XQuery or XPath that
    augment or override the parameters defined in the OSM data dictionary using
    vf:instance()
    My question is, how do I make use of the parameters passed in in my Data Instance?
    The example given in Developer's Guide says:
    log:info($log,local-name(
    vf:instance($order/oms:GetOrder.Response/oms:_root/oms:data[1],'DataInstance',<oms:url>file://us/catalog.xml</oms:url>)/*[1]
    How do I make use of parameter oms:url in the Data Instance?
    I tried using ${oms:url} but it gives me compile error.
    I created a new namespace for the data instance to obtain the passed in parameters. Is this the correct way?
    the xquery to invoke the data instance:
    let $dataInstanceParams := <m1:params xmlns:m1="http://xxx.com/bcc/osm/com/orderopco/xml">
    <m1:OMGroupRefID>{fn:normalize-space(im:MainOrderLineItem[0]/im:OMGroupRefID/text())}</m1:OMGroupRefID>
    <m1:ActionCode>{fn:normalize-space(im:MainOrderLineItem[0]/im:ActionCode/text())}</m1:ActionCode>
    </m1:params>
    let $dboutput2 := vf:instance('CheckProductGroupExists',$dataInstanceParams/*)
    adapter is JDBC adapter, built-in.
    My Data Instance Behavior's oms:sql is:
    <query xmlns:im="http://xxx.com/bcc/osm/com/orderopco">
    <sql>
    select opg_ref_id from C_OM_OPG_MAP
    where om_product_group='{$OMGroupRefID}'
    and action_code='{$ActionCode}'
    </sql>
    </query>
    Thanks.
    Will
    Edited by: will.s on Dec 10, 2012 6:01 PM added xquery to invoke the data instance

    Hi Will;
    The DatabaseAdapter expects input parameters to be named "in:1", "in:2", "in:3" and so-on. The numbers 1, 2, 3, etc. correspond to the position of the ? entry in your SQL parameter. in:1 would be used as the value for the first ? in your sql, in:2 would be used as the value for the second ? and so-on.
    So based on this, your xquery would need to be something like this:
    let $dataInstanceParams := <m1:params xmlns:m1="http://xxx.com/bcc/osm/com/orderopco/xml">
    <in:1>{fn:normalize-space(im:MainOrderLineItem[0]/im:OMGroupRefID/text())}</in:1>
    <in:2>{fn:normalize-space(im:MainOrderLineItem[0]/im:ActionCode/text())}</in:2>
    </m1:params>
    let $dboutput2 := vf:instance('CheckProductGroupExists',$dataInstanceParams/*)
    We don't care what the namespace is that you use, but the namespace prefix must be "in:".
    For your reference, I'm copying below the full text of the Javadocs for the DatabaseAdapter. You can find the docs for this and other adapters in the OSM SDK Javadocs.
    This class implements a View Framework external instance adapter that executes a SQL statement and builds an XML document based on the result set.
    There are two mandatory parameters for this class, oms:sql and oms:dataSource.
    oms:dataSource: Refers to the jndi name of a JDBC datasource defined in WebLogic. For example 'mslv/oms/oms1/internal/jdbc/DataSource'
    oms:sql: Contains the sql that will be sent to the database. For example 'select * from scott.emp where empno=?'
    Additional optional input parameters may be supplied that will be bound to parameters defined in the oms:sql value. For example, in the above sql statement a parameter is used to define the value for 'empno' in the where clause. A value for this parameter may be specified by defining a paremter called "in:1". If there were additional input parameters defined in the sql statement, these could be passed as "in:2", "in:3" and so on.
    In all cases these input parameters will be assumed to be string values and bound to the sql statement as string values.
    The following is an example of using the DatabaseAdapter to invoke a query:
    <instance name="well_paid_salesman" xsi:type="externalInstanceType">
    <adapter>com.mslv.oms.view.rule.adapter.DatabaseAdapter</adapter> <parameter
    name="oms:dataSource">'mslv/oms/oms1/internal/jdbc/DataSource'</parameter> <parameter
    name="oms:sql">"select * from scott.emp where job='SALESMAN' and sal > ?"</parameter> <parameter
    name="in:1">1250</parameter> </instance>
    The above declaration returns the following XML instance:
    <results> <rowSet> <row> <empno>7499</empno> <ename>ALLEN</ename> <job>SALESMAN</job> <mgr>7698</mgr>
    <hiredate>1981-02-20 00:00:00.0</hiredate> <sal>1600</sal> <comm>300</comm> <deptno>30</deptno> </row> <row>
    <empno>7844</empno> <ename>TURNER</ename> <job>SALESMAN</job> <mgr>7698</mgr> <hiredate>1981-09-08
    00:00:00.0</hiredate> <sal>1500</sal> <comm>0</comm> <deptno>30</deptno> </row> </rowSet> </results>
    The DatabaseAdapter can also be used to execute SQL stored procedures.
    The DatabaseAdapter provides a stored procedure SQL escape syntax that allows stored procedures to be called in a standard way for all RDBMSs. This escape syntax is defined as part of the Java JDBC API.
    This escape syntax has one form that includes a result parameter and one that does not. If used, the result parameter must be registered as an OUT parameter. The other parameters can be used for input, output or both. Parameters are referred to sequentially, by number, with the first parameter being 1.
    {?= call [,, ...]}
    {call [,, ...]}
    Values for input parameters to the stored procedure are specified using the in:1, in:2 (etc.) parameters in the same way as they are for regular SQL queries.
    Output parameters are specified using out:1, out:2 (etc.). Keep in mind that the parameter number (1, 2, 3, etc.) are numbered sequentially from 1 ordered from left to right in the specified SQL statement including both input and output parameters.
    The value of the parameter is the parameter SQL type (see http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Types.html for a list of types).
    The following example illustrates how to call a database stored procedure that has one output parameter (the result of the stored procedure call), and one input parameter.
    <instance name="lock_count" xsi:type="externalInstanceType">
    <adapter>com.mslv.oms.view.rule.adapter.DatabaseAdapter</adapter> <parameter
    name="oms:dataSource">'mslv/oms/oms1/internal/jdbc/DataSource'</parameter> <parameter
    name="oms:sql">"{? = call om_cartridge_pkg.get_any_cartridge_id('my_cartridge',?)}"</parameter> <parameter
    name="out:1">'INTEGER'</parameter> <parameter name="in:2">'1.1'</parameter> </instance>
    The above declaration returns the following XML instance:
    <results> <outputParameter number="1">1234</outputParameter> </results>

  • Passing user parameters to groovy script

    From OIM 11gr2 ,I need to create users into LDAP through OID connector OID-11.1.1.6.0.
    After creation , i need to pass user id and other parameters to groovy script to run a command on target system.
    How do i pass these parameters to groovy script. Please assist

    Hi,
    I am calling the shell script from concurrent program and below is the log file of the concurrent program.
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    KORONT_041_SH module: KORONT - Daily Item Master Update
    +---------------------------------------------------------------------------+
    Current system time is 29-JUN-2011 10:09:35
    +---------------------------------------------------------------------------+
    REQUEST_ID: 68510795
    USER_ID: 4219
    PDC:    85
    Item Number:
    KORDC:    124
    PDCSET:   1100000003
    last_updated_in_hours: 24
    EMAIL_ID: [email protected],[email protected]
    SQLPATH: /e381/oracle/asodev01appl/custom/motont/1.0.0/sql/
    RPTDIR:  /e381/oracle/asodev01comn/admin/out/ASODEV01_asoprdb2
    RPTFILE: o68510795.out
    Table truncated.
    *Enter value for 6: User requested Interrupt or EOF detected.*
    Table truncated.
    old  15:       AND ic.organization_id   = &&4
    new  15:       AND ic.organization_id   = 1100000003
    0 rows created.
    Input truncated to 9 characters
    old   8:                AND organization_id   = &&4
    new   8:                AND organization_id   = 1100000003
    0 rows created.
    End of SQL
    No record.
    +---------------------------------------------------------------------------+
    Executing request completion options...
    +------------- 1) PRINT   -------------+
    Printing output file.
                   Request ID : 68510795      
             Number of copies : 0      
                      Printer : noprint
    +--------------------------------------+
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed successfully
    Current system time is 29-JUN-2011 10:09:38
    +---------------------------------------------------------------------------+Regards,
    Sreekanth

  • Problem to create a link with parameters using a PL/SQL function body

    Hi everybody,
    I need some help to create a link on a SELECT statement.
    I have a region report with type "PL/SQL function body return SQL query".
    I would like to use a link using HTML tag <a href>.
    I know how to do the link, but I don't know to pass a parameters in <a href> statement.
    Always I tried it doesn't work well.
    My PL/SQL anonimous block is, (just with link) :
    DECLARE
    q vARCHAR2(4000);
    BEGIN
    q:='select     "INDICADOR"."NRINDICADOR" as "NRINDICADOR",';
    q:=q||'     "INDICADOR"."DSINDICADOR" as "DSINDICADOR",';
    q:=q||'''<span style="font-weight:bold;">';
    q:=q||'''||TO_CHAR("TOTAL_INDICADOR"."VL_INDICADOR", ''999G999G999G990D00'')||''</span>''';
    q:=q||' as "VL_INDICADOR",';
    q:=q||'     "TOTAL_INDICADOR"."VL_META" as "VL_META" ';
    q:=q||' from     "TOTAL_INDICADOR" "TOTAL_INDICADOR",';
    q:=q||'     "INDICADOR" "INDICADOR" ';
    q:=q||' where "INDICADOR"."NRINDICADOR"="TOTAL_INDICADOR"."NR_INDICADOR"';
    RETURN q;
    END;
    Thanks for any help,
    Alessandra

    Your code is in a default value for an item, right?
    You need to make sure :P33_YEAR is not null and handle the error in the PL/SQL if it is.
    How is P33_YEAR populated? do you pass it in? check to see if it is making it there..
    Message was edited by:
    Bill Carlisle

Maybe you are looking for

  • SQL Developer - Data Modeler - Trigger for FK arc constraints

    In the preferences there is an option "Data Modeler > DDL > Create Triggers for FK arc constraints". I think Oracle recomments to use constraints instead of triggers where it is possible. Can anyone from the Development team tell me why here is just

  • Index is unusable after using Direct path of SQL Loader

    When using the Direct path of SQL Loader to load records from a comma(,) seperated file into a table, the index which I specify the records are sorted in becomes unusable. In the log file created by SQL Loader the error: "ORA-01409: NOSORT option may

  • Configuring service with party to service without party

    Hi, I have a scenario where the sender is an external system and reciver system is in our landscape. I have created a party and service for the sender system and a service without party for my receiver system. Is it possible to configure a scenario,

  • Exchange server 2010 forwarding to multiple email address

    Is it possible to forward email from one address to multiple email address?

  • Looking at buying Sony NEX 7

    The specs below are confusing to this video neophyte. Will I be able to connect camera and expect to see camera in iMovie or iPhoto? "The NEX-7's Full HD video is recorded using AVCHD Version 2.0 compression, with Dolby Digital (AC-3) audio, and a wi