How to upload employees picture thru API

Hi All,
Can anybody say me how to upload the employees pictures thru PER_IMAGE_UPLOAD_PKG.LOAD(). Here i am having 2500 employees photos.
and if it is step wise manner it will be more helpful and where we have to place the pictures in server , in which location

Okay. This is pretty old code, and I don't quite remember how it works entirely, but here it is. I created a Formbuilder form with some custom java beans to read the directory where the badge photos resided, and create a SQL*Loader control file for each .jpg file. Here is the main code, from the client_pkg package and the OK button when-button-pressed trigger:
PACKAGE client_pkg IS
staging_dir varchar2(200) := 'c:\userapps\empphotos';
photo_dir varchar2(200) := '\\Netser1\server dir\APPD\Human Resources Badging System\Photos';
template varchar2(2000) := 'options (bindsize 400000)' || chr(10)
     ||'load data' || chr(10)
     ||'infile ''$INFILE$'' "fix $FILESIZE$"' || chr(10)
     ||'$OPERATION$' || chr(10)
     ||'into table per_images' || chr(10)
     ||'(image raw ($FILESIZE$), -- filesize' || chr(10)
     ||'parent_id constant $PERSON_ID$,' || chr(10)
     ||'table_name constant "PER_PEOPLE_F",' || chr(10)
     ||'image_id char "hr.per_images_s.nextval")' || chr(10)
missing_template varchar2(2000) := 'options (bindsize 400000)' || chr(10)
     ||'LOAD DATA' || chr(10)
     ||'INFILE ''$INFILE$'' "fix $FILESIZE$"' || chr(10)
     ||'$OPERATION$' || chr(10)
     ||'INTO TABLE lac.lac_photo_dir' || chr(10)
     ||'     (IMAGE raw($FILESIZE$) -- filesize' || chr(10)
     ||' , FILENAME constant "$FILENAME$"' || chr(10)
     ||'     , FILESIZE constant $FILESIZE$' || chr(10)
     ||'     , FILEDATE constant "$FILEDATE$"' || chr(10)
     ||'     )' || chr(10)
END client_pkg;
--OK Button - When-Button-Pressed
declare
     alert_msg varchar2(2000);
     button_pressed number;
     in_file Text_IO.File_Type;
     out_file Text_IO.File_Type;
     log_file Text_IO.File_Type;
     v_buffer varchar2(200);
     v_ctl_txt varchar2(2000);
     v_dir_find_string varchar2(20) := 'Directory of ';
     v_dirstring varchar2(200);
     v_pos integer;
     v_slash varchar2(2) := '\';
     v_filesize varchar2(20);
     v_filename varchar2(20);
     v_ctl_filename varchar2(120);
     v_log_filename varchar2(120);
     v_operation varchar2(20);
     v_emp_num varchar2(20);
     v_emp_name varchar2(80);
     v_payroll_id number;
     v_person_id number;
     v_load_count integer;
     v_qry_count integer;
     v_instance varchar2(20);
     v_username varchar2(20);
     v_password varchar2(20);
     v_connect_string varchar2(100);
     v_exec_string varchar2(200);
     v_success_count integer;
     v_beg_pos integer;
     v_end_pos integer;
     cursor c_badges(p_payroll_id in number) is
          select xref.emp_num
          , ppf.employee_number || ' - ' || ppf.full_name emp_name
          , xref.filename
          , ppf.person_id
, decode(pi.image_id, null, 'N', 'Y') image_exists_yn
from hr.per_all_people_f ppf
          , hr.per_all_assignments_f paf
          , lac.lac_emp_badge_xref xref
, hr.per_images pi
          where paf.person_id=ppf.person_id
          and xref.emp_num = ppf.employee_number
          and sysdate between ppf.effective_start_date and ppf.effective_end_date
          and sysdate between paf.effective_start_date and paf.effective_end_date
          and paf.assignment_type<>'B'
