Dynamically concatenating a field.

Posts   
 
    
MattE avatar
MattE
User
Posts: 77
Joined: 11-Sep-2007
# Posted on: 19-Feb-2008 13:36:32   

Anyone tell me how I can do something like:

select 'xyz'+ foo.field from foo

To effectively append 'xyz' to each varchar field?

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 20-Feb-2008 00:36:39   

Hi MattE, a nice place to do what you want is in a type converter, download the sdk from the customer section a take a look to the sources of the built in typeconverters, you'll be surprised in how straight forward it is.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 20-Feb-2008 09:55:42   

To elaborate a bit (As I had to think it through as well what Gus meant wink ): you create a typeconverter which converts string to string, so no type change, but it prefixes every varchar field's value with 'xyz'. This is then done automatically for you.

Frans Bouma | Lead developer LLBLGen Pro