<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Answers &#187; iSeries SQL</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/tag/as400/iseries-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers</link>
	<description></description>
	<lastBuildDate>Tue, 18 Jun 2013 20:40:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Compare part of string to field</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/compare-part-of-string-to-field/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/compare-part-of-string-to-field/#comments</comments>
		<pubDate>Mon, 14 May 2012 10:40:46 +0000</pubDate>
		<dc:creator>Keithbrc</dc:creator>
				<category><![CDATA[iSeries SQL]]></category>
		<category><![CDATA[iseries v5r4]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hi.  Hopefully a simple one but beyond my self-taught abilities in iSeries SQL.  I have a file with one field containing customer order details including their purchase order reference such as &#8216;A1-123&#8242;.  The first part of the PO reference is a branch identifier.  Unfortunately, as it is a free text field, it is sometimes expressed [...]]]></description>
				<content:encoded><![CDATA[<p>Hi.  Hopefully a simple one but beyond my self-taught abilities in iSeries SQL.  I have a file with one field containing customer order details including their purchase order reference such as &#8216;A1-123&#8242;.  The first part of the PO reference is a branch identifier.  Unfortunately, as it is a free text field, it is sometimes expressed as &#8217;123-A1&#8242; instead.  I have another file containing branch details where &#8216;A1&#8242; = London etc.  So I need to look in my first file and find any orders where part of the order reference string matches the branch code in the branch details file.  I realise it will be an inefficient means of testing as I will also get erroneous matches but I can also check for the customer account number in the first file which should narrow it down.  I *think* the statement should be something like  SELECT * FROM FILE1 WHERE CUSTORD LIKE (SELECT * FROM FILE2) but clearly this is an oversimplification.  Any ideas? Thanks, Keith </p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/compare-part-of-string-to-field/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Change Initial Program</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/change-initial-program/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/change-initial-program/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 17:17:50 +0000</pubDate>
		<dc:creator>Rhinopop</dc:creator>
				<category><![CDATA[iSeries SQL]]></category>
		<category><![CDATA[SQL Profiler]]></category>
		<category><![CDATA[V5R1]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[how do you change the initial program and library for all user profiles preferrably using SQL.]]></description>
				<content:encoded><![CDATA[<p>how do you change the initial program and library for all user profiles preferrably using SQL.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/change-initial-program/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iSeries SQL case on AS/400</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/iseries-sql/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/iseries-sql/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 10:14:48 +0000</pubDate>
		<dc:creator>Alanlev</dc:creator>
				<category><![CDATA[AS/400 SQL]]></category>
		<category><![CDATA[DB2 SQL]]></category>
		<category><![CDATA[iSeries]]></category>
		<category><![CDATA[iSeries SQL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Is there an equivalent to case when exists on the as/400?]]></description>
				<content:encoded><![CDATA[<p>Is there an equivalent to case when exists on the as/400?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/iseries-sql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iSeries SQL ISNULL Equivalent</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/iseries-sql-isnull-equivalent/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/iseries-sql-isnull-equivalent/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 22:28:26 +0000</pubDate>
		<dc:creator>Jaggerdude</dc:creator>
				<category><![CDATA[AS/400]]></category>
		<category><![CDATA[iSeries Access]]></category>
		<category><![CDATA[iSeries Navigator]]></category>
		<category><![CDATA[iSeries SQL]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[What is the equivalent of the function ISNULL in t-sql in AS/400 iSeries Navigator SQL? or the equivalent of the NZ function in Access?]]></description>
				<content:encoded><![CDATA[<p>What is the equivalent of the function ISNULL in t-sql in AS/400 iSeries Navigator SQL? or the equivalent of the NZ function in Access?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/iseries-sql-isnull-equivalent/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Deleting unmatched records from a file in iseries SQL</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/deleting-unmatched-records-from-a-file/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/deleting-unmatched-records-from-a-file/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 17:31:31 +0000</pubDate>
		<dc:creator>PSMurray</dc:creator>
				<category><![CDATA[iSeries SQL]]></category>
		<category><![CDATA[iseries v5r4]]></category>
		<category><![CDATA[RPGSQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[V5R4]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Question Edited by Serena3]]></description>
				<content:encoded><![CDATA[Question Edited by Serena3]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/deleting-unmatched-records-from-a-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What does this mean when SQLCOD = -206? I need to write 2 sets embedded SQL statement in my program.</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sqlcod-206/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/sqlcod-206/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 19:06:53 +0000</pubDate>
		<dc:creator>Huana</dc:creator>
				<category><![CDATA[iSeries SQL]]></category>
		<category><![CDATA[SQL statements]]></category>
		<category><![CDATA[SQLRPGLE]]></category>
		<category><![CDATA[System i]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[what does this mean when SQLCOD = -206. I need to write 2 sets embedded SQL statement in my program. first one is one and I was able to fetch data but the 2nd one has error just right after I declare cursor. Here are the statements EVAL SQLSTMT2 = SELECT_H_2 + WHERE_H_2; + AND_H_A; [...]]]></description>
				<content:encoded><![CDATA[<p>what does this mean when SQLCOD = -206.  I need to write 2 sets embedded SQL statement in my program.  first one is one and I was able to fetch data but the 2nd one has error just right after I declare cursor.  Here are the statements<br />
EVAL    SQLSTMT2    = SELECT_H_2 + WHERE_H_2;<br />
                    + AND_H_A;                  </p>
<p>        EXEC SQL<br />
        PREPARE     S2 FROM :SQLSTMT2;          </p>
<p>        EXEC SQL<br />
        DECLARE     S2CURSOR CURSOR2 FOR S2;    </p>
<p>IF      SQLCOD  &lt; 0;<br />
        DUMP;<br />
        LEAVESR;<br />
ENDIF;</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/sqlcod-206/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Set DataTable name in returned data set</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/set-datatable-name-in-returned-data-set/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/set-datatable-name-in-returned-data-set/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 03:29:16 +0000</pubDate>
		<dc:creator>LordPerrin</dc:creator>
				<category><![CDATA[C# .NET]]></category>
		<category><![CDATA[DataTable name]]></category>
		<category><![CDATA[iSeries SQL]]></category>
		<category><![CDATA[SQL stored procedures]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have a SQL stored procedure with simple select statements that returns multiple datatables within the dataset.  The stored procedure is being called from C#/.NET code.  The stored procedure is returning the data but the datatable names end up Table, Table1, Table2,&#8230;  when the dataset is received on the .NET side.  Is there a way to define [...]]]></description>
				<content:encoded><![CDATA[<p>I have a SQL stored procedure with simple select statements that returns multiple datatables within the dataset.  The stored procedure is being called from C#/.NET code.  <br/><br/> The stored procedure is returning the data but the datatable names end up Table, Table1, Table2,&#8230;  when the dataset is received on the .NET side.  Is there a way to define the datatable name within the stored procedure that will be used in the dataset and seen on the .NET side?  <br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/set-datatable-name-in-returned-data-set/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Plus signs in fields when using a date from a file compared to the month and year function</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/plus-signs-in-fields-when-using-a-date-from-a-file-compared-to-the-month-and-year-function/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/plus-signs-in-fields-when-using-a-date-from-a-file-compared-to-the-month-and-year-function/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 14:08:53 +0000</pubDate>
		<dc:creator>LoriWood</dc:creator>
				<category><![CDATA[iSeries]]></category>
		<category><![CDATA[iSeries SQL]]></category>
		<category><![CDATA[SQL statement]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have included the complete SQL statement. I keep getting +++ in ontime and percent. select c.totallines, c.ontime, decimal(((c.ontime/c.totallines)*100),15,2) as percent from (select decimal(sum(b.totallines),15,2) as totallines, decimal(sum(b.ontime),15,2) as ontime from (select a.ord as ord, a.line as line, a.custreqdate as custreqdate, a.qtyord as qtyord, a.qtyship as qtyship, a.shipdate as shipdate, a.qtyinv as qtyinv, a.invdate as invdate, [...]]]></description>
				<content:encoded><![CDATA[<p>I have included the complete SQL statement. I keep getting +++ in ontime and percent. select c.totallines, c.ontime, decimal(((c.ontime/c.totallines)*100),15,2) as percent from (select decimal(sum(b.totallines),15,2) as totallines, decimal(sum(b.ontime),15,2) as ontime from (select a.ord as ord, a.line as line, a.custreqdate as custreqdate, a.qtyord as qtyord, a.qtyship as qtyship, a.shipdate as shipdate, a.qtyinv as qtyinv, a.invdate as invdate, a.totallines as totallines, (case when shipdate &lt;= custreqdate and qtyship &gt;= qtyord and shipdate &lt;&gt; 0 and month(date(digits(custreqdate) concat &#8217;000000&#8242;)) = month(curdate()) and year(date(digits(custreqdate) concat &#8217;000000&#8242;)) = year(curdate()) then 1 else (case when invdate &lt;= custreqdate and qtyinv &gt;= qtyord and invdate &lt;&gt; 0 and month(date(digits(custreqdate) concat &#8217;000000&#8242;)) = month(curdate()) and year(date(digits(custreqdate) concat &#8217;000000&#8242;)) = year(curdate()) then 1 else 0 end) end) as ontime from (select integer(avg(jord)) as ord, integer(avg(jline)) as line, integer(avg(jsdte)) as custreqdate, integer(avg(lqord)) as qtyord, ifnull(sum(llsqty),0) as qtyship, ifnull(max(llsdte),0) as shipdate, ifnull(sum(ilqty),0) as qtyinv, ifnull(max(siinvd),0) as invdate, 1 as totallines from erplxusrf/dcol inner join erplxf/ecl on jord=lord and jline=lline and jprod=lprod and jfac=licfac left outer join erplxf/lll on jord=llordn and jline=llolin and jprod=llprod and jfac=llfacl left outer join erplxf/sil on jord=ilord and jline=ilseq and jprod=ilprod left outer join erplxf/sih on ilord=siord and ilcust=sicust and ilinvn=siinvn where jfac=&#8217;010&#8242; and jseq=1 and jsdte between 20100501 and 20100527 and lqord&lt;&gt;0 group by jord,jline,jprod) a) b) c result is&#8230; Position to line . . . . . &#8230;.+&#8230;.1&#8230;.+&#8230;.2&#8230;.+&#8230;.3&#8230;.+&#8230;.4&#8230;.+&#8230;.5&#8230;.+&#8230;.6&#8230;.+.. TOTALLINES ONTIME PERCENT 3,382.00 +++++++++++++++++++++ +++++++++++++++++++++ ******** End of data ********</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/plus-signs-in-fields-when-using-a-date-from-a-file-compared-to-the-month-and-year-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iSeries SQL function in a SQL procedure &#8211; error: Function Name &#8220;in *LIBL type *N not found.&#8221;</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/iseries-sql-function-in-a-sql-procedure-error-function-name-in-libl-type-n-not-found/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/iseries-sql-function-in-a-sql-procedure-error-function-name-in-libl-type-n-not-found/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 16:36:41 +0000</pubDate>
		<dc:creator>Seeker1</dc:creator>
				<category><![CDATA[iSeries SQL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hi everyone.  I have created an SQL procedure using Create Procedure interactively after starting SQL with STRSQL on an iSeries V5R4.  I then created a function using the Create Function statement interactively in SQL on the iSeries.  I put the function in the select field prior to the where clause.  The function works interactively in a SQLRPGLE and the procedure works [...]]]></description>
				<content:encoded><![CDATA[<p>Hi everyone.  I have created an SQL procedure using Create Procedure interactively after starting SQL with STRSQL on an iSeries V5R4.  I then created a function using the Create Function statement interactively in SQL on the iSeries.  I put the function in the select field prior to the where clause.  The function works interactively in a SQLRPGLE and the procedure works without the function included in the select.  However, when I put the function in the select I receive the error message function name &#8220;in *LIBL type *N not found&#8221;.  I qualified the library in the create function statement and qualified the library on the &#8220;SPECIFIC&#8221; parameter.  Drilling down further in the error message indicates the external name and the usage name are different.  What am I missing here?   Thanks</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/iseries-sql-function-in-a-sql-procedure-error-function-name-in-libl-type-n-not-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQLRPGLE</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sqlrpgle-3/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/sqlrpgle-3/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 21:09:21 +0000</pubDate>
		<dc:creator>trishahles</dc:creator>
				<category><![CDATA[iSeries SQL]]></category>
		<category><![CDATA[SQLRPGLE]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I need to retrieve the RRN and use it within my RPGLE program. I have the Select RRN(file) statement, but I get a Character in Cast argument not valid when executing. Any suggestions?]]></description>
				<content:encoded><![CDATA[<p>I need to retrieve the RRN and use it within my RPGLE program. I have the Select RRN(file) statement, but I get a Character in Cast argument not valid when executing. Any suggestions?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/sqlrpgle-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</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/26 queries in 0.049 seconds using memcached
Object Caching 900/1022 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-06-18 23:54:24 -->