Paquetes Pl Sql[1]

  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Paquetes Pl Sql[1] as PDF for free.

More details

  • Words: 131
  • Pages: 3
Especificación del Paquete: create or replace package pk_ventas is procedure ventasxvendedor; procedure ventasxdepartamento; function ventasxciudad (codigo_ciudad number) return number; end;

Cuerpo del Paquete: create or replace package body pk_ventas is procedure ventasxvendedor is nombre varchar2 (50); total number; cursor cursor1 is select nom_vendedor,sum(val_factura) as total from vendedor,cliente,factura where vendedor.cod_vendedor=cliente.cod_vendedor and cliente.cod_cliente=factura.cod_cliente group by nom_vendedor; begin for registro in cursor1 loop imprimir(registro.nom_vendedor||' '||registro.total); end loop; end; procedure ventasxdepartamento is nombre varchar2 (50); total number; cursor cursor1 is select nom_departamento,sum(val_factura) as total from departamento,ciudad,cliente,factura where departamento.cod_departamento=ciudad.cod_departamento and cliente.cod_ciudad=ciudad.cod_ciudad and cliente.cod_cliente=factura.cod_cliente group by nom_departamento; begin for registro in cursor1 loop imprimir(registro.nom_departamento||registro.total); end loop; end; function ventasxciudad(codigo_ciudad number) return number is total number; begin

select sum(val_factura)into total from ciudad,cliente,factura where ciudad.cod_ciudad=cliente.cod_ciudad and cliente.cod_cliente=factura.cod_cliente and ciudad.cod_ciudad=codigo_ciudad group by ciudad.cod_ciudad; return total; end; end;

Pantallas del Resultado

Related Documents

Paquetes Pl Sql[1]
April 2020 1
Paquetes Tecnicos
November 2019 17
Pl
May 2020 41
Pl
June 2020 27
Pl
May 2020 33
Pl
May 2020 59