Jump to content

PHP oci functions


racer99

Recommended Posts

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++;
}   
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.