dbTalk Databases Forums  

Help with: System.ArgumentException in IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPEsqlT ype)

comp.databases.informix comp.databases.informix


Discuss Help with: System.ArgumentException in IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPEsqlT ype) in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
eferreyra
 
Posts: n/a

Default Help with: System.ArgumentException in IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPEsqlT ype) - 01-03-2012 , 06:33 AM






Hi all, i need help on this one, when i try this select from a .net
application with the .Net Informix Provider i get the error show
below:


string sql = "SELECT DECRYPT_CHAR(field_encrypted, ?)
AS field_decrypted" +
" FROM some_table WHERE id = 48084";

using (DbCommand cmd = ds.GetCommand(sql))
{
ds.AddParameter(cmd, "ope_tar_pan_dec",
DbType.String, "somepassword");

using (IDataReader dr = cmd.ExecuteReader()) //
<-- THROWS
// cut the rest


This fails at IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPE sqlType)
apparently SQL_TYPE been 0 ?

Message=Tipo de SQL desconocido - 0. --> translated is: SQL type
unknow - 0.

Im using csdk 3.70.TC3, was working with ODBC .net provider before,
full detail:

System.ArgumentException was unhandled
Message=Tipo de SQL desconocido - 0.
Source=IBM.Data.Informix
StackTrace:
en IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPE sqlType)
en IBM.Data.Informix.IfxParameter.Bind(IfxDataReader tmpReader,
IntPtr stmt, IfxCommand parent, Int16 ordinal, CNativeBuffer
valueBuffer, CNativeBuffer lenIndBuffer)
en
IBM.Data.Informix.IfxCommand.ExecuteReaderObject(C ommandBehavior
behavior, String method)
en IBM.Data.Informix.IfxCommand.ExecuteReader(Command Behavior
behavior)
en
IBM.Data.Informix.IfxCommand.ExecuteDbDataReader(C ommandBehavior
behavior)
en System.Data.Common.DbCommand.ExecuteReader()
en IT.Data.DataSession.ExecuteReader(DbCommand cmd) en C:
\Proyectos\DotNet\TFS\IT\IT.Data\IT.Data\DataSessi on.cs:línea 310
en IT.Data.DataSession.GetRecord(DbCommand cmd) en C:\Proyectos
\DotNet\TFS\IT\IT.Data\IT.Data\DataSession.cs:líne a 479
en DataEnc.Program.Main(String[] args) en C:\Proyectos\DotNet
\SandBox\DataEnc\DataEnc\Program.cs:línea 31
en System.AppDomain._nExecuteAssembly(Assembly assembly,
String[] args)
en System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
en
Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
en System.Threading.ThreadHelper.ThreadStart_Context( Object
state)
en System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
en System.Threading.ThreadHelper.ThreadStart()
InnerException:


Help!!!
Enrique

Reply With Quote
  #2  
Old   
eferreyra
 
Posts: n/a

Default Re: Help with: System.ArgumentException in IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPEsqlT ype) - 01-03-2012 , 08:00 AM






Have found that the problem is to determine the TYPE of the first
DbCommand parameter, the first ?, if i use a constant value
concatenated in the string problem goes away.

Still my workaround is to create a stored procedure that receives the
varchars and return varchar so i can keep using parameters.

Yet, ugly bug. isnt there in ODBC provider.

Quote:
* string sql = "SELECT DECRYPT_CHAR(field_encrypted, ?) <-- this ? apparently cant be resolved as SQL_TYPE and .Bind method fails.
AS field_decrypted" +
* * * * * * * * * * " FROM some_table WHERE id = 48084";
snip.

Reply With Quote
  #3  
Old   
Art Kagel
 
Posts: n/a

Default Re: Help with: System.ArgumentException inIBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPE sqlType) - 01-03-2012 , 08:39 AM



Is this the Informix SQLI driver or the "Universal" DRDA driver?

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly,
implicitly, or by inference. Neither do those opinions reflect those of
other individuals affiliated with any entity with which I am affiliated nor
those of the entities themselves.



On Tue, Jan 3, 2012 at 9:00 AM, eferreyra <eferreyra (AT) gmail (DOT) com> wrote:

Quote:
Have found that the problem is to determine the TYPE of the first
DbCommand parameter, the first ?, if i use a constant value
concatenated in the string problem goes away.

Still my workaround is to create a stored procedure that receives the
varchars and return varchar so i can keep using parameters.

Yet, ugly bug. isnt there in ODBC provider.


string sql = "SELECT DECRYPT_CHAR(field_encrypted, ?) <-- this ?
apparently cant be resolved as SQL_TYPE and .Bind method fails.
AS field_decrypted" +
" FROM some_table WHERE id = 48084";
snip.
_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
  #4  
Old   
eferreyra
 
Posts: n/a

Default Re: Help with: System.ArgumentException in IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPEsqlT ype) - 01-03-2012 , 09:19 AM



Hi Art.

Informix SQLI driver

