daily pastebin goal
10%
SHARE
TWEET

nin

a guest May 16th, 2018 136 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE  FUNCTION Bestiban(acc varchar)
  2. RETURNS varchar AS $$
  3. DECLARE num numeric;
  4. DECLARE DC varchar(2);
  5. BEGIN
  6.     SELECT CAST(replace(acc, ' ', '')|| '******' AS numeric) INTO num;
  7.     SELECT LPAD(CAST(98 - MOD(num, 97) AS varchar(2)), 2, '0') INTO DC;
  8.     RETURN 'ES' || DC || replace(acc, ' ', '');
  9. END;
  10. $$ LANGUAGE plpgsql;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top