Thank LJ, Partgeter, The set field using $LASTCOUNT$ right-after direct SQL set field does not return the correct count. It seems Remedy does not populate this keyword from the direct SQL. Changing to SELECT COUNT(*) as CNT still no luck...
Still exploring other options... if not, we may need to do a set field action in Remedy with the "Set Field If" part equivalent to the "WHERE" clause in the SQL statement to get the $LASTCOUNT$ On Thu, Mar 18, 2010 at 1:14 PM, Pargeter, Christie :CO IS <cparg...@lhs.org > wrote: > ** > Also try not using the word Count in your AS section. Sometimes DBs don't > like you using their reserved words here. What happens if you just do > SELECT COUNT(*) from ... then try SELECT COUNT(*) as CNT from ... > > ------------------------------ > *From:* Action Request System discussion list(ARSList) [mailto: > arsl...@arslist.org] *On Behalf Of *LJ Longwing > *Sent:* Thursday, March 18, 2010 12:48 PM > *To:* arslist@ARSLIST.ORG > *Subject:* Re: Return SQL Count to Remedy > > ** > When you do your 'select request_id...' query, create another setfield > after that one and set the field you want with $LASTCOUNT$....that's the > count of the last search performed...in this case your direct sql select > statement. > > ------------------------------ > *From:* Action Request System discussion list(ARSList) [mailto: > arsl...@arslist.org] *On Behalf Of *Andrew Fremont > *Sent:* Thursday, March 18, 2010 1:43 PM > *To:* arslist@ARSLIST.ORG > *Subject:* Return SQL Count to Remedy > > ** Hi, > > We have some direct SQL in filter action to write data to file on server, > and > we also want to get a number of rows from direct SQL. > > Is it possible to return the count from the SQL to remedy? > > We're able to get the column values from the "SQL Result Column" 1 - 10, > but could find the way to get the count. > > "SELECT Request_Id ..." returns expected values in "SQL Result Column" 1 > - 10 > "SELECT COUNT(*) as Count ..." returns NULL for all columns > > > ARS 7.0.1 P005 > MS SQL 2005 > Win Server 2003 > MT- 7.1 P006 > Microsoft IIS ServletExec/5.0p06 > > Andrew. > Thanks > > _Platinum Sponsor: rmisoluti...@verizon.net ARSlist: "Where the Answers > Are"_ _Platinum Sponsor: rmisoluti...@verizon.net ARSlist: "Where the > Answers Are"_ > _Platinum Sponsor: rmisoluti...@verizon.net ARSlist: "Where the Answers > Are"_ > _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"