V4RB - DB method that evaluates type of expression

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Jul 6 09:46:28 CDT 2005


On 7/6/05 1:48 AM, "Erne" <ernestogiannotta at tiscalinet.it> wrote:

Hi Erne,

Have you note that actually functions of Valentina can return result in any
type?

Yes, on default, RETURN TYPE of "Month(TableClients.Birthday)" is INT.

But you still can ask it as string,

    CreateStringField( "a",  50, "Month(TableClients.Birthday)" )

And this will work.
Or use that result as argument for next sting function, e.g. Concat()

So I do not see yet what task you can solve using this new function


> 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 :?)

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina-beta mailing list