--          and paf.payroll_id = p_payroll_id
          and lower(filename) like '%.jpg'
--          and ppf.employee_number in ('00012','08278') -- Temp debugging line
and pi.parent_id(+) = paf.person_id
          order by emp_num
     cursor c_photo_dir is
     select xr.emp_num
     , pd.filename
     , pd.filesize
     , pd.filedate
     from lac.lac_emp_badge_xref xr
     , lac.lac_photo_dir pd
     where xr.filename(+) = pd.filename
     and xr.emp_num is null
     and lower(pd.filename) like '%.jpg'
     order by pd.filename
begin
break;
:System.Message_Level := '5';
     v_instance := get_application_property(CONNECT_STRING);
     v_username := get_application_property(USERNAME);
     v_password := get_application_property(PASSWORD);
     v_connect_string := v_username || '/' || v_password || '@' || v_instance;
if :replace_cb = 'Y' then
          v_operation := 'Replace';
else
     v_operation := 'Append';
end if;
     v_load_count := 0;
set_custom_property('FILEIO_BEAN',1,'SOURCEDIR',:photo_file_dir);
     set_custom_property('EXEC_BEAN',1,'CMDSTRING','echo TEST');
for v_badges in c_badges(to_number(:payroll_list))
loop
          :work_file := v_badges.filename;
set_custom_property('FILEIO_BEAN',1,'SOURCEFNAME',:work_file);
v_filesize := get_custom_property('FILEIO_BEAN',1,'FILELENGTH');
--          alert_msg := 'File Size for ' || :work_file || ' = ' || v_filesize || chr(10);
--          SET_ALERT_PROPERTY('GENERIC_ALERT',ALERT_MESSAGE_TEXT, alert_msg);
--          button_pressed := Show_Alert('GENERIC_ALERT');
          if v_badges.image_exists_yn = 'Y' then
               delete from hr.per_images
               where parent_id = to_number(v_badges.person_id);
               commit;
          end if;
          v_ctl_txt := client_pkg.template;
          v_ctl_txt := replace(v_ctl_txt, '$OPERATION$', v_operation);
          v_ctl_txt := replace(v_ctl_txt, '$INFILE$', :photo_file_dir || v_slash || v_badges.filename);
          v_ctl_txt := replace(v_ctl_txt, '$FILESIZE$', v_filesize);
          v_ctl_txt := replace(v_ctl_txt, '$PERSON_ID$', v_badges.person_id);
          v_ctl_filename := 'sqlldr' || v_badges.emp_num || '.ctl';
          v_ctl_filename := :staging_dir || v_slash || v_ctl_filename;
          v_log_filename := replace(v_ctl_filename,'.ctl','.log');
          out_file := Text_IO.Fopen(v_ctl_filename, 'w');
          text_io.put_line(out_file, v_ctl_txt);
          text_io.fclose(out_file);
          v_exec_string := 'sqlldr ' || v_connect_string || ' control=' || v_ctl_filename
          || ' log=' || v_log_filename;
--          alert_msg := 'before, v_exec_string= ' || v_exec_string || chr(10);
--          SET_ALERT_PROPERTY('GENERIC_ALERT',ALERT_MESSAGE_TEXT, alert_msg);
--          button_pressed := Show_Alert('GENERIC_ALERT');
          :emp_name := v_emp_name;
          synchronize;
          set_custom_property('EXEC_BEAN',1,'CMDSTRING',v_exec_string);
--          alert_msg := 'after, v_exec_string= ' || v_exec_string || chr(10);
--          SET_ALERT_PROPERTY('GENERIC_ALERT',ALERT_MESSAGE_TEXT, alert_msg);
--          button_pressed := Show_Alert('GENERIC_ALERT');
          v_operation := 'Append';
          v_load_count := v_load_count + 1;
          exit when v_load_count >= nvl(:proc_limit,99999);
