Generating Log Code (Surrogate Key)
- String str1 = "select 'LOG' || replace(substr(quote(zeroblob((9 + 1) / 2)), 3, (9 - length('LOG') - length(max(IFNULL(e.LogID,0)+1)))), ''', '') || "
- +" max(IFNULL(e.LogID,0)+1) || '-' || strftime('%Y-%m-%d', date('now'))"
- +" from elog e ";
複製代碼 What happens when there are no rows in the
database initially.
Thanks |
|
|