sql column default values

Posts   
 
    
jspanocsi
User
Posts: 145
Joined: 04-Mar-2005
# Posted on: 05-Jul-2006 17:51:33   

Is there any way to get to the default value in sql server of a field in a template?

Thanks

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 06-Jul-2006 04:30:41   

Could you please elaborate a bit. Possibly an example of what you are trying to achieve.

jspanocsi
User
Posts: 145
Joined: 04-Mar-2005
# Posted on: 06-Jul-2006 19:16:30   

in a template, I want to get the default value in sql server so I can set the property of the entity to this default value.

For instance I have a table with a field called AmountOfItems. There is an sql default on this field thats 100. I want the entity to set AmountOfItems to 100 when it's created.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 06-Jul-2006 23:48:39   

You can in an .lpt template read the TARGET field of an entity field (thus the field the entity field is mapped on) which has a property called DefaultValue, that's the value read from the meta-data.

Please check the project inspector plugin in v2 designer and the sdk reference manual.

Frans Bouma | Lead developer LLBLGen Pro
jspanocsi
User
Posts: 145
Joined: 04-Mar-2005
# Posted on: 10-Jul-2006 14:54:23   

Thanks!