IBM Informix Client SDK 3.50.TC4DE (same problem with 3.70.TC3.WIN)



On 3 ene, 11:39, Art Kagel <art.ka... (AT) gmail (DOT) com> wrote:
Quote:
Is this the Informix SQLI driver or the "Universal" DRDA driver?

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog:http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly,
implicitly, or by inference. *Neither do those opinions reflect those of
other individuals affiliated with any entity with which I am affiliated nor
those of the entities themselves.







On Tue, Jan 3, 2012 at 9:00 AM, eferreyra <eferre... (AT) gmail (DOT) com> wrote:
Have found that the problem is to determine the TYPE of the first
DbCommand parameter, the first ?, if i use a constant value
concatenated in the string problem goes away.

Still my workaround is to create a stored procedure that receives the
varchars and return varchar so i can keep using parameters.

Yet, ugly bug. isnt there in ODBC provider.

*string sql = "SELECT DECRYPT_CHAR(field_encrypted, ?) * <-- this ?
apparently cant be resolved as SQL_TYPE and .Bind method fails.
* AS field_decrypted" +
* * * * * * * * * * " FROM some_table WHERE id = 48084";
snip.
_______________________________________________
Informix-list mailing list
Informix-l... (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
  #5  
Old   
Art Kagel
 
Posts: n/a

Default Re: Help with: System.ArgumentException inIBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPE sqlType) - 01-03-2012 , 09:42 AM



Try the DRDA driver, it tends to be faster for .NET and the .NET feature
support is a bit better also.

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly,
implicitly, or by inference. Neither do those opinions reflect those of
other individuals affiliated with any entity with which I am affiliated nor
those of the entities themselves.



On Tue, Jan 3, 2012 at 10:19 AM, eferreyra <eferreyra (AT) gmail (DOT) com> wrote:

Quote:
Hi Art.

Informix SQLI driver

IBM Informix Client SDK 3.50.TC4DE (same problem with 3.70.TC3.WIN)



On 3 ene, 11:39, Art Kagel <art.ka... (AT) gmail (DOT) com> wrote:
Is this the Informix SQLI driver or the "Universal" DRDA driver?

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog:http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly,
implicitly, or by inference. Neither do those opinions reflect those of
other individuals affiliated with any entity with which I am affiliated
nor
those of the entities themselves.







On Tue, Jan 3, 2012 at 9:00 AM, eferreyra <eferre... (AT) gmail (DOT) com> wrote:
Have found that the problem is to determine the TYPE of the first
DbCommand parameter, the first ?, if i use a constant value
concatenated in the string problem goes away.

Still my workaround is to create a stored procedure that receives the
varchars and return varchar so i can keep using parameters.

Yet, ugly bug. isnt there in ODBC provider.

string sql = "SELECT DECRYPT_CHAR(field_encrypted, ?) <-- this ?
apparently cant be resolved as SQL_TYPE and .Bind method fails.
AS field_decrypted" +
" FROM some_table WHERE id = 48084";
snip.
_______________________________________________
Informix-list mailing list
Informix-l... (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
  #6  
Old   
eferreyra
 
Posts: n/a

Default Re: Help with: System.ArgumentException in IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPEsqlT ype) - 01-03-2012 , 10:11 AM



Its downloadable from IBM ?

Anyway sp solution better for now, we have a lot of servers and
clients using Connect/CSDK still could test it in some server.

I once try one that was a lot of DB2 stuff and override my Informix
CSDK with old drivers, i hope isnt that one...

Thanks Art.

Reply With Quote
  #7  
Old   
Rajendra H Kamath
 
Posts: n/a

Default Re: Help with: System.ArgumentExceptionin IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPE sqlType) - 01-03-2012 , 10:15 AM



The DRDA driver suite infact has two drivers underneath, the
recommendation is to use the DB2.NET driver (supports Informix as well as
DB2).
Ref:
http://www.ibm.com/developerworks/da...ids/index.html

Regards,
Raj
"Setting an example is not the main means of influencing another, it is
the only means."
--Albert Einstein




From: Art Kagel <art.kagel (AT) gmail (DOT) com>
To: eferreyra <eferreyra (AT) gmail (DOT) com>
Cc: informix-list (AT) iiug (DOT) org
Date: 01/03/2012 09:13 PM
Subject: Re: Help with: System.ArgumentException in
IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPE sqlType)
Sent by: informix-list-bounces (AT) iiug (DOT) org



Try the DRDA driver, it tends to be faster for .NET and the .NET feature
support is a bit better also.

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly,
implicitly, or by inference. Neither do those opinions reflect those of
other individuals affiliated with any entity with which I am affiliated
nor those of the entities themselves.



On Tue, Jan 3, 2012 at 10:19 AM, eferreyra <eferreyra (AT) gmail (DOT) com> wrote:
Hi Art.

Informix SQLI driver

IBM Informix Client SDK 3.50.TC4DE (same problem with 3.70.TC3.WIN)



On 3 ene, 11:39, Art Kagel <art.ka... (AT) gmail (DOT) com> wrote:
Quote:
Is this the Informix SQLI driver or the "Universal" DRDA driver?

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog:http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly,
implicitly, or by inference. Neither do those opinions reflect those of
other individuals affiliated with any entity with which I am affiliated
nor
those of the entities themselves.







On Tue, Jan 3, 2012 at 9:00 AM, eferreyra <eferre... (AT) gmail (DOT) com> wrote:
Have found that the problem is to determine the TYPE of the first
DbCommand parameter, the first ?, if i use a constant value
concatenated in the string problem goes away.

Still my workaround is to create a stored procedure that receives the
varchars and return varchar so i can keep using parameters.

Yet, ugly bug. isnt there in ODBC provider.

string sql = "SELECT DECRYPT_CHAR(field_encrypted, ?) <-- this ?
apparently cant be resolved as SQL_TYPE and .Bind method fails.
AS field_decrypted" +
" FROM some_table WHERE id = 48084";
snip.
_______________________________________________
Informix-list mailing list
Informix-l... (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list
_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list
_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
  #8  
Old   
Rajendra H Kamath
 
Posts: n/a

Default Re: Help with: System.ArgumentExceptionin IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPE sqlType) - 01-03-2012 , 11:25 PM



The DRDA drivers now come packaged along with CSDK. It is referred to as
'IBM Data Server Driver Package'. If you are using CSDK 3.50xC6 or later
OR any version of CSDK 3.70 you must find it as part of the package. Yes,
the driver I was referring to is in the IBM.Data.DB2 namepsace. All of the
classes and functions might have a DB2 prefix, however this is the
recommended driver for new application development against Informix.

Do feel free to reach out if you need further assistance/help on this
issue. Thanks!

Regards,
Raj
"Setting an example is not the main means of influencing another, it is
the only means."
--Albert Einstein




From: eferreyra <eferreyra (AT) gmail (DOT) com>
To: informix-list (AT) iiug (DOT) org
Date: 01/03/2012 10:20 PM
Subject: Re: Help with: System.ArgumentException in
IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPE sqlType)
Sent by: informix-list-bounces (AT) iiug (DOT) org



Its downloadable from IBM ?

Anyway sp solution better for now, we have a lot of servers and
clients using Connect/CSDK still could test it in some server.

I once try one that was a lot of DB2 stuff and override my Informix
CSDK with old drivers, i hope isnt that one...

Thanks Art.

_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
  #9  
Old   
eferreyra
 
Posts: n/a

Default Re: Help with: System.ArgumentException in IBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPEsqlT ype) - 01-04-2012 , 05:31 AM



Thanks Raj, i was using 3.70 until i unistall to try 3.50 and see if
problem goes away, buy yet in both always using IBM.Data.Informix
provider.

Questions: with this driver and DRDA protocol:

Is other provider ? what is his name ? there is any pdf with the
reference ?
I have: IBM Informix .NET Provider Reference Guide 30.pdf

There is anything to change in the server to suport DRDA or it comes
built in and working ? (IDS 11.5x and later)
There is any technical pdf about DRDA ?

This fixes the issues of adding the provider to the several
machine.configs of different frameworks?

It still comes with ODBC driver named: IBM INFORMIX ODBC DRIVER ? can
we make the ODBC driver work with DRDA ?

Thanks, ill start another thread with more questions.

Enrique

Reply With Quote
  #10  
Old   
Art Kagel
 
Posts: n/a

Default Re: Help with: System.ArgumentException inIBM.Data.Informix.TypeMap.FromSqlType(SQL_TYPE sqlType) - 01-04-2012 , 08:22 AM



DRDA client support is built into the engine, you just have to define a new
DBSERVERALIAS for that connection protoco, put an entry for it in the
sqlhosts file using drtlitcp or drsoctcp as appropriate for your platform,
and bounce the engine.

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly,
implicitly, or by inference. Neither do those opinions reflect those of
other individuals affiliated with any entity with which I am affiliated nor
those of the entities themselves.



On Wed, Jan 4, 2012 at 6:31 AM, eferreyra <eferreyra (AT) gmail (DOT) com> wrote:

Quote:
Thanks Raj, i was using 3.70 until i unistall to try 3.50 and see if
problem goes away, buy yet in both always using IBM.Data.Informix
provider.

Questions: with this driver and DRDA protocol:

Is other provider ? what is his name ? there is any pdf with the
reference ?
I have: IBM Informix .NET Provider Reference Guide 30.pdf

There is anything to change in the server to suport DRDA or it comes
built in and working ? (IDS 11.5x and later)
There is any technical pdf about DRDA ?

This fixes the issues of adding the provider to the several
machine.configs of different frameworks?

It still comes with ODBC driver named: IBM INFORMIX ODBC DRIVER ? can
we make the ODBC driver work with DRDA ?

Thanks, ill start another thread with more questions.

Enrique

_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.