Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 20 Oct 2010 @ 09:57:56 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Provider does not support conversion from VarChar to System.Boolean
 
From:   Anomy Anom

<-- Anonymously Posted: Wednesday, October 20, 2010 05:46 -->

     ++++++++++++++++++++++++++++++++++++++++++
     m_UserHierarchy.IsDefault =
                             m_DataReader.GetBoolean( m_Columns[ (int)enumColumn.IsDefault]
     );//**********Here is the provider error happening


     private enum enumColumn: int
                 {
                       Tel_ID,
                       TelHierr_ID,
                       ApplicationAlias,
                       TelNode_ID,
                       IsDefault
                 }

     private int[] m_Columns;
     +++++++++++++++++++++++++++++++++++++++++++++++

I could not get to bottom of the .Net constructs. enum datatype confuses me a little. Appreciate your explanation.

Ashish,

(1) I have few questions on the way the subscriptor to the array is passed. I believe it is an integer enumerated data type.Isn't it ? If so, are you expecting a variable character to be stored as part of usage. Below statement what confuses me.

You quoted "Isdefault column, Output is of type varchar".

(2) If say "IsDefault" holds a character and we are expecting it to convert to an integer after the cast. And since the m_Columns is an integer type array then there is a problem. Are we be sure we are not going out of bounds ? How big is m_Columns[].

But enum is made to hold of type "int". Can it take char/varchar ?

(3) If say we are in the limits and a character is converted to integer and an array value is accessed and what logic you are intending

     say anything other than 0 is -> False  / 'f'
                             Non zero -> TRUE / 't'

If we have reached (3) without the issues in (1) and (2) a small c program can be converted to udf.

Hope it helps in moving forward. Do you know how this works in other Databases.

One more question is, Also what are the valid set of values you are passing to this call? It can be linked to (1) and (2) above.

Regards.



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023