This content has been marked as final.
Show 2 replies

1. Re: i hate function.
ck May 1, 2013 7:26 AM (in response to 1002942)999939 wrote:
Functions is one of the main part of programming technics. You just want to get answer into your lesson given by your instructor. Please dont hate you just dont know it.
the only thing i hate about programming is function. if any of u got a spare time can u help me resolve this problem so i can study from it :)
PLEASE READ :
https://forums.oracle.com/forums/ann.jspa?annID=432
Create a function with the name get_distance. This function receives four parameters of the data type number. These parameters are actually two coordinates describing spatial information. The first coordinates (y1, x1), and the second coordinates (y2, x2), where yvalues indicate the distance in meters from the equator, and the xvalues indicate the distance in meters from the Greenwich meridian. The function should return the distance in meters between the two points.
this is simple example.. you can modified in simplified manner. Just try i dont have any sql available.
In order to solve the task, you should be familiar with the Pythagorean Theorem. PLSQL Builtinfunctions: SQRT(9) = 3, POWER(3,2) = 9.
function get_distance(y1 number, x1 number,y2 number, x2 number) return number is
distance := sqrt(power(y1x1,2) + power(y2x2,2)); try this also
distance number;
first_cor number;
second_cor number;
begin
first_cor := (y1x1);
second_cor := (y2x2);
distance := sqrt(power(first_cor,2) + power(second_cor,2));
return distance;
end get_distance;
based on this
The Distance Formula:
The distance formula is a method of determining the distance of a line segment between two points. It can be derived using the Pythagorean theorem.
The distance formula follows:
x and y are the x,y coordinates for the first point
a and b are the x,y coordinates for the second point
d is the distance between the two points
About the date
Please google it or look at the forms builder help about DATE FUNCTION, TO_CHAR FUNCTION, SYSDATE
Edited by: ck on May 1, 2013 12:26 AM 
2. Re: i hate function.
InoL May 3, 2013 5:16 PM (in response to 1002942)the only thing i hate about programming is function.
Then you must hate programming a lot! Programming is all about creating functions and procedures.