 




<?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: Validate SQL and display the output</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/validate-sql-and-display-the-output/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/validate-sql-and-display-the-output/</link>
	<description></description>
	<lastBuildDate>Mon, 20 May 2013 12:39:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/validate-sql-and-display-the-output/#comment-115672</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Tue, 29 Jan 2013 11:53:18 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/validate-sql-and-display-the-output/#comment-115672</guid>
		<description><![CDATA[To check the SQL statement, pass it to the &lt;a href=&quot;http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fapis%2Fqsqchks.htm&quot; rel=&quot;nofollow&quot;&gt;Syntax Check SQL Statement (QSQCHKS) API&lt;/a&gt;. To display the output, there are three general ways.First, you can analyze the statement to determine the tables and libraries. Then determine the column list and retrieve the attributes of all columns that will be displayed. Define a SQL descriptor area (SQLDA) to hold column values according to their data types. You&#039;ll need to work out out ways to dynamically display values on a screen without declaring the fields in a display file. There are various MI APIs that would be helpful. Most likely, this will take a couple months to get working.Second, you could pass the SQL into a REXX function or the Qshell db2 utility, and let them do most of the work. The db2 utility would probably be easiest. Almost as easy and probably a little cleaner would be passing the statement into a generic QM query, and running STRQMQRY to list the output. It should only take a day or so to get a generic QM query working. Numerous examples can be downloaded.But third and probably best might be just to let the system do it all for you. Why create something that you already have on the system? Just let the users type the SQL into QM query and run it. All that needs to be done is to create QM profiles for the users who need it. Authorize the users only to SELECT statements and you&#039;re essentially done. There isn&#039;t even any need for syntax checking ahead of time.Tom]]></description>
		<content:encoded><![CDATA[<p>To check the SQL statement, pass it to the <a href="http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fapis%2Fqsqchks.htm" rel="nofollow">Syntax Check SQL Statement (QSQCHKS) API</a>. To display the output, there are three general ways.First, you can analyze the statement to determine the tables and libraries. Then determine the column list and retrieve the attributes of all columns that will be displayed. Define a SQL descriptor area (SQLDA) to hold column values according to their data types. You&#8217;ll need to work out out ways to dynamically display values on a screen without declaring the fields in a display file. There are various MI APIs that would be helpful. Most likely, this will take a couple months to get working.Second, you could pass the SQL into a REXX function or the Qshell db2 utility, and let them do most of the work. The db2 utility would probably be easiest. Almost as easy and probably a little cleaner would be passing the statement into a generic QM query, and running STRQMQRY to list the output. It should only take a day or so to get a generic QM query working. Numerous examples can be downloaded.But third and probably best might be just to let the system do it all for you. Why create something that you already have on the system? Just let the users type the SQL into QM query and run it. All that needs to be done is to create QM profiles for the users who need it. Authorize the users only to SELECT statements and you&#8217;re essentially done. There isn&#8217;t even any need for syntax checking ahead of time.Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RamvishakRamesh</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/validate-sql-and-display-the-output/#comment-115670</link>
		<dc:creator>RamvishakRamesh</dc:creator>
		<pubDate>Tue, 29 Jan 2013 10:54:56 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/validate-sql-and-display-the-output/#comment-115670</guid>
		<description><![CDATA[Meantime, I have used FETCH NEXT FROM CURSOR INTO:Data
Now the &#039;Data&#039; field&#160;has the result of the query, but as we cannot say how lengthy the result can be, I have declared it as 9999A and thinking about moving it onto a display file screen field. Any better suggestions? Instead of embedded SQL&#160;I thought about RUNSQLSTM, but it requires additional source file for the SQL statements and it gives a chance for someone to change the SQL inside the source file. So I am not going for that. Please give your suggestions
&#160;]]></description>
		<content:encoded><![CDATA[<p>Meantime, I have used FETCH NEXT FROM CURSOR INTO:Data<br />
Now the &#8216;Data&#8217; field&nbsp;has the result of the query, but as we cannot say how lengthy the result can be, I have declared it as 9999A and thinking about moving it onto a display file screen field. Any better suggestions? Instead of embedded SQL&nbsp;I thought about RUNSQLSTM, but it requires additional source file for the SQL statements and it gives a chance for someone to change the SQL inside the source file. So I am not going for that. Please give your suggestions<br />
&nbsp;</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 3/8 queries in 0.036 seconds using memcached
Object Caching 283/284 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-20 13:37:23 -->