Category Archives: Oracle PL/SQL

SQL to convert Comma Separated String to Rows

Convert Comma separated List to rows SELECT TRIM( SUBSTR ( txt , INSTR (txt, ‘,’, 1, level ) + 1 , INSTR (txt, ‘,’, 1, level+1 ) – INSTR (txt, ‘,’, 1, level) -1 ) ) AS u FROM ( … Continue reading

Posted in Oracle PL/SQL | Tagged , | Leave a comment

SQL Method to generate random Date or text in Oracle SQL

This function will provide a random string with uppercase and lowercase characters create or replace function random_str(v_length number) return varchar2 is my_str varchar2(4000); begin for i in 1..v_length loop my_str := my_str || dbms_random.string( case when dbms_random.value(0, 1) < 0.5 … Continue reading

Posted in Oracle PL/SQL | Tagged , | Leave a comment

How to fill a increasing values in a column of a table?

How to fill a increasing values in a column of a table? Lets assume we have a tableTable name : test Name Value Yogesh 0 Yogesh 0 Yogesh 0 Yogesh 0 Yogesh 0 Suresh 0 Suresh 0 Requirement : to … Continue reading

Posted in Database, Oracle, Oracle PL/SQL, Server Side Programming | Tagged , | Leave a comment