I am playing around with APEX creating a Karaoke screen as a learning exercise. This requires a dynamic action to read song words from a database and at intervals, automatically display a set of words on the screen.
If I use javascript, I find it can do everything but read a database.
If I use PL/SQL, I find it can do everything except refresh the screen during the song, so the only words I see on the screen are the last words of the song. [Note: I am updating the screen using: apex_util.set_session_state(‘P3_SONG_WORDS’, v_song_line);]
Are there any solutions to these problems?
You can execute PL/SQL code to read the value from the database using JavaScript. Below is an example:
Click on the process tab and then click on the Ajax Callback node and create a process. And add the PL/SQL code in it to get the song words, for example:
Give any name to the above Ajax callback process, for example, AjxGetWords. Now call it using JavaScript below:
Try it.
Thanks. That works fine.