Help needed in forming dynamic insert statement

HI,
I am trying to construct a insert statement as given below.
Please help me as to how to form this and where am i going wrong?
i want the columns names to be auto populated when a table name is given.
output should be like:
==============
insert into tablename
col1,col2,col3..coln)
values
(col1, col2, col3..coln);
declare
v_sql varchar2(5000);
cnt number :=0;
col_count number;
name varchar2(5000); 
TYPE string_assarrtype IS TABLE OF VARCHAR2 ( 25 ) INDEX BY VARCHAR2 ( 20 );
arr string_assarrtype;
BEGIN
   select count(column_name) into col_count from user_tab_columns
  where
  table_name = 'PS_D_RE_BCSREGIONMAPPING';
   v_sql:='insert into tablename (' ;
     for i  in 1..arr(col_count)
      loop
       v_sql:='v_sql' ||' '||arr(i);
      DBMS_OUTPUT.PUT_lINE(v_sql);
     END LOOP;
END;

Below is the actual code which i am trying to write:
Since the below trigger logic is same for around 25/30 tables i wanted to construct a generic procedure which will take input parameter as tablename and auit_table and form the insert statement which will populate the column names which are different for different tables.
Please guide...
CREATE OR REPLACE PROCEDURE make_trigger(  tablename  in  VARCHAR2,
                                         auditable  in   VARCHAR2                                                                                  
AS
v_sql varchar(10000);
begin
v_sql := 'DROP TRIGGER  TRD_D_AUDIT_D'||tablename;
dbms_output.put_line (v_sql );
v_sql:='CREATE OR REPLACE TRIGGER TRG_D_AUDIT_D_'||tablename||' '||
'BEFORE INSERT OR UPDATE OR DELETE ON 'tablename||' '||' REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW';
dbms_output.put_line (v_sql );
v_sql:= 'DISABLE
DECLARE
v_Operator        psoprdefn.oprid%type;
v_Sysdate        Date;
v_Actn            varchar2(1);
V_AUDIT_RECNAME    PSRECDEFN.RECNAME%type;
BEGIN';
dbms_output.put_line (v_sql );
v_sql:= 'If (Inserting) Then
   v_Actn    :='||'''||'A'||'''||';'||
   'Insert into '||auditable||'
                    ('||
                   AUDIT_RECNAME,
                AUDIT_ACTN,
                AUDIT_OPRID,
                AUDIT_STAMP,
                D_USER_GROUP,
                D_GROUP_DESC,
                D_BCS_ID,
                D_UBR_ID,
                D_FILTER_ID,
                D_NAME_ACCESS_TYPE,
                D_GLOBAL_EMP_LIST
                    Values
                V_AUDIT_RECNAME,
                v_Actn,
                v_Operator,
                v_Sysdate,
                :NEW.D_USER_GROUP,
                :NEW.D_GROUP_DESC,
                :NEW.D_BCS_ID,
                :NEW.D_UBR_ID,
                :NEW.D_FILTER_ID,
                :NEW.D_NAME_ACCESS_TYPE,
                :NEW.D_GLOBAL_EMP_LIST
end if;
end;Edited by: user11942774 on Oct 5, 2012 11:46 AM
Edited by: user11942774 on Oct 5, 2012 8:09 PM
Edited by: user11942774 on Oct 5, 2012 8:10 PM

Similar Messages

  • Dynamic insert statement

    Hi all
    I had problem in insert statement.
    I know the column of the table, tablename and the value to be insert.
    My code:
    Data: column(20) type c.   -
    >refer to the tablecolumn
    Data: tablename(20) type c.  -
    >refer to table name
    Data: value(20) type c.          -
    >value to be insert to the column in the table
    column = 'Admino'.
    tablename = 'Student'.
    value = '123456'.
    <b>insert <column> into <tablename> values <value>.</b>
    i know there something wrong with my insert statement. How to do it in abap insert code where i can put in all the parameter in the insert statement.
    Anycode or sample to show. Many thank.

    From f1 help....
    EXTRACT
    Basic form
    EXTRACT fg.
    Effect
    Writes all fields of the field group fg (FIELD-GROUPS) as an entry in asequential dataset. If you have defined a field group HEADER,its fields precede each entry as a sort key. Afterwards, you canuse SORT and LOOP ... ENDLOOP to sort or process the datasetrespectively. No further EXTRACT statements are possible afterthis.
    Notes
    General:
    As soon as you have extracted a dataset using EXTRACT, you canno longer extend the field group using INSERT. In particular, you cannot change the HEADERfield group at all after the first EXTRACT (regardless of thefield group to which it applied).
    Large extract datasets are not stored in main memory. Instead, theyare kept in an external auxiliary file. You can set the directory inwhich this file is created using the SAP profile parameterDIR_EXTRACT. The default directory is the SAP data directory(SAP profile parameter DIR_DATA).
    Notes
    Runtime errors:
    EXTRACT_AFTER_SORT/LOOP: EXTRACT after SORT, orLOOP. EXTRACT_BUFFER_NO_ROLL: Unable to create the required main
    EXTRACT_FIELD_TOO_LARGE: Occupied length of a field is toolarge.
    EXTRACT_HEADER_NOT_UNIQUE: Field group HEADER wasmodified after an EXTRACT statement.
    EXTRACT_OPEN_EXTRACTFILE_OPEN:
    Error opening the external extract dataset file.
    EXTRACT_RESOURCEHANDLER_FAILED: Error deleting the externalextract dataset file.
    EXTRACT_TOO_LARGE: Total length of the entry for extraction(including HEADER fields) is too large.
    Additional help
    Filling anExtract with Data
    Extracts
    Since internal tables have fixed line structures, they are not suited to handle data sets with varying structures. Instead, you can use extract datasets for this purpose.
    An extract is a sequential dataset in the memory area of the program. You can only address the entries in the dataset within a special loop. The index or key access permitted with internal tables is not allowed. You may only create one extract in any ABAP program. The size of an extract dataset is, in principle, unlimited. Extracts larger than 500KB are stored in operating system files. The practical size of an extract is up to 2GB, as long as there is enough space in the filesystem.
    An extract dataset consists of a sequence of records of a pre-defined structure. However, the structure need not be identical for all records. In one extract dataset, you can store records of different length and structure one after the other. You need not create an individual dataset for each different structure you want to store. This fact reduces the maintenance effort considerably.
    In contrast to internal tables, the system partly compresses extract datasets when storing them. This reduces the storage space required. In addition, you need not specify the structure of an extract dataset at the beginning of the program, but you can determine it dynamically during the flow of the program.
    You can use control level processing with extracts just as you can with internal tables. The internal administration for extract datasets is optimized so that it is quicker to use an extract for control level processing than an internal table.
    Procedure for creating an extract:
    Define the record types that you want to use in your extract by declaring them as field groups. The structure is defined by including fields in each field group.
    Defining an Extract
    Fill the extract line by line by extracting the required data.
    Filling an Extract with Data
    Once you have filled the extract, you can sort it and process it in a loop. At this stage, you can no longer change the contents of the extract.
    Processing Extracts
    INSERT Statement
    The INSERT statement is used to insert values into a single database table.
    <insert statement> ::= INSERT INTO <table name> <insert column list> <insert source>.
    <insert source> ::= VALUES '(' <value> ( ',' <value> )* ')'
    | <query specification>.
    <value> ::= <value expression>
    | <dynamic parameter specification>
    | NULL.
    <insert column list> ::= '(' <column name> ( ',' <column name> )* ')'.
    In Open SQL the <insert column list> is not optional.
    You cannot specify string literals as values for CLOB columns. Hex literals are not supported in Open SQL.
    Examples
    INSERT INTO employees (employee_id, employee_name)
    VALUES (4711, 'John Smith')
    Inserting Values. A new row is inserted into the table employees with the values 4711 and 'John Smith' for the columns employee_id and employee_name respectively.
    INSERT INTO well_paid_employees (employee_id, salary)
    SELECT employee_id, salary
    FROM employees
    WHERE salary > ?
    Inserting the Result of a Query. The employee_idand the salaryof all employees from table employeeswith a salary exceeding a certain value are inserted into the table well_paid_employees.
    Please reward points if helpful.

  • Relation between record in a form and insert statement written in button

    hi all,
    i am using Forms [32 Bit] Version 6.0.8.24.1 (Production).
    i have a master detail form with relation
    A is master of B, B is master of C and a button which resides on control block(other than A,B,C).
    so i will insert a one record into the block 'A' and i will press button which will insert particular record into particular table.
    so when i try to move to next record('A' block) it is asking for database change. when i give 'yes' everything is ok. but when i give 'no'(w.r.t that record) and moves to next record and inserts the record and insert record throguh button also, at this time user press 'yes' then the first record is not saving but what ever i have inserted through the insert statement is not rolling back.
    How can i control insert statement with the respect to datablock change in the block.
    The block 'C' data is going to the other table through insert statement the block 'C' i am posting. So due to 'post' the block is not getting cleared so insert statement is also firing.
    In other words i want to unpost the posted data when user press 'no' in the database message.
    I know there is nothing to do with the forms message. But is its possible to control when user press 'no' then the insert statement should not gets saved into the table.
    Please help.
    Thanks..
    Edited by: GD on Jun 27, 2011 5:38 AM

    First off, you need to understand how Oracle Forms interacts with an Oracle database. Forms natively handles all DML transactions for you. Meaning, if you have a Forms data block based on a database table, Forms will generate all the necessary DML to handle any changes that occur in that block. You do not need to write your own DML statements in code.
    so i will insert a one record into the block 'A' and i will press button which will insert particular record into particular table.Is Block "A" based on a table? How are you inserting the record into the table? If you are writting your own DML to insert the record this would explain why you are being prompted to save when you change records. As I mentioned, if your block is based on a table, Forms will know if you change a value within the block.
    How can i control insert statement with the respect to datablock change in the block.If your blocks are based on tables, let Forms handle the DML! don't do it yourself.
    In other words i want to unpost the posted data when user press 'no' in the database messageIf your block is based on a table, when you are prompted to save changes - answering 'NO' will automatically clear the current record of the data block (in essence - rollback the change).
    Craig...

  • Oracle 9i Forms - Display Insert Statements

    I'm getting an Oracle error "unable to insert record" during runtime of the 9i forms. Is there a way to display the insert statements? In 3.0 or 4.5 you can press F1 and F2 key how about in 9i ?
    thanks

    If you have the standard pull-down menu, you can use Help, Display Error.
    Otherwise, it depends on the key functions defined in your fmrweb.res resource file. The default released from Oracle shows Shift Ctrl E:
    69   : 3 : "Shift+Ctrl+E"   : 78 : "Display Error"The line in the fmrpcweb.res file (which is what I use) shows Shift F1:
    112  : 1 : "Shift+F1"       : 78 : "Display Error"

  • Help With SUBSTR in dynamic SQL statement

    Following is the dynamic SQL statement.
    EXECUTE IMMEDIATE 'UPDATE table_name pml
    SET pml.'|| con_fields.field ||' = SUBSTR(pml.'||con_fields.field||' ||'' ''||
    (SELECT pml1.'||con_fields.field||'
    FROM table_name pml1
    WHERE pml1.grp_id = '||los_concats.grp_id ||'
    AND pml1.row_id = '||los_concats.row_id||'
    AND pml1.loser_flg = ''Y''),1, '||con_fields.max_length||')
    WHERE pml.grp_id = '||los_concats.grp_id ||'
    AND pml.loser_flg IS NULL ';
    what it does is that it updates a particular field. This field is concatenated by a field of a similar record.
    My problem is with SUBSTR function. Since I am concatenating fields I do not want the field to be updated greater than max_length on that field, the reason why I use SUBSTR. the select query inside SUBSTR works alright with one of the AND condition in a WHERE clause not present. When I add that additional condition it gives me this error.
    ORA-00907: missing right parenthesis.
    Is there any way to get around this problem. Does SQL has other than SUBSTR function which can limit the character length.
    Appreciate it.

    The other alternative I thought about was to do this first
    EXECUTE IMMEDIATE 'SELECT pml.'||con_fields.field||'
    FROM table_name pml
    WHERE pml.grp_id = '||los_concats.grp_id||'
    AND pml.row_id = '||los_concats.row_id||'
    AND pml.loser_flg = ''Y''
    ' INTO v_concat_field;
    write into the variable v_concat_field and then use it into the previous script.
    But on this I get SQL Command not properly terminated, I don't get it Why?
    Donald I tried with your suggested script. It works fine with one of the conditions eliminated. I don't understand what the error trying to say?
    Thanks

  • Help needed in Form userexit_save_document_prepare include MV45AFZZ

    Hi Experts,
    I need to check the values entered in table control under sales tab in VA01.
    If the item category for a material is 'TANN' it should save if not it should not save and display an error message and then it should alow the user to edit the table control values. 
    how do i achieve it in Form userexit_save_document_prepare include MV45AFZZ.
    this is what I have done. kindly check the logic and help me further.
    case sy-ucomm.
    when 'SICH'.          " On Save action
    if vbak-vtweg eq 'HA'.  " Check Distribution channel
      flg_dh = 'X'.         " Sets if DC is 'HA'.
    endif.
    if flg_dh eq 'X'.
      if vbap-pstyv eq 'TANN'.    " Check item category
        flg_itmc = 'X'.            " Set if item cat is 'TANN'.
      else.
      message 'SO could not be created Please enter brokerage material' type 'E'.
      endif.

    Hi,
    Please use the following:
    when 'SICH'.          " On Save action
    if vbak-vtweg eq 'HA'.  " Check Distribution channel
      flg_dh = 'X'.         " Sets if DC is 'HA'.
    endif.
    if flg_dh eq 'X'.
      if vbap-pstyv eq 'TANN'.    " Check item category
        flg_itmc = 'X'.            " Set if item cat is 'TANN'.
      else.
      message 'SO could not be created Please enter brokerage material' type 'E' display like 'E'.
      endif.
    endif.

  • Help needed in designing dynamic images

    Hi,
    I just posted a thread before, but there is something wrong in that post.
    Any ways, I am new to Java and am trying to design a GUI which has images, which change dynamically. One of the examples is on this webpage
    http://images.google.com/imgres?imgurl=http://www.snapstream.com/images/blog/godzilla/overheating_max_cpu_tn.jpg&imgrefurl=http://blogs.snapstream.com/2006/01/18/godzilla-pvr/&h=516&w=683&sz=80&hl=en&start=3&tbnid=huDY6gDdtS_o-M:&tbnh=105&tbnw=139&prev=/images%3Fq%3DCPU%2Btemperature%26gbv%3D2%26svnum%3D10%26hl%3Den%26sa%3DG
    I need help desperately. I would appreciate, if you can help me. What do i need to use? Can it be done by using Swing? Are there any good examples of it on web? I am basically not clear, what do I need to use...
    waiting for your reply. thanks in advance.
    Ankit

    consider you have a JFrame called "frame"
    what you can do:
    JLabel lab = new JLabel("../firstPic.jpg");
    frame.getContentPane().add(lab);
    then, each time you will call "setIcon()" on the lab and refresh the frame it will display a new picture

  • Help needed in configuring Dynamic F4

    Hi All
    I am trying to configure Dynamic F4 help for Actvities appln.
    In Actvities Appln I have the Partners tab.In this Partner tab I have partner function and partner Id fields. When I make a search for partner Id  I need to launch  the search screen based on thepartner function selected.
    I guess we can use dynamic F4 help but how to achieve this I am not sure. If anyone has done simliar stuff please do give your inputs.
    Thanks
    Regards
    Senthil

    Hi Senthil,
    You can use Search Help Exit for your problem.
    <b>Search help exit</b> : A search help exit is a function module for making the input help process described by the search help more flexible than possible with the standard version.
    This function module must have the same interface as function module F4IF_SHLP_EXIT_EXAMPLE. The search help exit may also have further optional parameters (in particular any EXPORTING parameters).
    A search help exit is called at certain time points in the input help process.
    <b>Note:</b> The source text and long documentation of the above-specified function module (including the long documentation about the parameters) contain information about using search help exits.
    Function modules are provided in the function library for operations that are frequently executed in search help exits. The names of these function modules begin with the prefix F4UT_. These function modules can either be used directly as search help exits or used within other search help exits. You can find precise instructions for use in the long documentation for the corresponding function module.
    A search help exit is called repeatedly in connection with several
    Events during the F4 process. The relevant step of the process is passed on in the CALLCONTROL step. If the module is intended to perform only a few modifications before the step, CALLCONTROL-STEP should remain unchanged.
    However, if the step is performed completely by the module, the following step must be returned in CALLCONTROL-STEP.
    For more detailed information please refer to the documentation describing the concept of the search help exit.
    The module must react with an immediate EXIT to all steps that it does not know or does not want to handle.
    <b>Time Points</b> :
    During the input help process, a number of time points are defined that each define the beginning of an important operation of the input help process.
    If the input help process is defined with a search help having a search help exit, this search help exit is called at each of these time points. If required, the search help exit can also influence the process and even determine that the process should be continued at a different time point.
    The following time points are defined:
    <b>1. SELONE</b>
    Call before selecting an elementary search help. The possible elementary search helps are already in SHLP_TAB. This time point can be used in a search help exit of a collective search help to restrict the selection possibilities for the elementary search helps.
    Entries that are deleted from SHLP_TAB in this step are not offered in the elementary search help selection. If there is only one entry remaining in SHLP_TAB, the dialog box for selecting elementary search helps is skipped. You may not change the next time point.
    The time point is not accessed again if another elementary search help is to be selected during the dialog.
    <b>2. PRESEL1</b>
    After selecting an elementary search help. Table INTERFACE has not yet been copied to table SELOPT at this time point in the definition of the search help (type SHLP_DESCR_T). This means that you can still influence the attachment of the search help to the screen here. (Table INTERFACE contains the information about how the search help parameters are related to the screen fields).
    <b>3. PRESEL</b>
    Before sending the dialog box for restricting values.
    This time point is suitable for predefining the value restriction or for completely suppressing or copying the dialog.
    <b>4. SELECT</b>
    Before selecting the values. If you do not want the default selection, you should copy this time point with a search help exit. DISP should be set as the next time point.
    <b>5. DISP</b>
    Before displaying the hit list. This time point is suitable for restricting the values to be displayed, e.g. depending on authorizations.
    <b>6. RETURN</b> (usually as return value for the next time point)
    The RETURN time point should be returned as the next step if a single hit was selected in a search help exit.
    It can make sense to change the F4 flow at this time point if control of the process sequence of the Transaction should depend on the selected value (typical
    example: setting SET/GET parameters). However, you should note that the process will then depend on whether a value was entered manually or with an input help.
    <b>7. RETTOP</b>
    You only go to this time point if the input help is controlled by a collective search help. It directly follows the time point RETURN. The search help exit of the collective search help, however, is called at time point RETTOP.
    <b>8. EXIT</b> (only for return as next time point)
    The EXIT time point should be returned as the next step if the user had the opportunity to terminate the dialog within the search help exit.
    <b>9. CREATE</b>
    The CREATE time point is only accessed if the user selects the function "Create new values". This function is only available if field CUSTTAB of the control string CALLCONTROL was given a value not equal to SPACE earlier on.
    The name of the (customizing) table to be maintained is normally entered there. The next step returned after CREATE should be SELECT so that the newly entered value can be selected and then displayed.
    10. <b>APP1, APP2, APP3</b>
    If further pushbuttons are introduced in the hit list with function module F4UT_LIST_EXIT, these time points are introduced. They are accessed when the user presses the corresponding pushbutton.
    <b>Note:</b> If the F4 help is controlled by a collective search help, the search help exit of the collective search help is called at time points SELONE and RETTOP. (RETTOP only if the user selects a value.) At all other time points the search help exit of the selected elementary search help is called.
    If the F4 help is controlled by an elementary search help, time point RETTOP is not executed. The search help exit of the elementary search help is called at time point SELONE (at the moment). This search help exit should not do anything at this time point. Any preparatory work should be carried out at time point PRESEL1.
    <b>Steps for creating search help :</b>
    1. Run Transaction SE11
    2. Give search help name
    3. Click on Create
    4. Make selection for Elementary or Collective search
       Help
    <b>For Elementary Search Help</b>
    5. Elementary search Help screen.  
    6. Give short description.
    7. Dialog type specifies the data display in the hit
       list.
    8. Give selection method
    A] Search for database tables
    B] Search for Views
    9. Hot key specifies the letter or number displayed with every elementary search help. 
    10. Search help Exit: Specify the function module developed for the search of data for the elementary search help.
    11. Search help parameter
    A] Specify the input and output fields in the search help parameter column.
    B] IMP column is input parameter for the search help.
    C] EXP column is output parameter of the search help, to be displayed in the Hit list after selection.
    D] LPos specifies the order in which fields are displayed in the hit list.
    E] SPos specifies the order in which fields are displayed in the search help pop up screen.
    F] Specify Data element in the field.
    G] Specify the default value for any field required.
    <b>For Collective Search Help :</b>
    12. Search help exit: Specify the function module developed for the search of data for the elementary search help.
    13. Search help parameter: Specify the import and export parameters.          
    14. Search help: Specify the elementary search help and the short text.
    15. Parameter Assignment: Select the elementary search help and click on the parameter assignment. System proposes fields. User has to select the fields as per requirement, fields to be displayed in the output
    hit list. Parameter assignment has to be done compulsorily for every elementary search help designed for the collective search help.   
    <b>Please reward points if it helps.</b>
    Regards,
    Amit Mishra

  • Help needed with forms

    Hi,
    I need help with 2 things:
    1. I want to create a form with name,subject and message box on for the user to fill out and then when they click submit it sends the form to my email address.
    2. I want to create a form where the user can upload their CV and then click submit and it will send the CV to my email address aswell.
    Can any1 help?
    Cheers
    Dan

    Thanks for that, i have followed the steps but cant test it out till i have finished the site and uploaded it, will let u know if it was
    successfull!
    cheers
    Dan

  • Help needed writing simple PL/SQL statement

    Hi,
    I need to run the following delete statement in a PL/SQL procedure but for it to commit every 1000 rows or so. Can anyone help?
    DELETE
    FROM IDIS.YPROCRULES A
    WHERE 1 = 1
    AND NOT EXISTS (SELECT 'X' FROM IDIS.YPROCCTRL B WHERE A.SEQ_0 = B.SEQ_0)
    Thanks
    Mark

    The fastest most efficient way of doing the delete is to write it in one sql statement as you have done.
    Commiting every 1000 rows means you have to use row by row processing. A lot of us call this slow by slow processing.
    Every time you commit in a loop , you increase the risk of snapshot too old error, plus you actually slow down the processing, as well as give you issues with regards to what happens if your process fails after x iterations. (some of your data is commited, other data is not, how do you restart the process)
    The correct approach is to have appropriately sized rollback/undo segments.

  • Immediate help needed for Forms on Citrix

    All Gurus
    Form works perfect on desktop but when I put in on citrix then it didn't work. problem is when we click on any push button that is not executing a code behind it. so push button in forms are not working. we installed forms 6i runtime software on citrix. is there anything do I need to do to make buttons work.
    Thank you so much
    Nitin

    I compiled my form on desktop and its working fine then I moved .fmx file to citrix and there button is not working. other thing using forms default menu if I use execute query it works but when I click on button (when-button pressed trigger and code is go_block, execute_query) then it doesn't execute. so I added just message for testing and message also not populating. so what would be the issue?
    where you are saying I have to compile form on citrix and how we can compile on citrix? pl. help.
    do you have forms installed on citrix?
    pl.help
    Thanks
    Nitin

  • Help needed in debugging dynamic SQL.

    When I pass the p_deptno =30 and run the below code the refcursor returns the rows.But when I pass the dpetno =null then it goes to the condition if p_job is not null and throws an error.Can any one please help me in debugging this code.
    declare
    p_deptno number:=null;
    p_job varchar2(30):='SALESMAN';
    v_sql varchar2(4000);
    l_ename varchar2(30);
      TYPE my_cursor IS REF CURSOR;
      RC my_cursor;
    begin
      v_sql := 'select ename
                from emp
               where 1=1';
      if p_deptno is not null then
        v_sql := v_sql||' AND deptno='||p_deptno;
      else
        if p_job is not null then
          v_sql := v_sql||' AND job='||p_job;
        end if;
      end if;
      OPEN RC FOR v_sql;
      LOOP
        FETCH RC INTO l_ename;
        EXIT WHEN RC%NOTFOUND;
        dbms_output.put_line(l_ename);
      END LOOP;
      CLOSE RC;
    END;Thanks.
    Edited by: user3565577 on Mar 6, 2010 8:44 PM

    Hi
    I've mocked up a simple test and it seems to use the indexes when I try with one or the other values being supplied, I've made an assumption on the indexes you have (i.e. single column indexes on job and deptno),
    --indexes on emp table:
    p2056@dbapw01> @indexes
    Enter value for table_name: emp
    Enter value for owner: p2056
    INDEX_OWNER                    INDEX_NAME                INDEX_TYPE                  PAR COLUMN_NAME                    STATUS
    P2056                          EMPI1                     NORMAL                      NO  DEPTNO                         VALID
    P2056                          EMPI2                     NORMAL                      NO  JOB                            VALID
    2 rows selected.
    --when accessing with a job value
    p2056@dbapw01> explain plan for select *
      2  from emp
      3  where (
      4   (null is null and job = 'SALESMAN')
      5   OR
      6   ('SALESMAN' is null and deptno = null)
      7   OR
      8   ('SALESMAN' is null and null is null)
      9         );
    Explained.
    p2056@dbapw01> @xplan
    PLAN_TABLE_OUTPUT
    Plan hash value: 1888885832
    | Id  | Operation                   | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |       |     2 |   154 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP   |     2 |   154 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | EMPI2 |     2 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("JOB"='SALESMAN')
    --when accessing with a deptno value
    p2056@dbapw01> explain plan for select *
      2  from emp
      3  where (
      4   (2 is null and job = null)
      5   OR
      6   (null is null and deptno = 2)
      7   OR
      8   (null is null and 2 is null)
      9         );
    Explained.
    p2056@dbapw01> @xplan
    PLAN_TABLE_OUTPUT
    Plan hash value: 1336173234
    | Id  | Operation                   | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |       |     1 |    77 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP   |     1 |    77 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | EMPI1 |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("DEPTNO"=2)

  • HELP NEEDED IN FORMING A QUERY...URGENT.....

    Hi,
    I have a table where in that an employee has multiple rows,
    in that i need to query a particular column values, and need to display
    in one column separated any special charactar like ":". I need this query.
    ex:
    EmpID in_time
    1900 9:00:00
    1900 9:45:00
    1900 10:50:00
    Here i want to display this as
    EmpID time
    1900 9:00;9:45;10:50;
    Please give me your valuable contributions...

    create table user644354(empid number(4),in_time varchar2(8));
    insert into user644354 values(1900,'9:00:00');
    insert into user644354 values(1900,'9:45:00');
    insert into user644354 values(1900,'10:50:00');
    commit;
    select substr(max(SYS_CONNECT_BY_PATH(In_Time, ', ')),2) In_Time FROM
    (SELECT in_time,ROWNUM NBR FROM (SELECT In_time FROM user644354 e where empid=1900))
    CONNECT BY PRIOR NBR = NBR - 1 START WITH NBR = 1
    Regards
    Girish Sharma

  • Help needed in defaulting Dynamic assignment blocks

    Hi All,
    We are trying to default assignment blocks based on the configuration saved against each object type.
    Procedure followed is as below
    Created 2 configurations, one for sold to party and the other one for ship to party in the BP_Head cpmponent for the Overview page. Two configurations of the overview page are saved against a role config key but with a variant of object type
    Created two logical link IDs one each for sold to party and ship to party
    Make these two logical link IDs available in the UI as direct link groups
    Upon clicking sold to party the configuration saved against that(Set of assignment blocks in the overview page) needs to be called (Remember we saved this configuration with a variant of object type)
    Similarly when clicking on the ship to party link corresponding configuration (Set of assignment blocks in the overview page) needs to be displayed
    Any inputs on this will be of great help.
    Regards,
    udaya

    you need to redefine the method DO_CONFIG_DETERMINATION of your controller
    there you get the role and any other needed values, and you define the OBJECT_TYPE and SUBTYPE that will be used as key fields for the configuration

  • Help needed - XML forms not displaying in my repository

    Hi all
    I could really do with some help here.  I have a custom XML form for news articles.  It works fine in the standard documents repository, but I have my iView pointing to a folder in my own CM repository.
    When a user tries to directly access the "show" form, instead of the form it displays the XML code.  Any ideas why this is?
    My CM repository is running the following services:
    layout, properties, svc_acl, tbp
    EP6SP14
    Thanks!  Chris

    Hello,
    I have the same problem. When I'm trying to create an XML file using XML form in the repository /etc, I get the following error:
    XML - Forms 
    Cannot create item e0977870-cf29-2d10-bb89-d00b5761268c.xml in collection /etc/public/; operation is not supported.
    When I do the same in repository /documents, it works fine.
    I think, I've made the neccesary settings for the repository (Form Based Publishing, ...).
    Any clues will be highly appreciated.
    Jiri

Maybe you are looking for