Stored proc to accept parameters at prompt

How do you create a stored proc in SQL so that when run in desk you can input parameters?
I have a simple stored proc but when I create in deski always get an error saying that it expects '@DateStart'.
here is the sproc ive used:
CREATE  Procedure [dbo].[sp_redempt](@DateStart Datetime,@DateEnd Datetime)  AS  SELECT *
FROM redempt             
WHERE planners.office = 'abc'
AND ProcessDate >= @DateStart and ProcessDate <= @DateEnd
-- running it in SQL ent mgr
exec dbo.sp_NCLredempt '01 february 2011', '28 february 2011';
can you help with the syntax I use or specify a simple stored proc using the adventure works DB that will prompt for a parameter in deski?
BO Edge XI 3.0
App server: MS Win2003 Server Standard SP2
DB server: MS Win2003 Server Standard SP2
DB on DB server: SQL 2005

Hi,
this is not the best place to post this but you may try the SQL Server forums from Microsoft.
Might  be an issue in your parameter type definition. What you can do is in
SQL Server Management Studio, go to the stored procedures (programability) under AdventureWorks database, and Right click -> Script Stored Procedure As -> CREATE to -> New Query Editor Window. Then there you will able to see the syntax how it's used.
You can run one sample procedure in Deski. In Designer create a secure connection to AdventureWorks database. Then create a Deski report based on the "uspGetManagerEmployees" procedure and you can use MnagerID  6 when you run it. You will get results.

