Re: DeriveParameters method fails if UDR parameter defined using LIKE
Posted in 2008
Topics: Data Types & Schema Design
On 25 Jul, 15:51, Rich <informix.databa...@geos.com> wrote: > On 25 Jul, 15:37, Rich <informix.databa...@geos.com> wrote: > > > > > Ref:http://www-1.ibm.com/support/docview.wss?rs=681&context=SSVT2J&dc=DB5... > > > Apparently upgrading to at last CSDK 3.00 should have fixed the > > problems with DeriveParameters but alas I fear not. > > > I'm using CSDK 3.50.TC1 and I'm still having problems: > > > 1. DeriveParameters fails with a "Specified cast is not valid" > > exception when deriving a parameter from a UDR parameter defined using > > LIKE. Columns defined as int seem fine but columns defined as varchar > > fail - I haven't tried other types yet. > > > 2. A parameter called "RETURN" is always included as the first > > parameter in the derived results, this is hard-coded but there's no > > explanation as to what it is or why it's there? > > > 3. A parameter called "Parameter1" is always appended to the list of > > parameters, it appears completely spurious! > > > Although irritating I can work around #2 and #3 but #1 is damn > > annoying! > > > IDS version 9.40.TC2. > > > Anyone tried using this stuff? > > > Thanks, > > > Rich > > Oh and while I'm in a grumbling mood, the coding example given in the > manual wouldn't even compile if you tried it - does anyone check this > stuff?! > > --------------- > // IfxConnection - con > IfxCommand cmd = new IfxCommand("SP_GETUSERINFO",con); > IfxCommandBuilder cb = new IfxCommandBuilder(); > Con.Open(); > Cb.DeriveParameters(cmd); > foreach (IfxParameter param in cmd.Parameters) > { > Console.WriteLine(param.ParameterName);} > > con.Close(); > --------------- > > 1. DeriveParameters is a static method, not an instance method i.e. > you cannot call it from a class instance. > > 2. C# is case-sensitive so declaring the variable as "cb" and then > trying to use "Cb" won't work, in fact it wouldn't even compile. > (ditto the con/Con variable)- Hide quoted text - > > - Show quoted text - ...the problems continue: 1. Why do you ALWAYS get an "Unknown SQL Type - -110" exception if the final parameter is an INT? 2. Why is the final parameter not 'derived'? i.e. it's always missing from the collection. 3. Why is lvarchar mapped to IfxType.Clob when there's a perfectly reasonable IfxType.Lvarchar type?
On 28 Jul, 16:04, Rich <informix.databa...@geos.com> wrote: > On 25 Jul, 15:51, Rich <informix.databa...@geos.com> wrote: > > > > > On 25 Jul, 15:37, Rich <informix.databa...@geos.com> wrote: > > > > Ref:http://www-1.ibm.com/support/docview.wss?rs=681&context=SSVT2J&dc=DB5... > > > > Apparently upgrading to at last CSDK 3.00 should have fixed the > > > problems with DeriveParameters but alas I fear not. > > > > I'm using CSDK 3.50.TC1 and I'm still having problems: > > > > 1. DeriveParameters fails with a "Specified cast is not valid" > > > exception when deriving a parameter from a UDR parameter defined using > > > LIKE. Columns defined as int seem fine but columns defined as varchar > > > fail - I haven't tried other types yet. > > > > 2. A parameter called "RETURN" is always included as the first > > > parameter in the derived results, this is hard-coded but there's no > > > explanation as to what it is or why it's there? > > > > 3. A parameter called "Parameter1" is always appended to the list of > > > parameters, it appears completely spurious! > > > > Although irritating I can work around #2 and #3 but #1 is damn > > > annoying! > > > > IDS version 9.40.TC2. > > > > Anyone tried using this stuff? > > > > Thanks, > > > > Rich > > > Oh and while I'm in a grumbling mood, the coding example given in the > > manual wouldn't even compile if you tried it - does anyone check this > > stuff?! > > > --------------- > > // IfxConnection - con > > IfxCommand cmd = new IfxCommand("SP_GETUSERINFO",con); > > IfxCommandBuilder cb = new IfxCommandBuilder(); > > Con.Open(); > > Cb.DeriveParameters(cmd); > > foreach (IfxParameter param in cmd.Parameters) > > { > > Console.WriteLine(param.ParameterName);} > > > con.Close(); > > --------------- > > > 1. DeriveParameters is a static method, not an instance method i.e. > > you cannot call it from a class instance. > > > 2. C# is case-sensitive so declaring the variable as "cb" and then > > trying to use "Cb" won't work, in fact it wouldn't even compile. > > (ditto the con/Con variable)- Hide quoted text - > > > - Show quoted text - > > ...the problems continue: > > 1. Why do you ALWAYS get an "Unknown SQL Type - -110" exception if > the final parameter is an INT? > > 2. Why is the final parameter not 'derived'? i.e. it's always > missing from the collection. > > 3. Why is lvarchar mapped to IfxType.Clob when there's a perfectly > reasonable IfxType.Lvarchar type?- Hide quoted text - > > - Show quoted text - Oh and DateTime doesn't appear to be supported at all - you get the Uknown SQL Type -110 exception. (Apologies for the 'flood')