Posts

CRUD Operation from HTML

Image
 -----------------------------CRUD OPERATION from html------------------------- ----------------------------html template-------------------------- <!DOCTYPE html> <html>     <head>         <title>Personal Information</title>         <!-- Latest compiled and minified CSS -->         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" />         <style>             .main-container {                 margin: 0 auto;                 display: flex;                 flex-direction: column;             }             .section-top {                 width: 600px; ...

How to insert and show blob images in form and report of Oracle Apex

Image
 ---------------------Source Code------------------------- CREATE TABLE emp_test ( emp_id number generated always as identity(start with 1 order), emp_name varchar2(100), emp_photo blob, photo_file_name varchar2(100), photo_mime_type varchar2(100), photo_last_update timestamp, constraint emp_test_pk primary key (emp_id)  ); -------------------show image------------------- <div class="img-box">     <img src="" alt="Photo" id="preview_img_id" /> </div> -------------------css code--------------------- .img-box {     display: flex;     flex-direction: column;     justify-content: center;     align-items: center; } .img-box img {     width: 120px;     max-height: 130px;     min-height: 100px;     border: 1px solid #ddd;     padding: 5px; } --------------------Report---------------------- select         decode(nvl(dbms_lob.getlength(EMP_PHOTO...

How to set apex public account's password limit life time.

Image
------------------Check User Status--------------------------------- select * from apex_release; select username      , account_status   from dba_users  where username in (        'ANONYMOUS'      , 'APEX_210200'      , 'APEX_LISTENER'      , 'APEX_PUBLIC_USER'      , 'APEX_REST_PUBLIC_USER'      , 'APEX_INSTANCE_ADMIN_USER'      , 'ORDS_PUBLIC_USER'      , 'ORDS_METADATA'      , 'PDBADMIN'      , 'SYS'      , 'XDB'  )  order by username; NOTE: Be sure that the new passwords for APEX accounts are the same passwords you set at the time of installing ORDS, otherwise, you will get an error. ------------------------Reason for being apex password expired/account locked---------------------- what is a profile? A profile is a set of limits on database resources and password access to the data...

How to print even numbers and odd numbers by PL/SQL

Image
 Even and Odd Numbers -------------------------------------------- Even numbers are divisible by 2 without remainders. They end in 0, 2, 4, 6, or 8.  Odd numbers are not evenly divisible by 2 and end in 1, 3, 5, 7, or 9. set serveroutput on; declare v_input number := 10; v_counter number := 1; v_odd_number clob; v_even_number clob; begin while (v_counter <= v_input) loop if (mod(v_counter, 2) = 0) then v_even_number := v_even_number||','||v_counter; else v_odd_number := v_odd_number||','||v_counter; end if; v_counter := v_counter+1; end loop; dbms_output.put_line('Even Numbers = '||trim(leading ',' from v_even_number)); dbms_output.put_line('Odd Numbers = '||trim(leading ',' from v_odd_number)); end; Result: Even Numbers = 2,4,6,8,10 Odd Numbers = 1,3,5,7,9

How to print prime numbers by PL/Sql

Image
 Prime Number -------------------------------------------- A prime number is a positive integer that has no positive integer divisors other than 1 and itself.   set serveroutput on; declare v_input number := 200; v_counter number := 2; v_flag boolean; v_result clob; begin while (v_counter <= v_input) loop v_flag := true; for i in 2..v_counter-1 loop if (mod(v_counter, i) = 0) then v_flag := false; exit; end if; end loop; if (v_flag = true) then v_result := v_result||','||v_counter; end if; v_counter := v_counter+1; end loop; dbms_output.put_line('Prime Numbers = '||trim( leading ',' from v_result)); end; Result:Prime Numbers = 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199

How to print factors of a particular number by PL/SQL

Image
 Factors of a particular number ------------------------------------------ A factor is a number that divides into another number exactly and without leaving a remainder.  set serveroutput on; declare v_input number := 125; v_counter number := 1; v_result clob; begin while (v_counter <= v_input) loop if (mod(v_input, v_counter) = 0) then v_result := v_result||','||v_counter; end if; v_counter := v_counter + 1; end loop; dbms_output.put_line(v_input||' Factor = '||trim(leading ',' from v_result)); end; Result: 125 Factors = 1,5,25,125

How to print Factorial by PL/SQL

Image
  Factorial -------------------------------------------- Factorial, in mathematics, the product of all positive integers less than or equal to a given positive  integer and denoted by that integer and an exclamation point.  Thus, factorial seven is written 7!, meaning 1 × 2 × 3 × 4 × 5 × 6 × 7. ----------------------Start Codes---------------- set serveroutput on; declare v_factorial number := 30; v_fact_products number := 1; v_counter number := 1; v_result clob; begin while (v_counter <= v_factorial) loop v_fact_products := v_fact_products*v_counter; v_result := v_result||'X'||(v_factorial-v_counter+1); v_counter := v_counter + 1; end loop; dbms_output.put_line(v_factorial||'!='||trim(leading 'X' from v_result)||'='||v_fact_products); end; Result: 30!=30X29X28X27X26X25X24X23X22X21X20X19X18X17X16X15X14X13X12X11X10X9X8X7X6X5X4X3X2X1=265252859812191058636308480000000