I saw a weird usage of SQL in a Java application. Apparently whomever had written the code did not understand how to generate a new Entity with Hibernate and retrieve it’s primary key, and created a pkey field on a table that was, sometimes, string + integer. And sometimes just integer. In the test code […]
February 12 2010 by
B-Drive in
Database |
DECLARE tokenString VARCHAR2 (256) := ‘Jim,Jerry,Jordan’; tokenLength NUMBER := 0; tokenDelimiter VARCHAR2 (1) := ‘,’; tokenChar VARCHAR2 (1) := ”; tokenIzed VARCHAR (30) := ”;BEGIN SELECT LENGTH (tokenString) INTO tokenLength FROM DUAL; FOR i IN 1 .. tokenLength LOOP SELECT SUBSTR (tokenString, i, 1) INTO tokenChar FROM DUAL; IF tokenChar = tokenDelimiter OR […]