Search This Blog

Wednesday, September 20, 2017

Copy Table From Database to Another Database Using Copy SQLPlus Command

Using SQLPlus copy command

SQL> COPY {FROM database | TO database | FROM database TO database} {APPEND|CREATE|INSERT|REPLACE} destination_table [(column, column, column, ...)]
USING query

example - (from any machine in your network)

SQL> copy from hr/hr@orcl to scott/tiger@orcl2 create employees_copy using 
select * from employees ;


Be carefull- SQLPlus COPY supports only the following datatypes:

    CHAR
    DATE
    LONG
    NUMBER
    VARCHAR2

Wednesday, September 6, 2017

How to make a boot able pen drive



How to make a boot able pen drive: 
cmd: diskpart
:list disk
:select disk (number of your pen drive like; 1) (Please be careful to select disk, Disk 0 is always may hard disk) 
:clean ( to format all )
:create partition primary
:active
:format fs=fat32 quick 
:assign

Tuesday, September 5, 2017

Email Validation in Oracle Apex 5

Steps...

Step 1. Create a item type as Textfield .

Step 2. Create Validation on this Textfield and select Validation>>Type >> Item Match Regular Expression.
Step 3. Then type this code in Regular Expression .Always Execute will >>No

Email Validation Expression:


^[a-zA-Z0-9][a-zA-Z0-9\.\-]{1,}@[a-zA-Z]{1}[a-zA-Z\.\-]{1,}\.{1}([a-zA-Z]{3,3}|[a-  zA-Z]{2,2}\.{1}[a-zA-Z]{2,2})$

Step 4. Give a Error Message for wrong email type. And Display Location will inline with Field and in Notification. 


It will work. I guess. 

Wednesday, August 30, 2017

How to Create Modal or Popup or Dialog in Oracle apex by Java script


Steps...


Step 1.  First create a region and give it a Static ID like random word  modal . Then you can do anything what you need to show in our dialog.
Step 2. Then create a button or any other item to calling a Dynamic Action.
Step 3. Now create a Dynamic Action on this item select Execute Java Script Code as Action.
         and use this code :

   
$('#modal').dialog({ "title":"Group","minheight":"60%", "width":"50%", "position":"top" }); 

    Or

 
javascript:openModal('modal');

End of this steps  Execute the item. Comment for any query.

Sunday, August 13, 2017

User Image Show in Navigation Bar

1. Create application item name > 'FILE_ID',> Session State Protection > Unrestricted.

2. Create Application Processes > 'GETIMAGE',> Process Point > Ajax Callback, > PL/SQL Code >


begin

    for c1 in (select * from table_name

                where column_id = :FILE_ID) loop

        --

        sys.htp.init;

        sys.owa_util.mime_header( c1.PIC_TYPE, FALSE );

        sys.htp.p('Content-length: ' || sys.dbms_lob.getlength( c1.PIC));

        sys.htp.p('Content-Disposition: attachment; filename="' || c1.PIC_NM || '"' );

        sys.htp.p('Cache-Control: max-age=3600');  -- tell the browser to cache for one hour, adjust as necessary

        sys.owa_util.http_header_close;

        sys.wpg_docload.download_file( c1.PIC );

     

        apex_application.stop_apex_engine;

    end loop;

end;

3. Create/Select navigation bar where you want to show image > User Defined Attributes 1.

<img style="width:35px;height:35px;border-radius:50%;background" 

src="f?p=&APP_ID.:0:&APP_SESSION.:APPLICATION_PROCESS=GETIMAGE:::FILE_ID:&APP_USER." alt="No Image">





How to do Tooltip on Oracle apex 5

----For Element Custom Attributes ----
-----------------Uning Tooltip----------------------
Use this function:

onmouseover="toolTip_enable(event,this,'This is a tooltip')"

IMAGE SHOW ON SINGLE ITEM STEP BY STEP ON ORACLE APEX 5


 1.FIRST INPUT THE FOLLOWING CODE IN PAGE HTML HEADER

 <script type="text/javascript">

