Some Not-So-Obvious iDQL and iAPI Commands

I am willing to wager you are already familiar with the iAPI32* and iDQL32 command line clients for Documentum.  (If not, these clients allow you to run API commands and DQL queries from the operating system command line.  They can be found on the Content Server at %DM_HOME%\bin.) But did you know there are a few not-so-obvious commands that these clients posses that make them easier to use?

iAPI32

?

You can run DQL queries and retrieve query results directly from the iAPI32 interface by using the ‘?’ command. The ? command allows you to enter a DQL SELECT statement in iAPI32 and returns the results immediately, just like iDQL32.  This is a very handy if you are working in iAPI32 and need to run a quick query.

API>?,c,select r_object_id, object_name from dm_document where folder('/Temp');

----------------  -------------------------------------
090000018000151b  Room Upgrade Fri Oct 16 14:28:27 PDT
0900000180001d05  TargetSetup.Result
0900000180007941  VD Root
0900000180008d0d  test 3
090000018000d9dd  TargetSetup.Result
0900000180011900  xPlore_1.0_Deployment_Guide.pdf
etc...

The ? command also allows you to retrieve a collection (query result) formatted as a table instead of using the next() method to retrieve the rows one at a time.  For example:

API>readquery,c,select r_object_id, object_name from dm_document where folder('/Temp')
API>q0
API>?,c,q0
r_object_id       object_name
----------------  -----------------------------------------
090000018000151b  Room Upgrade Fri Oct 16 14:28:27 PDT 2009
0900000180001d05  TargetSetup.Result
0900000180007941  VD Root
0900000180008d0d  test 3
090000018000d9dd  TargetSetup.Result
0900000180011900  xPlore_1.0_Deployment_Guide.pdf
etc...

@

The @ command allows you to run an API script from the API> prompt.  Usually to run an API script, you specify it on the command line when starting iAPI32 by using the -r argument.  However, if you are already in iAPI32 and want to run a script, you can use the @ command to load and run it, saving you from having to exit and restart iAPI32.

API> @c:\temp\test.api
1 API> create,c,dm_document
1 090000018001c901 1
1 API> set,c,l,object_name
1 SET> test doc
1 OK 1
1 API> link,c,l,/Temp
1 OK 1
1 API> setfile,c,l,c:\temp\test.api,crtext
1 OK 1
1 API> save,c,l
1 OK 1
API>

Describe

The describe command allows you to retrieve the column names, types and sizes for object types and registered tables in the repository (i.e., describe them). This command can be really handy when you are trying to construct a query but are unsure of attribute names.

API>describe,c,type,dm_document
Type Name:    dm_document
SuperType Name:    dm_sysobject
Attributes:        86
object_name                      CHAR(255)
r_object_type                    CHAR(32)
title                            CHAR(400)
subje                            CHAR(192)
autho                            CHAR(48)    REPEATING
keywds                           CHAR(48)    REPEATING
etc...

The ? and describe commands work in both iAPI32 and the Webtop API Tester, the @ command only works in iAPI32.

iDQL32

The describe command works in iDQL32 too, but not in the DQL Editor of DA.

DQL>describe table dm_queue

Table Name:     dbo.dm_queue
Columns:        36
stamp                            CHAR(16)
stamp_i                          CHAR(16)
name                             CHAR(32)
sent_by                          CHAR(32)
date_sent                        TIME
event                            CHAR(64)
etc...

@

The @ command works in iDQL32 similarly to how it works in iAPI32.  It allows you to load and run a “script file” containing DQL commands.  The @ command does not work in the DA DQL Editor.

DQL>@c:\temp\test.dql
r_object_id       object_name
----------------  -----------------------------------------
090000018000151b  Room Upgrade Fri Oct 16 14:28:27 PDT 2009
0900000180001d05  TargetSetup.Result
0900000180007941  VD Root
0900000180008d0d  test 3
090000018000d9dd  TargetSetup.Result
0900000180011900  xPlore_1.0_Deployment_Guide.pdf
etc...

Shutdown

The shutdown command will shutdown the content server immediately (only if you are superuser, of course).  It provides no feedback, and is the same as shutting down the Docbase from Server Manager or the Windows Services control panel.

DQL>shutdown

The shutdown command works in both iDQL32 and the Webtop DQL Editor.

*Note, the use of iAPI32 is deprecated as of D6.
Advertisements

About Scott
I have been implementing Documentum solutions since 1997. In 2005, I published a book about developing Documentum solutions for the Documentum Desktop Client (ISBN 0595339689). In 2010, I began this blog as a record of interesting and (hopefully) helpful bits of information related to Documentum, and as a creative outlet.

2 Responses to Some Not-So-Obvious iDQL and iAPI Commands

  1. Pie says:

    Scott, thanks for this. One thing that I think way too many people forget is the ability to run DQL scripts. Reminding people of the long-time features is great.

    -Pie

    Like

  2. sahd says:

    scott i am trying to run the IAPI command but its saying command not found in linux env
    i am giving the bin/iapi

    its saying command not found
    how to run it and what env variable required to run it properly.
    l

    Like

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

%d bloggers like this: