Skip to Main Content
IBM Data and AI Ideas Portal for Customers


This portal is to open public enhancement requests against products and services offered by the IBM Data & AI organization. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:


Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,


Post your ideas

Post ideas and requests to enhance a product or service. Take a look at ideas others have posted and upvote them if they matter to you,

  1. Post an idea

  2. Upvote ideas that matter most to you

  3. Get feedback from the IBM team to refine your idea


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

IBM Employees should enter Ideas at https://ideas.ibm.com


Status Not under consideration
Workspace Db2
Created by Guest
Created on Feb 11, 2020

IBM Data Server .Net Provider Support For Informix Types TEXT, BYTE and BOOLEAN

We are in the process of moving from .Net Framework to .Net Core. We currently use the Informix Client SDK ADO.Net drivers to access Informix databases using ADO.Net.

When we tried to migrate to the IBM Data Server Driver (IBM.Data.DB2.dll) we found that calling stored procedures worked except for some types (TEXT, BYTE and BOOLEAN). We contacted IBM and were told to use a workaround to call the stored procedures using TEXT and BYTE types, however this workaround does not follow the best practices set down by Microsoft for calling stored procedures from ADO.Net code. Also due to the generic way our products deal with different database providers, the workaround is not going to work for us.

 

Workaround suggested was to call the stored procedure using:

 

command.CommandType = CommandType.Text;

command.CommandText = "CALL test_db2text1(?::TEXT)";

 

rather than the standard best practise of

 

command.CommandType = CommandType.StoredProcedure;
command.CommandText = "test_db2text1";
 

We've been given no response to the question about the BOOLEAN type.

 

After many weeks of communication about the issue we were told to either wait an unknown period of time for the new "native" Informix .NET Core provider or raise an RFE here. We are pursuing both options at the moment as this is blocking several projects.

 

If neither of these give a satisfactory result then we will need consider other options, including moving all our Informix customers to another database provider.

 

-----------

 

Example to replicate the issue (example for TEXT, but BYTE has the same behaviour) (please note the code below is purely test code to show the issue, it is not production code.)

 

For example with a test stored procedure like:

 

CREATE PROCEDURE "informix".test_db2text1 (in_test REFERENCES TEXT)

 

   RETURNING REFERENCES TEXT;

 

    DEFINE p_text REFERENCES TEXT;

 

                LET p_Text = in_test;

 

                return p_Text;

END PROCEDURE;

 

And code like:

 

string parameterValue = "The quick brown fox jumps over the lazy dog.";

                int parameterSize = parameterValue.Length;

 

                using (DB2Connection connection = new DB2Connection("Server=mydbserver:9089;Database=mydb1;User Id=myuser;Password=mypassword;Pooling=true"))

                {

                    connection.Open();

 

                    using (DB2Command command = connection.CreateCommand())

                    {

                        DB2Parameter parameter = new DB2Parameter("in_test", DB2Type.Clob)

                                                 {

                                                     Value = parameterValue,

                                                     Size = parameterSize

                                                 };

 

                        command.Parameters.Add(parameter);

                       

                        command.CommandType = CommandType.StoredProcedure;

                        command.CommandText = "test_db2text1";

                        DB2DataReader dataReader = command.ExecuteReader();

 

                        // This will only read 1 row.

                       

                        while (dataReader.Read())

                        {

                            if (!dataReader.IsDBNull(0))

                            {

                                displayBuilder.AppendLine(dataReader.GetValue(0).ToString());

                            }

                            else

                            {

                                displayBuilder.AppendLine("Value was NULL");

                            }

                        }

 

                        dataReader.Close();

                    }

                }

 

We get the error:

 

IBM.Data.DB2.DB2Exception (0x80004005): ERROR [IX000] [IBM][IDS/UNIX64] Routine (test_db2text1) can not be resolved.

   at IBM.Data.DB2.DB2Command.ExecuteReaderObject(CommandBehavior behavior, String method, DB2CursorType reqCursorType, Boolean abortOnOptValueChg, Boolean skipDeleted, Boolean isResultSet, Int32 maxRows, Boolean skipInitialValidation)

   at IBM.Data.DB2.DB2Command.ExecuteReaderObject(CommandBehavior behavior, String method)

   at IBM.Data.DB2.DB2Command.ExecuteReader(CommandBehavior behavior)

   at IBM.Data.DB2.DB2Command.ExecuteReader()

 

 

----------

 

Example of issue for BOOLEAN

 

C# line like:

 

                DB2Parameter parameter = new DB2Parameter("test", DB2Type.Boolean);

 

 Will throw the error:

 

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.

Parameter name: Invalid DB2 Type enumeration value=1015.

   at IBM.Data.DB2.TypeMap.FromDB2Type(DB2Type db2Type)

   at IBM.Data.DB2.DB2Parameter.set_DB2Type(DB2Type value)

   at IBM.Data.DB2.DB2Parameter..ctor(String szName, DB2Type db2Type)

 

----------

The informix article

 

https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.swg.im.dbclient.adonet.ref.doc/doc/DB2TypeEnumeration.html

 

does list the Boolean issue as a limitation of the driver. It does not list any issues for Text and Byte types.

 

Concerningly it also lists several other Informix types (like NVARCHAR, etc) that throw exceptions at runtime.