DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: C# Oracle-Types in SQL Developer

  1. #1
    Join Date
    Apr 2006
    Posts
    4

    C# Oracle-Types in SQL Developer

    Hi,

    I've developped a function in PL/SQL with SQL Developer named TOPOLOGIE that returns a TABLE OF NUMBER (I've created a new type "TYPE_TABLE_IDENTIFIANTS_POINTS" for this).

    I would like to execute this function in C# to get this table of numbers.

    I've tried with this code :
    constr = "User Id=" + userName + ";Password=" + password + ";Data Source=" + service;
    OracleConnection conn = new OracleConnection(constr);
    conn.Open();

    query = "SELECT TOPOLOGIE('RESEAU', 200225275, 350, 450, null, 1) FROM DUAL";

    OracleCommand cmd = new OracleCommand(query);
    cmd.Connection = conn;
    OracleDataReader reader = cmd.ExecuteReader();

    while (reader.Read())
    {
    result = reader.GetDecimal(0);
    //result2 = reader.GetString(0);
    }

    reader.Close();
    conn.Close();


    It works when the function "TOPOLOGIE" returns a NUMBER (with result) but an error system occurs with cmd.ExecuteReader() instruction when the function returns a TABLE OF NUMBER (that appears like "TYPE_TABLE_IDENTIFIANTS_POINTS(200225482, 200228061, 200213966)" in SQL*Plus WorkSheet).


    Do you know how I can get custom types with C# ? Is it possible ?

    Thanks.

  2. #2
    Join Date
    Sep 2005
    Posts
    278
    Use the following query to get the values, hope this will work

    query = "SELECT * FROM TABLE(TOPOLOGIE('RESEAU', 200225275, 350, 450, null, 1))";

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width