<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: idql and its column output	</title>
	<atom:link href="https://www.dbi-services.com/blog/idql-and-its-column-output/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbi-services.com/blog/idql-and-its-column-output/</link>
	<description></description>
	<lastBuildDate>Fri, 24 Oct 2025 07:22:45 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Cesare Cervini		</title>
		<link>https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2786</link>

		<dc:creator><![CDATA[Cesare Cervini]]></dc:creator>
		<pubDate>Tue, 18 Jul 2023 16:29:14 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2786</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2772&quot;&gt;parmigiana di melanzane&lt;/a&gt;.

Hi Parmigiana,

The Dirty Trick #1 can be greatly simplified in gawk using the string variable FIELDWIDTHS, as described in paragraph 4.6.1 Processing Fixed-Width Data of the GAWK: Effective AWK Programming manual.
It works like this: set FIELDWIDTHS as a list of one-space separated field widths (including the 2-blank separator string), e.g. &quot;18 34 24 255&quot; for a &quot;select r_object_id, a_content_type, r_full_content_size, object_name from dm_document&quot;.
r_object_type is a 16-long character field, + 2 column separation characters, that&#039;s the 18 above; and so on for the other fields.
Then, you can extract the individual columns as usual using $1, $2, etc.
Because of idql&#039;s columnar output, this works very well.

To programmatically build the FIELDWIDTHS string, just parse the header&#039;s dashed separation line in the output. It gives you the column widths to assign to FIELDWIDTHS. To get that line, in the BEGIN {} section, use getline in a loop until the regexp &quot;^-+&quot; is satisfied (you may want to be more specific if it is too ambiguous). Then, iterate from 1 to NF and set widths[i] = length($i), or append directly the length($i) to FIELDWIDTHS with a separator space.

Of course, you can also go full procedural and use dmawk and the API functions to send a DQL query, retrieve and parse the result set line by line, column by column. In the aforementioned links, there are functions that do that, and more (e.g. return the full result set already parsed into an associative array). If your prefer gawk over dmawk, there is even a binding of the dmAPI to gawk. Also for python and perl, and for the JVM-based languages via the DFCs such as groovy or jython.

As you see, there are numerous work-arounds the idql output limitation, but if you must absolutely use idql/iapi, consider prefixing those tools with rlwrap (see link above); the piping facility of this tool can help parsing too.

Best regards,
Cesare]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2772">parmigiana di melanzane</a>.</p>
<p>Hi Parmigiana,</p>
<p>The Dirty Trick #1 can be greatly simplified in gawk using the string variable FIELDWIDTHS, as described in paragraph 4.6.1 Processing Fixed-Width Data of the GAWK: Effective AWK Programming manual.<br />
It works like this: set FIELDWIDTHS as a list of one-space separated field widths (including the 2-blank separator string), e.g. &#8220;18 34 24 255&#8221; for a &#8220;select r_object_id, a_content_type, r_full_content_size, object_name from dm_document&#8221;.<br />
r_object_type is a 16-long character field, + 2 column separation characters, that&#8217;s the 18 above; and so on for the other fields.<br />
Then, you can extract the individual columns as usual using $1, $2, etc.<br />
Because of idql&#8217;s columnar output, this works very well.</p>
<p>To programmatically build the FIELDWIDTHS string, just parse the header&#8217;s dashed separation line in the output. It gives you the column widths to assign to FIELDWIDTHS. To get that line, in the BEGIN {} section, use getline in a loop until the regexp &#8220;^-+&#8221; is satisfied (you may want to be more specific if it is too ambiguous). Then, iterate from 1 to NF and set widths[i] = length($i), or append directly the length($i) to FIELDWIDTHS with a separator space.</p>
<p>Of course, you can also go full procedural and use dmawk and the API functions to send a DQL query, retrieve and parse the result set line by line, column by column. In the aforementioned links, there are functions that do that, and more (e.g. return the full result set already parsed into an associative array). If your prefer gawk over dmawk, there is even a binding of the dmAPI to gawk. Also for python and perl, and for the JVM-based languages via the DFCs such as groovy or jython.</p>
<p>As you see, there are numerous work-arounds the idql output limitation, but if you must absolutely use idql/iapi, consider prefixing those tools with rlwrap (see link above); the piping facility of this tool can help parsing too.</p>
<p>Best regards,<br />
Cesare</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: parmigiana di melanzane		</title>
		<link>https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2774</link>

		<dc:creator><![CDATA[parmigiana di melanzane]]></dc:creator>
		<pubDate>Thu, 13 Jul 2023 12:50:51 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2774</guid>

					<description><![CDATA[Now I have browsed the C annex &quot;ISQL &#038; IAPI&quot; in &quot;DQL Reference Guide&quot; and discovered @ to include other script files (good!)
(and then, echo is not documented!).

And we are using some dirty tricks to get by and obtain output that is a bit more palatable later using gawk:
* Dirty trick #1 to delimit fields in a result row: select field1, &#039;##&#039; as c1, field2, etc
* Dirty trick #2 to delimit lines of a result set, echo #BEGIN xxx, echo #END xxx, before and after every query sentence
* And of course, as you do, matching the final counter for a result set of lines /^\([0-9]+ rows? affected\)/

Thanks!

-- Same IT minion from Barcelona]]></description>
			<content:encoded><![CDATA[<p>Now I have browsed the C annex &#8220;ISQL &amp; IAPI&#8221; in &#8220;DQL Reference Guide&#8221; and discovered @ to include other script files (good!)<br />
(and then, echo is not documented!).</p>
<p>And we are using some dirty tricks to get by and obtain output that is a bit more palatable later using gawk:<br />
* Dirty trick #1 to delimit fields in a result row: select field1, &#8216;##&#8217; as c1, field2, etc<br />
* Dirty trick #2 to delimit lines of a result set, echo #BEGIN xxx, echo #END xxx, before and after every query sentence<br />
* And of course, as you do, matching the final counter for a result set of lines /^\([0-9]+ rows? affected\)/</p>
<p>Thanks!</p>
<p>&#8212; Same IT minion from Barcelona</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Cesare Cervini		</title>
		<link>https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2773</link>

		<dc:creator><![CDATA[Cesare Cervini]]></dc:creator>
		<pubDate>Thu, 13 Jul 2023 07:21:30 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2773</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2772&quot;&gt;parmigiana di melanzane&lt;/a&gt;.

Hello Parmigiana,

The command-line tools iapi and idql are documented in Documentum Content Server DQL Reference Guide. Their command-line parameters are listed there along with the commands to comment a line (#), and the other commands you mentioned.
I totally agree with you about the limitations of those tools. In fact, they are so frustrating that I wrote several articles to work-around them, see for example the 2-part one here https://www.dbi-services.com/blog/enhancing-idql-iapi-with-rlwrap-part-i/ and https://www.dbi-services.com/blog/enhancing-idql-iapi-with-rlwrap-part-ii/. This one make idql and iapi actually quite usable.
If you just want a nice output from a DQL query, you can use the gawk filter presented here: https://www.dbi-services.com/blog/an-awk-filter-to-truncate-or-wrap-around-tabular-output/, or use the python output functions presented here https://www.dbi-services.com/blog/dctmapi-py-revisited/, or even write your own using the API interface to gawk (cf. https://www.dbi-services.com/blog/adding-a-documentum-extension-to-gawk-part-i/) or python (cf. https://www.dbi-services.com/blog/dctmapi-py-revisited).
There are several scripting languages that can be used with Documentum and the DMCL or DFCs API, cf. https://www.dbi-services.com/blog/a-few-scripting-languages-for-documentum/, so you can format the output the way you want.
Finally, if you work under  Windows, you can use the free dqMan GUI-based utility (https://dqman.com/download/) or DQL Buddy (https://www.informedgroup.com/products/dql-buddy/) which is free too.
I hope you&#039;ll find this information useful.
Best regards,
Cesare]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2772">parmigiana di melanzane</a>.</p>
<p>Hello Parmigiana,</p>
<p>The command-line tools iapi and idql are documented in Documentum Content Server DQL Reference Guide. Their command-line parameters are listed there along with the commands to comment a line (#), and the other commands you mentioned.<br />
I totally agree with you about the limitations of those tools. In fact, they are so frustrating that I wrote several articles to work-around them, see for example the 2-part one here <a href="https://www.dbi-services.com/blog/enhancing-idql-iapi-with-rlwrap-part-i/" rel="ugc">https://www.dbi-services.com/blog/enhancing-idql-iapi-with-rlwrap-part-i/</a> and <a href="https://www.dbi-services.com/blog/enhancing-idql-iapi-with-rlwrap-part-ii/" rel="ugc">https://www.dbi-services.com/blog/enhancing-idql-iapi-with-rlwrap-part-ii/</a>. This one make idql and iapi actually quite usable.<br />
If you just want a nice output from a DQL query, you can use the gawk filter presented here: <a href="https://www.dbi-services.com/blog/an-awk-filter-to-truncate-or-wrap-around-tabular-output/" rel="ugc">https://www.dbi-services.com/blog/an-awk-filter-to-truncate-or-wrap-around-tabular-output/</a>, or use the python output functions presented here <a href="https://www.dbi-services.com/blog/dctmapi-py-revisited/" rel="ugc">https://www.dbi-services.com/blog/dctmapi-py-revisited/</a>, or even write your own using the API interface to gawk (cf. <a href="https://www.dbi-services.com/blog/adding-a-documentum-extension-to-gawk-part-i/" rel="ugc">https://www.dbi-services.com/blog/adding-a-documentum-extension-to-gawk-part-i/</a>) or python (cf. <a href="https://www.dbi-services.com/blog/dctmapi-py-revisited" rel="ugc">https://www.dbi-services.com/blog/dctmapi-py-revisited</a>).<br />
There are several scripting languages that can be used with Documentum and the DMCL or DFCs API, cf. <a href="https://www.dbi-services.com/blog/a-few-scripting-languages-for-documentum/" rel="ugc">https://www.dbi-services.com/blog/a-few-scripting-languages-for-documentum/</a>, so you can format the output the way you want.<br />
Finally, if you work under  Windows, you can use the free dqMan GUI-based utility (<a href="https://dqman.com/download/" rel="nofollow ugc">https://dqman.com/download/</a>) or DQL Buddy (<a href="https://www.informedgroup.com/products/dql-buddy/" rel="nofollow ugc">https://www.informedgroup.com/products/dql-buddy/</a>) which is free too.<br />
I hope you&#8217;ll find this information useful.<br />
Best regards,<br />
Cesare</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: parmigiana di melanzane		</title>
		<link>https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2772</link>

		<dc:creator><![CDATA[parmigiana di melanzane]]></dc:creator>
		<pubDate>Wed, 12 Jul 2023 11:59:17 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/idql-and-its-column-output/#comment-2772</guid>

					<description><![CDATA[I am discovering it, trying to use it for some rutinary batch data extractions, and I can&#039;t believe that the output of documentum idql is so useless.

Are there any reference for the not-so-obvious commands like: go, echo, quit, # comment, etc?

Anyway, thankyou for showing the way,

-- Some IT minion in sunny, hot and humid Barcelona]]></description>
			<content:encoded><![CDATA[<p>I am discovering it, trying to use it for some rutinary batch data extractions, and I can&#8217;t believe that the output of documentum idql is so useless.</p>
<p>Are there any reference for the not-so-obvious commands like: go, echo, quit, # comment, etc?</p>
<p>Anyway, thankyou for showing the way,</p>
<p>&#8212; Some IT minion in sunny, hot and humid Barcelona</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: www.dbi-services.com @ 2026-10-23 00:12:32 by W3 Total Cache
-->