end loop;
     set_custom_property('EXEC_BEAN',1,'CMDSTRING','echo TEST');
if false then     
v_operation := 'Append';
     for v_photo_dir in c_photo_dir
     loop
          v_pos := instr(v_photo_dir.filename,'.jpg');
          v_end_pos := v_pos - 1;
          v_pos := instr(v_photo_dir.filename,'-',-1,1);
          if v_pos > 0 then
               v_beg_pos := v_pos + 1;
          else
               v_beg_pos := 1;
          end if;
          v_emp_num := lpad(substr(v_photo_dir.filename,v_beg_pos, v_end_pos + 1 - v_beg_pos),5,'0');
          v_payroll_id := to_number(:payroll_list);
          begin          
               select ppf.employee_number || ' - ' || ppf.full_name
                    , ppf.person_id
                    into v_emp_name
                    , v_person_id
          from hr.per_all_people_f ppf
                    , hr.per_all_assignments_f paf
          , hr.per_images pi
                    where paf.person_id=ppf.person_id
                    and sysdate between ppf.effective_start_date and ppf.effective_end_date
                    and sysdate between paf.effective_start_date and paf.effective_end_date
                    and paf.assignment_type<>'B'
          and pi.parent_id(+) = paf.person_id
          and decode(pi.image_id, null, 'N', 'Y')='N'
          and ppf.employee_number = v_emp_num
--          and paf.payroll_id = v_payroll_id
          exception
               when no_data_found then
               v_emp_name := null;
               v_person_id := null;
               when others then
                    alert_msg := 'Error looking up Employee: ' || v_emp_num || chr(10) || sqlerrm;
                    SET_ALERT_PROPERTY('GENERIC_ALERT',ALERT_MESSAGE_TEXT, alert_msg);
                    button_pressed := Show_Alert('GENERIC_ALERT');
               raise form_trigger_failure;
     end;
          if v_person_id is not null then
               :work_file := v_photo_dir.filename;
               v_ctl_txt := client_pkg.template;
               v_ctl_txt := replace(v_ctl_txt, '$OPERATION$', v_operation);
               v_ctl_txt := replace(v_ctl_txt, '$INFILE$', :photo_file_dir || v_slash || v_photo_dir.filename);
               v_ctl_txt := replace(v_ctl_txt, '$FILESIZE$', v_photo_dir.filesize);
               v_ctl_txt := replace(v_ctl_txt, '$PERSON_ID$', v_person_id);
               v_ctl_filename := 'sqlldr' || v_emp_num || '.ctl';
               v_ctl_filename := :staging_dir || v_slash || v_ctl_filename;
               v_log_filename := replace(v_ctl_filename,'.ctl','.log');
               out_file := Text_IO.Fopen(v_ctl_filename, 'w');
               text_io.put_line(out_file, v_ctl_txt);
               text_io.fclose(out_file);
               v_exec_string := 'sqlldr ' || v_connect_string || ' control=' || v_ctl_filename
               || ' log=' || v_log_filename;
     --          alert_msg := 'before, v_exec_string= ' || v_exec_string || chr(10);
     --          SET_ALERT_PROPERTY('GENERIC_ALERT',ALERT_MESSAGE_TEXT, alert_msg);
     --          button_pressed := Show_Alert('GENERIC_ALERT');
               :emp_name := v_emp_name;
               synchronize;
               set_custom_property('EXEC_BEAN',1,'CMDSTRING',v_exec_string);
     --          alert_msg := 'after, v_exec_string= ' || v_exec_string || chr(10);
     --          SET_ALERT_PROPERTY('GENERIC_ALERT',ALERT_MESSAGE_TEXT, alert_msg);
     --          button_pressed := Show_Alert('GENERIC_ALERT');
               v_operation := 'Append';
               v_load_count := v_load_count + 1;
     --          exit when v_load_count >= nvl(:proc_limit,99999);
          end if;
     end loop;     
     set_custom_property('EXEC_BEAN',1,'CMDSTRING','echo TEST');
return;
end if;
exit_form;
exception
     when no_data_found then
          Text_IO.Fclose (in_file);
     exit_form;
when others then
text_io.fclose(in_file);
text_io.fclose(out_file);
          alert_msg := 'Error outside loop: ' || chr(10) || sqlerrm;
          SET_ALERT_PROPERTY('GENERIC_ALERT',ALERT_MESSAGE_TEXT, alert_msg);
          button_pressed := Show_Alert('GENERIC_ALERT');
          raise form_trigger_failure;          
end;
Hope that helps.............Dave

Similar Messages

  • How to upload my pictures taken through my iphone 4s to icloud

    how to upload my pictures taken through my iphone 4s to icloud? how to enable automatically upload to icloud. also how to check whether the photos are uploaded? pls help.

    Hello Stephen,
    I read your post, and it sounds as though you'd like to learn more about Photo Stream and iCloud. I have linked to an article that provides information you may find helpful:
    My Photo Stream FAQ - Apple Support
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • How to get Employee Picture in Smartforms

    Hi Experts
    Please help me out in getting employee picture in Smartforms
    I have used the following FMs
    1. HR_IMAGE_EXISTS
    2. SCMS_DOC_URL_READ
    By using these two FM i got the URL and i am able to get the picture in my Report Program,by using FM 'ISM_URL_SHOW'.
    But Please tell how to get this picture in Smartform .
    As i am generating Employee Biodata and in that i need employee Picture.
    Please HELP me ....
    Thanks & Regards
    Shaveta Prabhakar

    Hi,
         U need pictures in smartforms for that just try this one I think so it will help full to u.
          First Upload that picture in the se78 that photo must be in the bitmapformat(picture.bmp).
    steps are:
             goto se78>graphics->import--->it asks the file path here,fill those details
    Then goto Smartform--->In which page u want to put the picture,
              there click that page  and goto Background picture,
             here give the name of that picture and select the resolution and positin of the picture there. 
               Then u will get the picture in the output.
    Regards,
    Surya

  • How to fetch Employee Picture in Smartforms

    Hi Experts
    Please help me out in getting employee picture in Smartforms
    I have used the following FMs
    1. HR_IMAGE_EXISTS
    2. SCMS_DOC_URL_READ
    By using these two FM i got the URL and i am able to get the picture in my Report Program,by using FM 'ISM_URL_SHOW'.
    But Please tell how to get this picture in Smartform .
    As i am generating Employee Biodata and in that i need employee Picture.
    Please HELP me ....
    Thanks & Regards
    Shaveta Prabhakar

    Hi Shaveta,
    The question has been raised earlier as well on SDN.
    Please search for 'Smartforms dynamic picture' on sdn and you will get a good number of solutions.
    The one answer which i found to be promising one is the one which mentioned somethig like:
    <b>Create a graphic node in the Smartform and under the tab 'General Attributes' fill the Name, Object and Id with variables (e.g. &NAME&, &OBJECT& and &ID&) and fill these parameters to get the picture you want at runtime.</b>
    See if this helps.
    check this link too
    smartforms dynamic logo
    and revert for more clarifications if any.
    <b>Always reward points to useful suggestions.</b>
    regards,
    Vikas

  • HT1338 how to upload email pictures to Facebook..... iMac

    How do I upload email pictures to my facebook account from iMac

    Post in the iPhoto forum where those experts will provide an answer.

  • Forgot how to upload my pictures to the cloud. how to start?

    forgot how to connect to the cloud to upload my pictures. what is the method?

    File Sync Links that may help... all the links I have, since I don't know the cause of your specific problem
    -https://forums.adobe.com/community/creative_cloud/host_sync
    -http://helpx.adobe.com/creative-cloud/help/sync-settings.html
    -http://helpx.adobe.com/creative-cloud/kb/arent-my-files-syncing.html
    -Size Limits https://forums.adobe.com/thread/1488242
    -sync and email link http://forums.adobe.com/thread/1427516?tstart=0
    -Phantom folder problem https://forums.adobe.com/thread/1490445
    -an overview of assets https://assets.adobe.com/files

  • How to upload/download Pictures from W3K Server

    I have an Ipad 4 running IOS7, Wi-Fi only and is connected to my Network.
    I have a Windows 2003 Server which has a File Server which holds all my pictures and I would like to know if there is some way I can access the server to upload pictures from my Ipad to the server and download pictures from the server to my Ipad.
    If this is possible, can you please give me some direction on how to get the Ipad connected to do this?
    Thanks

    I have an Ipad 4 running IOS7, Wi-Fi only and is connected to my Network.
    I have a Windows 2003 Server which has a File Server which holds all my pictures and I would like to know if there is some way I can access the server to upload pictures from my Ipad to the server and download pictures from the server to my Ipad.
    If this is possible, can you please give me some direction on how to get the Ipad connected to do this?
    Thanks

  • How to upload scanned pictures to Facebook

    I have recently scanned some pictures using my HP Deskjet F4200 scanner to the HP Photosmart location.  I have tried to upload them to Facebook or to email them and cannot.  I am fairly new to this as a senior citizen and would appreciate any help as to what I need to do.

    Hello Stephen,
    I read your post, and it sounds as though you'd like to learn more about Photo Stream and iCloud. I have linked to an article that provides information you may find helpful:
    My Photo Stream FAQ - Apple Support
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • How to upload 1 picture to existing album

    Hello all, is it possible to upload only 1 picture to an existing album in mobile me?

    floydstyle wrote:
    Hello all, is it possible to upload only 1 picture to an existing album in mobile me?
    Yes. Drag the picture to one of your existing MobileMe albums listed (in the 'Library' view) and drop it on the album name. To the right of the album name is an icon that looks a bit like radio-waves. Click the icon and it'll trigger a re-synchronization of your local album with the MobileMe website -- pushing the new image up to the hosted gallery.

  • I am having issues uploading and sending via email pictures and videos today. Anyone else having this problem? Also, anyone know how to upload multiple pictures to Facebook at one time?

    Post relates to: Pre 2 p102eww (Verizon)

    Jneklason wrote:
    ~snip~
    I know this email is confusing and really hard to understand...perhaps now you will know how i've been feeling--lost and confused with all the mis-information, with a hit and miss phone, and out of time with all the 1 1/2 hr to 2 hrs EACH wasted on this issue.
    On top of all this, I can't even find out how to file a complaint with anyone higher up than Customer Service.
    I hate to tell you this, but you didn't write an email. You wrote a discussion post on the Verizon Wireless Community forum which is a public peer to peer forum. Unfortunately since you didn't mark your post as a question, the VZW reps that roam this community won't ever see your post. Before you re-post it, don't. Duplicate posts get removed from the community.
    I see there were several missteps both by the reps and yourself in your post. First you should have insisted on returning the phone within the 14 day return policy period. Second which Samsung Galaxy mini model did you purchase? The S3 mini or the S4 mini? Did you do any research prior to deciding on this device. The reps at that time deflected the easiest course of action, by trying to get you to replace the phone under insurance instead of returning the phone. The Early Edge payment option requires the current phone on the line using the early Edge must be returned to Verizon Wireless. Did you once considered going to a third party site like Swappa to purchase a gently used device for your daughter?

  • Calling up employee picture

    Hi Gurus,
    I uploaded employee picture into sap server, i wanted to view it from enterprise portal and want it to authoumatically be attached to emp data when i call it up again, each time i call up the emp portal, it will not show, meaning that it may not be in the right path or something else is wrongh. What should i do? pls help.
    Tanx
    Maureen.

    Hi Maureen,
    I am guessing you are on at least ESS 1.0 (ECC6.0)
    Goto Customizing for Personnel Management by choosing Employee Self-Service ® Service-Specific Settings ® Whou2019s Who. 
    Determine Document Type u2013
    Where are the employee photos stored - maintained as a system switch in T77S0
         (By Default use Admin-Photo-HRICOLPHOTO)
    Also, In Maintain Settings u2013 Whether to display employee photo, enable the flag.

  • On my ipod touch I'm not too sure how I uploaded a album onto my ipod from my laptop. But, now there is no way to delete the album full of pictures. What do I do? I only gotten it a while ago and not fully sure how to work it. Help?

    On my ipod touch I'm not too sure how I uploaded a album onto my ipod from my laptop. But, now there is no way to delete the album full of pictures. What do I do? I only gotten it a while ago and not fully sure how to work it. Help?

    http://support.apple.com/kb/HT4236

  • How to upload to Azure Media Services when using HTML5 with Web API

    I keep finding examples demonstrating how to upload video to Azure Media Services through a console application.  I am developing an application using HTML5 with angularjs and web api, but am having trouble finding an example for uploading when you
    are getting the file from a form on a web browser.  The main issue I find is that I see a way to upload from a file path and no way to upload from a stream.  I would like to upload the file to blob storage and then associate the file in blob storage
    with the IAssetFile object, which is then associated with IAsset.  It this possible and if so can you point me in the direction of some tutorials that demonstrate this?  Also, I am allowing site members to upload videos and images.  For this
    images scenario, I saw doc. demonstrating how to start a job that will save the image into a different size, what if I need four different sizes for each image uploaded?

    Hi,
    the following example shows how to upload a stream into a blob and associate the blob with an asset: https://code.msdn.microsoft.com/How-to-upload-a-stream-to-d2750102.
    thanks,
    Julia
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Hi there, i bought an Ipad air and trying to upload the pictures that i have taken in raw files via itunnes. however pictures are quite blurry which is disappointing. appreciate any suggestions on how to make it right via itunes?

    Hi there, i bought an Ipad air and trying to upload the pictures that i have taken in raw files via itunnes. however pictures are quite blurry which is disappointing. Appreciate any suggestions on how to make it right via itunes?
    Thanks

    Hi there, i bought an Ipad air and trying to upload the pictures that i have taken in raw files via itunnes. however pictures are quite blurry which is disappointing. Appreciate any suggestions on how to make it right via itunes?
    Thanks

  • How to upload pictures from laptop to iphone

    Dear friends,
    i have iphone 4 with IO6, could you please help me with tools how to upload pictures from my laptop to my Iphone?
    Best wishes.

    Use iTunes to sync them to your iPhone... http://support.apple.com/kb/HT4236

Maybe you are looking for

  • How to check time is entered

    Dear sir I have column sales_date with forms data type - datetime and I set format mask -dd-mon-yyyy hh24:mi How to validate whether user entered both date and time. How to check this in oracle forms Rgds Dev

  • Mobile e-mail

    I have a basic phone and the 9.95 data plan. I want to use mobile e-mail. When I try to use it, it says my trial subscription has ended. It then wants me to 'buy' it. I thought it was free since I have a data plan. Am I missing something here??

  • The AE CC 2014 SDK download link seems broken...

    The SDK download link is currently going to a 404 page: http://www.adobe.com/devnet/aftereffects/sdk/cc2014_eula.html Is there a mirror site to download the SDK (or can someone prod whoever maintains the link to fix it Thx.

  • CS6 brand new program Indesign Missing Plug ins?

    On my brand new mac book pro and brand new CS6 creative suite all my programs installed with flying colors, with the exception of indesign. It opens but after 400 Error messages about plugins???? i can "use it" but many buttons are stuck in not use l

  • Setting a Filter on a Shuttle ???

    The help document for Shuttle has under Runtime Control, instructions for Adding a Leading List Data Filter to a Shuttle. Has anybody gotten this to work?