 




<?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: STRQMQRY</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/strqmqry/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/strqmqry/</link>
	<description></description>
	<lastBuildDate>Sat, 18 May 2013 20:55:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strqmqry/#comment-83450</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Tue, 09 Nov 2010 06:29:50 +0000</pubDate>
		<guid isPermaLink="false">#comment-83450</guid>
		<description><![CDATA[&lt;i&gt;It seems that someone might look at the query, before they looked at the CL and wouldn’t know what the &amp;Q&amp;PARM1&amp;Q was doing.&lt;/i&gt;

I wouldn&#039;t be expecting someone to be making changes without also testing. I&#039;m sure it could happen, but what would they do? Surely they&#039;re not going to be removing substitution parameters without knowing why they&#039;re there. If they do, then I&#039;m not clear what protections could be put in place.

But note that I used the variable name &quot;Q&quot; mostly for brevity. How about using the name &quot;apost&quot; or &quot;SnglQuote&quot; instead? The value in &quot;Q&quot; is shortness for examples and whatever help it gives keeping the SQL simple. Perhaps it also provokes a little curiosity. Some research into why it&#039;s there could be valuable in learning what substitution variables actually and how they can be used to advantage.

Is it better that the technique is never seen?

Tom]]></description>
		<content:encoded><![CDATA[<p><i>It seems that someone might look at the query, before they looked at the CL and wouldn’t know what the &amp;Q&amp;PARM1&amp;Q was doing.</i></p>
<p>I wouldn&#8217;t be expecting someone to be making changes without also testing. I&#8217;m sure it could happen, but what would they do? Surely they&#8217;re not going to be removing substitution parameters without knowing why they&#8217;re there. If they do, then I&#8217;m not clear what protections could be put in place.</p>
<p>But note that I used the variable name &#8220;Q&#8221; mostly for brevity. How about using the name &#8220;apost&#8221; or &#8220;SnglQuote&#8221; instead? The value in &#8220;Q&#8221; is shortness for examples and whatever help it gives keeping the SQL simple. Perhaps it also provokes a little curiosity. Some research into why it&#8217;s there could be valuable in learning what substitution variables actually and how they can be used to advantage.</p>
<p>Is it better that the technique is never seen?</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bigkat</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strqmqry/#comment-83396</link>
		<dc:creator>bigkat</dc:creator>
		<pubDate>Mon, 08 Nov 2010 14:58:01 +0000</pubDate>
		<guid isPermaLink="false">#comment-83396</guid>
		<description><![CDATA[Tom
Since this was popped back onto the active questions, I like your &quot;trick&quot; of coding the &lt;i&gt;&amp;Q&lt;/i&gt; parm for the single quote.  It makes it easy to get them in the right places, but do you find it confuses others who may have to support the code in the future?  It seems that someone might look at the query, before they looked at the CL and wouldn&#039;t know what the &lt;i&gt;&amp;Q&amp;PARM1&amp;Q&lt;/i&gt; was doing.]]></description>
		<content:encoded><![CDATA[<p>Tom<br />
Since this was popped back onto the active questions, I like your &#8220;trick&#8221; of coding the <i>&amp;Q</i> parm for the single quote.  It makes it easy to get them in the right places, but do you find it confuses others who may have to support the code in the future?  It seems that someone might look at the query, before they looked at the CL and wouldn&#8217;t know what the <i>&amp;Q&amp;PARM1&amp;Q</i> was doing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hishamkhafagi</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strqmqry/#comment-83366</link>
		<dc:creator>hishamkhafagi</dc:creator>
		<pubDate>Sun, 07 Nov 2010 14:44:49 +0000</pubDate>
		<guid isPermaLink="false">#comment-83366</guid>
		<description><![CDATA[also check if you pass a character variable then you need to pass it&#039;s lenght + 2 to anther variable which must contain single cottation + your variable + single cottation ( &#039; *cat &amp;var *cat &#039;)]]></description>
		<content:encoded><![CDATA[<p>also check if you pass a character variable then you need to pass it&#8217;s lenght + 2 to anther variable which must contain single cottation + your variable + single cottation ( &#8216; *cat &amp;var *cat &#8216;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strqmqry/#comment-69339</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Thu, 22 Oct 2009 02:00:19 +0000</pubDate>
		<guid isPermaLink="false">#comment-69339</guid>
		<description><![CDATA[Variables do not need to be enclosed in quotes.

Substitution variable &lt;i&gt;names&lt;/i&gt; &lt;b&gt;might&lt;/b&gt; need to be inquotes if the names contain lower-case letters -- QM substitution variable names are case-sensitive. Use upper-case names and quotes aren&#039;t needed.

Also, the SQL statement might contain elements that rely on quotes. E.g.:
&lt;pre&gt;select col1, col2, col3 from table where col3=&#039;literalvalue&#039;&lt;/pre&gt;
For that statement, you might create your QM query like this:
&lt;pre&gt;select col1, col2, col3 from table where col3=&amp;PARM1&lt;/pre&gt;
Because you removed the quotes when you put the substitution variable in, you have to replace the quotes when the substitution value is passed in. It seems that most people will concatenate quote-marks with the literal value in CL before passing it in. I prefer a different way:
&lt;pre&gt;select col1, col2, col3 from table where col3=&amp;Q&amp;PARM1&amp;Q&lt;/pre&gt;
I simply mark any spot where I want a quote-mark with a new substitution variable -- &amp;Q.

The STRQMQRY SETVAR() parameter can then include SETVAR((Q &#039;&#039;&#039;&#039;) (PARM1 &#039;literalvalue&#039;))

The Q variable simply gets the quote-mark and it&#039;s placed wherever I marked it.

Tom]]></description>
		<content:encoded><![CDATA[<p>Variables do not need to be enclosed in quotes.</p>
<p>Substitution variable <i>names</i> <b>might</b> need to be inquotes if the names contain lower-case letters &#8212; QM substitution variable names are case-sensitive. Use upper-case names and quotes aren&#8217;t needed.</p>
<p>Also, the SQL statement might contain elements that rely on quotes. E.g.:</p>
<pre>select col1, col2, col3 from table where col3='literalvalue'</pre>
<p>For that statement, you might create your QM query like this:</p>
<pre>select col1, col2, col3 from table where col3=&amp;PARM1</pre>
<p>Because you removed the quotes when you put the substitution variable in, you have to replace the quotes when the substitution value is passed in. It seems that most people will concatenate quote-marks with the literal value in CL before passing it in. I prefer a different way:</p>
<pre>select col1, col2, col3 from table where col3=&amp;Q&amp;PARM1&amp;Q</pre>
<p>I simply mark any spot where I want a quote-mark with a new substitution variable &#8212; &amp;Q.</p>
<p>The STRQMQRY SETVAR() parameter can then include SETVAR((Q &#8221;&#8221;) (PARM1 &#8216;literalvalue&#8217;))</p>
<p>The Q variable simply gets the quote-mark and it&#8217;s placed wherever I marked it.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jsellick</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strqmqry/#comment-66744</link>
		<dc:creator>jsellick</dc:creator>
		<pubDate>Tue, 11 Aug 2009 10:31:26 +0000</pubDate>
		<guid isPermaLink="false">#comment-66744</guid>
		<description><![CDATA[Have you enclosed the variables with quotes?
If not, QMQRY won&#039;t recognise them as valid values and will prompt.
When running in batch it can&#039;t prompt, which is why the job fails.
Each variable needs to be enclosed in quotes, so for example &amp;CDTE must be defined with length 9.
Then CHGVAR VAR(&amp;CDTE) VALUE( &#039;&#039;&#039;&#039; *CAT CDTEI *CAT &#039;&#039;&#039;&#039;)]]></description>
		<content:encoded><![CDATA[<p>Have you enclosed the variables with quotes?<br />
If not, QMQRY won&#8217;t recognise them as valid values and will prompt.<br />
When running in batch it can&#8217;t prompt, which is why the job fails.<br />
Each variable needs to be enclosed in quotes, so for example &amp;CDTE must be defined with length 9.<br />
Then CHGVAR VAR(&amp;CDTE) VALUE( &#8221;&#8221; *CAT CDTEI *CAT &#8221;&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yorkshireman</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strqmqry/#comment-66552</link>
		<dc:creator>yorkshireman</dc:creator>
		<pubDate>Thu, 06 Aug 2009 14:18:53 +0000</pubDate>
		<guid isPermaLink="false">#comment-66552</guid>
		<description><![CDATA[Then you want to run the clle in debug and check what&#039;s going on 


Capture the precise command as constructed and run it from the command line.]]></description>
		<content:encoded><![CDATA[<p>Then you want to run the clle in debug and check what&#8217;s going on </p>
<p>Capture the precise command as constructed and run it from the command line.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sorella</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strqmqry/#comment-66541</link>
		<dc:creator>sorella</dc:creator>
		<pubDate>Thu, 06 Aug 2009 12:37:53 +0000</pubDate>
		<guid isPermaLink="false">#comment-66541</guid>
		<description><![CDATA[If I run STRQMQRY in batch mode I can bypass the prompt, but the command fails with error QWM2701.]]></description>
		<content:encoded><![CDATA[<p>If I run STRQMQRY in batch mode I can bypass the prompt, but the command fails with error QWM2701.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/9 queries in 0.018 seconds using memcached
Object Caching 352/355 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-18 22:10:40 -->