Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8415425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:26:37+00:00 2026-06-10T01:26:37+00:00

I am wrote stored procedure to Insert data into database table but i am

  • 0

I am wrote stored procedure to Insert data into database table but i am not getting how to pass datatable to stored procedure kindly tell how to use it.

below is my storedprocedure

CREATE OR REPLACE PROCEDURE PR_SREE_TEST(p_recordset In SYS_REFCURSOR) IS

Contrac_rc SREE_TEST%rowtype;
BEGIN

   Loop
   Fetch p_recordset Into Contrac_rc;
   EXIT WHEN p_recordset%NOTFOUND;
       Insert into SREE_TEST(CT,DESC,FLAG)
       Values(Contrac_rc.CT,Contrac_rc.DESC,Contrac_rc.FLAG);

   End Loop;


   EXCEPTION
     WHEN NO_DATA_FOUND THEN
       NULL;
     WHEN OTHERS THEN
       -- Consider logging the error and then re-raise
       RAISE;
END PR_SREE_TEST;
/

and cs page

  public DataSet sreetest(DataTable dt)
        {
            DataSet dsRegularIndentdtl = new DataSet();
            try
            {
                OracleConnection OraConn = new OracleConnection(strDBConnection);
                OraConn.Open();

                OracleCommand OraCmd = new OracleCommand();
                OraCmd.Connection = OraConn;
                OraCmd.CommandText = "PR_SREE_TEST";
                OraCmd.CommandType = CommandType.StoredProcedure;
                OracleParameter parameter = new OracleParameter();


                var recordSet1 = new DataTable();
                recordSet1 = dt;
               OraCmd.Parameters.Add("p_recordset", OracleDbType.RefCursor, recordSet1, ParameterDirection.Input);
                 OraCmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dsRegularIndentdtl;
        }
    }

above is my code it is saying that p_recordset not valied. please tell me how to execute it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:26:39+00:00Added an answer on June 10, 2026 at 1:26 am

    Make sure you are using the correct overload of OraCmd.Parameters.Add(),

    As per msdn the fourth parameter is not parameter direction, it is as below

    public OracleParameter Add(
        string parameterName,
        OracleType dataType,
        int size,
        string srcColumn
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a stored procedure to update\insert data into a table using MERGE. One
I wrote a stored procedure that worked in my local machine but in the
I wrote a simple Stored Procedure with a while loop that's not working. Here's
I have to insert some data periodically in my SQL Server database. But the
I am trying to modify a stored procedure I wrote to pull data from
here's the stored procedure i wrote.In this proc p_subjectid is an array of numbers
On our SQL Server (Version 10.0.1600), I have a stored procedure that I wrote.
I'm trying to write a stored procedure to copy a subset of data from
In Sql Server 2005, I have a stored procedure, in which i have wrote
I am learning how to write a stored procedure. I kinda get it but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.