Transactional Triggers

Hi,
I'm new in oracle forms. I've been reading different documents/online help etc. But i'm confuse with the Transactional Triggers like On-Insert, On-Update, On-Delete. I mean when we should use On-Insert/On-Update/On-Delete? We can use regular insert/update procedure to achieve the task. So can someone please explain the differnece? Can someone please give me a sample example of how to create a block based on a transactional triggers and another one based on procedure.
Thanks
timt
Message was edited by:
timt

Hello,
Create a block base on a table and create a On-Insert trigger on that block. Put null in the On-Insert trigger. Run the form and enter some data into the item and commit it.
Do the same thing without the On-Insert trigger.
You are able to get the difference.
Cheers
SUN

Similar Messages

  • Transactional triggers and commit processing

    I have only been an active member of this thread for a couple of weeks and have tried to contribute to a few postings. But I have also noticed lots of postings relating to the use of DML statements inside what I would call non commit time triggers.
    What I mean here is, for example, a WHEN-BUTTON-PRESSED trigger that does inserts, updates, deletes, followed by the COMMIT_FORM procedure.
    I thought it might be useful to draw attention to the possible pitfalls of this approach. I'm not saying that this approach is wrong - far from it, but sometimes it means that people aren't leveraging the functionality that you get "for free" from Forms.
    By coding some DML followed by a Commit_Form, you are not getting any rollback functionality from Forms. For example:
    INSERT INTO A
    INSERT INTO B
    COMMIT_FORM;
    Let's imagine that the insert into A worked but the insert into B failed for some reason. The user gets an unhandled exception. Now imagine that the cause of the error is cleared up, and the user presses the button (or whatever the invokation action was) again, and the commit works. You will have 2 records in A and 1 in B. You may not have expected that, and without coding your own rollback/savepoint that's what you would get.
    You also (1) don't get a Working... message without coding it yourself, and (2) get the "No changes to commit" message; removing this is the subject of many threads on this site.
    If you have a block which is based over a table which you need to update, then all of the DML statements ought to be coded inside PRE/POST/ON INSERT/UDPATE/DELETE statements, or other Forms transactional triggers (pre-database-commit etc..). If you need to change other tables then put the DML for them inside those triggers. Then you don’t have to worry about which records the user changed – if the user didn’t touch them then Forms won’t fire the triggers. And when you call the COMMIT_FORM procedure, Forms will fire the triggers for you and if any of them fail, it will rollback back to where the COMMIT_FORM started.
    An example in 1 thread I saw this morning, was a Delete button, which was to delete the current record in a multi-record block. This button performed the “DELETE FROM <table> WHERE <key=:block.key>” followed by a Commit. Then of course the block needed to be re-queried to reflect the fact that the record had gone. Using the power of Forms to simply call the DELETE_RECORD procedure would have achieved the same result without needing to requery the block. And Forms would do the delete by ROWID, the fastest way of doing it.
    If you don’t have a block based over a table, then you can consider creating a dummy block which uses Transactional Triggers. Code an ON-INSERT on that block which includes the DML you want to execute. Then in the trigger initiating the commit processing you would do something like:
    :DUMMY_BLOCK.ITEM1 := ‘X’;
    COMMIT_FORM;
    IF (NOT FORM_SUCCESS) OR :SYSTEM.FORM_STATUS != ‘QUERY’ THEN
    -- the commit failed
    END IF;
    Then you’ll get a nice Working.. message and full rollback control.
    I think the moral of what I’m trying to get across is to use the power of Forms in the way it handles the transactions. Whilst we moan about it, it is actually quite good at that!
    I hope this posting is taken in a positive light, I am certainly not trying to teach anyone to “suck eggs”.
    PS. I find it ironic that you were prevented from coding DML statements outside of commit time triggers, in Forms 2.3!

    Thank you, Kevin. Very informative.

  • Use of transactional triggers in Forms 4.5.

    Hi All,
    Can any body help me in using transactional triggers?
    It 'll be best if anybody send me a text version (.fmt) of
    ttrig.fmb**, which is a demo provided by Oracle, with D2K
    release 1.x. This form 'll solve my purpose, since it
    demonstrates all the functionality of transactional
    triggers.
    Help 'll be greatly appreciated.
    Regards,
    Vimal Kaushik
    null

    Mr. Duncan Mills and other Oracle experts,
    I am currently working on an upgrade of numerous SQL*Forms version 2.3 to 6i.
    I have a few questions:
    Is there a detailed checklist to follow for the migration from SQL*Forms 2.x to 6i?
    Do you have any examples that show the proper syntax to follow for this conversion?
    Some of our colleagues have stated that a migration from SQL*Forms version 2.3 to 3.0 is required?
    Just to verify, if migrating from SQL*Forms v.2.3 to 6i - I need to first migrate the SQL*Forms v.2.3 .inp file to
    version 4.5 using the F45GEN program of Developer 2000, this will generate a version 4.5 .fmb file which I then need to
    migrate to 6i using the IF60CMP program of Developer6i
    Please let me know if there are any additional undocumented steps that I need to follow.
    Does anyone have an electronic copy of the Duncan Mills presentation 'Migrating Character Mode Applications
    to the Web '? If so, Can you email me a copy?
    Thank you, in advance, for your assistance.

  • To find out user exit/ badi for the VT01n transaction triggered in Save

    Hi Friends,
              I have the following requirement and for this appropriate user exit/ badi should be needed which will trigger during saving of the shipment.
    Cass shipment type (VTTK-ADD03) field needs to be required and should be automatically populated upon creation of the shipment document.  The rules for populating the value (SO, ST, PO and RA) are as follows:
    If any of the orders on the shipment are customer order types, then the CASS shipment type should be a SO,
    If all of the orders are STO orders, then the Cass shipment type should be "ST",
    If all of the orders are PO orders, then the Cass shipment type should be "PO" , and
    If all of the orders are customer return orders, then the Cass shipment type should be "RA".
    I have tried with the 3 badi available and 7 to 8 user exit, but it won't work.
    Thanking a lot in advance for giving the solution.
    With Regards,
    Ajit.

    Hi,
    This code will give you all the user-exits.
    Code:
    & Report ZPJA_PM002 (Ver4) &
    & PJA Consultancy Services (www.pjas.com) &
    & This report attmpts to find Enhancements, Program-Exits, BADIs &
    & and Business Transaction Events in a particular program/tcode. &
    & Other search options: &
    & Program: RPR_ABAP_SOURCE_SCAN &
    & FModule: &
    & Text Elements: &
    & P_DEVC Show user-exits from development class &
    & P_LIMIT Limit submit program selection &
    & P_FUNC Show function modules &
    & P_SUBM Show submit programs &
    & S01 Selection data (TCode takes precedence over program name) &
    report zpja_pm002
    no standard page heading
    line-size 221.
    data: tabix like sy-tabix,
    w_linnum type i,
    w_off type i,
    w_index like sy-tabix,
    w_include like trdir-name,
    w_prog like trdir-name,
    w_incl like trdir-name,
    w_area like rs38l-area,
    w_level,
    w_fsel like sy-ucomm, " Determination of screen field
    w_str(50) type c,
    w_funcname like tfdir-funcname.
    constants: c_fmod(40) type c value 'Function modules selected: ',
    c_subm(40) type c value 'Submit programs selected: ',
    c_col1(12) type c value 'Enhanmt Type',
    c_col2(40) type c value 'Enhancement',
    c_col3(30) type c value 'Program/Include',
    c_col4(20) type c value 'Enhancement Name',
    c_col5(40) type c value 'Enhancement Description',
    c_col6(8) type c value 'Project',
    c_col7(1) type c value 'S',
    c_col8(12) type c value 'ChangeName',
    c_col9(10) type c value 'ChangeDate'.
    Work Areas: ABAP Workbench
    data: begin of wa_d010inc.
    data: master type d010inc-master.
    data: end of wa_d010inc.
    data: begin of wa_tfdir.
    data: funcname type tfdir-funcname,
    pname type tfdir-pname,
    include type tfdir-include.
    data: end of wa_tfdir.
    data: begin of wa_tadir.
    data: devclass type tadir-devclass.
    data: end of wa_tadir.
    data: begin of wa_tstc.
    data: pgmna type tstc-pgmna.
    data: end of wa_tstc.
    data: begin of wa_tstcp.
    data: param type tstcp-param.
    data: end of wa_tstcp.
    data: begin of wa_enlfdir.
    data: area type enlfdir-area.
    data: end of wa_enlfdir.
    Work Areas: BADIs
    data: begin of wa_sxs_attr.
    data: exit_name type sxs_attr-exit_name.
    data: end of wa_sxs_attr.
    data: begin of wa_sxs_attrt.
    data: text type sxs_attrt-text.
    data: end of wa_sxs_attrt.
    Work Areas: Enhancements
    data: begin of wa_modsap.
    data: member type modsap-member.
    data: end of wa_modsap.
    data: begin of wa_modsapa.
    data: name type modsapa-name.
    data: end of wa_modsapa.
    data: begin of wa_modsapt.
    data: modtext type modsapt-modtext.
    data: end of wa_modsapt.
    Work Areas: Business Transaction Events
    data: begin of wa_tbe01t.
    data: text1 type tbe01t-text1.
    data: end of wa_tbe01t.
    data: begin of wa_tps01t.
    data: text1 type tps01t-text1.
    data: end of wa_tps01t.
    user-exits
    types: begin of ty_mod,
    member like modact-member,
    name like modact-name,
    status like modattr-status,
    anam like modattr-anam,
    adat like modattr-adat,
    end of ty_mod.
    data: w_mod type ty_mod.
    types: begin of t_userexit,
    type(12) type c,
    pname like trdir-name,
    txt(300),
    level type c,
    modname(30) type c,
    modtext(60) type c,
    modattr type ty_mod,
    end of t_userexit.
    data: i_userexit type standard table of t_userexit with header line.
    Function module developmnet classes
    types: begin of t_devclass,
    clas like trdir-clas,
    end of t_devclass.
    data: i_devclass type standard table of t_devclass with header line.
    types: begin of t_enlfdir,
    area type enlfdir-area,
    end of t_enlfdir.
    data: i_enlfdir type standard table of t_enlfdir with header line.
    Submit programs
    types: begin of t_submit,
    pname like trdir-name,
    level,
    done,
    end of t_submit.
    data: i_submit type standard table of t_submit with header line.
    Source code
    types: begin of t_sourcetab, "#EC * (SLIN lügt!)
    line(200), "#EC * (SLIN lügt!)
    end of t_sourcetab. "#EC * (SLIN lügt!)
    data: sourcetab type standard table of t_sourcetab with header line.
    data c_overflow(30000) type c.
    Description of an ABAP/4 source analysis token
    data: i_stoken type standard table of stokex with header line.
    data wa_stoken like i_stoken.
    Description of an ABAP/4 source analysis statement
    data: i_sstmnt type standard table of sstmnt with header line."#EC NEEDED
    keywords for searching ABAP code
    types: begin of t_keywords,
    word(30),
    end of t_keywords.
    data: keywords type standard table of t_keywords with header line.
    function modules within program
    types: begin of t_fmodule,
    name like rs38l-name,
    pname like trdir-name,
    pname2 like trdir-name,
    level,
    bapi,
    done,
    end of t_fmodule.
    data: i_fmodule type standard table of t_fmodule with header line.
    & Selection Options &
    selection-screen begin of block selscr1 with frame title text-s01.
    parameter: p_pname like trdir-name memory id rid,
    p_tcode like syst-tcode,
    p_limit(4) type n default 100,
    p_devc like rihea-dy_ofn default ' ',
    p_func like rihea-dy_ofn default ' ',
    p_subm like rihea-dy_ofn default ' '.
    selection-screen end of block selscr1.
    & START-OF-SELECTION &
    start-of-selection.
    if p_pname is initial and p_tcode is initial.
    message e008(hrfpm). "Make entry on the selection screen
    stop.
    endif.
    ensure P_LIMIT is not zero.
    if p_limit = 0.
    p_limit = 1.
    endif.
    perform data_select.
    perform get_submit_data.
    perform get_fm_data.
    perform get_additional_data.
    perform data_display.
    & Form DATA_SELECT &
    form data_select.
    data selection message to sap gui
    call function 'SAPGUI_PROGRESS_INDICATOR'
    destination 'SAPGUI'
    keeping logical unit of work
    exporting
    text = 'Get programs/includes' "#EC NOTEXT
    exceptions
    system_failure
    communication_failure
    . "#EC *
    determine search words
    keywords-word = 'CALL'.
    append keywords.
    keywords-word = 'FORM'.
    append keywords.
    keywords-word = 'PERFORM'.
    append keywords.
    keywords-word = 'SUBMIT'.
    append keywords.
    keywords-word = 'INCLUDE'.
    append keywords.
    if not p_tcode is initial.
    get program name from TCode
    select single pgmna from tstc into wa_tstc-pgmna
    where tcode eq p_tcode.
    if not wa_tstc-pgmna is initial.
    p_pname = wa_tstc-pgmna.
    TCode does not include program name, but does have refereve TCode
    else.
    select single param from tstcp into wa_tstcp-param
    where tcode eq p_tcode.
    if sy-subrc = 0.
    check wa_tstcp-param(1) = '/'.
    check wa_tstcp-param+1(1) = '*'.
    if wa_tstcp-param ca ' '.
    endif.
    w_off = sy-fdpos + 1.
    subtract 2 from sy-fdpos.
    if sy-fdpos gt 0.
    p_tcode = wa_tstcp-param+2(sy-fdpos).
    endif.
    select single pgmna from tstc into wa_tstc-pgmna
    where tcode eq p_tcode.
    p_pname = wa_tstc-pgmna.
    if sy-subrc <> 0.
    message e110(/saptrx/asc) with 'No program found for: ' p_tcode."#EC NOTEXT
    endif.
    else.
    message e110(/saptrx/asc) with 'No program found for: ' p_tcode."#EC NOTEXT
    endif.
    endif.
    endif.
    Call customer-function aus Program coding
    read report p_pname into sourcetab.
    if sy-subrc > 0.
    message e017(enhancement) with p_pname raising no_program."#EC *
    endif.
    scan abap-source sourcetab tokens into i_stoken
    statements into i_sstmnt
    keywords from keywords
    overflow into c_overflow
    with includes.
    if sy-subrc > 0. "keine/syntakt. falsche Ablauflog./Fehler im Skanner
    message e130(enhancement) raising syntax_error. "#EC *
    endif.
    check I_STOKEN for entries
    clear w_linnum.
    describe table i_stoken lines w_linnum.
    if w_linnum gt 0.
    w_level = '0'.
    w_prog = ''.
    w_incl = ''.
    perform data_search tables i_stoken using w_level w_prog w_incl.
    endif.
    endform. "DATA_SELECT
    & Form GET_FM_DATA &
    form get_fm_data.
    data selection message to sap gui
    call function 'SAPGUI_PROGRESS_INDICATOR'
    destination 'SAPGUI'
    keeping logical unit of work
    exporting
    text = 'Get function module data' "#EC NOTEXT
    exceptions
    system_failure
    communication_failure. "#EC *
    Function module data
    sort i_fmodule by name.
    delete adjacent duplicates from i_fmodule comparing name.
    loop at i_fmodule where done ne 'X'.
    clear: i_stoken, i_sstmnt, sourcetab, wa_tfdir, w_include .
    refresh: i_stoken, i_sstmnt, sourcetab.
    store function groups
    select single area from enlfdir into wa_enlfdir-area
    where funcname = i_fmodule-name.
    i_enlfdir-area = wa_enlfdir-area.
    append i_enlfdir.
    Store development classes
    if not wa_enlfdir-area is initial.
    select single devclass into wa_tadir-devclass
    from tadir where pgmid = 'R3TR'
    and object = 'FUGR'
    and obj_name = wa_enlfdir-area.
    check not wa_tadir-devclass is initial.
    move wa_tadir-devclass to i_devclass-clas.
    append i_devclass.
    endif.
    clear wa_tfdir.
    select single funcname pname include from tfdir into wa_tfdir
    where funcname = i_fmodule-name.
    check sy-subrc = 0.
    call function 'FUNCTION_INCLUDE_SPLIT'
    exporting
    program = wa_tfdir-pname
    importing
    group = w_area.
    concatenate 'L' w_area 'U' wa_tfdir-include into w_include.
    i_fmodule-pname = w_include.
    i_fmodule-pname2 = wa_tfdir-pname.
    modify i_fmodule.
    read report i_fmodule-pname into sourcetab.
    if sy-subrc = 0.
    scan abap-source sourcetab tokens into i_stoken
    statements into i_sstmnt
    keywords from keywords
    with includes.
    if sy-subrc > 0.
    message e130(enhancement) raising syntax_error.
    endif.
    check i_stoken for entries
    clear w_linnum.
    describe table i_stoken lines w_linnum.
    if w_linnum gt 0.
    w_level = '1'.
    w_prog = i_fmodule-pname2.
    w_incl = i_fmodule-pname.
    perform data_search tables i_stoken using w_level w_prog w_incl.
    endif.
    endif.
    endloop.
    sort funtion groups
    sort i_devclass.
    delete adjacent duplicates from i_devclass.
    sort i_enlfdir.
    delete adjacent duplicates from i_enlfdir.
    endform. "GET_FM_DATA
    & Form GET_SUBMIT_DATA &
    form get_submit_data.
    data selection message to sap gui
    call function 'SAPGUI_PROGRESS_INDICATOR'
    destination 'SAPGUI'
    keeping logical unit of work
    exporting
    text = 'Get submit data' "#EC NOTEXT
    exceptions
    system_failure
    communication_failure
    . "#EC *
    sort i_submit.
    delete adjacent duplicates from i_submit comparing pname.
    w_level = '0'.
    loop at i_submit where done ne 'X'.
    check i_submit-pname ne p_pname. " ensure not the same as origianl program
    clear: i_stoken, i_sstmnt, sourcetab.
    refresh: i_stoken, i_sstmnt, sourcetab.
    read report i_submit-pname into sourcetab.
    if sy-subrc <> 0.
    delete i_submit.
    continue.
    else.
    scan abap-source sourcetab tokens into i_stoken
    statements into i_sstmnt
    keywords from keywords
    with includes.
    if sy-subrc > 0.
    continue.
    endif.
    check i_stoken for entries
    clear w_linnum.
    describe table i_stoken lines w_linnum.
    if w_linnum gt 0.
    w_prog = i_submit-pname.
    w_incl = ''.
    perform data_search tables i_stoken using w_level w_prog w_incl.
    endif.
    endif.
    restrict number of submit program selected for processing
    describe table i_submit lines w_linnum.
    if w_linnum ge p_limit.
    w_level = '1'.
    endif.
    i_submit-done = 'X'.
    modify i_submit.
    endloop.
    sort i_submit.
    delete adjacent duplicates from i_submit comparing pname.
    endform. "GET_SUBMIT_DATA
    & Form DATA_SEARCH &
    form data_search tables p_stoken structure stoken
    using p_level p_prog p_incl.
    loop at p_stoken.
    clear i_userexit.
    tabix = sy-tabix + 1.
    i_userexit-level = p_level.
    if i_userexit-level = '0'.
    if p_incl is initial.
    i_userexit-pname = p_pname.
    else.
    concatenate p_pname '/' p_incl into i_userexit-pname.
    endif.
    else.
    if p_incl is initial.
    i_userexit-pname = p_prog.
    else.
    concatenate p_prog '/' p_incl into i_userexit-pname.
    endif.
    endif.
    Include
    if p_stoken-str eq 'INCLUDE'.
    check p_level eq '0'. " do not perform for function modules (2nd pass)
    w_index = sy-tabix + 1.
    read table p_stoken index w_index into wa_stoken.
    check not wa_stoken-str cs 'STRUCTURE'.
    check not wa_stoken-str cs 'SYMBOL'.
    read table i_submit with key pname = wa_stoken-str.
    if sy-subrc <> 0.
    i_submit-pname = wa_stoken-str.
    i_submit-level = p_level.
    append i_submit.
    endif.
    endif.
    Enhancements
    if p_stoken-str eq 'CUSTOMER-FUNCTION'.
    clear w_funcname.
    read table p_stoken index tabix.
    translate p_stoken-str using ''' '.
    condense p_stoken-str.
    if p_prog is initial.
    concatenate 'EXIT' p_pname p_stoken-str into w_funcname
    separated by '_'.
    else.
    concatenate 'EXIT' p_prog p_stoken-str into w_funcname
    separated by '_'.
    endif.
    select single member from modsap into wa_modsap-member
    where member = w_funcname.
    if sy-subrc = 0. " check for valid enhancement
    i_userexit-type = 'Enhancement'.
    i_userexit-txt = w_funcname.
    append i_userexit.
    else.
    clear wa_d010inc.
    select single master into wa_d010inc-master
    from d010inc
    where include = p_prog.
    concatenate 'EXIT' wa_d010inc-master p_stoken-str into w_funcname
    separated by '_'.
    i_userexit-type = 'Enhancement'.
    i_userexit-txt = w_funcname.
    endif.
    endif.
    BADIs
    if p_stoken-str cs 'cl_exithandler='.
    w_index = sy-tabix + 4.
    read table p_stoken index w_index into wa_stoken.
    i_userexit-txt = wa_stoken-str.
    replace all occurrences of '''' in i_userexit-txt with space.
    i_userexit-type = 'BADI'.
    append i_userexit.
    endif.
    Business transaction events
    if p_stoken-str cs 'OPEN_FI_PERFORM'.
    i_userexit-type = 'BusTrEvent'.
    i_userexit-txt = p_stoken-str.
    replace all occurrences of '''' in i_userexit-txt with space.
    i_userexit-modname = i_userexit-txt+16(8).
    case i_userexit-txt+25(1).
    when 'E'.
    clear wa_tbe01t.
    select single text1 into wa_tbe01t-text1 from tbe01t
    where event = i_userexit-txt+16(8)
    and spras = sy-langu.
    if wa_tbe01t-text1 is initial.
    i_userexit-modtext = ''. "#EC NOTEXT
    else.
    i_userexit-modtext = wa_tbe01t-text1.
    endif.
    i_userexit-modname+8 = '/P&S'. "#EC NOTEXT
    when 'P'.
    clear wa_tps01t.
    select single text1 into wa_tps01t-text1 from tps01t
    where procs = i_userexit-txt+16(8)
    and spras = sy-langu.
    i_userexit-modtext = wa_tps01t-text1.
    i_userexit-modname+8 = '/Process'.
    endcase.
    append i_userexit.
    endif.
    Program exits
    if p_stoken-str cs 'USEREXIT_'.
    i_userexit-type = 'Program Exit'.
    i_userexit-txt = p_stoken-str.
    replace all occurrences of '''' in i_userexit-txt with space.
    append i_userexit.
    endif.
    Submit programs
    if p_stoken-str cs 'SUBMIT'.
    check p_level eq '0'. " do not perform for function modules (2nd pass)
    check not p_stoken-str cs '_'. " ensure not SUBMIT_XXX
    w_index = sy-tabix + 1.
    read table p_stoken index w_index into wa_stoken.
    check not wa_stoken-str cs '_'. " ensure not SUBMIT_XXX
    replace all occurrences of '''' in wa_stoken-str with space.
    read table i_submit with key pname = wa_stoken-str.
    if sy-subrc <> 0.
    i_submit-pname = wa_stoken-str.
    i_submit-level = p_level.
    append i_submit.
    endif.
    endif.
    Perform routines (which reference external programs)
    if p_stoken-str cs 'PERFORM'.
    check p_level eq '0'. " do not perform for function modules (2nd pass)
    w_index = sy-tabix + 1.
    read table p_stoken index w_index into wa_stoken.
    if not wa_stoken-ovfl is initial.
    w_off = wa_stoken-off1 + 10.
    w_str = c_overflow+w_off(30).
    find ')' in w_str match offset w_off.
    w_off = w_off + 1.
    wa_stoken-str = w_str(w_off).
    endif.
    check wa_stoken-str cs '('.
    w_off = 0.
    while sy-subrc = 0.
    if wa_stoken-str+w_off(1) eq '('.
    replace section offset w_off length 1 of wa_stoken-str with ''.
    replace all occurrences of ')' in wa_stoken-str with space.
    read table i_submit with key pname = wa_stoken-str.
    if sy-subrc <> 0.
    i_submit-pname = wa_stoken-str.
    append i_submit.
    endif.
    exit.
    else.
    replace section offset w_off length 1 of wa_stoken-str with ''.
    shift wa_stoken-str left deleting leading space.
    endif.
    endwhile.
    endif.
    Function modules
    if p_stoken-str cs 'FUNCTION'.
    clear i_fmodule.
    check p_level eq '0'. " do not perform for function modules (2nd pass)
    w_index = sy-tabix + 1.
    read table p_stoken index w_index into wa_stoken.
    if wa_stoken-str cs 'WF_'.
    if wa_stoken-str cs 'IDOC'.
    break-point.
    endif.
    if wa_stoken-str cs 'BAPI'.
    i_fmodule-bapi = 'X'.
    endif.
    replace first occurrence of '''' in wa_stoken-str with space.
    replace first occurrence of '''' in wa_stoken-str with space.
    if sy-subrc = 4. " didn't find 2nd quote (ie name truncated)
    clear wa_tfdir.
    concatenate wa_stoken-str '%' into wa_stoken-str.
    select single funcname into wa_tfdir-funcname from tfdir
    where funcname like wa_stoken-str.
    if sy-subrc = 0.
    i_fmodule-name = wa_tfdir-funcname.
    else.
    continue.
    endif.
    else.
    i_fmodule-name = wa_stoken-str.
    endif.
    read table i_fmodule with key name = i_fmodule-name.
    if sy-subrc <> 0.
    i_fmodule-level = p_level.
    append i_fmodule.
    endif.
    endif.
    endloop.
    endform. "DATA_SEARCH
    & Form GET_ADDITIONAL_DATA &
    form get_additional_data.
    data selection message to sap gui
    call function 'SAPGUI_PROGRESS_INDICATOR'
    destination 'SAPGUI'
    keeping logical unit of work
    exporting
    text = 'Get additional data' "#EC NOTEXT
    exceptions
    system_failure
    communication_failure
    . "#EC *
    loop at i_userexit.
    Enhancement data
    if i_userexit-type cs 'Enh'.
    clear: wa_modsapa.
    select single name into wa_modsapa-name from modsap
    where member = i_userexit-txt.
    check sy-subrc = 0.
    i_userexit-modname = wa_modsapa-name.
    clear wa_modsapt.
    select single modtext into wa_modsapt-modtext from modsapt
    where name = wa_modsapa-name
    and sprsl = sy-langu.
    i_userexit-modtext = wa_modsapt-modtext.
    MOH - enhancement to get the project name
    clear w_mod.
    select single modactmember modactname modattr~status
    modattranam modattradat
    into w_mod
    from modact
    inner join modattr
    on modattrname = modactname
    where modact~member = wa_modsapa-name
    and modact~typ = space.
    i_userexit-modattr = w_mod.
    MOH - eoe
    endif.
    BADI data
    if i_userexit-type eq 'BADI'.
    clear wa_sxs_attr.
    select single exit_name into wa_sxs_attr-exit_name from sxs_attr
    where exit_name = i_userexit-txt.
    if sy-subrc = 0.
    i_userexit-modname = i_userexit-txt.
    else.
    i_userexit-modname = 'Dynamic call'. "#EC NOTEXT
    endif.
    clear wa_sxs_attrt.
    select single text into wa_sxs_attrt-text from sxs_attrt
    where exit_name = wa_sxs_attr-exit_name
    and sprsl = sy-langu.
    i_userexit-modtext = wa_sxs_attrt-text.
    endif.
    modify i_userexit.
    endloop.
    get enhancements via program package
    clear wa_tadir.
    select single devclass into wa_tadir-devclass from tadir
    where pgmid = 'R3TR'
    and object = 'PROG'
    and obj_name = p_pname.
    if sy-subrc = 0.
    clear: wa_modsapa, wa_modsapt.
    select name from modsapa into wa_modsapa-name
    where devclass = wa_tadir-devclass.
    select single modtext from modsapt into wa_modsapt-modtext
    where name = wa_modsapa-name
    and sprsl = sy-langu.
    read table i_userexit with key modname = wa_modsapa-name.
    if sy-subrc <> 0.
    i_userexit-modtext = wa_modsapt-modtext.
    i_userexit-type = 'Enhancement'. "#EC NOTEXT
    i_userexit-modname = wa_modsapa-name.
    i_userexit-txt = 'Determined from program DevClass'."#EC NOTEXT
    i_userexit-pname = 'Unknown'. "#EC NOTEXT
    append i_userexit.
    endif.
    endselect.
    endif.
    Get IDOCs
    loop at i_devclass.
    endloop.
    endform. "GET_ADDITIONAL_DATA
    & Form DATA_DISPLAY &
    form data_display.
    data selection message to sap gui
    call function 'SAPGUI_PROGRESS_INDICATOR'
    destination 'SAPGUI'
    keeping logical unit of work
    exporting
    text = 'Prepare screen for display' "#EC NOTEXT
    exceptions
    system_failure
    communication_failure
    . "#EC *
    sort i_userexit by type txt modname.
    delete adjacent duplicates from i_userexit comparing txt modname.
    format headings
    write: 'Enhancements from main program'. "#EC NOTEXT
    write: /.
    uline.
    format color col_heading.
    write: / sy-vline,
    (12) c_col1, "Enhanmt Type
    sy-vline,
    (40) c_col2, "Enhancement
    sy-vline,
    (30) c_col3, "Program/Include
    sy-vline,
    (20) c_col4, "Enhancement name
    sy-vline,
    (60) c_col5, "Enhancement description
    sy-vline,
    (8) c_col6, "Project
    sy-vline,
    (1) c_col7, "S
    sy-vline,
    (12) c_col8, "ChangeName
    sy-vline,
    (10) c_col9, "ChangeDate
    sy-vline.
    format reset.
    uline.
    format lines
    loop at i_userexit.
    set line colour
    case i_userexit-type.
    when 'Enhancement'.
    format color 3 intensified off.
    when 'BADI'.
    format color 4 intensified off.
    when 'BusTrEvent'.
    format color 5 intensified off.
    when 'Program Exit'.
    format color 6 intensified off.
    when others.
    format reset.
    endcase.
    write: / sy-vline,
    i_userexit-type,
    sy-vline,
    i_userexit-txt(40),
    sy-vline,
    i_userexit-pname(30),
    sy-vline,
    i_userexit-modname(20),
    sy-vline,
    i_userexit-modtext(60),
    sy-vline,
    i_userexit-modattr-name,
    sy-vline,
    i_userexit-modattr-status,
    sy-vline,
    i_userexit-modattr-anam,
    sy-vline,
    i_userexit-modattr-adat no-zero,
    sy-vline.
    hide: i_userexit-type,
    i_userexit-txt,
    i_userexit-pname,
    i_userexit-modname,
    i_userexit-modtext.
    endloop.
    format reset.
    uline.
    user-exits from development class of function modules
    if p_devc = 'X'.
    write: /.
    write: / 'User-exits from function module development class'."#EC NOTEXT
    write: 157''.
    uline (90).
    write: 157''.
    loop at i_devclass.
    clear wa_modsapa.
    select name from modsapa into wa_modsapa
    where devclass = i_devclass-clas.
    select single name modtext into corresponding fields of wa_modsapt
    from modsapt
    where name = wa_modsapa-name
    and sprsl = sy-langu.
    format color 3 intensified off.
    write: / sy-vline,
    (12) 'Enhancement',
    sy-vline,
    wa_modsapa-name,
    sy-vline,
    wa_modsapt-modtext,
    sy-vline.
    endselect.
    endloop.
    uline (90).
    format reset.
    endif.
    describe table i_fmodule lines w_linnum.
    write: / c_fmod , at 35 w_linnum. "#EC NOTEXT
    write: 157''.
    if p_func = 'X'.
    display fuction modules used in program
    uline (38).
    write: 157''.
    loop at i_fmodule.
    write: sy-vline,
    i_fmodule-name,
    sy-vline,
    i_fmodule-bapi,
    sy-vline.
    write: 157''.
    endloop.
    uline (38).
    write: 157''.
    endif.
    describe table i_submit lines w_linnum.
    write: / c_subm , at 35 w_linnum. "#EC NOTEXT
    write: 157''.
    if p_subm = 'X'.
    display submit programs used in program
    uline (44).
    write: 157''.
    loop at i_submit.
    write: sy-vline,
    i_submit-pname,
    sy-vline.
    write: 157''.
    endloop.
    uline (44).
    endif.
    issue message with number of user-exits displayed
    describe table i_userexit lines w_linnum.
    message s697(56) with w_linnum.
    endform. "DATA_DISPLAY
    & User Selection Processing &
    at line-selection.
    get cursor field w_fsel.
    case w_fsel.
    when 'I_USEREXIT-MODNAME'.
    case i_userexit-type.
    when 'Enhancement'.
    set parameter id 'MON' field i_userexit-modname.
    call transaction 'SMOD' and skip first screen.
    when 'BADI'.
    check i_userexit-modname ne 'Dynamic call'.
    set parameter id 'EXN' field i_userexit-modname.
    call transaction 'SE18' and skip first screen.
    when 'BusTrEvent'.
    submit rfopfi00 with attr_typey_selm = 'A'
    with event = i_userexit-modname(8)
    via selection-screen
    and return.
    when others.
    endcase.
    when 'I_USEREXIT-PNAME'.
    check i_userexit-modname ne 'Unknown'.
    w_off = 0.
    find '/' in i_userexit-pname match offset w_off.
    if w_off = 0.
    set parameter id 'RID' field i_userexit-pname.
    call transaction 'SE38' and skip first screen.
    else.
    w_off = w_off + 1.
    w_prog = i_userexit-pname+w_off.
    set parameter id 'RID' field w_prog.
    call transaction 'SE38' and skip first screen.
    endif.
    when others.
    endcase.
    Feel free to revert back.
    --Ragu

  • About transactional Triggers

    Hai All,
    Can any one tell me what is transactional trigger and when to use it???
    Thanks
    Sriram.

    Is it possible for you to start with an Oracle Forms 10g Starters-Course at Oracle University? 5 days and after that you know Forms very good. If you do the course here in cologne - then I'm your trainer :-)
    if it's not possible we well help you as good as we can...
    have fun
    Gerd

  • Synchronize MII transaction - only one running instance at a time

    Hello,
    I have a scenario where I use an MII transaction triggered by PCO, and it may be the case that the same PCO notification triggers this transaction twice within a very short time, i.e., the second transaction instance starts its execution before the first instance has finished. But I really need to make sure that those calls are done one after the other and that they do not overlap.
    What is the best way to achieve this? Which MII technologies can I use? I do not want to use message services and schedule a job that handels the requests one after the other - I need real time action and  in this case I would need to schedule the Job every second. Im really looking for a kind of semaphore/mutex solution to make sure that the MII transaction call can be fired by PCO and in case the previous transaction call is still running, the current one should wait until the previous one has finished.
    Thank you for your input and ideas!
    Best Regards,
    Matthias

    Hi Steve,
    1. The PCO notification will be triggered when a PLC counter increases (which is actually the trigger that another piece has been produced on one of our production lines) - this happens in average every 10 to 15 seconds, but due to some special setup it can be the case that 2 or 3 consecutive pieces come out at the end of the line immediately one after the other, followed by a larger pause.
    2. The expected duration of the MII transactoin will be approx. 2 to 3 seconds.
    3. The exact software versions we use are PCO 2.1.6.1 and MII 12.1.9.123.
    to be precise, the serialization of the transactiona does not need to be for all instances, but only for instances of the same production line, i.e., transactions of different lines may run at the same time, but for a single production line the transaction calls must not overlap.
    The reason is the following: We want to implement a "difference posting" of produced pieces: each PCO message holds the  PLC counter value, and in the MII transaction I want to refer to the counter of the previously produced piece. If the difference is one, everything was OK, one additional piece needs to be recorded in the system. If the difference is greater than one (for the sake of example, lets say 3) I will record 3 new pieces in the system, and if the difference is less than one (wrong order in message delivery, should normally not happen) I will simply ignore the message. This gives us the possibility to not lose data during a PCO outage: PCO is up until PLC counter value 10, is down from PLC counter value 11 to 15, and comes back at PLC counter value 16. When I process the message with counter value 16, I will see that the last processed piece was for counter value 10, therefore I need to create 6 pieces - the 5 I have "lost" plus the current one.
    To be able to safely refer to the previously produced piece, there must not be any parallel transaction executions, since then maybe two instances read the same "previous counter" and therefore mess up the collected data.
    I hope this gives you an idea what I want to achieve.
    Best Regards,
    Matthias

  • Can we call another transaction from the Userexit

    Hi all,
            Can we call another transaction from the Userexit?
    Thanks,
    Balaji

    Hi
    Because the statament CALL TRANSACTION triggers the end of the LUW so COMMIT WORK, so you should be sure not to insert that statament while some updating actions are been doing.
    So that exit shouldn't be triggered while updating
    Max

  • OIM Transaction Mgmt/Rollback

    We have a requirement as follows:
    Service A calls OIM to create a user and in turn provision to target
    1. Service A triggers OIM User Create at that point, OIM Instead of committing the transaction triggers provisioning to target, it should provision first and then commit OIM user creation.
    Or. Create a user in OIM but don't respond to calling service yet, trigger provisioning to target on success respond to service as success, if provisioning fails, delete/rollback the user in OIM.
    How can either of case be implemented?
    please advise.

    As for initiating provisioning, OIM needs User Key and that will be generated only after creation of User In to OIM.
    It's difficult to write such queries which will Roll Back everything but it's not recommended as it is against Audit and Compliance but if you want then you can write only with Hard Work. How are you provisioning that Resource from Access Policy or through Event Handler.
    Try with putting Event Handler on Pre Insert which will trigger the Provisioning. I haven't tested it but you can give a try and let us know the results.

  • Leave transaction

    Hello everyone
    I have problem like this: From transaction TR1 I call another transaction TR2.I don' t want to call transaction TR2 with her first screen ,but with hers third screen. This is the code:
    DATA: BDCDATA TYPE TABLE OF BDCDATA.
          DATA: PROGRAM LIKE SY-REPID,
          WA_BDCDATA TYPE BDCDATA,
          WA_BDCDATA1 TYPE BDCDATA.
          CLEAR WA_BDCDATA.
          WA_bdcdata-program = 'ZREKLAMACJE'.
          WA_bdcdata-dynpro = '0100'.
          WA_bdcdata-dynbegin = 'X'.
          APPEND WA_BDCDATA TO BDCDATA.
          CLEAR WA_BDCDATA.
          WA_BDCDATA-FNAM = 'BDC_CURSOR'.
          WA_BDCDATA-FVAL = 'T1'.
          APPEND WA_BDCDATA TO BDCDATA.
          CLEAR WA_BDCDATA.
          WA_BDCDATA-FNAM = 'BDC_OKCODE'.
          WA_BDCDATA-FVAL = 'ANALIZA'.
          APPEND WA_BDCDATA TO BDCDATA.
          set parameter id 'num_wew' field NUMER_ZNAKOWY-ROWTYPE.
          set parameter id 'kod_transakcji' field sy-tcode.
          call transaction 'ZREKLAMACJA_ZEW' USING BDCDATA MODE 'E'.
    The transacton TR2 is working, but how can I end transaction TR1. When I'm using leave program, when second transaction ends, everything goes back to the first transaction TR1.
    Please help .
    Thank you.

    Hi
    It depends on how the second transaction is called, you should consider a batchinput simulation ends when a commit is triggered, a statament like CALL TRANSACTION triggers automatically the commit.
    So you should change the program in ordert to change the way to call the transaction TR2:
    - try to use LEAVE TRANSACTION instead of CALL TRANSACTION;
    - or create a dialog for TR2
    Max

  • Creating a block using transactional trigger

    hello every body,
    how to create datablock using transactional triggers.
    give me one example with contiguous steps..

    Ramesh,
    What do you meen by "transactional trigger" ?
    Do you want to base the block on a view, a sub query or strored procedures ?
    Francois

  • Multiple data blocks on the same canvas

    Forms newbie question:
    Is it possible to have 2 data blocks with two different sets of transactional triggers (ON-UPDATE, ON-LOCK, etc.) on the same canvas?
    I've got an example where i've got two data blocks (one sourced from a view, and one that is a CTL block) on the same canvas. The block sourced from the view is working fine. When I make updates, they are reflected, etc. But, i've got one field in the control block that I need to update from as well, and I can't seem to get it (or any of the CTL block items) to show up as "updateable", regardless of the set_item_property....theyre always grayed out.
    Do i need to take the user to a new canvas to be able to utilize the update of the ctl field?

    A second canvas is not needed. Normally, control-block items are always updateable, so there is something going on in your form to prevent it.
    > I can't seem to get it (or any of the CTL block items) to show up as "updateable",
    regardless of the set_item_property....theyre always grayed out.
    What... Is there code someplace in the form that sets them to Enabled, false? If that is the case, then to get them working again, besides setting Enabled to true, you also must set Updateable and Navigable to Property_True. (This is documented at the end of the on-line help on Set_Item_Property.)

  • "instead of" trigger on a view with a condition

    I'm trying to create an instead-of trigger on a view but I want it all such that:
    1. It fires only for a certain condition.
    2. When the condition isn't met, I want the normal DML on the view to continue as it normally would.
    3. I want to avoid writing as much manual DML code as possible for long-term maintainability.
    My first attempt is like this:
    create or replace trigger PROPOSAL_PARTS_V_IRU
      instead of update on proposal_parts_v
      for each row
      WHEN :old.PART_MASTER_ID <> :new.PART_MASTER_ID
    BEGIN
      do_stuff_for_part_master_change;
    END;So when the OLD and NEW PART_MASTER_IDs have changed, I want special processing. Else, I want it to do whatever it normally does (let the view get updated and the database will manage the update of the underlying table).
    When compiling that I get "ORA-25004: WHEN clause is not allowed in INSTEAD OF triggers".
    OK I will accept that even though I want it to work.
    So my next attempt could be:
    create or replace trigger PROPOSAL_PARTS_V_IRU
      instead of update on proposal_parts_v
      for each row
    BEGIN
      IF :old.PART_MASTER_ID <> :new.PART_MASTER_ID THEN
        do_stuff_for_part_master_change;
      ELSE
        UPDATE proposal_parts -- Manually update the underlying table with manually-written DML but I hate having to do this in case the view or table columns change.
        SET...
        WHERE...
      END;So my question is...is there any syntax to do something like this?
    create or replace trigger PROPOSAL_PARTS_V_IRU
      instead of update on proposal_parts_v
      for each row
    BEGIN
      IF :old.PART_MASTER_ID <> :new.PART_MASTER_ID THEN
        do_stuff_for_part_master_change;
      ELSE
        update_row;
      END;...where "update_row" is some sort of built-in command that tells oracle to continue with the current update as if the trigger never existed.
    Back in the day I seem to remember that Oracle Forms had a trigger and syntax like this where you could intercept a DML and if under certain conditions it wasn't true, you could say "update_row" (or maybe it was "update_record?...whatever) and it meant "continue with update as if this instead-of trigger never existed".
    Is anything available like that for the DB now? I know in older versions no, but we are now on 11g...anything new come out like this?
    Otherwise I have to manually write an update statement and I'd rather not if I don't need to.
    Thanks!

    riedelme wrote:
    gti_matt wrote:
    I'm trying to create an instead-of trigger on a view but I want it all such that:
    1. It fires only for a certain condition.You can use IF Logic inside a trigger to do or not do anything. As long as it is a condition you can check you can code IF logic around it
    2. When the condition isn't met, I want the normal DML on the view to continue as it normally would.You will have to code all of your logic in the INSTEAD of trigger. The whole purpose of the INSTEAD OF trigger is to execute INSTEAD OF performing DML on the view. There is no way to go back to the "normal DML" when the INSTEAD OF trigger exists.
    You can put all of the logic you will need in the INSTEAD OF trigger and use IF conditions. Use IF logic to code both your special and "normal" processing.
    3. I want to avoid writing as much manual DML code as possible for long-term maintainability.You will have to code the operative lines somewhere. Reusable functions and/or procedures in a package?Yep using an "IF" I knew about...no problem there.
    But was just looking for a cheap and easy way to say (for the "else" condition) to revert to normal DML processing. Sounds like in a DB trigger there is no such syntax I guess.
    This is an example from Oracle Forms, I was looking for a database equivalent of this(see http://sqltech.cl/doc/dev2000/help/fbhelp18.htm):
    Built-in Subprograms for On-Event Triggers For most of the transactional On-event triggers, there is a corresponding built-in subprogram.
    On-Event Trigger
    Corresponding Built-in
    On-Delete
    DELETE_RECORD
    On-Insert
    INSERT_RECORD
    On-Update
    UPDATE_RECORD
    When you call one of these built-in subprograms from its corresponding transactional trigger, Form Builder performs the default processing that it would have done normally at that point in the transaction.
    For example, if you call the INSERT_RECORD procedure from an On-Insert trigger, Form Builder performs the default processing for inserting a record in the database during a commit operation.
    When these built-ins are issued from within their corresponding transactional triggers, they are known as do-the-right-thing built-ins. That is, they do what Form Builder would normally have done at that point if no trigger had been present. Thus, an On-Insert trigger that calls the INSERT_RECORD procedure is functionally equivalent to not having an On-Insert trigger at all. Such a trigger is explicitly telling Form Builder to do what it would have done by default anyway.Note that the author calls them the "do-the-right-thing" built-ins. That's what I was looking for but on the DB side. Sounds like Oracle didn't come up with that (yet)?

  • SXMB_MONI and BPM acknowledgement status updates

    Hi folks,
    We have a scenario in place where we deliver an IDOC to the backend system via the 'send' step and we had acknowledgement property set to 'transport' as we believed that the IDOC adapter would at least return us with exception information when something went wrong with the delivery of the IDOC.  We also added 'deadline' monitoring as well to prevent the BPM of 'waiting forever' ... In case of exceptions or deadline, an alert is thrown.
    This concept worked fine during development testing - IDOCS with status 56 or even 51 got picked up and resulted in error ... ( huray )
    Once tested in acceptance it didn't work at all anymore and all our BPM's ended up in the deadline branch - even for those IDOCS that were processed successfully ...
    After reading SAP note 'Note 837285 - BPE TS: Acknowledgments in the BPE' we understood that the BPM does not support transient errors and as such our concept would never work as we intented it but still it did in development ... even worse it worked sometimes in acceptance as well ...
    After a while we figured out that it worked when we ran transaction SXMB_MONI while the BPM was still waiting for the acknowledgement ... so basically this transaction triggered somehow the update of the acknowledgement status and as such the BPM continued as expected ...
    Then we noticed as well that the transaction even updates statuses of messages of previous days ... ( the BPM for those was obviously allready completed due to deadline ... )
    We are a bit 'lost' here on the whole concept ...
    We read the 'How to handle Acknowledgements' PDF with ALEAUDIT but that only works for logical systems which is not our case ...
    Why is the SXMB_MONI transaction updating the acknowledgement statuses ?  How does it do that - what does it check ? ( we noticed that although IDOCS had status 56 we still got a positive ack status )?  
    In general it seems that using BPM with send step and waiting for ack with the IDOC adapter is useless due to the transient ack status ( as explained in the note ) ... is that assumption correct ?
    Regards,
    Steven

    Hi Steven,
    I can't answer your specific questions, but it occurs to me that the <a href="http://help.sap.com/saphelp_nw04/helpdata/en/44/a1b46c4c686341e10000000a114a6b/frameset.htm">new functionality in SP18</a> to turn received ALEAUDs into "normal" XI request messages may provide a workaround for your problems. The transformed ALEAUDs could be routed to your BPM by way of a correlation on the IDoc number. This way you could react to <i>all</i> ALEAUDs regardless of status...
    Regards,
    Thorsten

  • Oracle SQL and PL/SQL interview questions.

    Can anyone forward me all Oracle SQL and PL/SQL Interview questions and answers asap.
    Many Thanks.
    Bba

    Dear Pal
    I not sure all the all answers are correct. I got one mail couple yrs back. I am just sharing mail contents. Kindly keep question and compare answers.
    1 Which is more faster - IN or EXISTS?
    EXISTS is more faster than IN because EXISTS returns a Boolean value whereas IN returns a value.
    2 Which datatype is used for storing graphics and images?
    LONG RAW data type is used for storing BLOB's (binary large objects).
    3 When do you use WHERE clause and when do you use HAVING clause?
    HAVING clause is used when you want to specify a condition for a group function and it is written after GROUP BY clause. The WHERE clause is used when you want to specify a condition for columns, single row functions except group functions and it is written before GROUP BY clause if it is used.
    4 What WHERE CURRENT OF clause does in a cursor?
    LOOPSELECT num_credits INTO v_numcredits FROM classesWHERE dept=123 and course=101;UPDATE studentsSET current_credits=current_credits+v_numcreditsWHERE CURRENT OF X;END LOOPCOMMIT;END;
    5 What should be the return type for a cursor variable.Can we use a scalar data type as return type?
    The return type for a cursor must be a record type.It can be declared explicitly as a user-defined or %ROWTYPE can be used. eg TYPE t_studentsref IS REF CURSOR RETURN students%ROWTYPE
    6 What is use of a cursor variable? How it is defined?
    A cursor variable is associated with different statements at run time, which can hold different values at run time. Static cursors can only be associated with one run time query. A cursor variable is reference type (like a pointer in C).Declaring a cursor variable:TYPE type_name IS REF CURSOR RETURN return_type type_name is the name of the reference type,return_type is a record type indicating the types of the select list that will eventually be returned by the cursor variable.
    7 What is the purpose of a cluster?
    Oracle does not allow a user to specifically locate tables, since that is a part of the function of the RDBMS. However, for the purpose of increasing performance, oracle allows a developer to create a CLUSTER. A CLUSTER provides a means for storing data from different tables together for faster retrieval than if the table placement were left to the RDBMS.
    8 What is the maximum buffer size that can be specified using the DBMS_OUTPUT.ENABLE function?
    1,000,00
    9 What is syntax for dropping a procedure and a function .Are these operations possible?
    Drop Procedure procedure_nameDrop Function function_name
    10 What is OCI. What are its uses?
    Oracle Call Interface is a method of accesing database from a 3GL program. Uses--No precompiler is required,PL/SQL blocks are executed like other DML statements. The OCI library provides· -functions to parse SQL statemets· -bind input variables· -bind output variables· -execute statements· -fetch the results
    11 What is difference between UNIQUE and PRIMARY KEY constraints?
    A table can have only one PRIMARY KEY whereas there can be any number of UNIQUE keys. The columns that compose PK are automatically define NOT NULL, whereas a column that compose a UNIQUE is not automatically defined to be mandatory must also specify the column is NOT NULL.
    12 What is difference between SUBSTR and INSTR?
    SUBSTR returns a specified portion of a string eg SUBSTR('BCDEF',4) output BCDEINSTR provides character position in which a pattern is found in a string. eg INSTR('ABC-DC-F','-',2) output 7 (2nd occurence of '-')
    13 What is difference between SQL and SQL*PLUS?
    SQL*PLUS is a command line tool where as SQL and PL/SQL language interface and reporting tool. Its a command line tool that allows user to type SQL commands to be executed directly against an Oracle database. SQL is a language used to query the relational database(DML,DCL,DDL). SQL*PLUS commands are used to format query result, Set options, Edit SQL commands and PL/SQL.
    14 What is difference between Rename and Alias?
    Rename is a permanent name given to a table or column whereas Alias is a temporary name given to a table or column which do not exist once the SQL statement is executed.
    15 What is difference between a formal and an actual parameter?
    The variables declared in the procedure and which are passed, as arguments are called actual, the parameters in the procedure declaration. Actual parameters contain the values that are passed to a procedure and receive results. Formal parameters are the placeholders for the values of actual parameters
    16 What is an UTL_FILE.What are different procedures and functions associated with it?
    UTL_FILE is a package that adds the ability to read and write to operating system files. Procedures associated with it are FCLOSE, FCLOSE_ALL and 5 procedures to output data to a file PUT, PUT_LINE, NEW_LINE, PUTF, FFLUSH.PUT, FFLUSH.PUT_LINE,FFLUSH.NEW_LINE. Functions associated with it are FOPEN, ISOPEN.
    17 What is a view ?
    A view is stored procedure based on one or more tables, it’s a virtual table.
    18 What is a pseudo column. Give some examples?
    It is a column that is not an actual column in the table.eg USER, UID, SYSDATE, ROWNUM, ROWID, NULL, AND LEVEL.
    19 What is a OUTER JOIN?
    Outer Join--Its a join condition used where you can query all the rows of one of the tables in the join condition even though they don’t satisfy the join condition.
    20 What is a cursor?
    Oracle uses work area to execute SQL statements and store processing information PL/SQL construct called a cursor lets you name a work area and access its stored information A cursor is a mechanism used to fetch more than one row in a Pl/SQl block.
    21 What is a cursor for loop?
    Cursor For Loop is a loop where oracle implicitly declares a loop variable, the loop index that of the same record type as the cursor's record.
    22 What are various privileges that a user can grant to another user?
    · SELECT· CONNECT· RESOURCES
    23 What are various constraints used in SQL?
    · NULL· NOT NULL· CHECK· DEFAULT
    24 What are ORACLE PRECOMPILERS?
    Using ORACLE PRECOMPILERS, SQL statements and PL/SQL blocks can be contained inside 3GL programs written in C,C++,COBOL,PASCAL, FORTRAN,PL/1 AND ADA.The Precompilers are known as Pro*C,Pro*Cobol,...This form of PL/SQL is known as embedded pl/sql,the language in which pl/sql is embedded is known as the host language. The prcompiler translates the embedded SQL and pl/sql ststements into calls to the precompiler runtime library.The output must be compiled and linked with this library to creater an executable.
    25 What are different Oracle database objects?
    · TABLES· VIEWS· INDEXES· SYNONYMS· SEQUENCES· TABLESPACES etc
    26 What are different modes of parameters used in functions and procedures?
    · IN· OUT· INOUT
    27 What are cursor attributes?
    · %ROWCOUNT· %NOTFOUND· %FOUND· %ISOPEN
    28 What a SELECT FOR UPDATE cursor represent. [ANSWER]SELECT......FROM......FOR......UPDATE[OF column-reference][NOWAIT] The processing done in a fetch loop modifies the rows that have been retrieved by the cursor. A convenient way of modifying the rows is done by a method with two parts: the FOR UPDATE clause in the cursor declaration, WHERE CURRENT OF CLAUSE in an UPDATE or declaration statement.
    29 There is a string 120000 12 0 .125 , how you will find the position of the decimal place?
    INSTR('120000 12 0 .125',1,'.')output 13
    30 There is a % sign in one field of a column. What will be the query to find it?
    '' Should be used before '%'.
    31 Suppose a customer table is having different columns like customer no, payments.What will be the query to select top three max payments?
    SELECT customer_no, payments from customer C1
    WHERE 3<=(SELECT COUNT(*) from customer C2
    WHERE C1.payment <= C2.payment)
    32 minvalue.sql Select the Nth lowest value from a table
    select level, min('col_name') from my_table where level = '&n' connect by prior ('col_name') <
    'col_name')
    group by level;
    Example:
    Given a table called emp with the following columns:
    -- id number
    -- name varchar2(20)
    -- sal number
    -- For the second lowest salary:
    -- select level, min(sal) from emp
    -- where level=2
    -- connect by prior sal < sal
    -- group by level
    33 maxvalue.sql Select the Nth Highest value from a table
    select level, max('col_name') from my_table where level = '&n' connect by prior ('col_name') >
    'col_name')
    group by level;
    Example:
    Given a table called emp with the following columns:
    -- id number
    -- name varchar2(20)
    -- sal number
    -- For the second highest salary:
    -- select level, max(sal) from emp
    -- where level=2
    -- connect by prior sal > sal
    -- group by level
    34 How you will avoid your query from using indexes?
    SELECT * FROM emp
    Where emp_no+' '=12345;
    i.e you have to concatenate the column name with space within codes in the where condition.
    SELECT /*+ FULL(a) */ ename, emp_no from emp
    where emp_no=1234;
    i.e using HINTS
    35 How you will avoid duplicating records in a query?
    By using DISTINCT
    36 How you were passing cursor variables in PL/SQL 2.2?
    In PL/SQL 2.2 cursor variables cannot be declared in a package.This is because the storage for a cursor variable has to be allocated using Pro*C or OCI with version 2.2, the only means of passing a cursor variable to a PL/SQL block is via bind variable or a procedure parameter.
    37 How you open and close a cursor variable.Why it is required?
    OPEN cursor variable FOR SELECT...Statement
    CLOSE cursor variable In order to associate a cursor variable with a particular SELECT statement OPEN syntax is used. In order to free the resources used for the query CLOSE statement is used.
    38 How will you delete duplicating rows from a base table?
    delete from table_name where rowid not in (select max(rowid) from table group by duplicate_values_field_name); or
    delete duplicate_values_field_name dv from table_name ta where rowid <(select min(rowid) from table_name tb where ta.dv=tb.dv);
    39 How do you find the numbert of rows in a Table ?
    A bad answer is count them (SELECT COUNT(*) FROM table_name)
    A good answer is :-
    'By generating SQL to ANALYZE TABLE table_name COUNT STATISTICS by querying Oracle System Catalogues (e.g. USER_TABLES or ALL_TABLES).
    The best answer is to refer to the utility which Oracle released which makes it unnecessary to do ANALYZE TABLE for each Table individually.
    40 Find out nth highest salary from emp table
    SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal);
    For Eg:-
    Enter value for n: 2
    SAL
    3700
    41 Display the records between two range?
    select rownum, empno, ename from emp where rowid in (select rowid from emp where rownum <=&upto minus select rowid from emp where rownum<&Start);
    42 Display the number value in Words?
    SQL> select sal, (to_char(to_date(sal,'j'), 'jsp'))
    from emp;
    the output like,
    SAL (TO_CHAR(TO_DATE(SAL,'J'),'JSP'))
    800 eight hundred
    1600 one thousand six hundred
    1250 one thousand two hundred fifty
    If you want to add some text like, Rs. Three Thousand only.
    SQL> select sal "Salary ",
    (' Rs. '|| (to_char(to_date(sal,'j'), 'Jsp'))|| ' only.'))
    "Sal in Words" from emp
    Salary Sal in Words
    800 Rs. Eight Hundred only.
    1600 Rs. One Thousand Six Hundred only.
    1250 Rs. One Thousand Two Hundred Fifty only.
    43 Display Odd/ Even number of records
    Odd number of records:
    select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp);
    Output:-
    1
    3
    5
    Even number of records:
    select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)
    Output:-
    2
    4
    6
    44 Difference between procedure and function.
    Functions are named PL/SQL blocks that return a value and can be called with arguments procedure a named block that can be called with parameter. A procedure all is a PL/SQL statement by itself, while a Function call is called as part of an expression.
    45 Difference between NO DATA FOUND and %NOTFOUND
    NO DATA FOUND is an exception raised only for the SELECT....INTO statements when the where clause of the querydoes not match any rows. When the where clause of the explicit cursor does not match any rows the %NOTFOUND attribute is set to TRUE instead.
    46 Difference between database triggers and form triggers?
    Data base trigger(DBT) fires when a DML operation is performed on a data base table. Form trigger(FT) Fires when user presses a key or navigates between fields on the screen
    Can be row level or statement level No distinction between row level and statement level.
    Can manipulate data stored in Oracle tables via SQL Can manipulate data in Oracle tables as well as variables in forms.
    Can be fired from any session executing the triggering DML statements. Can be fired only from the form that define the trigger.
    Can cause other database triggers to fire.Can cause other database triggers to fire, but not other form triggers.
    47 Difference between an implicit & an explicit cursor.
    PL/SQL declares a cursor implicitly for all SQL data manipulation statements, including quries that return only one row. However,queries that return more than one row you must declare an explicit cursor or use a cursor FOR loop.
    Explicit cursor is a cursor in which the cursor name is explicitly assigned to a SELECT statement via the CURSOR...IS statement. An implicit cursor is used for all SQL statements Declare, Open, Fetch, Close. An explicit cursors are used to process multirow SELECT statements An implicit cursor is used to process INSERT, UPDATE, DELETE and single row SELECT. .INTO statements.
    48 Can you use a commit statement within a database trigger?
    No.
    49 Can the default values be assigned to actual parameters?
    Yes
    50 Can cursor variables be stored in PL/SQL tables.If yes how. If not why?
    No, a cursor variable points a row which cannot be stored in a two-dimensional PL/SQL table.
    51 Can a primary key contain more than one columns?
    Yes
    52 Can a function take OUT parameters. If not why?
    No. A function has to return a value,an OUT parameter cannot return a value.
    53 What are various joins used while writing SUBQUERIES?
    Self join-Its a join foreign key of a table references the same table. Outer Join--Its a join condition used where One can query all the rows of one of the tables in the join condition even though they don't satisfy the join condition.
    Equi-join--Its a join condition that retrieves rows from one or more tables in which one or more columns in one table are equal to one or more columns in the second table.
    54 Differentiate between TRUNCATE and DELETE
    TRUNCATE deletes much faster than DELETE
    TRUNCATE
    DELETE
    It is a DDL statement It is a DML statement
    It is a one way trip,cannot ROLLBACK One can Rollback
    Doesn't have selective features (where clause) Has
    Doesn't fire database triggers Does
    It requires disabling of referential constraints. Does not require
    1 What is PL/SQL ?
    PL/SQL is a procedural language that has both interactive SQL and procedural programming language constructs such as iteration, conditional branching.
    2 Write the order of precedence for validation of a column in a table ?
    I. done using Database triggers.
    ii. done using Integarity Constraints.
    I & ii.
    Exception :
    3 Where the Pre_defined_exceptions are stored ?
    In the standard package.
    Procedures, Functions & Packages ;
    4 What are % TYPE and % ROWTYPE ? What are the advantages of using these over datatypes?
    % TYPE provides the data type of a variable or a database column to that variable.
    % ROWTYPE provides the record type that represents a entire row of a table or view or columns selected in the cursor.
    The advantages are : I. Need not know about variable's data type
    ii. If the database definition of a column in a table changes, the data type of a variable changes accordingly.
    5 What will happen after commit statement ?
    Cursor C1 is
    Select empno,
    ename from emp;
    Begin
    open C1; loop
    Fetch C1 into
    eno.ename;
    Exit When
    C1 %notfound;-----
    commit;
    end loop;
    end;
    The cursor having query as SELECT .... FOR UPDATE gets closed after COMMIT/ROLLBACK.
    The cursor having query as SELECT.... does not get closed even after COMMIT/ROLLBACK.
    6 What is the basic structure of PL/SQL ?
    PL/SQL uses block structure as its basic structure. Anonymous blocks or nested blocks can be used in PL/SQL.
    7 What is Raise_application_error ?
    Raise_application_error is a procedure of package DBMS_STANDARD which allows to issue an user_defined error messages from stored sub-program or database trigger.
    8 What is Pragma EXECPTION_INIT ? Explain the usage ?
    The PRAGMA EXECPTION_INIT tells the complier to associate an exception with an oracle error. To get an error message of a specific oracle error.
    e.g. PRAGMA EXCEPTION_INIT (exception name, oracle error number)
    9 What is PL/SQL table ?
    Objects of type TABLE are called "PL/SQL tables", which are modeled as (but not the same as) database tables, PL/SQL tables use a primary PL/SQL tables can have one column and a primary key.
    Cursors
    10 What is Overloading of procedures ?
    The Same procedure name is repeated with parameters of different datatypes and parameters in different positions, varying number of parameters is called overloading of procedures.
    e.g. DBMS_OUTPUT put_line
    What is a package ? What are the advantages of packages ?
    11 What is difference between a PROCEDURE & FUNCTION ?
    A FUNCTION is always returns a value using the return statement.
    A PROCEDURE may return one or more values through parameters or may not return at all.
    12 What is difference between a Cursor declared in a procedure and Cursor declared in a package specification ?
    A cursor declared in a package specification is global and can be accessed by other procedures or procedures in a package.
    A cursor declared in a procedure is local to the procedure that can not be accessed by other procedures.
    13 What is difference between % ROWTYPE and TYPE RECORD ?
    % ROWTYPE is to be used whenever query returns a entire row of a table or view.
    TYPE rec RECORD is to be used whenever query returns columns of different
    table or views and variables.
    E.g. TYPE r_emp is RECORD (eno emp.empno% type,ename emp ename %type
    e_rec emp% ROWTYPE
    cursor c1 is select empno,deptno from emp;
    e_rec c1 %ROWTYPE.
    14 What is an Exception ? What are types of Exception ?
    Exception is the error handling part of PL/SQL block. The types are Predefined and user defined. Some of Predefined exceptions are.
    CURSOR_ALREADY_OPEN
    DUP_VAL_ON_INDEX
    NO_DATA_FOUND
    TOO_MANY_ROWS
    INVALID_CURSOR
    INVALID_NUMBER
    LOGON_DENIED
    NOT_LOGGED_ON
    PROGRAM-ERROR
    STORAGE_ERROR
    TIMEOUT_ON_RESOURCE
    VALUE_ERROR
    ZERO_DIVIDE
    OTHERS.
    15 What is a stored procedure ?
    A stored procedure is a sequence of statements that perform specific function.
    16 What is a database trigger ? Name some usages of database trigger ?
    Database trigger is stored PL/SQL program unit associated with a specific database table. Usages are Audit data modifications, Log events transparently, Enforce complex business rules Derive column values automatically, Implement complex security authorizations. Maintain replicate tables.
    17 What is a cursor for loop ?
    Cursor for loop implicitly declares %ROWTYPE as loop index,opens a cursor, fetches rows of values from active set into fields in the record and closes
    when all the records have been processed.
    eg. FOR emp_rec IN C1 LOOP
    salary_total := salary_total +emp_rec sal;
    END LOOP;
    18 What is a cursor ? Why Cursor is required ?
    Cursor is a named private SQL area from where information can be accessed. Cursors are required to process rows individually for queries returning multiple rows.
    19 What happens if a procedure that updates a column of table X is called in a database trigger of the same table ?
    Mutation of table occurs.
    20 What are two virtual tables available during database trigger execution ?
    The table columns are referred as OLD.column_name and NEW.column_name.
    For triggers related to INSERT only NEW.column_name values only available.
    For triggers related to UPDATE only OLD.column_name NEW.column_name values only available.
    For triggers related to DELETE only OLD.column_name values only available.
    21 What are two parts of package ?
    The two parts of package are PACKAGE SPECIFICATION & PACKAGE BODY.
    Package Specification contains declarations that are global to the packages and local to the schema.
    Package Body contains actual procedures and local declaration of the procedures and cursor declarations.
    22 What are the two parts of a procedure ?
    Procedure Specification and Procedure Body.
    23 What are the return values of functions SQLCODE and SQLERRM ?
    SQLCODE returns the latest code of the error that has occurred.
    SQLERRM returns the relevant error message of the SQLCODE.
    24 What are the PL/SQL Statements used in cursor processing ?
    DECLARE CURSOR cursor name, OPEN cursor name, FETCH cursor name INTO or Record types, CLOSE cursor name.
    25 What are the modes of parameters that can be passed to a procedure ?
    IN,OUT,IN-OUT parameters.
    26 What are the datatypes a available in PL/SQL ?
    Some scalar data types such as NUMBER, VARCHAR2, DATE, CHAR, LONG, BOOLEAN.
    Some composite data types such as RECORD & TABLE.
    27 What are the cursor attributes used in PL/SQL ?
    %ISOPEN - to check whether cursor is open or not
    % ROWCOUNT - number of rows fetched/updated/deleted.
    % FOUND - to check whether cursor has fetched any row. True if rows are fetched.
    % NOT FOUND - to check whether cursor has fetched any row. True if no rows are featched.
    These attributes are proceeded with SQL for Implicit Cursors and with Cursor name for Explicit Cursors.
    28 What are the components of a PL/SQL Block ?
    Declarative part, Executable part and Exception part.
    Datatypes PL/SQL
    29 What are the components of a PL/SQL block ?
    A set of related declarations and procedural statements is called block.
    30 What are advantages fo Stored Procedures /
    Extensibility,Modularity, Reusability, Maintainability and one time compilation.
    1 What is PL/SQL ?
    PL/SQL is a procedural language that has both interactive SQL and procedural programming language constructs such as iteration, conditional branching.
    2 Write the order of precedence for validation of a column in a table ?
    I. done using Database triggers.
    ii. done using Integarity Constraints.
    I & ii.
    Exception :
    3 Where the Pre_defined_exceptions are stored ?
    In the standard package.
    Procedures, Functions & Packages ;
    4 What are % TYPE and % ROWTYPE ? What are the advantages of using these over datatypes?
    % TYPE provides the data type of a variable or a database column to that variable.
    % ROWTYPE provides the record type that represents a entire row of a table or view or columns selected in the cursor.
    The advantages are : I. Need not know about variable's data type
    ii. If the database definition of a column in a table changes, the data type of a variable changes accordingly.
    5 What will happen after commit statement ?
    Cursor C1 is
    Select empno,
    ename from emp;
    Begin
    open C1; loop
    Fetch C1 into
    eno.ename;
    Exit When
    C1 %notfound;-----
    commit;
    end loop;
    end;
    The cursor having query as SELECT .... FOR UPDATE gets closed after COMMIT/ROLLBACK.
    The cursor having query as SELECT.... does not get closed even after COMMIT/ROLLBACK.
    6 What is the basic structure of PL/SQL ?
    PL/SQL uses block structure as its basic structure. Anonymous blocks or nested blocks can be used in PL/SQL.
    7 What is Raise_application_error ?
    Raise_application_error is a procedure of package DBMS_STANDARD which allows to issue an user_defined error messages from stored sub-program or database trigger.
    8 What is Pragma EXECPTION_INIT ? Explain the usage ?
    The PRAGMA EXECPTION_INIT tells the complier to associate an exception with an oracle error. To get an error message of a specific oracle error.
    e.g. PRAGMA EXCEPTION_INIT (exception name, oracle error number)
    9 What is PL/SQL table ?
    Objects of type TABLE are called "PL/SQL tables", which are modeled as (but not the same as) database tables, PL/SQL tables use a primary PL/SQL tables can have one column and a primary key.
    Cursors
    10 What is Overloading of procedures ?
    The Same procedure name is repeated with parameters of different datatypes and parameters in different positions, varying number of parameters is called overloading of procedures.
    e.g. DBMS_OUTPUT put_line
    What is a package ? What are the advantages of packages ?
    11 What is difference between a PROCEDURE & FUNCTION ?
    A FUNCTION is always returns a value using the return statement.
    A PROCEDURE may return one or more values through parameters or may not return at all.
    12 What is difference between a Cursor declared in a procedure and Cursor declared in a package specification ?
    A cursor declared in a package specification is global and can be accessed by other procedures or procedures in a package.
    A cursor declared in a procedure is local to the procedure that can not be accessed by other procedures.
    13 What is difference between % ROWTYPE and TYPE RECORD ?
    % ROWTYPE is to be used whenever query returns a entire row of a table or view.
    TYPE rec RECORD is to be used whenever query returns columns of different
    table or views and variables.
    E.g. TYPE r_emp is RECORD (eno emp.empno% type,ename emp ename %type
    e_rec emp% ROWTYPE
    cursor c1 is select empno,deptno from emp;
    e_rec c1 %ROWTYPE.
    14 What is an Exception ? What are types of Exception ?
    Exception is the error handling part of PL/SQL block. The types are Predefined and user defined. Some of Predefined exceptions are.
    CURSOR_ALREADY_OPEN
    DUP_VAL_ON_INDEX
    NO_DATA_FOUND
    TOO_MANY_ROWS
    INVALID_CURSOR
    INVALID_NUMBER
    LOGON_DENIED
    NOT_LOGGED_ON
    PROGRAM-ERROR
    STORAGE_ERROR
    TIMEOUT_ON_RESOURCE
    VALUE_ERROR
    ZERO_DIVIDE
    OTHERS.
    15 What is a stored procedure ?
    A stored procedure is a sequence of statements that perform specific function.
    16 What is a database trigger ? Name some usages of database trigger ?
    Database trigger is stored PL/SQL program unit associated with a specific database table. Usages are Audit data modifications, Log events transparently, Enforce complex business rules Derive column values automatically, Implement complex security authorizations. Maintain replicate tables.
    17 What is a cursor for loop ?
    Cursor for loop implicitly declares %ROWTYPE as loop index,opens a cursor, fetches rows of values from active set into fields in the record and closes
    when all the records have been processed.
    eg. FOR emp_rec IN C1 LOOP
    salary_total := salary_total +emp_rec sal;
    END LOOP;
    18 What is a cursor ? Why Cursor is required ?
    Cursor is a named private SQL area from where information can be accessed. Cursors are required to process rows individually for queries returning multiple rows.
    19 What happens if a procedure that updates a column of table X is called in a database trigger of the same table ?
    Mutation of table occurs.
    20 What are two virtual tables available during database trigger execution ?
    The table columns are referred as OLD.column_name and NEW.column_name.
    For triggers related to INSERT only NEW.column_name values only available.
    For triggers related to UPDATE only OLD.column_name NEW.column_name values only available.
    For triggers related to DELETE only OLD.column_name values only available.
    21 What are two parts of package ?
    The two parts of package are PACKAGE SPECIFICATION & PACKAGE BODY.
    Package Specification contains declarations that are global to the packages and local to the schema.
    Package Body contains actual procedures and local declaration of the procedures and cursor declarations.
    22 What are the two parts of a procedure ?
    Procedure Specification and Procedure Body.
    23 What are the return values of functions SQLCODE and SQLERRM ?
    SQLCODE returns the latest code of the error that has occurred.
    SQLERRM returns the relevant error message of the SQLCODE.
    24 What are the PL/SQL Statements used in cursor processing ?
    DECLARE CURSOR cursor name, OPEN cursor name, FETCH cursor name INTO or Record types, CLOSE cursor name.
    25 What are the modes of parameters that can be passed to a procedure ?
    IN,OUT,IN-OUT parameters.
    26 What are the datatypes a available in PL/SQL ?
    Some scalar data types such as NUMBER, VARCHAR2, DATE, CHAR, LONG, BOOLEAN.
    Some composite data types such as RECORD & TABLE.
    27 What are the cursor attributes used in PL/SQL ?
    %ISOPEN - to check whether cursor is open or not
    % ROWCOUNT - number of rows fetched/updated/deleted.
    % FOUND - to check whether cursor has fetched any row. True if rows are fetched.
    % NOT FOUND - to check whether cursor has fetched any row. True if no rows are featched.
    These attributes are proceeded with SQL for Implicit Cursors and with Cursor name for Explicit Cursors.
    28 What are the components of a PL/SQL Block ?
    Declarative part, Executable part and Exception part.
    Datatypes PL/SQL
    29 What are the components of a PL/SQL block ?
    A set of related declarations and procedural statements is called block.
    30 What are advantages fo Stored Procedures /
    Extensibility,Modularity, Reusability, Maintainability and one time compilation.
    31 Name the tables where characteristics of Package, procedure and functions are stored ?
    User_objects, User_Source and User_error.
    32 Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database Trigger ? Why ?
    It is not possible. As triggers are defined for each table, if you use COMMIT of ROLLBACK in a trigger, it affects logical transaction processing.
    33 How packaged procedures and functions are called from the following?
    a. Stored procedure or anonymous block
    b. an application program such a PRC C, PRO COBOL
    c. SQL *PLUS
    a. PACKAGE NAME.PROCEDURE NAME (parameters);
    variable := PACKAGE NAME.FUNCTION NAME (arguments);
    EXEC SQL EXECUTE
    b.
    BEGIN
    PACKAGE NAME.PROCEDURE NAME (parameters)
    variable := PACKAGE NAME.FUNCTION NAME (arguments);
    END;
    END EXEC;
    c. EXECUTE PACKAGE NAME.PROCEDURE if the procedures does not have any
    out/in-out parameters. A function can not be called.
    34 How many types of database triggers can be specified on a table ? What are they ?
    Insert Update Delete
    Before Row o.k. o.k. o.k.
    After Row o.k. o.k. o.k.
    Before Statement o.k. o.k. o.k.
    After Statement o.k. o.k. o.k.
    If FOR EACH ROW clause is specified, then the trigger for each Row affected by the statement.
    If WHEN clause is specified, the trigger fires according to the returned Boolean value.
    35 Give the structure of the procedure ?
    PROCEDURE name (parameter list.....)
    is
    local variable declarations
    BEGIN
    Executable statements.
    Exception.
    exception handlers
    end;
    36 Give the structure of the function ?
    FUNCTION name (argument list .....) Return datatype is
    local variable declarations
    Begin
    executable statements
    Exception
    execution handlers
    End;
    37 Explain the usage of WHERE CURRENT OF clause in cursors ?
    WHERE CURRENT OF clause in an UPDATE,DELETE statement refers to the latest row fetched from a cursor.
    Database Triggers
    38 Explain the two type of Cursors ?
    There are two types of cursors, Implicit Cursor and Explicit Cursor.
    PL/SQL uses Implicit Cursors for queries.
    User defined cursors are called Explicit Cursors. They can be declared and used.
    39 Explain how procedures and functions are called in a PL/SQL block ?
    Function is called as part of an expression.
    sal := calculate_sal ('a822');
    procedure is called as a PL/SQL statement
    calculate_bonus ('A822');
    Programmatic Constructs
    Last Update: September 06, 2004
    1 What are the different types of PL/SQL program units that can be defined and stored in ORACLE database ?
    Procedures and Functions,Packages and Database Triggers.
    2 What are the differences between Database Trigger and Integrity constraints ?
    A declarative integrity constraint is a statement about the database that is always true. A constraint applies to existing data in the table and any statement that manipulates the table.
    A trigger does not apply to data loaded before the definition of the trigger, therefore, it does not guarantee all data in a table conforms to the rules established by an associated trigger.
    A trigger can be used to enforce transitional constraints where as a declarative integrity constraint cannot be used.
    3 What is difference between Procedures and Functions ?
    A Function returns a value to the caller where as a Procedure does not.
    4 What is Database Trigger ?
    A Database Trigger is procedure (set of SQL and PL/SQL statements) that is automatically executed as a result of an insert in,update to, or delete from a table.
    5 What is a Procedure ?
    A Procedure consist of a set of SQL and PL/SQL statements that are grouped together as a unit to solve a specific problem or perform a set of related tasks.
    6 What is a Package ?
    A Package is a collection of related procedures, functions, variables and other package constructs together as a unit in the database.
    7 What are the uses of Database Trigger ?
    Database triggers can be used to automatic data generation, audit data modifications, enforce complex Integrity constraints, and customize complex security authorizations.
    8 What are the advantages of having a Package ?
    Increased functionality (for example,global package variables can be declared and used by any proecdure in the package) and performance (for example all objects of the package are parsed compiled, and loaded into memory once)
    1 With which function of summary item is the compute at options required?
    percentage of total functions.
    2 Why is it preferable to create a fewer no. of queries in the data model?
    Because for each query, report has to open a separate cursor and has to rebind, execute and fetch data.
    3 Why is a Where clause faster than a group filter or a format trigger?
    Because, in a where clause the condition is applied during data retrieval than after retrieving the data.
    4 Which parameter can be used to set read level consistency across multiple queries?
    Read only.
    5 Which of the two views should objects according to possession?
    view by structure.
    6 Which of the above methods is the faster method?
    performing the calculation in the query is faster.
    7 Where is the external query executed at the client or the server?
    At the server.
    8 Where is a procedure return in an external pl/sql library executed at the client or at the server?
    At the client.
    9 When do you use data parameter type?
    When the value of a data parameter being passed to a called product is always the name of the record group defined in the current form. Data parameters are used to pass data to produts invoked with the run_product built-in subprogram.
    10 When a form is invoked with call_form, Does oracle forms issues a save point?
    Yes
    11 What are the important difference between property clause and visual attributes?
    Named visual attributes differ only font, color & pattern attributes, property clauses can contain this and any other properties. You can change the appearance of objects at run time by changing the named visual attributes programmatically , property clause assignments cannot be changed programmatically. When an object is inheriting from both a property clause and named visual attribute, the named visual attribute settings take precedence, and any visual attribute properties in the class are ignored.
    12 What use of command line parameter cmd file?
    It is a command line argument that allows you to specify a file that contain a set of arguments for r20run.
    13 What is WHEN-Database-record trigger?
    Fires when oracle forms first marks a record as an insert or an update. The trigger fires as soon as oracle forms determines through validation that the record should be processed by the next post or commit as an insert or update. c generally occurs only when the operators modifies the first item in the record, and after the operator attempts to navigate out of the item.
    14 What is use of term?
    The term file which key is correspond to which oracle report functions.
    15 What is trigger associated with the timer?
    When-timer-expired.
    16 What is the use of transactional triggers?
    Using transactional triggers we can control or modify the default functionality of the oracle forms.
    17 What is the use of place holder column?
    A placeholder column is used to hold calculated values at a specified place rather than allowing is to appear in the actual row where it has to appear.
    18 What is the use of image_zoom built-in?
    To manipulate images in image items.
    19 What is the use of hidden column?
    A hidden column is used to when a column has to embed into boilerplate text.
    20 What is the use of break group?
    A break group is used to display one record for one group ones. While multiple related records in other group can be displayed.
    21 What is the remove on exit property?
    For a modelless window, it determines whether oracle forms hides the window automatically when the operators navigates to an item in the another window.
    22 What is the purpose of the product order option in the column property sheet?
    To specify the order of individual group evaluation in a cross products.
    23 What is the maximum no of chars the parameter can store?
    The maximum no of chars the parameter can store is only valid for char parameters, which can be upto 64K. No parameters default to 23Bytes and Date parameter default to 7Bytes.
    24 What is the main diff. bet. Reports 2.0 & Reports 2.5?
    Report 2.5 is object oriented.
    25 What is the frame & repeating frame?
    A frame is a holder for a group of fields. A repeating frame is used to display a set of records when the no. of records that are to displayed is not known before.
    26 What is the difference between OLE Server & Ole Container?
    An Ole server application creates ole Objects that are embedded or linked in ole Containers ex. Ole servers are ms_word & ms_excel. OLE containers provide a place to store, display and manipulate objects that are created by ole server applications. Ex. oracle forms is an example of an ole Container.
    27 What is the difference between object embedding & linking in Oracle forms?
    In Oracle forms, Embedded objects become part of the form module, and linked objects are references from a form module to a linked source file.
    28 What is the difference between boiler plat images and image items?
    Boiler plate Images are static images (Either vector or bit map) that you import from the file system or database to use a graphical elements in your form, such as company logos and maps. Image items are special types of interface controls that store and display either vector or bitmap images. Like other items that store values, image items can be either base table items(items that relate directly to database columns) or control items. The definition of an image item is stored as part of the form module FMB and FMX files, but no image file is actually associated with an image item until the item is populate at run time.
    29 What is the difference between $$DATE$$ & $$DBDATE$$ $$DBDATE$$ retrieves the current database date $$date$$ retrieves the current operating system date.
    30 What is the diff. when Flex mode is mode on and when it is off?
    When flex mode is on, reports automatically resizes the parent when the child is resized.
    31 What is the diff. when confine mode is on and when it is off?
    When confine mode is on, an object cannot be moved outside its parent in the layout.
    32 What is the diff. bet. setting up of parameters in reports 2.0 reports 2.5?
    LOVs can be attached to parameters in the reports 2.5 parameter form.
    33 What is the advantage of the library?
    Libraries provide a convenient means of storing client-side program units and sharing them among multiple applications. Once you create a library, you can attach it to any other form, menu, or library modules. When you can call library program units from triggers menu items commands and user named routine, you write in the modules to which you have attach the library. When a library attaches another library, program units in the first library can reference program units in the attached library. Library support dynamic loading-that is library program units are loaded into an application only when needed. This can significantly reduce the run-time memory requirements of applications.
    34 What is term?
    The term is terminal definition file that describes the terminal form which you are using r20run.
    35 What is system.coordination_operation?
    It represents the coordination causing event that occur on the master block in master-detail relation.
    36 What is synchronize?
    It is a terminal screen with the internal state of the form. It updates the screen display to reflect the information that oracle forms has in its internal representation of the screen.
    37 What is strip sources generate options?
    Removes the source code from the library file and generates a library files that contains only pcode. The resulting file can be used for final deployment, but can not be subsequently edited in the designer. ex. f45gen module=old_lib.pll userid=scott/tiger strip_source YES output_file
    38 What is relation between the window and canvas views?
    Canvas views are the back ground objects on which you place the interface items (Text items), check boxes, radio groups etc.,) and boilerplate objects (boxes, lines, images etc.,) that operators interact with us they run your form . Each canvas views displayed in a window.
    39 What is pop list?
    The pop list style list item appears initially as a single field (similar to a text item field). When the operator selects the list icon, a list of available choices appears.
    40 What is new_form built-in?
    When one form invokes another form by executing new_form oracle form exits the first form and releases its memory before loading the new form calling new form completely replace the first with the second. If there are changes pending in the first form, the operator will be prompted to save them before the new form is loaded.
    41 What is lexical reference? How can it be created?
    Lexical reference is place_holder for text that can be embedded in a sql statements. A lexical reference can be created using & before the column or parameter name.
    42 What is forms_DDL?
    Issues dynamic Sql statements at run time, including server side pl/SQl and DDL
    43 What is difference between open_form and call_form?
    when one form invokes another form by executing open_form the first form remains displayed, and operators can navigate between the forms as desired. when one form invokes another form by executing call_form, the called form is modal with respect to the calling form. That is, any windows that belong to the calling form are disabled, and operators cannot navigate to them until they first exit the called form.
    44 What is bind reference and how can it be created?
    Bind reference are used to replace the single value in sql, pl/sql statements a bind reference can be created using a (:) before a column or a parameter name.
    45 What is an user exit used for?
    A way in which to pass control (and possibly arguments ) form Oracle report to another Oracle products of 3 GL and then return control ( and ) back to Oracle reports.
    46 What is an OLE?
    Object Linking & Embedding provides you with the capability to integrate objects from many Ms-Windows applications into a single compound document creating integrated applications enables you to use the features form .
    47 What is an object group?
    An object group is a container for a group of objects; you define an object group when you want to package related objects, so that you copy or reference them in other modules.
    48 What is an anchoring object & what is its use?
    An anchoring object is a print condition object which used to explicitly or implicitly anchor other objects to itself.
    49 What is a User_exit?
    Calls the user exit named in the user_exit_string. Invokes a 3Gl program by name which has been properly linked into your current oracle forms executable.
    50 What is a timer?
    Timer is an "internal time clock" that you can programmatically create to perform an action each time the timer expires.
    51 What is a Text_io Package?
    It allows you to read and write information to a file in the file system.
    52 What is a text list?
    The text list style list item appears as a rectangular box which displays the fixed number of values. When the text list contains values that can not be displayed, a vertical scroll bar appears, allowing the operator to view and select undisplayed values.
    53 What is a property clause?
    A property clause is a named object that contains a list of properties and their settings. Once you create a property clause you can base other object on it. An object based on a property can inherit the setting of any property in the clause that makes sense for that object.
    54 What is a physical page ? & What is a logical page ?
    A physical page is a size of a page. That is output by the printer. The logical page is the size of one page of the actual report as seen in the Previewer.
    55 What is a library?
    A library is a collection of subprograms including user named procedures, functions and packages.
    56 What is a difference between pre-select and pre-query?
    Fires during the execute query and count query processing after oracle forms constructs the select statement to be issued, but before the statement is actually issued. The pre-query trigger fires just before oracle forms issues the select statement to the database after the operator as define the example records by entering the query criteria in enter query mode. Pre-query trigger fires before pre-select trigger.
    57 What is a combo box?
    A combo box style list item combines the features found in list and text item. Unlike the pop list or the text list style list items, the combo box style list item will both display fixed values and accept one operator entered value.
    58 What does the term panel refer to with regard to pages?
    A panel is the no. of physical pages needed to print one logical page.
    59 What are visual attributes?
    Visual attributes are the font, color, pattern proprieties that you set for form and menu objects that appear in your application interface.
    60 What are three panes that appear in the run time pl/sql interpreter?
    1.Source pane. 2. interpreter pane. 3. Navigator pane.
    Regards
    B RANGARAJAN

  • Block based on PL/SQL Procedure

    Hello,
    I have been thinking about building an architecture with
    database views to support block querying and stored procedures
    for DML. By doing this I keep the forms entirely seperated from
    the table model, which is good maintenance. Changes to the data
    model will affect the views and the stored procedures, not so
    much the forms. Another advantage is that block-fields that come
    from lookup-tables will be queryable and updateable without too
    much programming. And of course perfomance is good since all SQL
    is server-processed.
    Does anyone know where to look for documenation on basing a
    block on stored procedures ? The online help does not contain
    too much on this.
    Has anyone used this technique successfully and can tell me
    about a few advantages of it ? Disadvantages ?
    Regards
    /Stefan Nilsson, Sigma
    null

    Yes, I've tried that since Forms 5.0. I remember 3 possible
    sources for the block, FROM CLAUSE SUBQUERY, TRANSACTIONAL
    TRIGGERS , and PROCEDURES.
    Advantages,
    It is now easier to design screen with any functionality, like
    blocks where you are going to manipulate columns from different
    tables. Exactly what you have in mind when you mentioned about
    views.
    It also supports sources other than relational tables .like
    the object tables or even non-Oracle data sources.
    All you have to code are procedures to support the SELECT,
    LOCK, INSERT, DELETE, and UPDATE functions.
    Disadvantages,
    You have to code advanced PL/SQL procedures. Price to pay for
    excellent functionality.
    I can't exactly remember the documentation, but there is a
    book titlted Advanced Developers or domething...
    Stefan Nilsson (guest) wrote:
    : Hello,
    : I have been thinking about building an architecture with
    : database views to support block querying and stored procedures
    : for DML. By doing this I keep the forms entirely seperated from
    : the table model, which is good maintenance. Changes to the data
    : model will affect the views and the stored procedures, not so
    : much the forms. Another advantage is that block-fields that
    come
    : from lookup-tables will be queryable and updateable without too
    : much programming. And of course perfomance is good since all
    SQL
    : is server-processed.
    : Does anyone know where to look for documenation on basing a
    : block on stored procedures ? The online help does not contain
    : too much on this.
    : Has anyone used this technique successfully and can tell me
    : about a few advantages of it ? Disadvantages ?
    : Regards
    : /Stefan Nilsson, Sigma
    null

Maybe you are looking for

  • Display of PDFs in 5.1?

    I've just updated from 10.6.7 to 10.6.8 and from Safari 5 to Safari 5.1. To my surprise, PDFs are now displayed in QuickTime (first page only), where they had rpeviously been displayed in Preview. I moved the QuickTime plugin from Library/Internet Pl

  • Live View & Preview query

    Hi, I'm not sure what is happening or how it can happen. I am building a test site (6 pages, php, text and images only) with horizontal menu. Current problem seems impossible to me but I know there must be a cause and solution. Hoping someone has see

  • TS4147 how can I get rid of my contacts in icloud

    I have 540 old contacts that I wish to get rid of permently, but they keep getting synced from icloud everytime. How can I delete contacts etc.. from icloud?

  • AirPort Utility doesn't cancel the Time Cpause disk erase process

    Hello! Am I the only one, whos' AirPort Utility for Windows 5.6.1 doesn't cancel the previously started erase process? (See the picture) Pressing the "Cancel" buttin doesn't change anything. The windows blinks and nothing happens. here's the screensh

  • What is FireVault?

    two days ago i installed yosemite on my mac, i was in a hurry so i didn't read all the "fine print" and now am kind of nervous. When it was installing i said yes to fire vault on, hours later when i came back home i looked for more info about it and