V4RB - DB method that evaluates type of expression

Erne ernestogiannotta at tiscalinet.it
Wed Jul 6 00:48:13 CDT 2005


Hello Valentina Team,

I'd like to have a function in a Valentina Database Object
that I can pass an expression to and get the type of data returned by  
that expression

it's like asking for a field Type property, but applied to an expression

e.g.
I call the function (let's call it DataType(expression)):

iType = mDB.DataType("Concat(TableClients.Name, TableClients.Age)")

and I get a EVDataType.kTypeString value
(yep! EVDataType is a brand new set of enum constants)

or

iType = mDB.DataType("Month(TableClients.Birthday)")

and I get a EVDataType.kTypeInteger value

of course a vException error code should be returned
if the expression is wrong and can't be evaluated
(just as it does now when we try to pass a wrong expression to a  
MethodField)



this could be useful for many things
like creating abstract query classes
pass them parameters as variants
and let them build a proper SQL query expression



What do you think, feed it to Mantis :?)


Cool Runnings,
Erne.

/ |\ |\  | /
– |/ | \ | –
\ |\ |  \| \



More information about the Valentina-beta mailing list