Skip to content

Instantly share code, notes, and snippets.

@aldhinya
Created June 27, 2019 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aldhinya/62edbd7c5c85d82d806a61b63a776e31 to your computer and use it in GitHub Desktop.
Save aldhinya/62edbd7c5c85d82d806a61b63a776e31 to your computer and use it in GitHub Desktop.
create or replace procedure hargatotal2(idpemesanan in integer)
IS
totalnya number;
jumlahnya number;
harganya number;
BEGIN
select a.jumlah into jumlahnya from detail_pemesanan a join produk b on a.id_produk = b.id_produk where a.id_pemesanan=idpemesanan;
select a.harga_satuan into harganya from produk a join detail_pemesanan b on a.id_produk = b.id_produk where b.id_pemesanan=idpemesanan;
totalnya :=jumlahnya*harganya;
update pemesanan set pemesanan.harga_total=totalnya where pemesanan.id_pemesanan=idpemesanan;
END;
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment