Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Search metadata in command line??
bibulle
Is it possible to do a search metadata (in database) in command line????
I would like to have a DCRs list in output...
Find more posts tagged with
Comments
Adam Stoller
Can you be a bit more descriptive about what you are trying to do - and what the environement is that you are trying to do it in?
If the metadata has already been pushed into a DB - then you can probably use that DB's CLTs to perform queries on it. Alternatively you can create scripts or small programs using your favorite tools to do the same.
--fish
(Interwoven Senior Technical Consultant)
bibulle
Thank you for your help...
You have perfectly understanding what I mean. I have some metadata pushed in an oracle DB by DAS.
But do you know if some Perl corposants (for example) already exist to do this??? Or something likes that???
- I have read the file 'iwsearchmetadata.cgi' and 'iwsearchdcr.cgi'. They look like good for me but there are cgi's files...
Then?
Adam Stoller
There are a number of Perl modules out there for dealing with DB's - but generally you should probably be looking at the DBI and/or DBD modules for your particular DB.
The metadata search CGI's *could* probably be copied and modified to turn them into CLT-oriented utilities, but (a) that may be a violation of the copyright, (b) it may take longer than writing the code from scratch (since the entire UI basically has to change - and a large part of the CGI code is UI-driven)
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
You could just write SQL queries and invoke them via DD. The following 2 examples can be used to execute any arbitrary sql queries using DD. There are some pre-built queries in your DAS config files suchas showview which can be used similar to the search queries.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>^M
<data-deploy-configuration>^M
<client>^M
<deployment name="search">^M
<source>^M
<database db = "oradb:1521:utf8db"^M
user = "user"^M
password = "****"^M
vendor = "oracle"^M
table = "not-used">^M
<db-producer-query>^M
<![CDATA[^M
select PATH^M
from default_internet_book__book__main_br1_WORKAREA_ddtestwa
^M
where IW_STATE != 'NotPresent'^M
UNION ALL^M
select PATH^M
from default_internet_book__book__main_pradeeps_STAGING T1^M
where^M
not exists (^M
select 1^M
from default_internet_book__book__main_br1_WORKAREA_ddte
stwa T2^M
where T2.PATH = T1.PATH^M
)^M
order by 1^M
]]>^M
</db-producer-query>^M
</database>^M
</source>^M
<destinations>^M
<xml-formatted-data file="e:\cfgfiles\db2xml\xml.out" />^M
</destinations>^M
</deployment>^M
</client>^M
</data-deploy-configuration>
or
<deployment name="dosql">^M
<destinations>^M
<!-- Sybase SQL Anywhere 7.x -->^M
<database use ="sybase-sqlanywhere" ^M
table = "not-used-by-this-dosql-deployment">^
M
<!-- -->^M
<!-- Show the combined view of delta and -->^M
<!-- base tables -->^M
<!-- -->^M
<sql user-action="showview" type="query">^M
SELECT * FROM weather^M
WHERE NOT EXISTS (SELECT * FROM $mytablenameprefix^__weather__$mytablenamesu
ffix^M
WHERE $mytablenameprefix^__weather__$mytablenamesuffix.Path = weather.Path )
^M
UNION ALL ^M
SELECT * ^M
FROM $mytablenameprefix^__weather__$mytablenamesuffix^M
WHERE $mytablenameprefix^__weather__$mytablenamesuffix.State != 'NotPresent'
^M
</sql>^M
^M
<!-- -->^M
<!-- Show the files having DCR's -->^M
<!-- -->^M
<sql user-action="showpaths" type="query">^M
select Path from weather ^M
</sql>^M
^M
<!-- This deployment would not work if Referential Integrit
y is enforced -->^M
<sql user-action="drop" type="update">^M
drop table $mytablenameprefix^__weather__$mytablenamesuffix ^M
</sql>^M
</database>^M
</destinations>^M
</deployment>^M
bibulle
It's exactly what we want... Thank you! Wonderful!