DQL: Hidden DQL Tricks and Behaviors

Here are a few DQL tricks and behaviors that are not always obvious.

  1. Using r_object_id in the select statement changes the resultset.

The following DQL for any r_folder_path will return multiple rows for the same object.

select object_name, r_folder_path from dm_folder where any r_folder_path is not nullstring

By adding r_object_id to the select statement, the resultset will contain only distinct r_object_id’s. In other words, will only return a single row for each object.

select object_name, r_folder_path from dm_folder where any r_folder_path is not nullstring

2. When using joins with recurring attributes, you need to use the DQL hint “enable (ROW_BASED)”

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s