You are on page 1of 11

Code:

To Create a table:

Create column table "KABIL_PRACTICE"."OVERTIME"

"E_ID"integer,

"E_NAME"Nvarchar(35),

"OVERTIME(in_Hrs)"Integer );

To Drop a table:

Drop table"KABIL_PRACTICE"."OVERTIME";

To Insert the values into a table:

Inser tinto"KABIL_PRACTICE"."OVERTIME"values (1,'Kabil',20);

Insertinto"KABIL_PRACTICE"."OVERTIME"values (2,'Nazeer',15);

Insertinto"KABIL_PRACTICE"."OVERTIME"values (3,'Kalai',10);

To Create function:
Create Function "KABIL_PRACTICE"."CONVERT_HRS"

(i_Hours integer)

returns result Decimal(34,2)

as begin

result := :i_Hours * 60;

End;
Table Function:
FUNCTION"USER2"."KABIL_PRACTICE::TBL_FN_DEMO" ( )
RETURNS Table(
"Order_ID"Decimal(8,1),
"Order_Date"Date,
"Order_Quantity"Decimal(5,1),
"Sales"Decimal(31,13)
)
LANGUAGE SQL SCRIPT
SQL SECURITY INVOKERAS
BEGIN
RETURN

select "Order_ID",
"Order_Date",
"Order_Quantity",
"Sales"
from"KABIL_PRACTICE"."SUPERSTORE_SALES";

END;

You might also like