Skip to content

Instantly share code, notes, and snippets.

@arleyhr
Created June 3, 2018 14:03
Show Gist options
  • Save arleyhr/7c7256bf38ef74c3ebe1a9ad63da1e02 to your computer and use it in GitHub Desktop.
Save arleyhr/7c7256bf38ef74c3ebe1a9ad63da1e02 to your computer and use it in GitHub Desktop.
UPDATE `>>tablenam<<` SET slug = lower(>>BASE_TEXT<<),
slug = replace(slug, '.', ''),
slug = replace(slug, '\'', '-'),
slug = replace(slug, '/', '-'),
slug = replace(slug,'š','s'),
slug = replace(slug,'Ð','Dj'),
slug = replace(slug,'ž','z'),
slug = replace(slug,'Þ','B'),
slug = replace(slug,'ß','Ss'),
slug = replace(slug,'à','a'),
slug = replace(slug,'á','a'),
slug = replace(slug,'â','a'),
slug = replace(slug,'ã','a'),
slug = replace(slug,'ä','a'),
slug = replace(slug,'å','a'),
slug = replace(slug,'æ','a'),
slug = replace(slug,'ç','c'),
slug = replace(slug,'è','e'),
slug = replace(slug,'é','e'),
slug = replace(slug,'ê','e'),
slug = replace(slug,'ë','e'),
slug = replace(slug,'ì','i'),
slug = replace(slug,'í','i'),
slug = replace(slug,'î','i'),
slug = replace(slug,'ï','i'),
slug = replace(slug,'ð','o'),
slug = replace(slug,'ñ','n'),
slug = replace(slug,'ò','o'),
slug = replace(slug,'ó','o'),
slug = replace(slug,'ô','o'),
slug = replace(slug,'õ','o'),
slug = replace(slug,'ö','o'),
slug = replace(slug,'ø','o'),
slug = replace(slug,'ù','u'),
slug = replace(slug,'ú','u'),
slug = replace(slug,'û','u'),
slug = replace(slug,'ý','y'),
slug = replace(slug,'ý','y'),
slug = replace(slug,'þ','b'),
slug = replace(slug,'ÿ','y'),
slug = replace(slug,'ƒ','f'),
slug = replace(slug, 'œ', 'oe'),
slug = replace(slug, '€', 'euro'),
slug = replace(slug, '$', 'dollars'),
slug = replace(slug, '£', ''),
slug = replace(slug, '?', '-'),
slug = replace(slug, '¿', '-'),
slug = trim(slug),
slug = replace(slug, ',', ''),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment