Powered By Blogger

রবিবার, ৭ ডিসেম্বর, ২০২৫

To find missing or gap ID numbers in an Oracle table

 To find missing or gap ID numbers in an Oracle table, you can use a query that generates a sequence of numbers and then compares it to the existing IDs in your table.


Here's a common approach using a CONNECT BY clause to generate a series of numbers:


SELECT

    (SELECT MIN(id_column) FROM your_table) + LEVEL - 1 AS missing_id

FROM

    DUAL

CONNECT BY

    LEVEL <= (SELECT MAX(id_column) FROM your_table) - (SELECT MIN(id_column) FROM your_table) + 1

MINUS

SELECT

    id_column

FROM

    your_table;

শনিবার, ১১ অক্টোবর, ২০২৫

Go to on page top Button (No Page Refresh)

 

✅ 

1️⃣ Use a <button> or <a> that doesn’t submit

Replace your existing button HTML with this:

<button type="button" id="backToTopBtn" title="Go to top"> ⬆️ </button>

🔹 The key is type="button" — this prevents APEX or the browser from treating it as a form submit button.

Or, alternatively, use a link:

<a href="javascript:void(0)" id="backToTopBtn" title="Go to top">⬆️</a>

2️⃣ Keep the CSS (same as before)

#backToTopBtn { display: none; position: fixed; bottom: 40px; right: 40px; z-index: 9999; font-size: 22px; border: none; outline: none; background-color: var(--ut-button-primary-bg, #4CAF50); color: white; cursor: pointer; padding: 12px 16px; border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: all 0.3s ease; } #backToTopBtn:hover { background-color: var(--ut-button-primary-bg-hover, #45a049); transform: scale(1.1); }

3️⃣ Add the JavaScript (no refresh, smooth scroll)

Put this in Page → Execute when Page Loads:

// Show or hide the button when scrolling window.addEventListener("scroll", function () { const btn = document.getElementById("backToTopBtn"); if (document.documentElement.scrollTop > 100 || document.body.scrollTop > 100) { btn.style.display = "block"; } else { btn.style.display = "none"; } }); // Scroll smoothly to top when clicked (no page refresh) document.getElementById("backToTopBtn").addEventListener("click", function (e) { e.preventDefault(); // stop any default button action $('html, body').animate({ scrollTop: 0 }, 'slow'); });

💡 Tip:

If you’re using Universal Theme, you can even make the button blend with APEX styles by using:

#backToTopBtn { background-color: var(--ut-button-primary-bg); color: var(--ut-button-primary-text); } #backToTopBtn:hover { background-color: var(--ut-button-primary-bg-hover); }

✅ Result:

  • Appears when user scrolls down

  • Smoothly scrolls to top

  • No refresh / no page reload / no URL change

  • Looks native to APEX theme

শনিবার, ২৬ এপ্রিল, ২০২৫

Finding IP Address in apex

 To Find IP Address of the User who login in Apex


This is the very import as a developer prospective, normally we are tracking who user’s login name, date and time for monitoring purpose.

But I saw so many scenarios, some users are sharing his credentials, which is totally wrong. So by using below code, we can track the Ip Address of The user. So, any issues we can caught him.

It’s very important for user for those report, which are very important as company prospective.  

It’s available under owa_util package and another query available in Sys_context.

Query

 SELECT OWA_UTIL.GET_CGI_ENV('REMOTE_ADDR') IP_ADDESS_APP_USER FROM DUAL;

SELECT SYS_CONTEXT('USERENV', 'IP_ADDRESS', 15) IP_ADDESS_APP_USER FROM DUAL;


we can write the code Process > After Header


BEGIN

   INSERT INTO    xxxxcomany_apex_report_history (

                                         sa_username,

                                         sa_report_name,

                                         sa_page_id,

                                         sa_viewed_date,

                                         ip_address)

      (SELECT   

                :APP_USER,

                (SELECT   s.text

                   FROM   sify_procure_menu_ins s

                  WHERE   1 = 1 AND s.page_id = :APP_PAGE_ID)

                   text,

                :APP_PAGE_ID,

                SYSDATE,

    (SELECT OWA_UTIL.GET_CGI_ENV('REMOTE_ADDR') IP_ADDESS_APP_USER FROM DUAL) AS IP_ADDRESS


         FROM   DUAL);

END;


মঙ্গলবার, ১৫ এপ্রিল, ২০২৫

Finding Latitude and Longitude in oracle apex

 STEP 1:- CREATE A REGION WITH TWO ITEMS ONE IS LAT AND LONG


STEP 2:- THIS CODE PASTE INTO YOUR REGION STATIC CONTENT



<a id="geoError"></a>


STEP 3:- GO TO YOUR PAGE SECTION Function and Global Variable Declaration PASTE THIS CODE




function getLocation() {

var x=document.getElementById("geoError");

if (navigator.geolocation) {

navigator.geolocation.getCurrentPosition(

 function setPosition(position) {

// x.innerHTML="setPosition:"+position.coords.latitude;

 $s("P1_LATITUDE" , position.coords.latitude);

$s("P1_LONGITUDE", position.coords.longitude);

 }

,function (error)

{

switch(error.code) 

{

case error.PERMISSION_DENIED:

x.innerHTML="User denied the request for Geolocation."

break;

case error.POSITION_UNAVAILABLE:

x.innerHTML="Location information is unavailable."

break;

case error.TIMEOUT:

x.innerHTML="The request to get user location timed out."

break;

case error.UNKNOWN_ERROR:

x.innerHTML="An unknown error occurred."

break;

}

}    

,{timeout:10000});

x.innerHTML="Success";

}

else

x.innerHTML="Geolocation is not supported by this browser.";

}




STEP 4 :- ON PAGE LOAD EXECUTE JAVASCRIPT CODE


getLocation();

রবিবার, ১২ জানুয়ারি, ২০২৫

Row-level “Add” icon using a virtual column (APEX-safe)

1️⃣ Enable Insert in the Interactive Grid IG → Attributes Edit → Allowed Add Row → Yes 2️⃣ Add a New Column (Icon column) Column...