 




<?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: opnqry</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/opnqry-6/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/opnqry-6/</link>
	<description></description>
	<lastBuildDate>Tue, 21 May 2013 09:44:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/opnqry-6/#comment-58866</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Mon, 29 Dec 2008 19:14:14 +0000</pubDate>
		<guid isPermaLink="false">#comment-58866</guid>
		<description><![CDATA[No, this can be very flexible.  You can build the string based on the
fields used by the user (Sample below) then use that sting in the
QRYSLT part of the ovrdbf.  The trick, as you know, is building it with
the absolute correct format.

DCL &amp;QRYSLT *CHAR 256

...

if (&amp;FLD1 &lt;&gt; &#039; &#039;) then do
   chgvar &amp;QRYSLT  (&#039;MyField = &#039;&#039;&#039; *cat &amp;Fld1 *cat &#039;&#039;&#039;)
enddo
if (&amp;FLD2 &lt;&gt; &#039; &#039;) then do
   if &amp;QRYSLT &lt;&gt; &#039; &#039; then do
        CHGVAR &amp;QRYSLT (%TRIM(&amp;QRYSLT) *cat &#039; *AND &#039;)
  enddo
         CHGVAR &amp;QRYSLT (%TRIM(&amp;QRYSLT) *cat &#039; MyField2 = &#039;&#039;&#039; *cat &amp;Fld2 *cart &#039;&#039;&#039;)
enddo

Phil]]></description>
		<content:encoded><![CDATA[<p>No, this can be very flexible.  You can build the string based on the<br />
fields used by the user (Sample below) then use that sting in the<br />
QRYSLT part of the ovrdbf.  The trick, as you know, is building it with<br />
the absolute correct format.</p>
<p>DCL &amp;QRYSLT *CHAR 256</p>
<p>&#8230;</p>
<p>if (&amp;FLD1 &lt;&gt; &#8216; &#8216;) then do<br />
   chgvar &amp;QRYSLT  (&#8216;MyField = &#8221;&#8217; *cat &amp;Fld1 *cat &#8221;&#8217;)<br />
enddo<br />
if (&amp;FLD2 &lt;&gt; &#8216; &#8216;) then do<br />
   if &amp;QRYSLT &lt;&gt; &#8216; &#8216; then do<br />
        CHGVAR &amp;QRYSLT (%TRIM(&amp;QRYSLT) *cat &#8216; *AND &#8216;)<br />
  enddo<br />
         CHGVAR &amp;QRYSLT (%TRIM(&amp;QRYSLT) *cat &#8216; MyField2 = &#8221;&#8217; *cat &amp;Fld2 *cart &#8221;&#8217;)<br />
enddo</p>
<p>Phil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anderson123</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/opnqry-6/#comment-58865</link>
		<dc:creator>Anderson123</dc:creator>
		<pubDate>Mon, 29 Dec 2008 19:13:02 +0000</pubDate>
		<guid isPermaLink="false">#comment-58865</guid>
		<description><![CDATA[hey thanks i get wat u say...just confirm if this is right..i have two values in a screen date1 and date2.the user can either fill in the date values or leave it blank...if dates are given then my qryslt will have date1=12122008 and date2=12122008.case 2 is wen date1 iss blank then qryslt have only date2=12122008 ..if there are two more combinations then 2 more qry are required...this seems ok for few comb but if there are more nos is there an alternate way...if this is the only way i will continue with the same]]></description>
		<content:encoded><![CDATA[<p>hey thanks i get wat u say&#8230;just confirm if this is right..i have two values in a screen date1 and date2.the user can either fill in the date values or leave it blank&#8230;if dates are given then my qryslt will have date1=12122008 and date2=12122008.case 2 is wen date1 iss blank then qryslt have only date2=12122008 ..if there are two more combinations then 2 more qry are required&#8230;this seems ok for few comb but if there are more nos is there an alternate way&#8230;if this is the only way i will continue with the same</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gilly400</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/opnqry-6/#comment-58855</link>
		<dc:creator>gilly400</dc:creator>
		<pubDate>Mon, 29 Dec 2008 15:18:32 +0000</pubDate>
		<guid isPermaLink="false">#comment-58855</guid>
		<description><![CDATA[Hi,

You can do it in one OPNQRYF statement - If you build your statement up depending on the parameters filled in by your user.  This is why the IF statements in the example above are used.  Alternatively you could use one OPNQRYF statement with OR&#039;s.  Something like this :-

OPNQRYF QRYSLT((A=&amp;A *OR &amp;A = &#039; &#039;) *AND (B=&amp;B *OR &amp;B = &#039; &#039;) *AND (C=&amp;C *OR &amp;C = &#039; &#039;))

Once again this is only to give you an idea of how to achieve this, the syntax may not work for you depending on your variables, etc.

Regards,

Martin Gilbert.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>You can do it in one OPNQRYF statement &#8211; If you build your statement up depending on the parameters filled in by your user.  This is why the IF statements in the example above are used.  Alternatively you could use one OPNQRYF statement with OR&#8217;s.  Something like this :-</p>
<p>OPNQRYF QRYSLT((A=&amp;A *OR &amp;A = &#8216; &#8216;) *AND (B=&amp;B *OR &amp;B = &#8216; &#8216;) *AND (C=&amp;C *OR &amp;C = &#8216; &#8216;))</p>
<p>Once again this is only to give you an idea of how to achieve this, the syntax may not work for you depending on your variables, etc.</p>
<p>Regards,</p>
<p>Martin Gilbert.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anderson123</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/opnqry-6/#comment-58852</link>
		<dc:creator>Anderson123</dc:creator>
		<pubDate>Mon, 29 Dec 2008 13:21:23 +0000</pubDate>
		<guid isPermaLink="false">#comment-58852</guid>
		<description><![CDATA[sorry Am not clear..... wat i meant was depending on the combinations of select parameters given in the screen i require opnqry to select recrds from a file.So if user gives n number of combinations will i require n number of opnqry statements?]]></description>
		<content:encoded><![CDATA[<p>sorry Am not clear&#8230;.. wat i meant was depending on the combinations of select parameters given in the screen i require opnqry to select recrds from a file.So if user gives n number of combinations will i require n number of opnqry statements?</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.014 seconds using memcached
Object Caching 310/313 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-21 10:00:55 -->