Created
June 27, 2019 01:14
-
-
Save aldhinya/62edbd7c5c85d82d806a61b63a776e31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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