IBM Data & AI

 Welcome to the IBM Data & AI Ideas Portal for Clients! 

We welcome and appreciate your feedback on IBM Data & AI Products to help make them even better than they are today!
Before you submit an idea, please perform a search first as a similar idea may have already been reported in the portal.  If a related idea is not yet listed, please create a new idea and include with it a description which includes expected behavior as well as why having this feature would improve the service and how it would address your use case.
IBM Employees:
Clients:
  • Our team welcomes any feedback  and suggestions you have for improving our offerings / products!  This forum allows us to connect your offering / product improvement ideas with IBM product and engineering teams.
  • If you have not registered on this portal please click on the following link and register.  To complete registration you will need to open the email you will receive from Aha to confirm your identity. http://ibm.biz/IBM-Data-and-AI-Portal-Register
Additional Information:
  • The shorter URL for this site is: https://ibm.biz/IBM-Data-and-AI-Ideas
  • To view our roadmaps: http://ibm.biz/Data-and-AI-Roadmaps
  • Reminder: This is not the place to submit defects or support needs, please use normal support channel for these cases
  • Please do not use the Ideas Portal for reporting bugs - we ask that you report bugs or issues with the product by contacting IBM support.

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.

  • R Yarrow
  • Feb 11 2020
  • Needs review
Why is it useful?
Who would benefit from this IDEA? All of our customers would benefit from this as we will continue to be able to provide innovative best in class solutions to our customers.
How should it work?

Please provide full support for the Informix types TEXT, BYTE and BOOLEAN in the IBM Data Server Driver (IBM.Data.DB2.dll), using CommandType.StoredProcedure.

 

The driver has types of DB2Type.Boolean, DB2Type.Byte and DB2Type.Text available which appear to be there to support Informix but do not work. These could be leveraged to provide the support needed since DB2 does not appear to use those types.

Idea Priority Urgent
Priority Justification This is blocking our move to .Net Core and may cause us to have to move to a different database provider.
Customer Name
Submitting Organization
Submitter Tags
  • Attach files

NOTICE TO EU RESIDENTS: per EU Data Protection Policy, if you wish to remove your personal information from the IBM ideas portal, please login to the ideas portal using your previously registered information then change your email to "anonymous@euprivacy.out" and first name to "anonymous" and last name to "anonymous". This will ensure that IBM will not send any emails to you about all idea submissions