racer99 Posted November 22, 2006 Share Posted November 22, 2006 Quick question on what functions to use with a GROUP BY query that reads from a Oracle database. The problem is my current code is not giving me any output. I tried the exact same query in SQL Plus and it seems to work fine there. I just switched over from using ODBC stuff which worked fine so I think the problem resides in how I am using my oci functions. Anyway here is the code I am using...Any help is greatly appreiciated $query = "SELECT INCO_TERMS, SUM(QUOTE_TOTAL_QUAN) as sum, AVG(AVG_PRICE) as avg, AVG(AVG_FREIGHT) as avg1, AVG(AVG_NETBACK) as avg2 FROM SAPR3.ZPROTIVH WHERE SALES_PERSON_ID='$salesperson' GROUP BY INCO_TERMS"; $stmnt = oci_parse($connect,$query); $result = oci_execute($stmnt);$m=0; while (oci_fetch_row($stmnt)) { $FOBdelivered[$m] = oci_result($stmnt,"INCO_TERMS"); $totalQuan[$m]=oci_result($stmnt, "sum"); $avePrice[$m]=oci_result($stmnt,"avg"); $aveFreight[$m]=oci_result($stmnt,"avg1"); $aveNetback[$m]=oci_result($stmnt,"avg2"); $roundFreight[$m]=round($aveFreight[$m],3); $roundPrice[$m]=round($avePrice[$m],3); $roundNetback[$m]=round($aveNetback[$m],3); $m++; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.