View Single Post
  #3 (permalink)  
Old June 10th, 2004, 07:23 PM
junemo junemo is offline
Authorized User
 
Join Date: Apr 2004
Location: malacca, malacca, Malaysia.
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to junemo
Default

Hi,you mean must separate to execute the query like this?

// Create SQL statement and issue query
$stmt = OCIparse($connection,"insert into bill (bill, ship, invdate, invno, po, dn, cur, pri, term) ".
      "values ('$bill', '$ship', '$invdate', '$invno', '$po', '$dn', '$cur', '$pri', '$term')");
OCIExecute($stmt,OCI_DEFAULT);

$stmt = OCIParse($connection,"insert into item (line, invno, po1, stock1, qty1, uom1, pri1, amo1, total) ".
     "values ('$line', '$invno', '$po1', '$stock1', '$qty1', '$uom1', '$pri1', '$amo1', '$total')");

OCIExecute($stmt,OCI_DEFAULT);

This also display same error msg.
Pass in a unique line number each time? But I must start line number 1 for new invoice each time.

item table(invno)foreign key-bill table.
My table:
CREATE TABLE bill
    (bill VARCHAR2 (512),
     ship VARCHAR2 (512),
     invdate DATE,
     invno VARCHAR2 (12) CONSTRAINT pk_invno PRIMARY KEY,
     po VARCHAR2 (12),
     dn VARCHAR2 (15),
      cur VARCHAR2 (15),
      pri VARCHAR2 (35),
      term VARCHAR2 (30) );

CREATE TABLE item
    (line VARCHAR2 (15) CONSTRAINT pk_line PRIMARY KEY,
     invno VARCHAR2 (12) CONSTRAINT fk_no REFERENCES bill,
     po1 VARCHAR2 (10),
     stock1 VARCHAR2 (2000),
     qty1 NUMBER (10),
     uom1 VARCHAR2 (5),
     pri1 VARCHAR2 (10),
     amo1 VARCHAR2 (10),
     total VARCHAR2 (10) );

Have any way to solve this problem?How?

Thanks in advance.