Jumat, 01 Maret 2019

Contoh UDF

Berikut beberapa contoh dari UDF yang telah dijelaskan sebelumnya.


1. sqliteboy_randstr('abcdef123456', 3, 8)
         -> 'e2e6'
2. sqliteboy_randstr2(3, 8)
         -> '"Z\@Z'
3. sqliteboy_randstr3(3, 8)
         -> 'nItJ8'
4. sqliteboy_randstr_simple()
         -> 'VUmDAQeJCpww9IjmiexrWRuRT6ZgpacKVdOA'
5. sqliteboy_is_datetime_format('2019-03-01 11:50:09', '%Y-%m-%d %H:%M:%S')
         -> 1
6. sqliteboy_time2('2019-03-01 11:51:21')
         -> 1332937221.0
7. sqliteboy_time3(1)
         -> 1970-01-01 07:00:01
         -> timezone is UTC+7
8. sqliteboy_time4(1)
         -> 1970-01-01 00:00:01
9. sqliteboy_time5('2010-11-12 13:14:15', '2011-12-13 14:15:16', 3)
         -> 9505.01694444
10. sqliteboy_time6(850, ' years ', ' months ', ' days ', 0)
         -> 850 years 0 months 0 days
11. sqliteboy_capitalize('halo semua', 0)
        -> 'Halo semua'
12. sqliteboy_justify('hello', 2, 10, 'x')
        -> 'xxhelloxxx'
13. sqliteboy_find('hello sqliteboy', 'e', 0, 0)
        -> 1
14. sqliteboy_reverse('haikal aufar')
        -> 'rafua lakiah'
15. sqliteboy_repeat(6, 3)
        -> '666'
16. sqliteboy_count('leo messi', 'o', 0)
        -> 1
17. sqliteboy_normalize_separator
          (',,,,,1,1,,  2,  3,  4,,,,', ',', 1, 1)
        -> '1,2,3,4'
18. sqliteboy_split0('s.q.l.i.t.e.b.o.y', '.', 1)
        -> 'q'
19. select sqliteboy_chunk('123456789', 3, '-', 1, 'x')
        -> '123-456-789'
20. sqliteboy_number_format(12345.1234, 0, ',', '.')
        -> '12.345'
21. sqliteboy_number_to_words('888', 'id')
        -> 'delapan ratus delapan puluh delapan'
22. sqliteboy_number_to_words('12', 'en1')
        -> 'twelve'
23. sqliteboy_split1('h.e.l.l.o.w.o.r.l.d', '.', 'test_split', 'c', 1)
        -> 10
24. sqliteboy_if('select 0 as if' , 'True', 'False')
        -> 'False'
25. sqliteboy_app_title()
        -> 'sqliteboy 1.73'
26. sqliteboy_var_set('a', 1000)
        -> 1
27. sqliteboy_var_get('b')
        -> hello
28. sqliteboy_var_del('a')
        -> 1
29. sqliteboy_strip_html('<b>ousmane</b>')
        -> 'ousmane'

Tidak ada komentar:

Posting Komentar