Generate case-insenitive ORacel DDL

Posts   
 
    
Scottie
User
Posts: 11
Joined: 24-Oct-2013
# Posted on: 24-Oct-2013 20:13:08   

I am using LLGLGen Pro 4.0 and when I generate Oracle DDL it generates as case sensitive (it puts the " character round all table names and attribute names". How do I get it to generate case insensitive code?

Thanks in advance.

Stuart

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-Oct-2013 07:33:10   

Hi Stuart,

You didn't mention your LLBLGen version, Oracle driver (MSOracle or ODP), or your templateSet (Adapter / SelfServicing).

Anyway, the following thread has a useful code for that. You override some classes and you are ready to emit insensitive sql (no quotes), it's for Adapter: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=20734&StartAtMessage=0&#116884

Hope helpful wink

David Elizondo | LLBLGen Support Team
Scottie
User
Posts: 11
Joined: 24-Oct-2013
# Posted on: 25-Oct-2013 17:08:12   

Sorry, we are using LLBLGen Pro version 4.0 Final with Oracle ODP Net.

Thanks for the code snippet we'll give it a go and see if we can get it to work.

Is there anyway that this could be added as an enhancement in a future version so that case insensitive/case sensitive could be a settable option when generating DDL?

thanks

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 26-Oct-2013 06:51:31   

Scottie wrote:

Thanks for the code snippet we'll give it a go and see if we can get it to work.

Ok. Let us know if you make it wink

Scottie wrote:

Is there anyway that this could be added as an enhancement in a future version so that case insensitive/case sensitive could be a settable option when generating DDL?

You could modify the DDL template yourself to make that little change. I think that if this is important for lots of users and you can justify it, it could be considered as a future feature.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 26-Oct-2013 10:21:23   

Is there a reason you don't want case sensitive names in oracle (as it's a case sensitive db, hence we put the quotes around the names) ?

Frans Bouma | Lead developer LLBLGen Pro
Rana
User
Posts: 11
Joined: 27-Oct-2013
# Posted on: 27-Oct-2013 22:26:18   

Otis wrote:

Is there a reason you don't want case sensitive names in oracle (as it's a case sensitive db, hence we put the quotes around the names) ?

There is a fair bit of code outside llbl in the form of stored procedures. So it's primarily for not having to migrate all of this and the convenience of not having to double quote all object names for new (hand-written) procedures.

I would imagine there are others in the same boat? A parameter based setting for this would be very useful.

Rana
User
Posts: 11
Joined: 27-Oct-2013
# Posted on: 27-Oct-2013 22:42:03   

daelmo wrote:

Ok. Let us know if you make it wink

Yes, it did work with a couple of exceptions:

CreateDynamicQueryEngine had to be overridden as follows:


        protected override DynamicQueryEngineBase CreateDynamicQueryEngine()
        {
            return this.PostProcessNewDynamicQueryEngine(new DynamicQueryEngineInsensitive());
        }

and the stored procedure names (schema.package.procedure format) were coming in quoted in CreateValidAlias. So we had to do a rawAlias.Trim('"');

With that it's working fine.

Thanks for the help.

Rana
User
Posts: 11
Joined: 27-Oct-2013
# Posted on: 27-Oct-2013 22:52:35   

I should also mention I'm speaking for Stuart here, not hijacking his thread.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 28-Oct-2013 10:05:15   

We'll see what we can do for v4.2 for this use case. Thanks for the feedback simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-May-2014 11:28:23   

The case insensitive setting for DQEs (db2, firebird, oracle and postgresql) is implemented in v4.2. There's no need for a setting in the designer as the designer has a feature for name casing already implemented: Relational model data element name casing case sensitive dbs. If set to AllUpperCase, all names for tables/schemas and the like are created as UPPER CASE names, which are equal to the names not being wrapped in "".

So a table called "FOO" will be targeted in the query SELECT * FROM Foo, as 'Foo' is not wrapped with quotes and will therefore be seen as 'FOO'.

Frans Bouma | Lead developer LLBLGen Pro
Rana
User
Posts: 11
Joined: 27-Oct-2013
# Posted on: 27-May-2014 03:00:58   

That's great. Thank you very much.