How can I spare bandwidth while using the site?
DQL exercise
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > Content Management System > DQL exercise 29 August 2008 14:34:56

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

DQL exercise

DUMAS RaphaГ«l 29 August 2008 14:34:56
 Hi group,

I begin with DQL ... and my first query is hard ;-)­

I would like to give user in user interface a dropdown list of a
custom attribute.
The aim is to populate this dropdown list with folder names which
located in my_docbase_cabinet/­myfolder/
With DAB I use query type in value assistance.
I cannot put in the query my_docbase_cabinet (root) as there :
select object_name from dm_folder where folder
('my_docbase_cabine­t/myfolder')
because if the docbase name change, it does not work so far.

If I execute this query :
1- select object_id as my id from dm_folder where object_name = 'myfolder'
(in my project i am sure that myfolder will not be use as a name for
other folder. If really dangerous I can create a custom type inherited
from dm_folder...
after that :
2- select object_name from dm_folder where folder (id('myid'))

there it works but how can I construct one single query to perform
this ambitious task ?

Raphael





Add comment
Brian Ashenfelter 26 May 2005 07:51:37 permanent link ]
 Something like:

select object_name from dm_folder where any i_folder_id in (select
r_object_id from dm_folder where object_name = 'myfolder')

Note: this will only go down one level in the folder hierachy and get
you the set of folders directly under "myfolder" (i.e. it won't
recursively get all sub-folders).

brian

--- In documentum-users-hH­KSG33TihhbjbujkaE4pw­@public.gmane.org, DUMAS RaphaГ«l <raphael-
dumas@t...> wrote:> Hi group,>
I begin with DQL ... and my first query is hard ;-)­>
I would like to give user in user interface a dropdown list of a> custom attribute.> The aim is to populate this dropdown list with folder names which> located in my_docbase_cabinet/­myfolder/> With DAB I use query type in value assistance.> I cannot put in the query my_docbase_cabinet (root) as there :> select object_name from dm_folder where folder> ('my_docbase_cabine­t/myfolder')> because if the docbase name change, it does not work so far.>
If I execute this query :> 1- select object_id as my id from dm_folder where object_name =
'myfolder'> (in my project i am sure that myfolder will not be use as a name for> other folder. If really dangerous I can create a custom type
inherited> from dm_folder...> after that :> 2- select object_name from dm_folder where folder (id('myid'))>
there it works but how can I construct one single query to perform> this ambitious task ?>
Raphael





Add comment
DUMAS RaphaГ«l 26 May 2005 11:59:54 permanent link ]
 Many thanks Brian !
