Pass date range parameter  to SQL stored procedure.

Hi,
I'd like to pass a date range parameter from Crystal Reports to a sql stored procedure. Does anyone know if this is possible?
I've had no problem passing standard datetime (single value) paramaters to and from but am struggling with getting a range value parameter to work.
Environment: Crystal Reports 10/XI and SQL 2000 MSDE version or SQL 2005 Express Edition.
Any help would be appreciated.

C5112736 wrote:>
> And then these 2 formulas 'Formula # 1' and 'Formula # 2' can be used to pass on to the stored procedure.
Can someone please demonstrate exactly how to use formula results as date parameters to a SQL stored procedure?  Keep in mind, there are two parameters to the stored procedure.
I have gleaned this much: Use Add Command and insert the procedure with
EXEC ServerName.dbo.usp_sprocName;1 '{?StringParameter}'
but if I try to do
{CALL ServerName.dbo.usp_SprocName({@Formula1},{@Formula2})}
then it gives the error "No value given for one or more required parameters". 
Both of the parameters are VARCHAR(50).
I have finally found this link: [http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx|http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx]
This Microsoft site defines the format of the ODBC escape sequences, but I still do not know how to convince Crystal to insert it's parameter results or formula results.
Pulling what's left of my hair out . . .
~ Shaun

