This discussion is archived
9 Replies Latest reply: Jul 3, 2013 1:04 AM by Maahjoor RSS

image place holder for student entry form

Maahjoor Newbie
Currently Being Moderated

Dear all,

i want to create a form in apex 4.2 against oracle database 11g R2, internet explorer 9.

i have 2 tables.

create table students (student_id number primary key,
                                    student_name varcahr2(50));
create table pictures (pic_id number primary key,
                                   student_id number references students(student_id) not null,
                                   pic blob not null) ;

 

i want to create a single form where all the studnet infromation could be entered including the picture.

for the picture i need to have an image place holder, when i click on the image place holder, the file browse dialog should open.

i could do it in developer suite 10g.

but for apex, i don't know how to do it?

as there any example exists which could i follow?

any suggession?

i want to upload an image which i take from access employees entry page as for example. how could i upload image here? the image icon is disables above.

thanks.

  • 1. Re: image place holder for student entry form
    Pars Pro
    Currently Being Moderated

    Hi,

    for upload photo alter table and add column mimetype,filename,last_update and create form on table

    for  more details refer Sample database application in order tab

     

    regards.

  • 2. Re: image place holder for student entry form
    Maahjoor Newbie
    Currently Being Moderated

    thank you

    it is provided in the packeged applications?

    what is the name fo the sample database application please?

    i know the mimtype etc, i will include them, but problem is how to get together both the tables in one entry form?

    i want o show you an image which i have on my desktop. how could i share it with you here in the forum?

     

    Regards.

  • 3. Re: image place holder for student entry form
    Pars Pro
    Currently Being Moderated

    Hi,

    ya name of packaged application is sample database application

    1st refer all tables as well as report of that application also form and then try. it is in product tab.

     

    regards.

  • 4. Re: image place holder for student entry form
    Maahjoor Newbie
    Currently Being Moderated


    nice,

    just a final query,

    kindly make me understnd the query behind the report

    select p.product_id,
           p.product_name,
           p.product_description,
           p.category,
           decode(p.product_avail, 'Y','Yes','N','No') product_avail,
           p.list_price,
           (select sum(quantity) from demo_order_items where product_id = p.product_id) units,
           (select sum(quantity * p.list_price) from demo_order_items where product_id = p.product_id) sales,      
           (select count(o.customer_id) from demo_orders o, demo_order_items t where o.order_id = t.order_id and t.product_id = p.product_id group by p.product_id) customers,
           (select max(o.order_timestamp) od from demo_orders o, demo_order_items i where o.order_id = i.order_id and i.product_id = p.product_id) last_date_sold,
           p.product_id img,
    apex_util.prepare_url('f?p='||:app_id||':6:'||:app_session||'::::P6_PRODUCT_ID,P6_BRANCH:'||p.product_id||','||3) icon_link,
    decode(nvl(dbms_lob.getlength(p.product_image),0),0,null,
        '<img style="border: 4px solid #CCC; -moz-border-radius: 4px; -webkit-border-radius: 4px;" '||
        'src="'||
        apex_util.get_blob_file_src('P6_PRODUCT_IMAGE',p.product_id)||
        '" height="75" width="75" alt="Product Image" title="Product Image" />')
        detail_img,
    decode(nvl(dbms_lob.getlength(p.product_image),0),0,null,
        apex_util.get_blob_file_src('P6_PRODUCT_IMAGE',p.product_id))
        detail_img_no_style,
        tags
    from demo_product_info p

    i stop understanding from line 12.

    could you kindly explaint these lines for me?

    Regards.

  • 5. Re: image place holder for student entry form
    Pars Pro
    Currently Being Moderated

    Hi,

    from 12th line you should write follow for your report as follow

     

    apex_util.prepare_url('f?p='||:app_id||':page_id:'||:app_session||'::::PX_PIC_ID,PX_BRANCH(i.e used to branch from form page):'||PIC_ID||','||3) icon_link,

           decode(nvl(dbms_lob.getlength(PIC),0),0,null,

        '<img style="border: 4px solid #CCC; -moz-border-radius: 4px; -webkit-border-radius: 4px;" '||

        'src="'||

        apex_util.get_blob_file_src('PX_PIC',PIC_ID)||

        '" height="75" width="75" alt="PIC" title="PIC" />')

        PIC,

     

    is query to display student pic in report

    regards.

  • 6. Re: image place holder for student entry form
    Maahjoor Newbie
    Currently Being Moderated

    hi pars,

     

    thanks for the time and guidense,

    i am making this thread as answered since the question is answered.

    i even do not understand.

    could you suggest me a book which have this topic?

    like how to find app_id,app_session, and what is px_branch etc.

    thanks again pars.

    regards.

  • 7. Re: image place holder for student entry form
    Pars Pro
    Currently Being Moderated

    Hi,

    refer following link

    Contents

    read that book also try that application page you can understand much more also report and form region of product

    regards.

  • 8. Re: image place holder for student entry form
    Pars Pro
    Currently Being Moderated

    Hi,

    put your example on apex.oracle.com

    regards

  • 9. Re: image place holder for student entry form
    Maahjoor Newbie
    Currently Being Moderated

    ok pars,

    i will do as you guide,

    and i am really searching for words to properly thank you.

    i cant put the example right now on apex.oracle.com becuase the it is in my personal laptop which is in my room,

    but i got a very better idea from your help.

    all i have is just to study thoroughly the sample database application's page and report, and the book you has given the refernece.

    i am planning to give my ocp final paper in the coming next days since i receive the confirmation email.

    thank you so much paars.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points