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
  1. Home
  2. Database & SysAdmin
  3. Database
  4. OracleCommandBuilder.DeriveParameters doesn't return parameters every time

OracleCommandBuilder.DeriveParameters doesn't return parameters every time

Scheduled Pinned Locked Moved Database
csharpdatabaseoraclequestion
3 Posts 3 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.
  • T Offline
    T Offline
    Tesic Goran
    wrote on last edited by
    #1

    Hello, I use Microsoft's Oracle client provider. I have 2 Oracle stored procedures that do the same thing and have only different names: SP1: create or replace procedure GetScalar(last_name IN PERSON.LastName%TYPE, row_count OUT INTEGER) as begin SELECT COUNT(*) INTO row_count FROM PERSON WHERE LASTNAME = last_name; end GetScalar; SP2: create or replace procedure Get_Bool(last_name IN PERSON.LastName%TYPE, r_count OUT INTEGER) as begin SELECT COUNT(*) INTO r_count FROM PERSON WHERE LASTNAME = last_name; end Get_Bool; I use the same C# code for both. When I use stored procedure SP1 after this code was called: OracleCommandBuilder.DeriveParameters(objCmd); int n = objCmd.Parameters.Count; n is 2, which is ok. But, when I use stored procedure SP2: n is 0, which is not ok. What should I do yo make it work? When I call both store procedures inside Oracle enviroment both work fine.

    J P 2 Replies Last reply
    0
    • T Tesic Goran

      Hello, I use Microsoft's Oracle client provider. I have 2 Oracle stored procedures that do the same thing and have only different names: SP1: create or replace procedure GetScalar(last_name IN PERSON.LastName%TYPE, row_count OUT INTEGER) as begin SELECT COUNT(*) INTO row_count FROM PERSON WHERE LASTNAME = last_name; end GetScalar; SP2: create or replace procedure Get_Bool(last_name IN PERSON.LastName%TYPE, r_count OUT INTEGER) as begin SELECT COUNT(*) INTO r_count FROM PERSON WHERE LASTNAME = last_name; end Get_Bool; I use the same C# code for both. When I use stored procedure SP1 after this code was called: OracleCommandBuilder.DeriveParameters(objCmd); int n = objCmd.Parameters.Count; n is 2, which is ok. But, when I use stored procedure SP2: n is 0, which is not ok. What should I do yo make it work? When I call both store procedures inside Oracle enviroment both work fine.

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      Would help if code tags were used but it appears that the stored proc signature, excluding identifiers, is the same. If that is the case then you have a faulty assumption. You are assuming that a difference in identifies makes a difference. Excluding key word usage (which I do not see any) that is not possible. Since it isn't possible it suggests that you need to look for a difference source of the problem. So possible reasons are the following. This is not a complete list. - The proc in your C# code is not named correctly. - The proc does not exist in the database, or it is an older version with no parameters. - You are pointing at a different database.

      1 Reply Last reply
      0
      • T Tesic Goran

        Hello, I use Microsoft's Oracle client provider. I have 2 Oracle stored procedures that do the same thing and have only different names: SP1: create or replace procedure GetScalar(last_name IN PERSON.LastName%TYPE, row_count OUT INTEGER) as begin SELECT COUNT(*) INTO row_count FROM PERSON WHERE LASTNAME = last_name; end GetScalar; SP2: create or replace procedure Get_Bool(last_name IN PERSON.LastName%TYPE, r_count OUT INTEGER) as begin SELECT COUNT(*) INTO r_count FROM PERSON WHERE LASTNAME = last_name; end Get_Bool; I use the same C# code for both. When I use stored procedure SP1 after this code was called: OracleCommandBuilder.DeriveParameters(objCmd); int n = objCmd.Parameters.Count; n is 2, which is ok. But, when I use stored procedure SP2: n is 0, which is not ok. What should I do yo make it work? When I call both store procedures inside Oracle enviroment both work fine.

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        Roll your own -- don't depend on automagic tools.

        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