How to add support for NEWSEQUENTIALID()

Posts   
 
    
gregkuha60
User
Posts: 47
Joined: 23-Jan-2012
# Posted on: 15-Sep-2014 10:14:23   

Hello

Sorry to ask this trivial question but i can't find the answer.

I'm trying to add support for NEWSEQUENTIALID in the designer, however i can't find out how. It's say like this in the documentation

".. To use this feature in LLBLGen Pro, you've to specify as the default for the primary key field in the table definition .." Where can i find the "table definition"?

http://www.llblgen.com/documentation/3.0/llblgen%20pro%20rtf/Using%20the%20generated%20code/gencode_dbspecificfeatures.htm

I have solved this by adding it in the database manually but it would be nice to do it in the designer.

Thank's for any guidance.

//Greg

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 15-Sep-2014 10:37:54   

In v4.2 we added support to define defaults in the designer, so starting with 4.2 you can define the default for the fields you want to have NEWSEQUENTIALID support for.

The default has to be defined on the field in the DB anyway, so even if it's defined at the designer level, the change has to be made in the DB as well. In v4.2 added defaults will result in an UPDATE DDL SQL script so the change will end up in the db that way.

When inserting a row, the field which has NEWSEQUENTIALID() as default will insert the value returned by the function call as the value for that field. A specific query is run right after the insert to obtain the inserted value (batched to the insert statement), and return it to engine to be inserted in the entity pk field. It only works for PK fields, and the field has to be null when inserted (so it's enough not to set it to a value).

Frans Bouma | Lead developer LLBLGen Pro
gregkuha60
User
Posts: 47
Joined: 23-Jan-2012
# Posted on: 15-Sep-2014 11:00:48   

There is no "field/column" naming default at entity editing. Where should i find this "input" for the default?

//Thanks greg

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 15-Sep-2014 11:31:02   

gregkuha60 wrote:

There is no "field/column" naming default at entity editing. Where should i find this "input" for the default?

//Thanks greg

http://www.llblgen.com/documentation/4.2/Designer/hh_goto.htm#Functionality%20Reference/TypeShortcuts.htm#Defaults

Again, it's introduced in v4.2. You referred to v3.0 in your previous link so I'm not sure what version you're using.

Frans Bouma | Lead developer LLBLGen Pro
gregkuha60
User
Posts: 47
Joined: 23-Jan-2012
# Posted on: 15-Sep-2014 12:00:15   

I have version 4.2 and the text is found under "Generated code - Database specific features"

Using%20the%20generated%20code/gencode_dbspecificfeatures.htm

I have now fixed it from your guidance.

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 15-Sep-2014 16:43:58   

gregkuha60 wrote:

I have version 4.2 and the text is found under "Generated code - Database specific features"

Using%20the%20generated%20code/gencode_dbspecificfeatures.htm

I have now fixed it from your guidance.

Thanks.

Yes, the runtime has documentation on it, but that's separate from the designer, as you can utilize this feature as well with a default defined in the database and not in the designer simple_smile So it comes down to: 'have the default present on the table field' and how that's done (manual edit, designer) is up to you. My apologies if that was confusing.

Frans Bouma | Lead developer LLBLGen Pro