function getImage(event) {

    var P35_IMAGE = document.getElementById('P35_IMAGE');
    P35_IMAGE.style.width = "150px";
    P35_IMAGE.style.height = "175px";
    P35_IMAGE.title="Customer Photo";
    P35_IMAGE.src = URL.createObjectURL(event.target.files[0]);
}
</script>

2. THEN INPUT THE BELOW CODE ON SINGLE ITEM ON PRE ELEMENT TEXT

<div id="select-img">
<img id="P35_IMAGE"/>

3. THEN CLOSE THE CODE  POST ELEMENT TEXT
</div>

4. THEN CALL THE FUNCTION ON BROWSE ITEM ON CHANGE EVENT  ON HTML Form Element Attributes

onchange="getImage(event);"

select rowid,

        JOB_ID,
       JOB_TITLE,
       MIN_SALARY,
       MAX_SALARY,
      '<img src="'||APEX_UTIL.GET_BLOB_FILE_SRC('P35_IMAGE',JOB_ID)||'"/>'   "IMAGE"
  from JOBS
;

Zoom in on Click and Zoom out on Another Click in Oracle Apex 5 using JavaScript

Steps :

1. Copy the code to your page HTML HEADER

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function()
{
$("#image").css("width", "800px");
$("#image").toggle(function()
{
$(this).animate({width: "100%"}, 1000);
$('p').text("Click To Zoom Out");

}, function(){
$(this).animate({width: "800px"}, 1000);
$('p').text("Click To Zoom In");
});
});
</script>

1. Put this  id="image"   in your photo retrieving SQL Query 

Then try it.


Saturday, August 12, 2017

Image Memory Size limitation at Upload time on Oracle Apex 5

To make a limitation on uploading image on Oracle Apex 5. You can do this steps.
Step-1

Select the File Browser field and Create a Validation
Step-2
Then  Validation>> Type >> PL/SQL Function (Return Error Type)
and pest the code:


 declare
 cursor c is 
 select doc_size
 from apex_application_files
 where name = :P18_IMAGE; -- where write the name of file upload field
 v_size number := 0;
 v_msg varchar2(100);
begin

open c; 
fetch c into v_size; 
close c;
  
if (v_size < 51200) then -- (50 kb*1024 byte=51200)
  v_msg  := 'Image must be at least 50KB!';
  DELETE from APEX_APPLICATION_FILES WHERE name = :P18_IMAGE;  ---where write the name of file upload field
  return v_msg;
elsif (v_size > 204800) then -- (200 kb*1024 byte=51200)
  v_msg  := 'Image size cannot be more than 200kb!';
  DELETE from APEX_APPLICATION_FILES WHERE name = :P18_IMAGE;
-- where write the name of file upload field
  return v_msg;
end if;

--:p15_rcremark := :P15_RCAPPIMG_temp;
end;

Then save the page and try.


Thursday, August 10, 2017

How to create a popup page / modal dialog manually in oracle apex using open()

Manual definition of  window.open() ;

1. Go to the page from where you want to open a popup. Open it in edit mode.

2. Go to to Page section -> HTML Header.
3. Paste the following java-script.

-- Start script

  <script language="JavaScript" type="text/javascript">

  function callMyPopup (puniq_id) {
 -- parameters are not mandatory  
  var url;

  url = 'f?p=&APP_ID.:27:&APP_SESSION.::::P27_QUNIQ_ID:'+ puniq_id ;
   -- parameters are not mandatory  

  w = open(url,"winLov","Scrollbars=1,resizable=1,width=925,height=400");
  
  }

  </script>

-- End Script


Note :- Change the parameters accordingly in f?p
puniq_id is the parameter that will pass the value from called page to calling page. P27_QUNIQ_ID is the component in Page 27 that will show this value.


4. Go to Report Attribute.
5. Edit the column in report you want to create link.
6. Go to Column Link.
7. Enter Link text.
8. Select URL in target.
9. In URL give calling function with desired parameter.

     
 javascript:callMyPopup('#Question UID#'); 
 -- parameters are not mandatory  

10. Apply Changes.

Create a Form Using Python for Save Data into Excel like a Database

#Download Pyhton from here https://www.python.org/downloads/  #Download Python: #Click the “Download Python 3.x.x” button (the latest versio...