Q:

PLSQL invalid number error after fetch

sorry if this is an confusing post and the style is not proper but this is my first question but im having an error after i want to fetch c_latlong :
the things he will fetch are:
LAT value : 50,9459744669855
LON value : 5,9704909091251
ORA-01722: invalid number
ORA-06512: at "DOMINOS.GETLATLONG", line 14
ORA-06512: at "DOMINOS.ZOEKWINKELVOORADRES2", line 34
ORA-06512: at line 9
This is the code i use:
create or replace FUNCTION getLatLong(v_postcode varchar2, v_huisnummer varchar2)  
RETURN varchar2  
IS  
  v_lat NVARCHAR2(38) ;  
  v_long NVARCHAR2(38);  
  v_postcode_id varchar2(200);  
  v_all varchar2(200);   
  CURSOR c_latlong IS  
     SELECT LAT, LON  
     FROM POSTCODE  
     WHERE POSTCODE =  v_postcode AND v_huisnummer BETWEEN MINNUMBER AND   MAXNUMBER;  
BEGIN  
  OPEN c_latlong;  
  FETCH c_latlong INTO v_lat, v_long;  
    v_all := v_lat || '-' || v_long;  
   -- print(v_all);  
    RETURN v_all;
  CLOSE c_latlong;
END getLatLong;

create or replace FUNCTION zoekWinkelVoorAdres2(v_postcode varchar2, v_huisnummer varchar2)  
RETURN varchar2  
IS  
  v_array_this apex_application_global.vc_arr2 := apex_util.string_to_table(getLatLong(v_postcode,v_huisnummer), '-');  
  v_temp_postcode varchar2(200);  
  v_temp_huisnummer varchar2(200);  
  v_temp_id varchar2(200);  
  v_temp_winkel apex_application_global.vc_arr2;  
  v_array dbms_sql.varchar2_table;  
  v_max number;  

  v_closest_winkel varchar2(200);  
  v_closest_dis varchar2(200);  

  CURSOR c_all_stores_max IS  
    SELECT count(*)  
    FROM WINKEL;  
  CURSOR c_all_stores IS  
    SELECT ID, POSTCODE, HUISNR  
    FROM WINKEL;  
  CURSOR c_select_dis IS  
  SELECT WINKEL_ID, DISTANCE   
  FROM allwinkeldis ORDER BY DISTANCE DESC;  
BEGIN  
  --DELETE FROM allwinkeldis;  
  OPEN c_all_stores_max;  
    FETCH c_all_stores_max INTO v_max;  
  CLOSE c_all_stores_max;  
  OPEN c_all_stores;  
    FOR i IN 1..v_max  
    LOOP  
      FETCH c_all_stores INTO v_temp_id, v_temp_postcode, v_temp_huisnummer;  
     -- print('-------------------1---------------------' ||v_temp_postcode);  
     print(getLatLong(v_temp_postcode,v_temp_huisnummer));  
      v_temp_winkel :=apex_util.string_to_table(getLatLong(v_temp_postcode,v_temp_huisnummer), '-');  
    --  print(v_temp_id || ' ' || v_temp_winkel(1) || ' ' || v_temp_winkel(2));  
     --   print('-------------------2---------------------');  
      --v_array(i) := v_temp_id ||','||distance(v_array_this(2), v_array_this(3),v_temp_winkel(2),  v_temp_winkel(3));  
      INSERT INTO allwinkeldis(winkel_id, distance) VALUES (v_temp_id, distance(v_array_this(1), v_array_this(2), v_temp_winkel(1),  v_temp_winkel(2)));  
      --print(v_temp_id ||' -------------- '||distance(v_array_this(2), v_array_this(3), v_temp_winkel(2),v_temp_winkel(3)));  
    END LOOP;  
  CLOSE c_all_stores;  
  OPEN c_select_dis;  
      FETCH c_select_dis INTO v_closest_winkel, v_closest_dis;  
  CLOSE c_select_dis;  
  print(v_closest_winkel || '--------------' || v_closest_dis);  

END zoekWinkelVoorAdres2;

A:

I'm not sure what is the data type of LAT and LON in your table POSTCODE. 
But whatever variables you define to fetch data into, they must match these types.
For examples, assuming that LAT and LON are of the type NVARCHAR2, then I would rewrite your declaration section as follows:
CREATE OR REPLACE FUNCTION getLatLong(v_postcode varchar2, v_huisnummer varchar2)  
RETURN varchar2  
IS  
  v_postcode_id varchar2(200);  
  v_all varchar2(200);  

  CURSOR c_latlong IS  
     SELECT LAT, LON  
     FROM POSTCODE  
     WHERE POSTCODE =  v_postcode AND v_huisnummer BETWEEN MINNUMBER AND   MAXNUMBER;  

     TYPE temp_nvarchar2 IS TABLE OF NVARCHAR2(38);
     v_lat   temp_nvarchar2;  
     v_long  temp_nvarchar2;  
BEGIN  
     ....

