Is there a way to access to the datatype used in the CREATE TABLE statement dynamically ?
For instance, let's say I have created this table :
CREATE TABLE myTable VALUES ( aText TEXT, anInteger INTEGER)
Later, I want to be able to access the values of each row and store them in the correct variable - a string variable and an int variable in my case.
But I want to have to test which column I'm accessing, I want this to be more "universal" - using the datatype entered when the table was created !
In other word, I don't want to have to code :
if (columnName == "aText")
{
...store the value in a string variable
}
if (columnName == "anInteger")
{
...store the value in an int variable
}I'd rather do this :
if (columnDataType == "TEXT")
...store the value in a string variable
}
if (columnDataType == "INTEGER")
{
...store the value in an int variable
}Is there a way to do this ?
How do you guys deal with this problem ? In other word, how do you make sure that you are storing a value from the database in the RIGHT datatype variable - a string on a string variable, an int on an int variable...
Thanks by advance !
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

