Minggu, 04 April 2010

tugas2

Jawab :

1.

CREATE OR REPLACE FUNCTION HARI

RETURN VARCHAR 2 AS

BEGIN

RETURN “ HARI =” ;

END ;

CREATE OR REPLACE FUNCTION NAMA_HARI (A INTEGER )

RETURN INTEGER AS

BEGIN

0 := ‘ SENIN ‘ ;

1 := ‘SELASA’ ;

2 := ‘RABU’ ;

3 := ‘KAMIS’ ;

4 := ‘JUMAT’ ;

5 := ‘SABTU’ ;

6 := ‘MINGGU’ ;

RETURN NAMA_HARI ;

DECLARE

P VARCHAR ;

S VARCHAR ;

BEGIN

S := HARI ;

P := NAMA_HARI (3) ;

DBMS_OUTPUT.PUT_LINE (S) ;

DBMS_OUTPUT.PUT_LINE(TO_CHAR(P)) ;

END ;

2.

CREATE OR REPLACE FUNCTION LUAS_PP ( A IN NUMBER, B IN NUMBER ) RETURN VARCHAR AS LUAS NUMBER (10) ;

BEGIN

LUAS := A * B ;

RETURN (‘LUAS_PP =’ || LUAS );

END ;

0 komentar:

Posting Komentar

bagus sekali

Pages

Recent Comments

Introduction

Recent Posts