﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Teradata Forums / Data Warehousing  / Teradata   / COUNT and GROUP BY Stmt when SELECT returns zero. / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Teradata Forums</description><link>http://www.teradata.com/teradataforum/</link><webMaster>info@teradata.com</webMaster><lastBuildDate>Wed, 03 Dec 2008 20:52:19 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: COUNT and GROUP BY Stmt when SELECT returns zero.</title><link>http://www.teradata.com/teradataforum/Topic11083-1-1.aspx</link><description>hi,as it returns a blank...it means it didnt find any data(record) in the table to read. the SQLCODE it returned could be an indication of no data or end of data in the table.thx</description><pubDate>Wed, 21 May 2008 13:49:59 GMT</pubDate><dc:creator>SN</dc:creator></item><item><title>RE: COUNT and GROUP BY Stmt when SELECT returns zero.</title><link>http://www.teradata.com/teradataforum/Topic11083-1-1.aspx</link><description>SQLCODE as 1 is the indicator for a "warning but successful termination"...HTH!Regards,Adeel</description><pubDate>Wed, 21 May 2008 08:20:26 GMT</pubDate><dc:creator>Adeel.Chaudhry</dc:creator></item><item><title>COUNT and GROUP BY Stmt when SELECT returns zero.</title><link>http://www.teradata.com/teradataforum/Topic11083-1-1.aspx</link><description>SELECT count(distinct a.claim_ref_id)INTO    :v_RepClaimsTWFROM   fat_bse_cl_pay_cre_trans aJOIN     prt_lu_product bON       (a.product_id = b.product_id)WHERE (a.Reported_date_id between '2007/12/02' AND '2007/12/08'AND     b.Pr_Group_id not in ('1'))     -- if executed down to here 0 is the countGROUP BY a.claim_ref_idHAVING (CAST(sum((a.F_cl_total_reserve * a.f_exch_rate)) AS NUMERIC(18,2))) &amp;lt;&amp;gt; 0.00; -- if executed down to here the count is blank.  If records exist then you get a valid count, if there are no claims to group on the count is blank. I understand why but my code says if SQLCODE &amp;lt;&amp;gt; 0 THEN....leave procedure.Why does SQLCODE become 1 if the code executed okay?or can this be wrapped up somehow to return 0(zero)?</description><pubDate>Fri, 28 Mar 2008 10:36:42 GMT</pubDate><dc:creator>marcmc</dc:creator></item></channel></rss>