title: Changing data type from varchar to integer
body: <p>I'm trying to find the first free number (SYMBOL_ZAM) in a table and add 1, to make a unique one for my new record. First I'm selecting the last added number into a varchar variable (OST_SZUK_NR) and then I was trying to make field NOWY_SYMB_ZAM the same value as OST_SZUK_NR but declaring it as a integer, so I can add the 1, but it didn't work.
  Any tips how I can make this work?</p>
  
  <pre><code>begin
      -- POBRANIE DANYCH DO ZALOZENIA NAGLOWKA
       for select KATEGORIA, ROK_ZAM, SYMBOL_ZAM from M_ZAMWLASNE
       WHERE SYMBOL_ZAM =:symbol_zam_wyk
       into :KATEGORIA, :ROK_ZAM, :SYMBOL_ZAM
       DO begin
          -- STWORZENIE NAGLOWKA
  
          --OKRESLENIE DO KTOREJ BIBLIOTEKI WPADNIE OFERTA
          if (:KATEGORIA IN ('KOI','KOM','KOL')) then
              parametr='TOK';
          if (:KATEGORIA LIKE ('KOS')) then
              PARAMETR='SPA';
              --WYSZUKANIE NAJBLIZSZEGO WOLNEGO SYMBOLU ZLECENIA
              FOR select symbol_zam FROM m_zamwlasne 
              WHERE KATEGORIA=:parametr AND ROK_ZAM=:rok_zam
              ORDER BY symbol_zam desc
              INTO: OST_SZUK_NR
              --PRZEROBIENIE WYSZUKANEGO NUMERU Z VARCHAR NA INTEGER I DODANIE 1
              nowy_symb_zam=:ost_szuk_nr
              nowy_symb_zam=:nowy_symb_zam + 1
  </code></pre>