Sign Up

Hey, Dev!
Are you looking for a forum full of active developers to help you?
So if you want to:
➡️ Get answers for your development issues
➡️ Help others
➡️ Write an article
➡️ Get rewarded for your active participation
Then you are going to love this place.

Have an account? Sign In


Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

OrclQA.Com

OrclQA.Com Logo OrclQA.Com Logo
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Blog
  • New Questions
  • Tutorials
    • Oracle Apex
    • Python
  • Tags
  • Users
  • Badges & Points
  • About
Home/Questions/Q 4390
Answered
Greg
Greg

Greg

  • 6 Questions
  • 7 Answers
  • 0 Best Answers
  • 57 Points
View Profile
  • 1
GregProfessional
Asked: January 4, 20212021-01-04T11:53:24+05:30 2021-01-04T11:53:24+05:30

APEX 20.2: Creating Karaoke screens

  • 1

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?

apex
  • 2
  • 154
  • 0
  • 0
  • Share
    • Share on Facebook
    • Share on Twitter
Answer

    2 Answers

    1. Vinish

      Vinish

      • 1 Question
      • 416 Answers
      • 39 Best Answers
      • 2k Points
      View Profile
      Best Answer
      Vinish Legendary
      2021-01-04T12:17:36+05:30Added an answer on January 4, 2021 at 12:17 pm

      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:

      Declare
         v_words varchar2(1000);
      Begin
         select song_words into v_words
            from song where song_id = :p1_song_id;
       
        htp.p(v_words);
      
      exception 
         when others then 
          htp.p('ERROR');
      End;

      Give any name to the above Ajax callback process, for example, AjxGetWords. Now call it using JavaScript below:

      apex.server.process('AjxGetWords',
      {
      pageItems : '#P1_SONG_ID' // page items to submit
      }
      ,
      {
      dataType : 'text', success : function(data)
      {
      if(data != 'ERROR') apex.item('P1_SONG_WORDS').setValue(data);
      }
      }
      )

      Try it.

      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
      • Greg

        Greg

        • 6 Questions
        • 7 Answers
        • 0 Best Answers
        • 57 Points
        View Profile
        Greg Professional
        2021-01-09T08:22:35+05:30Replied to answer on January 9, 2021 at 8:22 am

        Thanks. That works fine.

        • 0
        • Share
          Share
          • Share on Facebook
          • Share on Twitter

    You must login to add an answer.

    Forgot Password?

    Sidebar

    Ask Question
    Write a Post
    • Recent
    • Answers
    • Bheem

      What is best way to design school time table?

      • 0 Answers
    • OrclQA Wiki

      How to display file contents in MAC terminal app?

      • 1 Answer
    • Greg

      Displaying image in modal window

      • 3 Answers
    • Greg Grimes

      20.2 APEX: How can I pre-select the searchable column in ...

      • 0 Answers
    • ApexPadawan
      ApexPadawan added an answer Have you tried using the built in file browse item,… January 21, 2021 at 1:29 pm
    • ApexPadawan
      ApexPadawan added an answer First Add the following to CSS > Inline under Page… January 21, 2021 at 1:21 pm
    • Vinish
      Vinish added an answer Yes, this is also fine. January 19, 2021 at 3:25 pm
    • Greg
      Greg added an answer I tried your solution and it worked, but since I… January 19, 2021 at 3:23 pm
    • Vinish
      Vinish added an answer You can use the cat command to display file contents… January 19, 2021 at 10:41 am

    Recent Blog Posts

    • Vinish

      Copy URL to Clipboard on Button Click Examples

    • Vinish

      Find When Your Mac Was Last Shutdown

    • Vinish

      Oracle SELECT Statement

    • Vinish

      Python Append List to List Example

    • Vinish

      JavaScript Object Get Value by Key

    Explore

    • Home
    • Blog
    • New Questions
    • Tutorials
      • Oracle Apex
      • Python
    • Tags
    • Users
    • Badges & Points
    • About

    © 2020 OrclQA.Com. All Rights Reserved. Privacy Policy