Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic SYNERGY (steve huntington)
Decrease font size
Increase font size
Topic Title: Query for all objects that have parralel branches ...
Topic Summary: is_hist_leaf() ...
Created On: 3-Nov-2004 16:30
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 3-Nov-2004 16:30
User is offline View Users Profile Print this message


Damien CARRIERE

Posts: 10
Joined: 4-Oct-2004

Hi,
i want to build a query that can show me all the object in my database that have parralel branches ...
Il know the keyword is_hist_leaf() which shows objetcs without successors but in a very big database, result is twoooo big ...

So if you have ideas ???

I think it is possible playing with "instance" parameter ...
But perhaps there is  an other solution ...

Regards.

PS : sorry for my english ;o)
Report this to a Moderator Report this to a Moderator
 18-Feb-2005 17:53
User is offline View Users Profile Print this message


Brenda Beagi

Posts: 2
Joined: 17-Feb-2005

Hi,

Here is some roughly written (not syntax tested) shell script code that might help you out.

UNIQ_ID=$$
TMP_WORKING_DIR="/tmp/{this_script_name}_${UNIQ_ID}"
SPLIT_FILES_PREFIX="subset_of_work_${UNIQ_ID}_"

ccm query -u  "recursive_is_member_of('$PROJECT_NAME,$PROJECT_VERSION','') and not type='project' and not type='dir'" -f "%name" > $TMP_WORKING_DIR/$TMP_FILE

split -l 500 $TMP_WORKING_DIR/$TMP_FILE $SPLIT_FILES_PREFIX

TARGET_FILES=`ls $TMP_WORK_DIR/$SPLIT_FILES_PREFIX*`
NUMBER_OF_SPLIT_FILES=`ls $TMP_WORK_DIR/$SPLIT_FILES_PREFIX* | wc -l | sed -e "s/ //g"`

for TARGET_FILES in $TARGET_FILES
do


    ### sudo code here
    ### Just call the following type of logic in a nohupped background process so that
    ### for the sake of speed, each file is getting processed at the same time.
{
    cat $TARGET_FILE |
    while read $TARGET_OBJECT
    do
       ccm query -u "name='$TARGET_OBJECT' and not has_successor(name='$TARGET_OBJECT')" \
          | wc -l | sed -e "s/ //g" | read NUMBER_OF_SUCCESSORS
       if [ "$NUMBER_OF_SUCCESSORS" > "1" ]
          echo "$TARGET_OBJECT"  > $TMP_WORK_DIR/${TARGET_FILE}.parallel_objects
       fi
    done
    echo "DONE" > $TMP_WORK_DIR/${TARGET_FILE}.done
}

done

### Run through a loop to determine when all of the background processing is done, collect the data
### and then you have your results

DONE="NO"

while [ "$NONE" = "NO" ]
do
   NUMBER_OF_DONE_FILES=`ls $TMP_WORK_DIR/*.done | wc -l | sed -e "s/ //g"`
   if [ "$NUMBER_OF_DONE_FILES" = "$NUMBER_OF_SPLIT_FILES" ]
   then
      DONE="YES"
      cat  $TMP_WORK_DIR/*.parallel_objects > $TMP_WORK_DIR/FINAL_RESULTS_FILE
   fi
   sleep 15
done

Good Luck,
Brenda Beagi

Report this to a Moderator Report this to a Moderator
 22-Feb-2005 15:35
User is offline View Users Profile Print this message


ludovic michoux

Posts: 8
Joined: 8-Feb-2005

Informix SQL is much faster on Big DB :


select name,cvtype,subsystem from compver
where id not in (select from_cv from relate)
and cvtype not in ('AC','base','project')
group by name,cvtype,subsystem having count(*) >1 ;

Regards,

Ludo

Report this to a Moderator Report this to a Moderator
 1-Mar-2005 07:56
User is offline View Users Profile Print this message


Damien CARRIERE

Posts: 10
Joined: 4-Oct-2004

ok thx i'm going to test on my window server. Regards Damien
Report this to a Moderator Report this to a Moderator
 2-Mar-2005 08:48
User is offline View Users Profile Print this message


Philipp Weißmann

Posts: 28
Joined: 12-Oct-2004

Hello Ludovic, how can you commit the mentioned query? Are you using a informix client? Has ccm an option to commit direct queries?

Philipp Weißmann
Report this to a Moderator Report this to a Moderator
 14-Mar-2005 13:26
User is offline View Users Profile Print this message


ludovic michoux

Posts: 8
Joined: 8-Feb-2005

Philipp,
You have to use "dbaccess" to access the informix db in direct.
You can embed the sql query in a script after you have defined a couple of variables. as in this shell example.

Regards,

L.

export database=/path/to/database
export CCM_HOME=/path/to/ccm_home
export INFORMIXDIR=$CCM_HOME/informix
export SQLEXEC=$INFORMIXDIR/lib/sqlturbo
export TBCONFIG=your_server_name_here
export PATH=$INFORMIXDIR/bin:$PATH
export INFORMIXSERVER=your_server_name_here

dbaccess $database << ThisIsTheEnd 2>/dev/null

select name,cvtype,subsystem from compver
where id not in (select from_cv from relate)
and cvtype not in ('AC','base','project')
group by name,cvtype,subsystem having count(*) >1 ;

ThisIsTheEnd

Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic SYNERGY forum.
There are currently 0 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 15:34.
There are currently 0 guests browsing this forum, which makes a total of 0 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.