Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. please help me : How to call Pl sql function return record type in C#

please help me : How to call Pl sql function return record type in C#

Scheduled Pinned Locked Moved C#
databasecsharphelptutorialworkspace
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sampath_dr
    wrote on last edited by
    #1

    Hi all.. ======================================== TYPE Public_Rec IS RECORD (user_id SETUP_TAB.user_id%TYPE, tool SETUP_TAB.tool%TYPE, database SETUP_TAB.database%TYPE); ======================================== FUNCTION Get ( id_ IN VARCHAR2 ) RETURN Public_Rec IS temp_ Public_Rec; CURSOR get_attr IS SELECT user_id, tool, database FROM SETUP_TAB WHERE id = id_; BEGIN OPEN get_attr; FETCH get_attr INTO temp_; CLOSE get_attr; RETURN temp_; END Get; ======================================== can any one tell me how to this function and set return value to dataset.:confused::confused:

    C 1 Reply Last reply
    0
    • S sampath_dr

      Hi all.. ======================================== TYPE Public_Rec IS RECORD (user_id SETUP_TAB.user_id%TYPE, tool SETUP_TAB.tool%TYPE, database SETUP_TAB.database%TYPE); ======================================== FUNCTION Get ( id_ IN VARCHAR2 ) RETURN Public_Rec IS temp_ Public_Rec; CURSOR get_attr IS SELECT user_id, tool, database FROM SETUP_TAB WHERE id = id_; BEGIN OPEN get_attr; FETCH get_attr INTO temp_; CLOSE get_attr; RETURN temp_; END Get; ======================================== can any one tell me how to this function and set return value to dataset.:confused::confused:

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The same way you'd call a stored proc. Use ExecuteScalar if your function has a single return value.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      S 1 Reply Last reply
      0
      • C Christian Graus

        The same way you'd call a stored proc. Use ExecuteScalar if your function has a single return value.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        S Offline
        S Offline
        sampath_dr
        wrote on last edited by
        #3

        OracleConnection conn = new OracleConnection(); String str = "Data source=****;user ID=****;Password=****;"; conn.ConnectionString = str; OracleCommand cmd = new OracleCommand("Setup_API.Get", conn); cmd.CommandType = CommandType.StoredProcedure; OracleParameter id_ = new OracleParameter(); id_.ParameterName = "id_"; id_.OracleDbType = OracleDbType.Varchar2; id_.Value = "11"; id_.Direction = ParameterDirection.Input; cmd.Parameters.Add(id_); i have write this code..and can you tell me how to get return value(record) and and how to set it inti dataset.i'm new to C#,pl sql.thank you for reply my post.:confused::confused:

        C 1 Reply Last reply
        0
        • S sampath_dr

          OracleConnection conn = new OracleConnection(); String str = "Data source=****;user ID=****;Password=****;"; conn.ConnectionString = str; OracleCommand cmd = new OracleCommand("Setup_API.Get", conn); cmd.CommandType = CommandType.StoredProcedure; OracleParameter id_ = new OracleParameter(); id_.ParameterName = "id_"; id_.OracleDbType = OracleDbType.Varchar2; id_.Value = "11"; id_.Direction = ParameterDirection.Input; cmd.Parameters.Add(id_); i have write this code..and can you tell me how to get return value(record) and and how to set it inti dataset.i'm new to C#,pl sql.thank you for reply my post.:confused::confused:

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          sampath_dr wrote:

          i'm new to C#,pl sql.

          you're new to C# and SQL ? In what context do you need to do this then ?

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          S 1 Reply Last reply
          0
          • C Christian Graus

            sampath_dr wrote:

            i'm new to C#,pl sql.

            you're new to C# and SQL ? In what context do you need to do this then ?

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            S Offline
            S Offline
            sampath_dr
            wrote on last edited by
            #5

            i'm doing my indusrial training these days.To my project need it.can you help me? thank you reply my post.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups