I am still fairly new to Oracle SQL here, but I have scoured the internet to be able to just randomly pull a row from a table and saw a code like this.
firstNameGen = connection.prepareStatement(
"SELECT firstName "
+"FROM (SELECT firstName "
+"FROM firstNames "
+"ORDER BY dbms_random.value) "
+"WHERE ROWNUM = 1");
It is not working for me. Obviously, I did change all the column and table names to match my own database, but it just tells me "ERROR 42X01: Syntax error: Encountered "WHERE" at line 1, column 58."
I'm working in Eclipse. Do I need to import the functionality to use dbms_random or am I just missing something? Any help would be appreciated.