Rowtype parameter in stored procedure

Hi,
Trying to call a stored procedure/function in C++ using OCI libs, with ROWTYPE parameter. Any ideas on how to do this?
Thanks!

You can't.
ROWTYPE is an internal-to-PLSQL-only datatype (like BOOLEAN) except there is no external data type mapping. Use REF CURSOR or scalar arrays or object arrays instead.

Similar Messages

  • Pass a date parameter to Stored Procedure

    Hello friends,
    Can you help to pass a date parameter to Stored procedure from JSP. This is my code:
    In Oracle 9i I have this:
    PROCEDURE SP_EDORES(
    pfechaini IN hist_pol_reclama.hrc_fecha_contabilidad%Type, <-- This is a date field
    pfechafin IN hist_pol_reclama.hrc_fecha_contabilidad%Type, <-- This is a date field
    p_recordset OUT PKG_REP_CIERRE.cursor_type) AS
    In JSP have this:
    CallableStatement stmt = (CallableStatement)conn.prepareCall( "begin PKG_REP_CIERRE.SP_EDORES(?,?,?); end;" );
    stmt.registerOutParameter(3,oracle.jdbc.driver.OracleTypes.CURSOR);
    stmt.setDate(1,Date.valueOf("01-06-2005"));
    stmt.setDate(2,Date.valueOf("30-06-2005"));
    ResultSet rset = (ResultSet)stmt.getObject(3);
    while (rset.next()) {
    %>
    <TR>
    <TD ALIGN=CENTER> <%= rset.getString(1) %> </TD>
    <TD ALIGN=CENTER> <%= rset.getString(2) %> </TD>
    <TD ALIGN=CENTER> <%= rset.getString(3) %> </TD>
    <TD ALIGN=CENTER> <%= rset.getInt(4) %> </TD>
    </TR>
    <%
    The Stored Procedure returns de Result set, however I think does not recognized the date format because I need it with this format dd-mm-yyyy.
    Thanks in advance

    to use Date you will need the oracle package.
    u can try this other solution: use String, not Date
    CallableStatement stmt = (CallableStatement)conn.prepareCall( "begin PKG_REP_CIERRE.SP_EDORES(?,?,?); end;" );
    stmt.registerOutParameter(3,oracle.jdbc.driver.OracleTypes.CURSOR);
    stmt.setString(1,"01-06-2005");
    stmt.setString(2,"30-06-2005");
    ResultSet rset = (ResultSet)stmt.getObject(3);
    while (rset.next()) {
    %>
    if this don't work you can change your PL/SQL to get Strings and do the conversion with TO_DATE in the sql statement.

  • Passing parameter into stored procedure

    Hi guys,
    I have a big problem here passing as a parameter in stored
    procedure.
    If i pass as a parameter in where clause it is working fine.
    Whenever i pass the parameter in order by it was not working..
    How to implement this issue????
    Here i am giving the example for package:
    PACKAGE XTRA.TEST_STATUS
    AS
    TYPE GenericCurTyp IS REF CURSOR;
    PROCEDURE SP_MAIN
    ( insortgroup IN VARCHAR2,GENERAL_CUR IN OUT GenericCurTyp);
    END TEST_STATUS;
    PACKAGE BODY XTRA.TEST_STATUS
    AS
    PROCEDURE SP_MAIN
    ( insortgroup IN VARCHAR2, GENERAL_CUR IN OUT GenericCurTyp
    ) AS
    BEGIN
    OPEN GENERAL_CUR FOR
    select last_name,first_name from applicant Order By insortgroup;
    END SP_MAIN;
    END TEST_STATUS;
    Passing as a parameter i am getting the below details.
    LAST_NAME FIRST_NAME
    ASFSDAF DASDFASF
    Ad DASD
    Adams John
    DANA WITEST
    If i hot code the parameter insortgroup to last_name
    i am getting the below values:
    LAST_NAME FIRST_NAME
    'ANNUNZIO GIANCOLA GABRIEL
    0'BRIEN ARMA
    0120453EZ ESTANISLAO
    082479 ELIZABETH
    Thanks,
    Rao

    CREATE OR REPLACE PACKAGE xtra.test_status
    AS
      TYPE GenericCurTyp IS REF CURSOR;
      PROCEDURE sp_main
        (insortgroup IN     VARCHAR2,
         general_cur IN OUT GenericCurTyp);
    END test_status;
    CREATE OR REPLACE PACKAGE BODY xtra.test_status
    AS
      PROCEDURE sp_main
        (insortgroup IN     VARCHAR2,
         general_cur IN OUT GenericCurTyp)
      AS
        select_statement VARCHAR2 (4000) := NULL;
      BEGIN
        select_statement :=
        'SELECT   last_name,
                  first_name
         FROM     applicant
         ORDER BY ' || insortgroup;
        DBMS_OUTPUT.PUT_LINE (select_statement);
        OPEN general_cur FOR select_statement;
      END sp_main;
    END test_status;

  • Return a parameter through stored procedures

    Hello Experts
    I want to return parameter through stored procedures so as to ensure that the application has been executed properly.
    My source message format is
    <StatementName5>
    <storedProcedureName action=u201D EXECUTEu201D>
      <table>Summarize_prc</table>
    <empid  [isInput=u201Dtrueu201D] [isOutput=true] type=SQLDatatype>val1</empid>
    </storedProcedureName > 
    </StatementName5>
    Do i need to put some extra parameters for return values from the stored procedures?
    What would be the response message format to return the parameters from stored procedure.
    Thanks
    Sabyasachi

    Hi,
    If you wants to read the return values from stored procedure, the scanario should be designed as Sync.
    The format looks like thsi
    <Message Type Name>
          <STATEMENTNAME_response>
                      <Field1> </Field1>
       </STATEMENTNAME_response>
    </Message Type Name>

  • Is it possible to pass TABLE as the output parameter in stored procedure

    Hey Experts,
      Is it possible to pass TABLE as the output parameter in stored procedure.
    eg
    create procedure spGetData
    @tableName as TABLE(intValue INT NOT NUL)
    as 

    You can use OPENQUERY or OPENROWSET, as mentioned above, to make stored procedure results table like. There are
    some limitations with these methods:
    http://technet.microsoft.com/en-us/library/ms188427.aspx
    In OPENQUERY this-sql-server-instance can be used instead of a linked server name. It requires setting data accces server option:
    exec sp_serveroption @server = 'PRODSVR\SQL2012'
    ,@optname = 'DATA ACCESS'
    ,@optvalue = 'TRUE'
    LINK: http://www.sqlusa.com/bestpractices/select-into/
    Kalman Toth Database & OLAP Architect
    SELECT Video Tutorials 4 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • REF CURSOR as IN parameter to stored procedure

    Currently, ODP.NET supports REF CURSOR parameter as OUT parameter only.
    Based on the project requirements it is necessary to pass
    multiple records to the stored procedure.
    In this case REF CURSOR as IN parameter is useful.
    What are the plans to implement REF CURSOR as IN parameter to stored procedure?
    What is the work around in case it is necessary to pass several different
    record types as arrays to stored procedure?

    ODP.NET does not limit REF Cursor parameters to IN parameters. This is a known PL/SQL limitation.
    An excerpt from Application Developer's Guide:
    "If you pass a host cursor variable to PL/SQL, you cannot fetch from it on the server side unless you also open it there on the same server call".

  • Datetime parameter from stored procedure

    <p>I have a report written in CR10 which uses a stored procedure as the datasource. The stored procedure has 3 input parameters, two of which are datetime data types. When the crystal report is run, it prompts the user for the 3 parameters & runs just fine except...</p><p>For the date parameters, it prompts the user to enter a time as well. In previous versions of Crystal, parameters that were datetime data types in the stored procedure were just prompted for the date when the calling crystal report was run.</p><p>I attempted to edit the parameters in the report, but the "Value Type" is grayed out (I assume since the parameter is associated with the stored procedure, rather than being a user defined parameter within the report).  These date parameters are used in a BETWEEN statement in the stored proc, so if the user just enters a date but accepts the default time, the returned data gets flakey due to the addition of the time value passed by the parameter.</p><p> I tried setting a default value for the time, but I have to enter a date along with the time, which the report then uses as the default. The user then has to uncheck the "Pick from defaults" checkbox in order to enter their own date. This is really unwieldly for the end user, especially when they were previously able to just enter a date and not have to be concerned with a time at all.</p><p>Does anyone have suggestions on working around this issue? </p><p>Thanks in advance...</p>

    <p>You mention that you are using CRW version 10 for this.  What&#39;s the data source you are reporting against (you mention a stored procedure - but are you running against Oracle, SQL Server, DB2?).  Are you connecting natively or using ODBC? <br /></p>

  • Cannot get OUT parameter from stored procedure

    Hi,
    I am new to stored procedure programming. I wrote a simple java stored procedure as follows:
    package fvt;
    import java.sql.*;
    import java.io.*;
    public class FVTProcedures
    extends COM.ibm.db2.app.StoredProc {
    public void addRecord(int id, String name, int status)
    throws SQLException {
    java.sql.Statement stmt = null;
    java.sql.Connection con = null;
    PrintWriter pw = null;
    try {
    status =3;
    pw = new PrintWriter(new FileWriter("c:/temp/fvtproc.txt"));
    pw.println("starting...");
    // get connection
    con =getConnection();
    pw.println("Got connection");
    stmt = con.createStatement();
    stmt.execute("INSERT INTO cmtest (id, name) values (" + id + ",'"+name+"')");
    pw.println("Inserted the record");
    if (!con.getAutoCommit()) {
    con.commit();
    pw.println("Committed the connection");
    catch (SQLException sqle) {
    pw.println(sqle.getMessage());
    catch (Exception e) {
    pw.println(e.getMessage());
    finally {
    status =2;
    pw.close();
    try {
    if (stmt != null) {
    stmt.close();
    catch (SQLException sqle) {}
    try {
    if (con != null) {
    con.close();
    catch (SQLException sqle) {}
    Then I use the following sql command to create this stored procedure, especially register status as OUT parameter.
    CREATE PROCEDURE addRecord (IN id INT, IN name VARCHAR(20), OUT status INTEGER)
    FENCED LANGUAGE JAVA EXTERNAL NAME 'fvt.FVTProcedures!addRecord' PARAMETER
    STYLE DB2GENERAL
    My java program calling this stored proc is as follows:
    import java.sql.*;
    import javax.sql.*;
    public class CallableStmtTest {
         COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource ds = null;
         public static void main(String args[]) {
              CallableStmtTest dt = new CallableStmtTest();
              try {
                   dt.test();
              } catch (Exception e) {
                   e.printStackTrace(System.out);
         public CallableStmtTest() {
              ds = new COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource();
              ds.setUser("username");
              ds.setPassword("password");
              ds.setDatabaseName("database");
    public void test() {
    java.sql.Connection conn = null;
    CallableStatement cs = null;
    String sql = "CALL ADDRECORD(?, ?, ?)" ;
    try {
    conn = ds.getPooledConnection().getConnection();
    conn.setAutoCommit(false);
    System.out.println("Got the connection");
    cs = conn.prepareCall( sql ) ; /* con is the connection */
    System.out.println("Callable statement is prepared");
    cs.registerOutParameter(3, java.sql.Types.INTEGER);
    cs.setInt(1, 1001 );
    cs.setString(2, "1001");
    cs.execute() ;
    System.out.println("Callable statement is executed, return status: "+cs.getInt(3));
    conn.commit();
    catch(SQLException sqle) {
    sqle.printStackTrace();
    finally {
    try {
    if (cs!=null) {cs.close();}
    catch (SQLException sqle1) {
    try {
    if (conn!=null) {conn.close();}
    catch (SQLException sqle1) {
    However, the out put is always
    Callable statement is executed, return status: 0
    while i expect to be
    Callable statement is executed, return status: 2
    Can anyone tell me what's wrong with that?
    thansk,
    JST

    public void addRecord(int id, String name, int status)
    throws SQLException {
    status =3;In regular java you are never going to see this value (3) outside of that method. Java doesn't work that way.
    So unless java inside the DB works really differently from regular java, you are going to have to pass something else.

  • Passing multi-value parameter in stored procedure ssrs

    I have  customer parameter which is a drop down list in my report and I have set it to "allow multiple values". This is an SSRS report.
    How do I pass multiple values to my stored procedure?
    RJ

    Hi ,
    Create a Table valued function in SQL Functions  as below 
    Step 1
    CREATE FUNCTION [dbo].[FnSplit]
    @List nvarchar(2000),
    @SplitOn nvarchar(5)
    RETURNS @RtnValue table 
    Id int identity(1,1),
    Value nvarchar(100)
    AS  
    BEGIN
    While (Charindex(@SplitOn,@List)>0)
    Begin 
    Insert Into @RtnValue (value)
    Select
    Value = ltrim(rtrim(Substring(@List,1,Charindex(@SplitOn,@List)-1))) 
    Set @List = Substring(@List,Charindex(@SplitOn,@List)+len(@SplitOn),len(@List))
    End 
    Insert Into @RtnValue (Value)
    Select Value = ltrim(rtrim(@List))
    Return
    END
    Step 2 in your store procedure change the parameter where condition something like below
    ALTER PROCEDURE [dbo].[SomeSP] 
    -- Add the parameters for the stored procedure here
    @CostCentre NVARCHAR(255)
    SELECT
    [ProjectCode],[ProjectName],[ProjectManager],SUM([Hours]) AS [Hours MTD]FROM dbo.Rpt_NRMA_CATS NC
    INNER JOIN PeriodID P ON NC.PeriodID=P.PeriodID
    WHERE 
    ([CostCentre]) collate database_default IN(SELECT Value FROM dbo.FnSplit(@CostCentre,','))
    END
    I hope this will help you.
    Dasari

  • Missing parameter in stored procedure

    Hi all,
    I am new to Crystal Report, and I am facing this situation:
    a file .rpt reporting results of a sql server stored procedure, which takes one parameter in input.
    This .rpt is invoked by an .net web service, via libraries, passing the parameter.
    Now I evolved this stored procedure by adding a new parameter. Each of the two parameter is optional; the stored
    procedure returns correctly formatted data with one parameter, the other one, both or none.
    Then I adapted the .rpt file so that it can manage the updated stored procedure, via "Verify Database" istruction.
    Also the .rpt has obviously two input parameters now, with a default value.
    The problem is, the web service acting as handler gives the error "Missing parameter values", because actually it is passing still
    one parameter.
    If I update the web service code by passing both parameters, even with null value, it works, but for internal reasons I can't deploy
    this updated code now
    So, there is a way by modifying the .rpt using a stored procedure with two parameters, to make the invocation successfully even with one input parameter ?
    The missing parameter would have, in the execution logic now, value null or default; it could fit for me.
    Thanks in advance to everyone who will give advice!

    Thanks Don for your answer.
    Unless you change the SP so it has the logic to accept only one value which depends on the parameter type, if they are both strings for example then your SP can use logic the determine what/which param to fill and null the other one.
    What do you mean? Now if I call my stored procedure from SQL Server management studio with this command
    EXEC     [dbo].[StoredProcedureForCR] @FirstParameter = 2
    so, passing only the first parameter, I have no error.
    Which improvements to the SP are you suggesting?
    If I modify the web service, the CR is working, but I cannot deploy it in production for internal reasons related to the company
    Now I am planning these attempts:
    - calling the stored procedure via a command
    - creating in sql server a view and then filtering results in the report
    Do you think they could make sense ?
    Have a nice monday!
    Lidia

  • MultiSelect Parameter with Stored Procedure not working

    I am using Crystal Reports 2008 and SQL Server 2008. I am using a stored procedure which works with a multiselect in SQL side. I am using a string to table utility function in the where clause with the In statment like below:
    WHERE FORMULARY_ID in
    --(@FORMULARY_ID)
      (SELECT Extractedtext
       FROM ClarityTST.[rpt].[LHfn_StringToTable]( @FORMULARY_ID, ',') ) 
    When I try to use the stored procedure I get an error message:
    "The stored procedure cannot accept multiple values. Please ensure that the multiple value is set to False:"
    I would like to use it with multiple parameters.

    Crystal uses arrays to handle multiple values.  As far as I'm aware, there is no way to get a multi-valued report parameter into SQL (command or SP) directly.  In the past, I have used a "shell" main report that gets the parameters, used Join() to concatenate the selected values into a single string, then pass that to the "main" subreport, and into its SQL or SP.  The SQL than would need to find the database field in the string.  If you make the string passed to the subreport valid SQL for an IN clause, you could do it that way, too.
    HTH,
    Carl

  • IN Operator Parameter using stored procedure

    Hi Guys,
    I'm running a reporting services report using stored procedure and I'm facing a dilemma with the IN Operator in the stored procedure.
    Can someone please help me out debugging the statement below? (run it on AdventureWorks Database)
    Can I have the @Title Parameter based on another select statement something like this 
    Set @Title = SELECT Title FROM TableTitle
    DECLARE @Title varchar(1000)
    set @Title = 'Design Engineer', 'Tool Designer', 'Marketing Assistant'
    SELECT FirstName, LastName, e.Title
    FROM HumanResources.Employee AS e
    JOIN Person.Contact AS c
    ON e.ContactID = c.ContactID
    WHERE e.Title IN (@Title)
    Appreciate all the help on this.
    Thank you
    John

    Hi John,
    For your problem, we can use dynamical statement to solve the issue.
    Here are 2 options to be clarified:
             1. A multi-value parameter will return an array value.
             2. It is not able to pass an array in a stored procedure.
    To solve the issue, we can use the following steps:
    1.              Cconvert the array into string that delimited by “,” using the function “Join” in SQL Server Reporting Services.
    2.              Pass the string in the stored procedure.
    3.              Combine the parameter and the statement into one simply string.
    4.              Execute the simply string.
    Here are the detailed steps for your reference:
    1.       In Report Designer, create a new dataset as “SELECT Title FROM TableTitle”.
    2.       Create a new multi-value parameter, set the available value from the dataset above.
    3.       Set the query of the main dataset as :
    ="spSelect_Title "&Join(Parameters!para.Value, ",")
    4.       Change the stored procedure as:
    ALTER PROCEDURE [dbo].[spSelect_Title]
             -- Add the parameters for the stored procedure here
             --@Query NVarchar(Max),
             @Title NVarchar(MAX)
    AS
    BEGIN
             -- SET NOCOUNT ON added to prevent extra result sets from
             -- interfering with SELECT statements.
             SET NOCOUNT ON;
             DECLARE @Query Varchar(Max)
             SET @Query = 'SELECT FirstName, LastName, e.Title
             FROM HumanResources.Employee AS e
             JOIN Person.Contact AS c
             ON e.ContactID = c.ContactID
             WHERE e.Title IN (' + @Title+ ')'
    --       PRINT ' QUERY = '+ ISNULL(@Query,'NULL')
             Execute sp_executesql @Query
    END
    If you have any more questions, please feel free to ask.
    Thanks,
    Jin
    Jin Chen - MSFT

  • Passing parameter in stored procedure

    Hi, I am really new to using Oracle stored procedure. I have just tested a sample stored proc which should return multiple rows without passing any parameter.
    here is the stored proc I wrote
    create or replace procedure get_address
    as
    cur_table sys_refcursor;
    begin
    open cur_table for
    select * from address_table order by addr_id;
    end;
    when I execute it, I get a message "Procedure Created"
    then I executed the stored proc
    exec get_address;
    I again get a message "PL/SQL procedure successfully completed" and I do not see the records at all.
    so I decide to rewrite to the stored proc as such
    create or replace procedure get_address(cur_table out sys_refcursor)
    as
    begin
    open cur_table for
    select * from address_table order by addr_id;
    end;
    everthing is good so far.
    now when execute it
    exec get_address;
    I am getting the following error:
    "PLS-00306: wrong number or types of arguments in call to 'TESTCODEPROC'"
    I have searched so many places, but there is no document talks about this issue. I hope someone can help me to over come this. I need to call this stored proc from .NET 2.0 reporting viewer which is embedded in asp.net page.
    Thank you.

    so I decide to rewrite to the stored proc as such
    create or replace procedure get_address(cur_table out
    sys_refcursor)
    as
    begin
    open cur_table for
    select * from address_table order by addr_id;
    end;
    everthing is good so far.
    now when execute it
    exec get_address;
    I am getting the following error:
    "PLS-00306: wrong number or types of arguments in
    call to 'TESTCODEPROC'"
    From what you wrote I can assume that you have used SQL server before. Oracle does not automatically return the last opened cursor from a stored procedure like the query result, so you cannot just call exec get_address; (or just execute the procedure from .NET code). You will have to pass the cursor parameter and fetch it as an output parameter value in .NET, then use it to get the data reader etc.
    On the other hand, you can just execute the statement directly. I see a lot of folks coming from SQL server world using stored procedures like crazy even for things that are naturally suited to queries and views. Oracle view allows you to apply the same security restrictions you can put onto a stored procedure, and if you use statement caching and bound variables, you get precompilation benefits as well with a view. Using a view instead of a procedure in this case will require less code both in the database and in .NET, and will give you a more flexible interface in terms of retrieved columns and ordering.
    gojko adzic
    http://gojko.net

  • Passing parameter to stored procedure from windows form getting error

    I've written a procedure which shows the data in a table according to the table flag selected from the windows form. My code is:
    --- stored procedure ------
    CREATE PROC [dbo].[PROC_SELECT_TABLES]
    @TBL_FLAG INT
    AS
    BEGIN
    SET NOCOUNT ON;
    IF (@TBL_FLAG = 1)
    SELECT * FROM MHT_APPUSER ;
    IF (@TBL_FLAG = 2)
    SELECT * FROM MHT_ISA11 ;
    IF (@TBL_FLAG = 3)
    SELECT * FROM MHT_ISA22 ;
    SET NOCOUNT OFF;
    END
    GO
    Now, the module for calling the above procedure
    namespace DAL;
    public class DisplayData
    SqlLayer layer = new SqlLayer();
    public int tblFlag { get; set; }
    public DataTable GetData(int tblFlag)
    SqlParameter[] p = new SqlParameter[1];
    p[0] = new SqlParameter("@tblFlag", this.tblFlag);
    return layer.ExecuteDataSet("PROC_SELECT_TABLES", p).Tables[0];
    Now the SQL LAYER, containing the ExecuteDataSet and database connection code:
    namespace DAL;
    public class SqlLayer
    // sql connection code
    public DataSet ExecuteDataSet(string commandText, SqlParameter[] sqlParameter)
    SqlCommand cmd = new SqlCommand(commandText, this.conn);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.AddRange(sqlParameter);
    SqlDataAdapter sda = new SqlDataAdapter(cmd);
    DataSet ds = new DataSet();
    sda.Fill(ds);
    return ds;
    Now the windows form layer:
    using DAL;
    namespace BookKeepingSystem
    public partial class DisplayDataForm : Form
    DisplayData view = new DisplayData();
    private void GetData()
    view.tblFlag = 3;
    DataTable dt = view.GetData(view.tblFlag);
    dgvDisplayData.DataSource = dt;
    public DisplayDataForm()
    InitializeComponent();
    private void DisplayData_Load(object sender, EventArgs e)
    GetData();
    private void btnExit_Click(object sender, EventArgs e)
    Application.Exit();
    When I run the code I got the error:
    "Unhandled exception has occurred in your application...
    Procedure or function 'PROC_SELECT_TABLES' expects parameter @TBL_FLAG, which was not supplied"
    I can not figure what is missing with my code. Please can any one point out please.
    Thank You!!!

    Try something like this for starting -- do just this procedure to see if it works first.
    private DataTable GetDataTable(SqlConnection conn1)
    SqlDataAdapter daS1 = new SqlDataAdapter();
    daS1.SelectCommand = new SqlCommand();
    daS1.SelectCommand.Connection = conn1;
    if (conn1.State == ConnectionState.Closed) conn1.Open();
    daS1.SelectCommand.CommandType = CommandType.StoredProcedure;
    daS1.SelectCommand.CommandText = "yourStoredProcedureName";
    daS1.SelectCommand.Parameters.Add("@ParamName", SqlDbType.Int, 4);
    DataSet DS1 = new DataSet();
    daS1.Fill(DS1, "tbl1");
    return DS1.Tables["tbl1"];
    Note:  in the CommandText part place the name of your stored procedure.  In the Parameter part put the name of your parameter exactly as it is in the actual stored procedure.  Also, (if you have not done this already) make sure your stored
    procedure runs OK -- first -- test out your stored procedure in Sql Server Management Studio.  If the procedure runs OK in SSMS, then try it from you app.  Just create a simple form with one button .  Place GetDataTable() code under
    the button and call it something like this:
    private void button1_Click(object sender, EventArgs e)
    int i = GetDataTbl().Rows.Count;
    Console.WriteLine("i is {0}", i);
    Rich P

  • Length of "out char" parameter in stored procedure

    I call a SP with an output char parameter, the type is defined as a field in a table -- char(3),
    but when calling from stored procedure, it throws an exception:
    "ORA-01406: fetched column value was truncated"
    the exception happens in line 4:
    1. stmt->setSQL("call OUTPUT_CHAR1(:1)");
    2. stmt->registerOutParam(1, OCCISTRING, 10);          
    3. stmt->execute();
    4. string result = stmt->getString(1);
    One interesting thing is: if I use the same type as function return value(not output parameter), it works.
    Friends, please give me some idea..

    Just before commending about anyone it is good idea to go through Oracle Documentation .
    Go through the following link
    http://www.orafaq.com/faq/what_is_the_difference_between_varchar_varchar2_and_char_data_types
    and
    http://ora-01406.ora-code.com/ also
    Basic difference is CHAR is fixed length and VARCHAR2 variable length which takes more buffer than a fixed length since the length is also stored.
    Your error 'ORA-01406' is a common one in any place holder which does not have space to hold enough data. Thats why I told you to change to Varchar2 which is common fix in this case where exact data is not send to client unlike CHAR.
    It is good that you are rude to me , so that I learned a lesson not help others much.
    If you think the above explanation is also wrong , there are other experts in this forum , they will comment and not you alone

Maybe you are looking for

  • Save library & i-tunes files to external drive?

    How can i set up everything from the i-tunes set up files through to the library onto my external drive. I want to do this on my laptop as it's not a new system and soon fills up when I start putting my cd collection into the library to upload onto m

  • Pages 5.1 Formatting Issues

    Pages 5.1 changed my header formatting and removed an image...is there anything I can do to keep the previous formatting for my many docs?

  • Can't install flash player on mac OS 10.9.2

    Hi everyone, I updated to 10.9.2 recently (whenever it came out). Adobe prompted me to update the flash player from version 12.0.0.70 to 12.0.0.77, which failed. I tried uninstalling all versions and reinstalling the new version, which failed to work

  • Word processing on ipad retina?

    I just purchased an ipad retina the other day and I realize there's no app for Microsoft word, however I do need to work on my word documents on ipad at times and I'm just wondering if there's any way to synchronize Microsoft office on Mac with word

  • Ipods will not display correctly.

    Tried to reset my Ipod touch and now only shows the apple and then shows white screen.  When hooked up to the computer it does not recgonize the ipod.  Any help would be great