Topic
  • 8 replies
  • Latest Post - ‏2012-02-21T15:21:12Z by GokouZWAR
MenMen
MenMen
6 Posts

Pinned topic Informix BOOLEAN type is not supported?? IDS ADO EF

‏2009-03-05T08:49:58Z |
Hi.

BOOLEAN Type is not supported??

CREATE TABLE "myschema"."table_2" (
"id" INTEGER NOT NULL,
"COLUMN1" BOOLEAN ,
PRIMARY KEY ("id") CONSTRAINT pk_table_2)
;
GRANT DELETE, INDEX, INSERT, SELECT, UPDATE ON "myschema"."table_2" TO "public"
;

eppEntities e = new eppEntities();
e.AddToTable2(new Table2() { ID = 3, column1 = true});
e.SaveChanges(); <- throw exception

Inner Exception: "Specified cast is not valid."

Stack trace: at IBM.Data.DB2.DB2Parameter.b(DB2ParamInfo& A_0)
at IBM.Data.DB2.DB2Parameter.GetParamInfo(Int32 paramPos, DB2ParamInfo& paramInfo)
at IBM.Data.DB2.DB2ParameterCollection.GetParamInfoList(ArrayList namedParamList)
at IBM.Data.DB2.DB2Command.g()
at IBM.Data.DB2.DB2Command.ExecuteNonQuery()
at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
Windows XP SP3, Visual Studio 2008 SP1, Studio Add-in: v9.5fp3a_nt32_vsai, Driver: v9.5fp3_nt32_dsdriver_EN, iif.11.50 - Developer edition
Updated on 2012-02-21T15:21:12Z at 2012-02-21T15:21:12Z by GokouZWAR
  • SystemAdmin
    SystemAdmin
    2826 Posts

    Re: Informix BOOLEAN type is not supported?? IDS ADO EF

    ‏2009-03-05T19:03:50Z  
    Hi,

    This appears to be a generic defect in the provider but not specific to Entity Framework support alone. For your schema, writing a regular ADO.NET application would also result in an error. I will open a defect - to be fixed in V9.5 FP5.
  • MenMen
    MenMen
    6 Posts

    Re: Informix BOOLEAN type is not supported?? IDS ADO EF

    ‏2009-03-06T03:29:26Z  
    Thanks for your answer.
    Best regards.
  • petermcc
    petermcc
    2 Posts

    Re: Informix BOOLEAN type is not supported?? IDS ADO EF

    ‏2009-12-07T02:35:27Z  
    • MenMen
    • ‏2009-03-06T03:29:26Z
    Thanks for your answer.
    Best regards.
    So is there any update on this? I have been using the latest ADO .NET Informix and DB2 providers, and they still appear to suffer from the same issue.

    Our team are using LINQ to Entities, and we are investigating nHibernate. Same issue with both frameworks. Booleans not supported. This is a show stopper for us, and it is likely we cannot use either framework.

    I have written plain ADO .NET code using SQL parameters to isolate the issue. This fails as expected.
  • SystemAdmin
    SystemAdmin
    2826 Posts

    Re: Informix BOOLEAN type is not supported?? IDS ADO EF

    ‏2010-03-29T16:28:28Z  
    • petermcc
    • ‏2009-12-07T02:35:27Z
    So is there any update on this? I have been using the latest ADO .NET Informix and DB2 providers, and they still appear to suffer from the same issue.

    Our team are using LINQ to Entities, and we are investigating nHibernate. Same issue with both frameworks. Booleans not supported. This is a show stopper for us, and it is likely we cannot use either framework.

    I have written plain ADO .NET code using SQL parameters to isolate the issue. This fails as expected.
    Hi,

    the support for setting Boolean as a Parameter value has been added in the v9.7 fixpack 1 release of the entity provider. I strongly suggest moving to that release to get the functionality you're looking for. However, if, for some reason, you're unable to move to the new release, please contact IBM service to request the functionality for the v9.5 fixpack.
  • SubbaraoTurlapati
    SubbaraoTurlapati
    1 Post

    Re: Informix BOOLEAN type is not supported?? IDS ADO EF

    ‏2010-05-10T17:57:48Z  
    Hi,

    the support for setting Boolean as a Parameter value has been added in the v9.7 fixpack 1 release of the entity provider. I strongly suggest moving to that release to get the functionality you're looking for. However, if, for some reason, you're unable to move to the new release, please contact IBM service to request the functionality for the v9.5 fixpack.
    I tried to update the database using DB2DataAdapter.Update(...) and I could not get it to work with a Boolean column. I'm using 9.7 fix pack1 of the Data Server Drivers for .Net. Please help me move forward on this as this is blocking my current development.
  • SystemAdmin
    SystemAdmin
    2826 Posts

    Re: Informix BOOLEAN type is not supported?? IDS ADO EF

    ‏2010-05-25T13:58:04Z  
    I tried to update the database using DB2DataAdapter.Update(...) and I could not get it to work with a Boolean column. I'm using 9.7 fix pack1 of the Data Server Drivers for .Net. Please help me move forward on this as this is blocking my current development.
    The IDS BOOLEAN data type support has only been added to IBM's Entity Provider ( IBM.Data.DB2.Entity ). The standard ADO.NET provider does not have BOOLEAN support.
  • SystemAdmin
    SystemAdmin
    2826 Posts

    Re: Informix BOOLEAN type is not supported?? IDS ADO EF

    ‏2010-05-25T16:17:34Z  
    The IDS BOOLEAN data type support has only been added to IBM's Entity Provider ( IBM.Data.DB2.Entity ). The standard ADO.NET provider does not have BOOLEAN support.
    Just to clarify my previous post, the GetBoolean() operation is only supported on Entity provider. The regular provider treats BOOLEAN as a SMALLINT, and, therefore, operations like GetInt16() are available. Therefore, for DB2DataAdapter, the smallint should be used instead of bool.
  • GokouZWAR
    GokouZWAR
    2 Posts

    Re: Informix BOOLEAN type is not supported?? IDS ADO EF

    ‏2012-02-21T15:21:12Z  
    Just to clarify my previous post, the GetBoolean() operation is only supported on Entity provider. The regular provider treats BOOLEAN as a SMALLINT, and, therefore, operations like GetInt16() are available. Therefore, for DB2DataAdapter, the smallint should be used instead of bool.
    I'm also having this issue, I'm using the 9.7 fixpack 5. I think my problem is that the column in the database is not setup as a Boolean. How do you do this? We currently have it setup as a char(1) using Y and N for True and False respectively. How can we then take that information and get it into the site? I'm using EF 4.0 with ADO.Net. I have my database setup in an EDMX data model. I have several check boxes setup in my form that basically are supposed to set to checked when the value of the dynamic control is "Y" and unchecked if the value is "N". When the user goes to save the data it's supposed to read in those check boxes and say, if it's checked, set the dynamic control's value to Y, otherwise set it to N.

    It would be a lot easier if the entity framework choose the Boolean field template instead of using a text box...if anyone knows how to set this up please let me know.

    Sorry for digging up an old thread, but it seemed relative to my problem.