Similar Messages

  • Multiple threads calling the same stored proc with different parameters

    Hi,
    I have a stored procedure which will be called by 8 threads. Every time it takes in a different parameter.
    Actual execution time for this proc (irrespective of the parameter) is around 2 seconds. But when I call the 8 threads, I see that the total time taken (END TO END) is around 16 seconds. Threads do acquire a read lock right? Is there a way i can get over this issue?
    Please let me know.

    Sybase IQ is the database. I am using a thread pool. The time taken to execute this procedure without threads is about 2 seconds. It takes 16 seconds when I start using threads.
    I do something like this :
    ///////////////////////// databaseThreadPool.java
    * example of a fixed-size thread pool using the
    * executors introduced in Java 5
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Executors;
    public class databaseThreadPool
    public static void main(String[] args)
    * create a thread pool with four threads
    ExecutorService execSvc = Executors.newFixedThreadPool( 8);
    * place six tasks in the work queue for the thread pool
    for( int i = 0; i < 6; i++ )
    execSvc.execute( new CountDown() );
         long a =System.currentTimeMillis();
    execSvc.execute( new databaseThread("00055","YTD","GROSS") );
    execSvc.execute( new databaseThread("00055","YTD","NET") );
    execSvc.execute( new databaseThread("00055","YTM","GROSS") );
    execSvc.execute( new databaseThread("00055","YTM","NET") );
    execSvc.execute( new databaseThread("00055","LY","GROSS") );
    execSvc.execute( new databaseThread("00055","LY","NET") );
    execSvc.execute( new databaseThread("00055","LLY","GROSS") );
    execSvc.execute( new databaseThread("00055","LLY","NET") );
         long b =System.currentTimeMillis();
         try{
         while(databaseThread.done!=8)
              Thread.sleep(1000);
         catch(Exception ex){}
    execSvc.shutdown();
    System.out.println("END TO END TIME TAKEN : "+(b-a));
    /////////////////////////////////////////////////////////// databaseThread.java
    import java.io.PrintWriter;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.Statement;
    import java.io.PrintWriter;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.io.IOException;
    public class databaseThread implements Runnable
    protected int count = 8;
    * the following counter is incremented once
    * each time the class is instantiated, giving each
    * instance a unique number, which is printed in run()
    private static int taskCount = 0;
    private final int id = taskCount++;
    private String gpNum;
    private String time;
    private String domain;
    public static int i=0;
    public static int done=0;
    PrintWriter out = null;
    Connection connection = null;
    Statement statement;
    ResultSet rs;
    ResultSetMetaData rsmd;
         CallableStatement cStmt = null;
    public databaseThread(String gpNum, String time, String domain) {
    this.gpNum=gpNum;
    this.time=time;
    this.domain=domain;
    * print the id and the iteration count to the console, then
    * yield to another thread.
    public void run()
         try
         Class.forName("com.sybase.jdbc3.jdbc.SybDriver");
         connection = DriverManager.getConnection("jdbc:sybase:Tds:XXXXXXXXXXX:XXXXXXX", "cp_dbo","cp_dbo");
         statement = connection.createStatement();
              cStmt=connection.prepareCall("{call XXXXXX ?,?,?)}");
              cStmt.setString(1,gpNum);
              cStmt.setString(2, time);
              cStmt.setString(3,domain);
              long a =System.currentTimeMillis();
              rs=cStmt.executeQuery();
              long b=System.currentTimeMillis();
              System.out.println(id+" Time taken by to execute Query : "+(b-a));
         //rsmd=rs.getMetaData();
              while(rs.next())
              Thread.yield();
         catch (ClassNotFoundException e) {
              System.out.println("Driver Error" );
              e.printStackTrace();
              } catch (SQLException e) {
              System.out.println("SQLException: " + e.getMessage());
    }

  • Stored proc parameters referencing in code

    Hi,
    Quick question ...
    I want my stored proc to accept two parameters : a source table name and a destination table name. The stored proc's goal is to update the destingation table with data in the source table.
    Here is my code :
    CREATE OR REPLACE PROCEDURE UPDATE_FPSYNTHESE (
    sourcetable IN VARCHAR2,
    targettable IN VARCHAR2
    IS
    BEGIN
    INSERT INTO targettable (SELECT * FROM sourcetable WHERE id NOT IN (SELECT id FROM targettable));
    UPDATE targettable SET name = (select name from sourcetable where targettable.id = sourcetable.id);
    END;
    Here's when I want to create it :
    Errors for PROCEDURE UPDATE_FPSYNTHESE:
    LINE/COL ERROR
    10/1 PL/SQL: SQL Statement ignored
    10/40 PL/SQL: ORA-00942: table or view does not exist
    11/1 PL/SQL: SQL Statement ignored
    11/8 PL/SQL: ORA-00942: table or view does not exist
    Warning: Procedure created with compilation errors.
    It doesn't seem to dereference the parameters ...
    what am I doing wrong ?
    Thanks in advance,
    Best regards,
    Steve

    If the source and target tables must be dynamic, you would have to use dynamic SQL
    CREATE OR REPLACE PROCEDURE update_fpsynthese (
      sourcetable IN VARCHAR2,
      targettable IN VARCHAR2 )
    AS
      sqlStmt VARCHAR2(4000);
    BEGIN
      sqlStmt := 'INSERT INTO ' || targettable ||
                 ' (SELECT * ' ||
                 '    FROM ' || sourcetable ||
                 '   WHERE id NOT IN (SELECT id ' ||
                 '                      FROM ' || targettable || '))';
      EXECUTE IMMEDIATE sqlStmt;
    END;Since you are building up strings and executing them, you'll also have to worry about things like SQL injection attacks. You also lose compile-time syntax checking and generally complicate your life from a development & maintenance perspective. Are there really that many tables that you need to do this procedure with?
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Output parameters for sqlj stored procs ?

    is it possible to store a sqlj proc in DB which can be translated to a pl/sql procs with OUTPUT parameters ?
    how is it possible ?
    if not, how can i bypass this problem ?
    thanks for answers..
    [email protected]

    When you write a Java stored procedure that is called with OUT or IN OUT parameteres from the PL/SQL signature, then the OUT or IN OUT arguments must have an array signature in Java.
    For example, if you want to pass a Java int IN OUT from a Java method, then the method accepts an int[]. The first element (at index 0) holds the input value, and the same element must be set for the returned output value.
    Is this what you were wondering about?

  • Replacing null values in optional prompts and passing to stored proc

    Hi,
    I want to create a stored procedure with OPTIONAL prompts. When user does not pass a value for that parameter, I want to set the value for that parameter by selecting from a column in table then I WANT to use that paramvalue in sql within cursor of stored proc. How do I do that?
    In short, I want to do the following Here is the psuedocode:
    Create or replace procedure test (param IN varchar2 DEFAULT NULL)
    As
    var_param varchar(20);
    select param into var_param from dual;
    If param is null then select custid from table1 else var_param
    OPen ref_cursor for
    Select xyz from table2
    where fyy = var_para
    Can someone let me know the syntax on how to do this in stored proc?
    Regards,
    hena
    Edited by: 904385 on Dec 25, 2011 7:04 AM

    Hi,
    Merry Christmas, and welcome to the forum!
    Here's one way to do what you requested:
    CREATE OR REPLACE PROCEDURE     test
    (    param     IN     VARCHAR2     DEFAULT     NULL
    AS
        ref_cursor     SYS_REFCURSOR;
        var_param     VARCHAR2 (20)     := param;
    BEGIN
        IF  var_param  IS NULL
        THEN
         SELECT     custid
         INTO     var_param
         FROM     table1
    --     WHERE     ...     -- Unless table1 has only 1 row
        END IF;
        OPEN  ref_cursor
        FOR   SELECT  xyz
           FROM       table2
           WHERE       fyy     = var_param;
    END     test;Whatever you're trying to do, this is probably niot the simplest or most efficient way to do it.

  • Clearing Oracle Parameters to call diferent stored procs

    Sub Main
    Do While i < 3
    make_excel(i)
    i = i + 1
    Loop
    end Sub
    Sub make_excel(ByVal array As Integer)
    objCmd.Parameters.Add(New OracleParameter("p_cursor", OracleType.Cursor)).Direction = ParameterDirection.Output
    end Sub
    objCmd.Parameters.Clear()
    objCmd.Parameters.Remove("p_cursor")

    I agree with you. I was looking into mod_plsql, but it turns out that their development standards include not using Oracle HTTP server. The whole reason why they want to be able to execute a stored proc based on what is specified in an XML doc is that they want to avoid having to change their middle-tier configurations anytime a new stored proc or a change in stored proc parameters is made. I'm not familiar with what all is involved with .NET and the middle-tier, but supposedly this way, they can specify any stored procedure name and its parameters in an XML file. The XML is then suppose to be passed on to an Oracle stored procedure which will parse the XML and dynamically execute the stored procedure that was specified in the XML.
    Here is an example of the XML:
    '<Root>
      <PackageName>TEST_PKG</PackageName>
      <ProcedureName>TEST_PROC</ProcedureName>
        <Parameters> 
        <Parameter>
            <Name>EmpID</Name>
            <Value>12345</Value>
        </Parameter>
        <Parameter>
            <Name>Org</Name>
            <Value>ABC</Value>
        </Parameter>
        </Parameters>
    </Root>I basically need to parse out the pkg/proc names:
      SELECT t.COLUMN_VALUE.extract('//PackageName/text()').getstringval() PkgName,
             t.COLUMN_VALUE.extract('//ProcedureName/text()').getstringval() ProcName
         INTO v_pkg_name, v_proc_name
         FROM TABLE(xmlsequence(XMLTYPE(v_XML_input) .extract('/Root'))) t;...and then execute the procedure:
        EXECUTE IMMEDIATE 'BEGIN '||v_pkg_name||'.'||v_proc_name||'(:a, :b, :c); END;'
          using in v_in_param1, v_in_param2, out v_XML_output;The problem is that this approach is very complicated since there can be any number of IN/OUT parameters and of various datatypes. I would have to create all kinds of possible bind variables!

  • Save prompted sql stored proc parm values in rpt file from designer

    How can I save the last prompted sql stored proc parameter values from within the CR designer.  In other words I want to hard code some of the parameter values (the rest are passed) so that CR does not prompt at run time.  I am running CR Developer XI R2 SP1 from within VS.Net 2005 (Winforms)

    Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • How to pass XMLType as parameters to Java stored procs ?

    How to pass XMLType as parameters to Java stored procs ?
    ORA-00932: inconsistent datatypes: expected an IN argument at position 1 that is an instance of an Oracle type convertible to an instance of a user defined Java class got an Oracle type that could not be converted to a java class
    Java stored proc -->
    CREATE or replace FUNCTION testJavaStoredProcMerge( entity xmltype,event xmltype ) RETURN VARCHAR2 AS LANGUAGE JAVA
    NAME 'XDBMergeOp.merge(org.w3c.dom.Document,org.w3c.dom.Document) return java.lang.String';
    PL/SQL -->
    declare
    theQuote VARCHAR2(50);
    entity xmltype;
    event xmltype;
    begin
    entity := xmltype('<Quote><Fields><Field1>f1</Field1></Fields></Quote>');
    event := xmltype('<Quote><Fields><Field2>f2</Field2></Fields></Quote>');
    theQuote := testJavaStoredProcMerge(entity,event);
    dbms_output.put_line(theQuote);
    end;
    Java class -->
    public class XDBMergeOp {
    public static String merge(Document entity, Document event) throws Exception {
    return ...
    Thanks in advance.

    I think you'll need to use XMLType and then extract the DOM inside java..
    create or replace package SAXLOADER
    as
      procedure LOAD(P_PARAMETERS XMLTYPE, P_DATASOURCE BFILE);
    end;
    create or replace package body SAXLOADER
    as
    procedure LOAD(P_PARAMETERS XMLTYPE, P_DATASOURCE BFILE)
    AS
    LANGUAGE JAVA
    NAME 'com.oracle.st.xmldb.pm.saxLoader.SaxProcessor.saxLoader ( oracle.xdb.XMLType, oracle.sql.BFILE)';
    end;
      public static void saxLoader(XMLType parameterSettings, BFILE dataSource)
      throws Exception {
        Document parameters = parameterSettings.getDocument();
        SaxProcessor app = new SaxProcessor(parameters);
        app.processXMLFile(dataSource);
      Edited by: mdrake on Apr 6, 2009 11:28 AM

  • Omiting parameters for stored procs

    Post Author: lihaze
    CA Forum: Data Connectivity and SQL
    Hi - I hope that this is a straightforward one..  I have a number of params in a shared stored proc (they do default to NULL, but the app that I am using to call Crystal firstly cannot pass in a NULL value(!!!), and also always asks for the same no. of params that are in the creport. So, I am using Crystal 8.5, I dont even want these params to be requested. How can I make sure that they arent requested in Crystal?thanks

    Post Author: yangster
    CA Forum: Data Connectivity and SQL
    to actually pass a null value using crystal reports you will have to use crystal 2008as this isn't what you are after the alternative would be to in your report edit the parameter from the stored procedureput in a value, set the default value to that value and change allow custom value to falsethis will push the default value to the parameter every single time the report is run so you will not be prompted for the parameter value anymore

  • Arrays as IN/OUT parameters to stored procs

    I need the ability to pass Java arrays as input parameters and receive arrays as output parameters from stored procedures. I searched this forum for "array stored procedure" and came up with 9 posts dating back to April 30, 1999. In every one of these posts, people have asked how this can be done, and as yet there has not been any real solution provided. One messy solution is to add another stored proc that takes the array items as scalars and builds a PL/SQL table to pass to the original stored proc.
    I am getting the impression that using arrays for IN/OUT parameters to/from stored procedures is not possible with JDK 1.1. Can it be done with JDK 1.2?
    Isn't there anyone from Oracle that can provide an answer or solution?

    I've searched for a way of passing a rowtype to a stored
    procedure or passing an array to a stored procedure.
    The following example may have some pertinence. It was posted at
    http://www.classicity.com/oracle/htdocs/forums/ClsyForumID124/6.h
    tml#
    I also think that it would be useful to know how best to pas a
    ResultSet or equivalent to a Stored Procedure, if someone has
    more information. The idea is to have symmetry between the way
    data is retrieved from SP's (CURSORS) and supplied to SP's (???
    ARRAY/CURSOR) ?
    "[Example]Example of using JDBC with VARRAYS and REF CURSORs"
    This example shows how to use JDBC with VARRAYS and REF
    CURSORs.
    It also shows use of the PreparedStatement and CallableStatement
    methods.
    The example does the follows:
    1. selects from a table of VARRAYs
    2. inserts into a table of VARRAYs
    3. selects from a table of VARRAYs
    4. calls stored procedure -- parameters <ref cursor, varray>
    In order to test it, you will need to do two things first:
    1) Create related tables and types first. The screipt is given
    below.
    2) Create a package that gets called from JAVA code. The script
    is given below.
    ======================= Step 1 create tables etc. cute here
    ==================
    -- Run this through SQL*PLUS
    drop TABLE varray_table;
    drop TYPE num_varray;
    drop TABLE sec;
    -- create the type
    create TYPE num_varray as VARRAY(10) OF NUMBER(12, 2);
    -- create the table
    create TABLE varray_table (col1 num_varray);
    -- create the sec table
    create table sec (sec_id number(8) not null, sec_grp_id number
    (8) not null,
    company_id number(8) not null);
    insert into sec values (1,200,11);
    insert into sec values (2,1100,22);
    insert into sec values (3,1300,33);
    insert into sec values (4,1800,44);
    ==================== End of step
    1===========================================
    ================== Step 2 create package
    ====================================
    -- Run it through sql*plus
    CREATE OR REPLACE PACKAGE packageA AS
    type sctype is ref cursor return SEC%ROWTYPE;
    procedure get_port_consensus(sc IN OUT sctype, arr IN
    num_varray);
    procedure test_port_consensus(sc IN OUT sctype);
    END packageA;
    CREATE OR REPLACE PACKAGE BODY packageA AS
    procedure test_port_consensus(sc IN OUT sctype)
    IS
    testArr num_varray := num_varray(200, 1100, 1300, 1800);
    BEGIN
    get_port_consensus(sc, testArr);
    END test_port_consensus;
    procedure get_port_consensus(sc IN OUT sctype, arr IN num_varray)
    IS
    BEGIN
    open sc for select * from sec
    where sec_grp_id = arr(1)
    or sec_grp_id = arr(2)
    or sec_grp_id = arr(3)
    or sec_grp_id = arr(4);
    END get_port_consensus;
    END packageA;
    ===================== End of step 2
    ===================================
    ============ JAVA code to test the whole thing
    ========================
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.oracore.Util;
    import oracle.jdbc.driver.*;
    import java.math.BigDecimal;
    public class ArrayExample
    public static void main (String args<>)
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver
    // Connect to the database
    // You need to put your database name after the @ sign in
    // the connection URL.
    // The example retrieves an varray of type "NUM_VARRAY",
    // materializes the object as an object of type ARRAY.
    // A new ARRAY is then inserted into the database.
    Connection conn =
    DriverManager.getConnection ("jdbc:oracle:oci8:@v81",
    "scott", "tiger");
    // It's faster when auto commit is off
    conn.setAutoCommit (false);
    // Create a Statement
    Statement stmt = conn.createStatement ();
    System.out.println("Querying varray_table");
    ResultSet rs = stmt.executeQuery("SELECT * FROM varray_table");
    showResultSet (rs);
    // now insert a new row
    // create a new ARRAY object
    int elements<> = { 200, 1100, 1300, 1800 };
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor
    ("NUM_VARRAY",conn);
    ARRAY newArray = new ARRAY(desc, conn, elements);
    // prepare statement to be inserted and bind the num_varray type
    System.out.println("PreparedStatement: Inserting into
    varray_table");
    PreparedStatement ps =
    conn.prepareStatement ("insert into varray_table values (?)");
    ((OraclePreparedStatement)ps).setARRAY (1, newArray);
    ps.execute ();
    // query to view our newly inserted row
    System.out.println("Querying varray_table again");
    rs = stmt.executeQuery("SELECT * FROM varray_table");
    showResultSet (rs);
    // prepare a callable statement -- call the stored procedure
    // passing <ref cursor in out, varray in>
    System.out.println("CallableStatement: Calling Stored
    Procedure");
    OracleCallableStatement oraStmt1 =
    (OracleCallableStatement)conn.prepareCall("{ call
    packageA.get_port_consensus(?, ?) }");
    oraStmt1.registerOutParameter(1, OracleTypes.CURSOR);
    oraStmt1.setARRAY(2, newArray);
    oraStmt1.execute();
    rs = (ResultSet)oraStmt1.getObject(1);
    // loop through the result set of the ref cursor and display
    while (rs.next()) {
    System.out.println(rs.getString("sec_grp_id"));
    // Close all the resources
    rs.close();
    ps.close();
    stmt.close();
    oraStmt1.close();
    conn.close();
    public static void showResultSet (ResultSet rs)
    throws SQLException
    int line = 0;
    while (rs.next())
    line++;
    System.out.println("Row "+line+" : ");
    ARRAY array = ((OracleResultSet)rs).getARRAY (1);
    System.out.println ("Array is of type "+array.getSQLTypeName());
    System.out.println ("Array element is of type
    code "+array.getBaseType());
    System.out.println ("Array is of length "+array.length());
    // get Array elements
    BigDecimal<> values = (BigDecimal<>) array.getArray();
    for (int i=0; i<values.length; i++)
    BigDecimal value = (BigDecimal) values;
    System.out.println(">> index "+i+" = "+value.intValue());

  • ADO Recordsets as IN parameters to stored procs

    Is there anyone who knows whether we can pass one (or more)
    recordsets to an oracle stored procedure as input parameters.
    Since it can be done for OUT parameters, I thought it may be
    done with IN too.
    If anyone knows the way, or knows that it is not possible, I
    would appreciate to hear it
    Thanx

    Yep,
    I looking for the same.Did you get any joy?

  • How to create a stored procedure that accepts an array of args from Java?

    I am to be creating a stored procedure that accepts an array of arguments from Java. How to create this? thanks
    Sam

    Not a PL/SQL question really, but a Java one. The client call is done via ThinJDBC/OCI to PL/SQL, This call must be valid and match the parameters and data types of the PL/SQL procedure.
    E.g. Let's say I define the following array (collection) structure in Oracle:
    SQL> create or replace type TStrings as table of varchar2(4000);
    Then I use this as dynamic array input for a PL/SQL proc:
    create or replace procedure foo( string_array IN TStrings )...
    The client making the call to PL/SQL needs to ensure that it passes a proper TStrings array structure.. The Oracle Call Interface (OCI) supports this on the client side - allowing the client to construct an OCI variable that can be passed as a TStrings data type to SQL. Unsure just what JDBC supports in this regard.
    An alternative method, and a bit of a dirty hack, is to construct the array dynamically - but as this does not use bind variables, it is not a great idea.
    E.g. the client does the call as follows: begin
      foo( TStrings( 'Tom', 'Dick', 'Harry' ) );
    end;Where the TStrings constructor is created by the client by stringing together variables to create a dynamic SQL statement. A bind var call would look like this instead (and scale much better on the Oracle server side):begin
      foo( :MYSTRINGS );
    end;I'm pretty sure these concepts are covered in the Oracle Java Developer manuals...

  • Can you get values back from a stored procedure via OUTPUT parameters?

    Can you get values back from calling a stored procedure via OUTPUT parameters/variables? I call the SP via a SQL statement from a script either in a WF or DF.
    I thought I read some reference that DI could not get the values from OUTPUT parameters but I could not find it again (don't know if it is in any of the documentation or referred to in a forum.
    I did try a couple of tests but it did not reutrn any values via OUTPUT. But before I give up I thought I'd see if you could and maybe I needed to change something.

    This isn't exactly an answer to your question, but I'll point out that, given that you're resorting to a SQL script in the first place, there's no reason you can't also turn the output parameters into a regular result or record set. (The following uses T-SQL, although I think it's pretty generic.)
    declare @param1 int, param2 varchar(100), @return int;
    exec @return = proc @param1 = @param1 output, @param2 = @param2 output;
    select @param1 as param1, @param2 as param2;
    That is, to get from output parameters to a "regular" output from the SQL script isn't much of a leap...
    Jeff Prenevost
    BI Consultant
    Ann Arbor, MI

  • Stored Proc and dates

    Hi All,
    Fairly new at this, and a little confused with dates and date formats.
    I run the following:
    alter session set nls_date_format = 'dd/mm/yyyy'
    If I select sysdate from dual:
    02/11/2008 --> so this is correct.
    Now what I can't figure out is why I get different results if I use an sql statement VS a stored proc.
    If I run this sql update statement:
    UPDATE MAPPER.CONV_CNSTNTS
    SET CN_VALUE = TO_DATE('12/05/2007','MM/DD/YYYY')
    WHERE CN_TYPE = 'CONV'
    AND CN_REFRNCE = 'CONVDATE';
    When I select this data it shows: 12/05/2007
    This works perfect.
    Now if I take the exact same statement and put it in a stored proc i get a different result:
    create or replace procedure proc_test_date as
    begin
    UPDATE MAPPER.CONV_CNSTNTS
    SET CN_VALUE = TO_DATE('12/05/2007','MM/DD/YYYY')
    WHERE CN_TYPE = 'CONV'
    AND CN_REFRNCE = 'CONVDATE';
    COMMIT;
    end;
    When I select this data it shows: 05-DEC-07
    Why is there a difference here? Is there a difference in the NLS settings that are used when you run an sql statement vs a stored proc?
    Thanks for your help in advance.

    Thank you for the quick response.
    Glad I am on the right track ... NLS settings are painful :)
    So I ran: alter session set nls_date_format = 'Month DD, YYYY';
    Ran my proc and then the select.
    Still the date shows up as: 05-DEC-07
    I looked at the nls_parameters
    select * from v$nls_parameters
    NLS_CALENDAR     GREGORIAN
    NLS_DATE_FORMAT     Month DD, YYYY
    NLS_DATE_LANGUAGE ENGLISH
    I am using Oracle SQL Developer. I made sure these were set as well:
    Tool >> Preferences >> Database >> NLS Parameters
    Date Format --> MM/DD/YYYY
    Seems that I am missing something ...

  • Unable to pass the values to stored proc using presentation variable in OBI

    Hi All,
    Need your help regarding in resolving an issue in OBIEE 10.1.3.4.1
    There is an OBIEE requirement whereby two prompts need to be defined.
    1.     Textbox prompt
    2.     Drop-down prompt
    The dropdown values should be populated using textbox prompt. So, we have used presentation variable in textbox prompt and passing the same to select query of drop-down.
    Until this step, the report works just fine.
    Now, the value in both textbox and drop-down needs to be passed to stored proc.
    While trying to pass the values by using the presentation variable, the following error comes-up saying
    Session variable has no value definition.
    Note:Although the corresponding session variable has been set to default value,still the error appears.
    Please advise.
    Regards,
    Prasad

    "Session variable has no value definition" I'm assuming typo error and it should be presentation variable.
    Set default value for presentation variable that may work

Maybe you are looking for

  • Need help with my new optical drive

    Hey guys, So I recently bought a new optical drive because mine had died out a long time ago and was making plans to upgrade to snow leopard (currently running 10.4.11) So I installed it and everything and everything seems to be going right (hearing

  • How to use listitem control and listbox control with js in indesign?

    Anyone can give me some examples?

  • Reg:Flow of Conditions

    Hi All I have created contract for Service in ME31k, While i am trying to create Po w.r.t Contract rate is not flowing, it is asking me to enter manually. What could be the reason. Regards RK

  • SRM SERVER 7.0 XI CONTENT

    Hi XI Gurus, I'm trying to accomplish SRM-PI-CLM scenario in PI 7.1. I have already downloaded the .tpz (xi content) for SRM SERVER 7.0. Problem is there are no Operation Mappings (Interface Mapping) and no Message Mappings. How can I use the Data Ty

  • VISA resource error in TestStand

    Hi all, I have a vi to operate Agilent 34405A DMM. The vi is called by TestStand sequence,it always work fine. Suddenly it show me an error such as "Insufficient system resources to perform necessary memory allocation,-1078807800" Then I restart my P