Similar Messages

  • Pass BLOB as parameter to Packaged Stored Procedure

    Does JDBC (thin or otherwise) support passing a BLOB as a parameter to a packaged stored procedure in Oracle, or do we have to do an 'insert' statement to get it in?
    All the articles I've seen seem to refer to insert and select, but I want to strictly enforce all access to the database being through a package rather than table level access.
    We've certainly had no difficulty receiving blobs from the resultset returned by our packaged procedures.
    Any help appreciated,
    Thanks
    Jason.

    C5112736 wrote:>
    > And then these 2 formulas 'Formula # 1' and 'Formula # 2' can be used to pass on to the stored procedure.
    Can someone please demonstrate exactly how to use formula results as date parameters to a SQL stored procedure?  Keep in mind, there are two parameters to the stored procedure.
    I have gleaned this much: Use Add Command and insert the procedure with
    EXEC ServerName.dbo.usp_sprocName;1 '{?StringParameter}'
    but if I try to do
    {CALL ServerName.dbo.usp_SprocName({@Formula1},{@Formula2})}
    then it gives the error "No value given for one or more required parameters". 
    Both of the parameters are VARCHAR(50).
    I have finally found this link: [http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx|http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx]
    This Microsoft site defines the format of the ODBC escape sequences, but I still do not know how to convince Crystal to insert it's parameter results or formula results.
    Pulling what's left of my hair out . . .
    ~ Shaun

  • Passing Multi-Value Parameter to a Stored Procedure

    Has anyone experienced passing a Parameter (MultiValue) to a Stored Procedure? I am aware that Crystal Passes the Param as an Array. How would you go about handling this within a Stored Procedure???

    Hi Daniel
    Try as below:
    1. Create a Crystal report, and add a multi-value parameter.
    2. Since the multi-value parameter is treated as an array, create a formula that uses the JOIN function. Create a formula as below:
    //Formula: @JoinFormula
    Join ({?Multi-value parameter array},";")
    ====================
    NOTE:
    In the formula above, a semi-colon (";") is the delimiter.
    ====================
    3. Within the main report, create a subreport based on the stored procedure, and include the parameter to be populated with the multi-value list.
    4. Link the Join formula in the main report to the stored procedure parameter in the subreport.
    Doing so passes a multi-value parameter to the stored procedure.
    Hope this helps!!!!
    Regards
    Sourashree

  • Would like to pass multi-value parameter to a stored procedure

    Hi,
    Is it possible to pass a multi-value parameter to a stored procedure using crystal reports.
    Is there is a way to do so??/
    Thanks,
    Brian.

    Hi,
    Is it that you want to pass 2 or more parameters to a stored proc. it is possible
    go to database expert
    select your connection and click on add command their you will have to create parameters and pass to a proc
    for ref..
    {CALL `menagerie`.`sp_timer`({?delay time},{?delay time2})}
    where `menagerie`.`sp_timer` is a stored proc.
    and delay time and delay time2 are  parameters.
    but if it is like you have to pass multiple values to stored proc using single parameter as per my experience its
    not possible.

  • Parameter into SQL stored procedure

    Post Author: ashleyt
    CA Forum: Formula
    I have a stored procedure that has 16 parameters being passed from the report into the stored procedure.
    Is there a way to code the values for 2 of the parameters.  They will always be the same value, so I would like parameter 15 and 16 to always have the same value, but still need to be passed into the stored procedure.  So how can I "hard code" those values for the parameters so that they do not prompt the user?
    Thank you for any and all help!

    Post Author: ashleyt
    CA Forum: Formula
    Can this not be done, or is my explanation not understandable?!  Thanks for any help.

  • How to passing array as parameter to oracle stored procedure from JPA

    Hi All,
    I need to call a stored proc in Oracle that accepts an array as input parameter.
    Pls let me know how should i call it from my JPA. Is this even possible without using JDBC directly?
    i keep getting the ff error:
    wrong number or types of arguments in call to ....
    my code is something like this:
    String[] myArr...
    Query query = em.createNativeQuery("BEGIN myStoredProc(:arr); END;");
    query.setParameter("arr", myArr);
    Thanks in advance.

    I also fail to get this done my code till now is:
    PLSQL Function:
    function getHtml(pWhere VARCHAR2 DEFAULT NULL,
    pColSort HTP.STRINGARRAY) return clob is
    begin
    errorhndl.Log(pMessage => 'called');
    htp.prn('das ist der test
    for i in 1 .. pColSort.count loop
    htp.p('
    pColSort['||i||']: '||pColSort(i));
    end loop;
    htp.prn('
    <table> <tr> <td> max1.0 </td> <td> max2.0 </td> </tr>');
    htp.prn('<tr> <td> max1.1 </td> <td> max2.1 </td> </tr> </table>');
    htp.prn('test ende');
    return htp.gHtpPClob;
    exception
    when others then
    null;
    end getHtml;
    PLSQL TYPE: (in HTP package - self created - but could be anywhere else too)
    type STRINGARRAY is table of varchar2(256) index by binary_integer;
    JAVA DOA:
    public class ShowReportDOAImpl implements ShowReportDOA {
         private JdbcTemplate jdbcTemplate;
         private SimpleJdbcCall procShowReport;
         public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
              this.jdbcTemplate = jdbcTemplate;
              procShowReport = new SimpleJdbcCall(this.jdbcTemplate)
              .withCatalogName("Show_Report")
              .withFunctionName("getHtml")
              .withoutProcedureColumnMetaDataAccess()
              .declareParameters(
                   new SqlParameter("pWhere", Types.VARCHAR),
                   new SqlParameter("pColSort", Types.ARRAY, "HTP.STRINGARRAY"),
                   new SqlOutParameter("RETURN", Types.CLOB)
         public String readReport(Long id, ParameterHelper ph) {
              String[] sortCol = {"max", "michi", "stefan"};
              String pWhere = "fritz";
              MapSqlParameterSource parms = new MapSqlParameterSource();
              parms.addValue("pWhere", pWhere);
              parms.addValue("pColSort", sortCol, Types.ARRAY, "HTP.STRINGARRAY");
    parms.addValue("pColSort", Arrays.asList(sortCol), Types.ARRAY, "HTP.STRINGARRAY");
    Clob clob = procShowReport.executeFunction(Clob.class, parms);
    String clobString = "";
    try {
         System.out.println("length: "+new Long(clob.length()).intValue());
                   clobString = clob.getSubString(1, new Long(clob.length()).intValue());
              } catch (SQLException e) {
                   e.printStackTrace();
    return clobString;
    EXCEPTION IS:
    org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; uncategorized SQLException for SQL [{? = call SHOW_REPORT.GETHTML(?, ?)}]; SQL state [null]; error code [17059]; Konvertierung zu interner Darstellung nicht erfolgreich: [max, michi, stefan]; nested exception is java.sql.SQLException: Konvertierung zu interner Darstellung nicht erfolgreich: [max, michi, stefan]
         org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
         org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
         org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
         org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:969)
         org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1003)
         org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:391)
         org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:354)
         org.springframework.jdbc.core.simple.SimpleJdbcCall.executeFunction(SimpleJdbcCall.java:154)
         at.ontec.cat.config.doa.ShowReportDOAImpl.readReport(ShowReportDOAImpl.java:47)
         at.ontec.cat.http.ShowReport.doGet(ShowReport.java:80)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113)
         org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    root cause
    java.sql.SQLException: Konvertierung zu interner Darstellung nicht erfolgreich: [max, michi, stefan]
         oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
         oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
         oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:860)
         oracle.sql.ARRAY.toARRAY(ARRAY.java:209)
         oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7767)
         oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7448)
         oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7836)
         oracle.jdbc.driver.OracleCallableStatement.setObject(OracleCallableStatement.java:4586)
         org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:166)
         org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:166)
         org.springframework.jdbc.core.StatementCreatorUtils.setValue(StatementCreatorUtils.java:356)
         org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:216)
         org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:127)
         org.springframework.jdbc.core.CallableStatementCreatorFactory$CallableStatementCreatorImpl.createCallableStatement(CallableStatementCreatorFactory.java:212)
         org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:947)
         org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1003)
         org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:391)
         org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:354)
         org.springframework.jdbc.core.simple.SimpleJdbcCall.executeFunction(SimpleJdbcCall.java:154)
         at.ontec.cat.config.doa.ShowReportDOAImpl.readReport(ShowReportDOAImpl.java:47)
         at.ontec.cat.http.ShowReport.doGet(ShowReport.java:80)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113)
         org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    Please help!!
    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.

  • Regarding Date Range parameter

    hello,
    in purchase order, i want to pass date range parameter. For eg .
    I want to fetch data from 21/11/2011 to 25/11/2011
    how to pass parameter for this?? or do i need to create any formula??
    if yes then how/???????
    awaiting for soonest reply.

    hi,
    you need to do this in the Formula workshop.
    this formula {OPOR.DocDate} = {?DateRange}
    {OPOR.DocDate} - this is the PO DocDate
    {?DateRange} - this is what you have done in step #4 in my 1st post. in this example "DateRange" is the name of my Parameter.
    Quote from you post
    {OPOR.DocDate} = {?25/11/2011 to 30/11/2011} In this way should i write a formula??????
    change this {?25/11/2011 to 30/11/2011} to the name of your Parameter. refer to step #4.
    regards
    Fidel

  • Is it possible to pass a null Input Oracle parameter to a stored procedure

    I have a stored procedure that take 3 inputs and gives 1 output.I'm using Oracle parameter to add all 3 input parameters as follows :
    OracleParameter inobj = cmd.Parameters.Add("wid", OracleDbType.Int32,50);
    inobj.Direction = ParameterDirection.Input;
    inobj.Value = _employeeID;
    and added the output parameter as follows:
    OracleParameter outobj = _cmd.Parameters.Add("w_first", OracleDbType.Varchar2, 50);
    outobj.Direction = ParameterDirection.Output;
    On the UI end , the user has a choice to provide 1 input or all inputs or any 2 inputs based on his interest. Stored Proc looks as follows:
    SP( inp1 in parameter, inp2 in parameter, inp3 in parameter, output1 out parameter)
    If i just get 1 input or 2 inputs from the user, is it fine to query the data for output using same stored procedure or should i have individual stored procedures for each scenario(combination of different inputs)?
    Will i get any pl/sql error that says invalid number of arguements?

    This means if i have 1 input , i need to have a different method to pass 1 parameter value and other input parameters as null and if there are 2 inputs will need different method to handle. So 5 different methods all together?
    What if the stored procedure is as follows ,will its make things easier so that only one method is used for all scenarios?(optional parameters is set default value as null in the stored proc)
    Create or Replace
    Procedure GetFoo
    (cur_z OUT sys_refcursor,
    pub_date IN varchar2,
    fname IN varchar2 default null,
    lname IN varchar2 default null,
    phone IN varchar2 default null
    IS
    BEGIN
    ---get some data
    END;
    *actually i can test this but, all the database servers are down today. So, i need to have idea if this thing works before i confirm with someone. Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to pass the parameter of a stored procedure to iReport

    Hi... i don't know how to pass the parameter of the stored procedure to the iReport.
    In the Report Query, i tried
    1. sp_storedprocedure ' value'
    2. sp_storedprocedure +''''+$P{parameter}+''''+
    3. sp_storedprocedure +$V+$P{parameter}++$F($F is a variable having a value of ' (a single quote))may you enlighten us please? thank you

    For M$ SQL server I find that it only works when U use the fully qualified name...
    e.g. catalod.dbo.my_procedure_name 'variable'
    My full query in the Report Query window is something like this:
    EXEC arc.dbo.jasper_Invoice 1000
    Note that you may find that selecting from VIEWS / TABLES fails for no apparent reason and iReport will prompt you with the usual very unhelpful (we have what we "pay" for) prompt, stating that "The document is empty".
    To work around this issue, where a statement like "SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id=1000" does not work, simply create a PROC, something like:
    CREATE PROC jasper_MyProc (@my_rec_id integer) AS
    SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id= @my_rec_id integer
    ...to wrap your SELECT statement, then call the PROC
    Edited by: Sylinsr on Apr 22, 2008 4:23 PM

  • How to pass parameter from 1 stored procedure to another stored procedure inside crystal report

    Hi
    I have several stored procedure in my Crystal Report. I am wondering if it is possible for me to pass a parameter to one of the stored procedure and to use the result of that stored procedure E.g. CustomerCode. To another 2 stored procedure to generate the report dynamically?
    I have 3 stored procedure
    The 1st one is used to gather information and process the calculation
    another 2 stored procedure is used for generate the graph and both of them required to take 2 parameters. The 1st stored procedure will require 1 parameter (E.G. Reference Code) and will return a set of information including the data that could be use on the other 2 stored procedures.
    After I added these 2 stored procedure, it requires me to pass 3 parameters to the report. I would like to know if I could only pass the Reference Code for stored procedure 1 and use it to retrieve the information for the other 2 parameter?
    Thanks in advance
    Chi

    Hi Chi
    To pass parameter from 1 stored procedure to another stored procedure, you will have to create sub report. In your case you will have to create 2 sub reports for 2nd and 3rd stored procedure and link those sub reports with the main report using Reference Code field in order to pass the values.
    After creating the report when you will refresh the report, it will ask 4 parameters, one parameter for main report, one for the first subreport and two for second subreport to fetch the data correctly.
    Regards
    Poonam Thorat.

  • How to pass a table as parameter on a stored procedure

    Hello all,
    I want to pass the name of a table as parameter into a stored procedure, that will be used for cursors etc.
    But when i pass the parameter and i compile the S.P. it give me error (error: table not existing...)
    Any Help?
    Thanks in advance, Marco

    Marco wrote:
    As i've written above, i'm using stored procedures like 'batch' programs which will be executed with oracle scheduler (passing to s.p. the name of the 'input' tables)
    These input tables are 'external' tables which have got the same structure; for example i've got TABLEX_001, TABLEX_002, XXTAB etc. with the same structure.
    This is the the reason... what do you think?An external table definition can reference multiple files via the LOCATION definition or you can user "ALTER TABLE" to alter the location and change the file that the external table points to.
    Thus you only need one static External Table and use an alter table (via execute immediate) to change the file location it points to, or if you want all the data together, just specify all the files in the location.
    That would be clean design, using one fixed table, without the need to pass any table names, just dynamically altering the file names if necessary at run time.

  • Pass a datarow as input parameter in a stored procedure

    Hi everyone!
    I wonder if anyone know how to pass a datarow (better if tipized like "tablenameRow") as input parameter for a stored procedure.
    links or suggestions are welcome! (i'm newbie in .net programming, so if you can post some code i'll be really grateful!)
    Thank you!

    Hi,
    YES!! its possible you can pass a datarow to a SP from your Dot net application.
    Here below i'm going to give you an example for Desktop Application.
    For Passing a datarow as Input Parameters, your SP need to support for all these parameters.
    I mean, if a data row has 03 Columns. Then your procedure should be able to take 03 arguments/parameters.
    --Adjust code according to your need.
    --Its for C# Desktop application.
    --Visual Studio Professional, Framework (2.0)
    //Setting connections.
    OracleConnection con=new OracleConnection("Data Source=orcl9i; user id=scott; password=tiger");
    OracleComand cmd=new OracleCommand(con);
    cmd.Type=CommandType.StoredProcedure; //you are useing SP
    cmd.Text="my_stored_procedure"; //Mention SP name.
    --if DataRow has Three columns. You need three parameters.
    OracleParameter p1=new OracleParameter ();//By default parameters are input parameters.
    OracleParameter p2=new OracleParameter ();
    OracleParameter p3=new OracleParameter ();
    //We assume that Datarow already has data in it.
    p1.ParametersName="sp_var1 ";
    p1.OracleDbType=OracleDbType.Varchar;
    p1.Value=tablenameRow[1]; //Here DataRow object's Column1 is input.
    p2.ParametersName="sp_var2 ";
    p2.OracleDbType=OracleDbType.Varchar;
    p2.Value=tablenameRow[2]; //Here DataRow object's Column2 is input.
    p3.ParametersName="sp_var3 ";
    p3.OracleDbType=OracleDbType.Varchar;
    p3.Value=tablenameRow[3]; //Here DataRow object's Column3 is input.
    cmd.OracleParameter.Add(p1); //Add parameters.
    cmd.OracleParameter.Add(p2); //Add parameters.
    cmd.OracleParameter.Add(p3); //Add parameters.
    cmd.ExecuteNonQuery(); //Execute Procedure here.
    Feel free to ask if still found problem.
    ....

  • Pl/sql stored procedure as data source

    Hi I am a newbie
    I have a pl/sql stored procedure inside a package which uses a SYS_REFCURSOR as it returns a result set.
    Can I use this procedure as a Data Source using the wizard?
    When I use the Data source configuration wizard I get a list with only the tables and views.I don't see any stored procedures
    Thanks

    Here is a sample procedure..
    CREATE OR REPLACE PROCEDURE TEST_USER.TEST_PROCEDURE1 ( p_cursor OUT SYS_REFCURSOR)
    AS
    BEGIN
    OPEN p_cursor FOR
    SELECT C1,C2
    FROM TEST_USER.test_table4procedure;
    END;
    When I execute the procedure, I see the results. The goal is to put the results of the procedure into a different table.
    Unfortunately I have close to 0 zero knowledge in both java and jython.
    Please help.
    NOTE: For the life of me, I have no clue why the "other" system wants it to be a stored procedure, when we can use a view/table and make everybody's life easier (aka K.I.S.S.)
    Regards,
    Dave Null

  • APEX - accepting OUT variable values from PL/SQL Stored Procedure

    I have created a page (Form) which is accepting values text fields.
    In the Page Processing section under Processing, I am passing the values to a PL/SQL Stored Procedure, which acts like an API. The procedure contains code to validate the entered data and finally insert the data into the base tables. The procedure also contains OUT variables in the parameter that would return status of processing and any error messages.
    Now, my question is, how can I make the page accept these OUT variables from the procedure. What I wish to do is, to capture these messages/processing status from the procedure in the page. For example, if there is a error in the data and the procedure is sending this message in the OUT variable, I need this to be displayed on the page as an error message.
    Is this possible in APEX?
    Regards,
    Santhosh Jose

    Hi VC,
    I just tried putting the string directly instead of the variable. Its still not giving me the expected results.
    HOWEVER, I think the reason was because of the EXCEPTION block in my code. I have an EXCEPTION block to handle exceptions. I commented the WHEN OTHERS section and now the error message is coming on the page.
    So what I have done now is as follows: At the point at which the error is expected, I am raising a handled exception. And within the exception handling, I am giving RAISE_APPLICATION_ERROR.
    WHEN ex_main_error*
    THEN*
    p_status := 2;*
    p_msg := 'ERROR Stage: '||lc_err_stage||' ERROR Message: '||lc_err_msg;*
    RAISE_APPLICATION_ERROR (-20001, p_msg);*
    This is working now! Which is very good news. Thanks once again for your help!
    Regards,
    Santhosh Jose

Maybe you are looking for

  • How do I convert a word doc to pdf?

    I cannot seem to convert a word doc to a pdf- it keeps taking me back to the subscription page and I already have signed up for that. HELP!

  • What exactly are objects?

    Hi, i am new to java and i do not exactly understand the concept of OBJECTS...they are somehow relates to methods and classes. Is there a place where is can know about objects in java? Maybe someone here can help me..

  • Acrobat 9 :only page 1 of a web page is converted to pdf, remaining pages come out as blanks

    I have not seen this question anywhere but thats right. If a web page is 5 pages long, and we print it on the Acrobat 9 printer we get the first page correctly after which the remaining 4 pages are blank white sheets. I got the same result when I fir

  • How to get a decoration like that

    i want to get some decoration like that in the picture  i'm using labview 2011 Attachments: Untitled2.png ‏12 KB

  • About  "FIXUP_VTABLE"  in CS4

    In Cs4 sdk,there is a  VTableSupport.hpp : // If your plugin has a C++ object attached to it's globals, and if // the class of that object has virtual functions, those functions // will not work after the plugin is unloaded and then reloaded. // The