oracle / dotnet-db-samples

.NET code samples for Oracle database developers #OracleDotNet
http://otn.oracle.com/dotnet
MIT License
413 stars 191 forks source link

Passing associative array index by varchar2 from c# to pl/sql #220

Open lutin7812 opened 2 years ago

lutin7812 commented 2 years ago

Hi, even though the odp.net driver supports associative array binding, it only supports array index by integer. Is it possible that the driver could support in a future release, array index by varchar2? So we could map c# hash table to oracle pl/sql ones. Thank's for reply.

DECLARE
   SUBTYPE tvalue IS VARCHAR2 (1000);

   TYPE thash IS TABLE OF tvalue
      INDEX BY VARCHAR2 (50);

   hashtab   thash;
   elem      VARCHAR2 (50);
BEGIN
   hashtab ('avion') := NULL;
   hashtab ('voiture') := '748';
.............................
   hashtab ('train') := '749';
   hashtab ('bateau') := '750';
   hashtab ('velo') := '751';
alexkeh commented 2 years ago

If users vote for this feature, we'll definitely consider adding the feature. We have not seen indexing associative arrays by strings with .NET apps with much usage. It's pretty much all has been using numbers.

lutin7812 commented 2 years ago

Hi, thank's for reply. The advantage I see is that instead of passing fixded named parameters between c# and ORACLE PL/SQL procedure, which restrict evolution of code, passing named parameters through some kind of hastable ease code evolution. How can I encourage users voting?!

alexkeh commented 2 years ago

Use the thumbs up emoji on the original request above and/or have them respond to this thread. That seems to be the way many GitHub projects determine interest.