It works perfectly
Now i have to construct a second DQL query : I have to display in a
second dropdown list the folder path of subfolders of the folder
selected in the first drop down list (attribute name =
myfolder_att ). This query works perfectly :
select distinct r_object_id,substr(­r_folder_path,29) as name from
dm_folder where folder ('/my_docbase_cabin­et/myfolder/$value
(myfolderatt)',DESC­END)
but it is not good in case :
- docbase name change
- length change if docbase name change ... 29
= '/my_docbase_cabine­t/myfolder/'

if someone could give advice, I really appreciate.

regards

--- In documentum-users-hH­KSG33TihhbjbujkaE4pw­@public.gmane.org, "Brian Ashenfelter"
<bashen7@y...> wrote:> Something like:>
select object_name from dm_folder where any i_folder_id in (select > r_object_id from dm_folder where object_name = 'myfolder') >
Note: this will only go down one level in the folder hierachy and
get > you the set of folders directly under "myfolder" (i.e. it won't > recursively get all sub-folders).>
brian>
--- In documentum-users-hH­KSG33TihhbjbujkaE4pw­@public.gmane.org, DUMAS RaphaГ«l <raphael-> dumas@t...> wrote:> > Hi group,> >
I begin with DQL ... and my first query is hard ;-)­> >
I would like to give user in user interface a dropdown list of a> > custom attribute.> > The aim is to populate this dropdown list with folder names which> > located in my_docbase_cabinet/­myfolder/> > With DAB I use query type in value assistance.> > I cannot put in the query my_docbase_cabinet (root) as there :> > select object_name from dm_folder where folder> > ('my_docbase_cabine­t/myfolder')> > because if the docbase name change, it does not work so far.> >
If I execute this query :> > 1- select object_id as my id from dm_folder where object_name = > 'myfolder'> > (in my project i am sure that myfolder will not be use as a name
other folder. If really dangerous I can create a custom type > inherited> > from dm_folder...> > after that :> > 2- select object_name from dm_folder where folder (id('myid'))> >
there it works but how can I construct one single query to
perform> > this ambitious task ?> >
Raphael





Add comment
DUMAS RaphaГ«l 30 May 2005 17:00:53 permanent link ]
 My DQL exercise is very tricky ...
Is there anyone who know how to recursively get all sub-folders of a
folder whithout use folder predicate :
FOLDER (ID(''), DESCEND) or FOLDER (ID(''), DESCEND) ?

--- In documentum-users-hH­KSG33TihhbjbujkaE4pw­@public.gmane.org, DUMAS RaphaГ«l <raphael-
dumas@t...> wrote:> Many thanks Brian !> It works perfectly> Now i have to construct a second DQL query : I have to display in
a > second dropdown list the folder path of subfolders of the folder > selected in the first drop down list (attribute name = > myfolder_att ). This query works perfectly :> select distinct r_object_id,substr(­r_folder_path,29) as name from > dm_folder where folder ('/my_docbase_cabin­et/myfolder/$value> (myfolderatt)',DESC­END)> but it is not good in case :> - docbase name change> - length change if docbase name change ... 29 > = '/my_docbase_cabine­t/myfolder/'>
if someone could give advice, I really appreciate.>
regards>
--- In documentum-users-hH­KSG33TihhbjbujkaE4pw­@public.gmane.org, "Brian Ashenfelter" > <bashen7@y...> wrote:> > Something like:> >
select object_name from dm_folder where any i_folder_id in
(select > > r_object_id from dm_folder where object_name = 'myfolder') > >
Note: this will only go down one level in the folder hierachy
and > get > > you the set of folders directly under "myfolder" (i.e. it won't > > recursively get all sub-folders).> >
brian> >
--- In documentum-users-hH­KSG33TihhbjbujkaE4pw­@public.gmane.org, DUMAS RaphaГ«l <raphael-> > dumas@t...> wrote:> > > Hi group,> > >
I begin with DQL ... and my first query is hard ;-)­> > >
I would like to give user in user interface a dropdown list of
custom attribute.> > > The aim is to populate this dropdown list with folder names
which> > > located in my_docbase_cabinet/­myfolder/> > > With DAB I use query type in value assistance.> > > I cannot put in the query my_docbase_cabinet (root) as there :> > > select object_name from dm_folder where folder> > > ('my_docbase_cabine­t/myfolder')> > > because if the docbase name change, it does not work so far.> > >
If I execute this query :> > > 1- select object_id as my id from dm_folder where object_name
= > > 'myfolder'> > > (in my project i am sure that myfolder will not be use as a
name > for> > > other folder. If really dangerous I can create a custom type > > inherited> > > from dm_folder...> > > after that :> > > 2- select object_name from dm_folder where folder (id('myid'))> > >
there it works but how can I construct one single query to > perform> > > this ambitious task ?> > >
Raphael





Add comment
Personal Son 30 May 2005 22:37:04 permanent link ]
 Raphael,

very tricky indeed:
dm_folder defines 2 attributes:
r_folder_path
i_ancestor_id

both provides you the mean to retrieve all folders within a folder


----- Original Message -----
From: "DUMAS RaphaГ«l" <raphael-dumas-IWqW­ACnzNjxGWvitb5QawA@p­ublic.gmane.org>
To: <documentum-users-h­HKSG33TihhbjbujkaE4p­w@public.gmane.org>
Sent: Monday, May 30, 2005 3:00 PM
Subject: [documentum-users] Re: DQL exercise


My DQL exercise is very tricky ...
Is there anyone who know how to recursively get all sub-folders of a
folder whithout use folder predicate :
FOLDER (ID(''), DESCEND) or FOLDER (ID(''), DESCEND) ?

--- In documentum-users-hH­KSG33TihhbjbujkaE4pw­@public.gmane.org, DUMAS RaphaГ«l <raphael-
dumas@t...> wrote:> Many thanks Brian !> It works perfectly> Now i have to construct a second DQL query : I have to display in
second dropdown list the folder path of subfolders of the folder> selected in the first drop down list (attribute name => myfolder_att ). This query works perfectly :> select distinct r_object_id,substr(­r_folder_path,29) as name from> dm_folder where folder ('/my_docbase_cabin­et/myfolder/$value> (myfolderatt)',DESC­END)> but it is not good in case :> - docbase name change> - length change if docbase name change ... 29> = '/my_docbase_cabine­t/myfolder/'>
if someone could give advice, I really appreciate.>
regards>
--- In documentum-users-hH­KSG33TihhbjbujkaE4pw­@public.gmane.org, "Brian Ashenfelter"> <bashen7@y...> wrote:> > Something like:> >
select object_name from dm_folder where any i_folder_id in
(select> > r_object_id from dm_folder where object_name = 'myfolder')> >
Note: this will only go down one level in the folder hierachy
you the set of folders directly under "myfolder" (i.e. it won't> > recursively get all sub-folders).> >
brian> >
--- In documentum-users-hH­KSG33TihhbjbujkaE4pw­@public.gmane.org, DUMAS RaphaГ«l <raphael-> > dumas@t...> wrote:> > > Hi group,> > >
I begin with DQL ... and my first query is hard ;-)­> > >
I would like to give user in user interface a dropdown list of
custom attribute.> > > The aim is to populate this dropdown list with folder names
which> > > located in my_docbase_cabinet/­myfolder/> > > With DAB I use query type in value assistance.> > > I cannot put in the query my_docbase_cabinet (root) as there :> > > select object_name from dm_folder where folder> > > ('my_docbase_cabine­t/myfolder')> > > because if the docbase name change, it does not work so far.> > >
If I execute this query :> > > 1- select object_id as my id from dm_folder where object_name
=> > 'myfolder'> > > (in my project i am sure that myfolder will not be use as a
name> for> > > other folder. If really dangerous I can create a custom type> > inherited> > > from dm_folder...> > > after that :> > > 2- select object_name from dm_folder where folder (id('myid'))> > >
there it works but how can I construct one single query to> perform> > > this ambitious task ?> > >
Raphael





Yahoo! Groups Links










Add comment
Arjun 29 August 2008 14:34:56 permanent link ]
 Is it possible to write inner queries in DQl for eg Select * from A.field1, B.field1 from (inner query 1 ) A, (inner query 2) B where A.field 1 <> B.field 2


Can someone please provide an example?

I am trying to accomplish the following:-

I have a folder hierarchy Say level 1,level2, level 3, level 4,level 5
For each level 1 , I need to pull some attributes of all level 5 objects under it .
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > Content Management System > DQL exercise 29 August 2008 14:34:56

see also:
[Caches on JBoss (Caches/JBoss)]…
[Benchmarking] - Re: Benchmark JBoss…
[Mail Services] - MailLog considered…
пройди тесты:
see also:
LOVE KNOWS NO BOUNDS-I SACRIFICED…
LIFE TOOK ME A LITTLE FAR AWAY. MY ONLY…
THE TIME MY SISTER STARTED HIDIN SOME…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .