How can I search multiple columns in a SQL command of Union tables

Hi:
We have a database with tables that are nearly identical that we use for production and production history.
I have created an SQL command in Crystal 2008 to joins several of the tables and then added a "UNION" to connect the History and Prod tables.
I need to search multiple (3 total) columns for 5 different data types, to return the records being investigated. I tried this using an "OR" statement in the where clause and have had inconsistant results.
The first two or statement function perfectly the third works as long as the value being passed is numeric and the last two fail consistantly with invalid column name errors. It appears that crystal is getting confused and passing the wrong data type especially if I do a new search using a different option for the "?SearchParam"
Can some one offer some insite on how I can search these fields to return the record data needed
-- {?SearchParam} is the search parameter passed by Crystal that is a number 1 thru 5
-- {?Search_Val} is a parameter that is passed by Crystal that is a string of what to search for 1 = Numeric CMP ord #("TBSLI21"."LI21_OR_NO"), 2 = Numeric CI ord # ( "TBSLI33"."LI33_CI_OR_NO"),
--   3 =String  Ext Sys ord string ("TBSLI33"."LI33_EXT_SYS_SL_OR_NO"), 4 = String CMP Grp string ("TBSLI21"."LI21_OP_GRP_NO"), 5 = composit string PP ord string ("TBSOP13"."OP13_CLR_DAY" & "TBSOP13"."OP13_PP_GRP_SEQ_NO" & "TBSOP13"."OP13_CELL_ID")
SELECT "TBSLI21"."LI21_OR_NO",
"TBSLI21"."LI21_SH_DT_SCDL",
"TBSLI21"."LI21_TS_EN_ORIG",
"TBSLI21"."LI21_TS_SHIP",
"TBSLI21"."LI21_SYS_ORD_CD",
"TBSLI21"."LI21_SHIP_ID",
"TBSLI21"."LI21_WRKST_ID",
"TBSLI21"."LI21_LI_NO",
"TBSLI33"."LI33_CI_OR_NO",
"TBSLI33"."LI33_EXT_SYS_SL_OR_NO",
"TBSLI21"."LI21_OP_GRP_NO",
"TBSLI21"."LI21_LI_STAT",
"TBSOP13"."OP13_OP_GRP_STAT",
"TBSLI31"."LI31_LI_EV_DTL_TX",
"TBSLI31"."LI31_DT_EN",
"TBSLI31"."LI31_TM_EN",
"TBSLI31"."LI31_LI_EV",
"TBSLI21"."LI21_OP_WSH_FLNM",
"TBSLI21"."LI21_PR_ITF_CD",
"TBSLI21"."MFG_PLANT_CD",
"MFG_PLANT_LI"."MFG_PLANT_CD" as PrefPlant,
"TBSOP13"."OP13_OP_GRP_DSP_CD",
"TBSLI21"."LI21_LI_DSP_CD",
"TBSOP13"."OP13_CLR_DAY",
"TBSOP13"."OP13_PP_GRP_SEQ_NO",
"TBSOP13"."OP13_CELL_ID",
"MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG",
"TBSLI21"."LI21_OP_GRP_PS_NO1",
"TBSLI21"."LI21_POMS_MERGE_NO",
"TBSLI31"."LI31_OP_ID",
"TBSLI21"."LI21_LI_POR_FG",
"TBSLI21"."LI21_BIN_ID",
"TBSLI21"."LI21_TS_MRSHL",
"TBSLI33"."LI33_CI_LI_NO",
"TBSLI33"."LI33_SH_ADDR_1",
"TBSLI33"."LI33_SH_ADDR_2",
"TBSLI33"."LI33_SH_ADDR_3",
"TBSLI33"."LI33_SH_ADDR_4",
"TBSLI33"."LI33_SH_CITY_NM",
"TBSLI33"."LI33_SH_ST_NM",
"TBSLI33"."LI33_SH_ZIP_CD",
"TBSLI33"."LI33_CU_NM",
"TBSLI33"."LI33_CU_BUS_NM"
FROM   ((("CMPREPORTING"."dbo"."TBSLI33" "TBSLI33" FULL OUTER JOIN "CMPREPORTING"."dbo"."TBSLI21" "TBSLI21" ON ("TBSLI33"."LI33_BS_OR_NO"="TBSLI21"."LI21_OR_NO") AND ("TBSLI33"."LI33_BS_LI_NO"="TBSLI21"."LI21_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSOP13" "TBSOP13" ON "TBSLI21"."LI21_OP_GRP_NO"="TBSOP13"."OP13_OP_GRP_NO") LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSLI31" "TBSLI31" ON ("TBSLI21"."LI21_OR_NO"="TBSLI31"."LI31_OR_NO") AND ("TBSLI21"."LI21_LI_NO"="TBSLI31"."LI31_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."MFG_PLANT_LI" "MFG_PLANT_LI" ON ("TBSLI21"."LI21_OR_NO"="MFG_PLANT_LI"."OR_NO") AND ("TBSLI21"."LI21_LI_NO"="MFG_PLANT_LI"."LI_NO")
WHERE   {?aSearchParam} = 1 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI21"."LI21_OR_NO"=Cast( {?Search_Val} as Int)
or {?aSearchParam} = 2 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI33"."LI33_CI_OR_NO"=Cast( {?Search_Val} as numeric(12,0))
or {?aSearchParam} = 3 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(20),"TBSLI33"."LI33_EXT_SYS_SL_OR_NO")= Convert( VarChar(20), {?Search_Val})
or {?aSearchParam} = 4 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8),"TBSLI21"."LI21_OP_GRP_NO") = Convert( VarChar(8), {?GroupNo})
or {?aSearchParam} = 5 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8), ("TBSOP13"."OP13_CLR_DAY" & "TBSOP13"."OP13_PP_GRP_SEQ_NO" & "TBSOP13"."OP13_CELL_ID")) = Convert( VarChar(8), {?GroupNo})
Union
SELECT "TBSLI21_HIST"."LI21_OR_NO",
"TBSLI21_HIST"."LI21_SH_DT_SCDL",
"TBSLI21_HIST"."LI21_TS_EN_ORIG",
"TBSLI21_HIST"."LI21_TS_SHIP",
"TBSLI21_HIST"."LI21_SYS_ORD_CD",
"TBSLI21_HIST"."LI21_SHIP_ID",
"TBSLI21_HIST"."LI21_WRKST_ID",
"TBSLI21_HIST"."LI21_LI_NO",
"TBSLI33_HIST"."LI33_CI_OR_NO",
"TBSLI33_HIST"."LI33_EXT_SYS_SL_OR_NO",
"TBSLI21_HIST"."LI21_OP_GRP_NO",
"TBSLI21_HIST"."LI21_LI_STAT",
"TBSOP13_HIST"."OP13_OP_GRP_STAT",
"TBSLI31_HIST"."LI31_LI_EV_DTL_TX",
"TBSLI31_HIST"."LI31_DT_EN",
"TBSLI31_HIST"."LI31_TM_EN",
"TBSLI31_HIST"."LI31_LI_EV",
"TBSLI21_HIST"."LI21_OP_WSH_FLNM",
"TBSLI21_HIST"."LI21_PR_ITF_CD",
"TBSLI21_HIST"."MFG_PLANT_CD",
"MFG_PLANT_LI_HIST"."MFG_PLANT_CD",
"TBSOP13_HIST"."OP13_OP_GRP_DSP_CD",
"TBSLI21_HIST"."LI21_LI_DSP_CD",
"TBSOP13_HIST"."OP13_CLR_DAY",
"TBSOP13_HIST"."OP13_PP_GRP_SEQ_NO",
"TBSOP13_HIST"."OP13_CELL_ID",
"MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG",
"TBSLI21_HIST"."LI21_OP_GRP_PS_NO1",
"TBSLI21_HIST"."LI21_POMS_MERGE_NO",
"TBSLI31_HIST"."LI31_OP_ID",
"TBSLI21_HIST"."LI21_LI_POR_FG",
"TBSLI21_HIST"."LI21_BIN_ID",
"TBSLI21_HIST"."LI21_TS_MRSHL",
"TBSLI33_HIST"."LI33_CI_LI_NO",
"TBSLI33_HIST"."LI33_SH_ADDR_1",
"TBSLI33_HIST"."LI33_SH_ADDR_2",
"TBSLI33_HIST"."LI33_SH_ADDR_3",
"TBSLI33_HIST"."LI33_SH_ADDR_4",
"TBSLI33_HIST"."LI33_SH_CITY_NM",
"TBSLI33_HIST"."LI33_SH_ST_NM",
"TBSLI33_HIST"."LI33_SH_ZIP_CD",
"TBSLI33_HIST"."LI33_CU_NM",
"TBSLI33_HIST"."LI33_CU_BUS_NM"
FROM   ((("CMPREPORTING"."dbo"."TBSLI33_HIST" "TBSLI33_HIST" FULL OUTER JOIN "CMPREPORTING"."dbo"."TBSLI21_HIST" "TBSLI21_HIST" ON ("TBSLI33_HIST"."LI33_BS_OR_NO"="TBSLI21_HIST"."LI21_OR_NO") AND ("TBSLI33_HIST"."LI33_BS_LI_NO"="TBSLI21_HIST"."LI21_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSOP13_HIST" "TBSOP13_HIST" ON "TBSLI21_HIST"."LI21_OP_GRP_NO"="TBSOP13_HIST"."OP13_OP_GRP_NO") LEFT OUTER JOIN "CMPREPORTING"."dbo"."TBSLI31_HIST" "TBSLI31_HIST" ON ("TBSLI21_HIST"."LI21_OR_NO"="TBSLI31_HIST"."LI31_OR_NO") AND ("TBSLI21_HIST"."LI21_LI_NO"="TBSLI31_HIST"."LI31_LI_NO")) LEFT OUTER JOIN "CMPREPORTING"."dbo"."MFG_PLANT_LI_HIST" "MFG_PLANT_LI_HIST" ON ("TBSLI21_HIST"."LI21_OR_NO"="MFG_PLANT_LI_HIST"."OR_NO") AND ("TBSLI21_HIST"."LI21_LI_NO"="MFG_PLANT_LI_HIST"."LI_NO")
WHERE  {?aSearchParam} = 1 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI21_HIST"."LI21_OR_NO"= Cast( {?Search_Val} as Int)
or {?aSearchParam} = 2 and  "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI33_HIST"."LI33_CI_OR_NO"= Cast( {?Search_Val} as numeric(12,0))
or {?aSearchParam} = 3 and  "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(20), "TBSLI33_HIST"."LI33_EXT_SYS_SL_OR_NO")= Convert( VarChar(20),{?Search_Val})
or  {?aSearchParam} = 4 and "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8),"TBSLI21_HIST"."LI21_OP_GRP_NO")= Convert( VarChar(8), {?GroupNo} )
or {?aSearchParam} = 5 and  "MFG_PLANT_LI_HIST"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8), ("TBSOP13_HIST"."OP13_CLR_DAY" & "TBSOP13_HIST"."OP13_PP_GRP_SEQ_NO" & "TBSOP13_HIST"."OP13_CELL_ID")) = Convert( VarChar(8), {?GroupNo})

This is actually a fairly easy fix - because of the way the "OR" works in SQL, you need to surround each "set" of statements in the or with parentheses.  So, it would look something like this:
Where
({?aSearchParam} = 1 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI21"."LI21_OR_NO"=Cast( {?Search_Val} as Int))
or
({?aSearchParam} = 2 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND "TBSLI33"."LI33_CI_OR_NO"=Cast( {?Search_Val} as numeric(12,0)))
or
({?aSearchParam} = 3 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(20),"TBSLI33"."LI33_EXT_SYS_SL_OR_NO")= Convert( VarChar(20), {?Search_Val}))
or
({?aSearchParam} = 4 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8),"TBSLI21"."LI21_OP_GRP_NO") = Convert( VarChar(8), {?GroupNo}))
or
({?aSearchParam} = 5 and "MFG_PLANT_LI"."PRFR_MFG_PLANT_FLG"='Y' AND Convert( VarChar(8), ("TBSOP13"."OP13_CLR_DAY" & "TBSOP13"."OP13_PP_GRP_SEQ_NO" & "TBSOP13"."OP13_CELL_ID")) = Convert( VarChar(8), {?GroupNo}))
-Dell

Similar Messages

  • How can I pass multiple condition in where clause with the join table?

    Hi:
    I need to collect several inputs at run time, and query the record according to the input.
    How can I pass multiple conditions in where clause with the join table?
    Thanks in advance for any help.
    Regards,
    TD

    If you are using SQL-Plus or Reports you can use lexical parameters like:
    SELECT * FROM emp &condition;
    When you run the query it will ask for value of condition and you can enter what every you want. Here is a really fun query:
    SELECT &columns FROM &tables &condition;
    But if you are using Forms. Then you have to change the condition by SET_BLOCK_PROPERTY.
    Best of luck!

  • How can I return multiple values with PL/SQL Web Services

    Hi,
    I'm new to developping Web Services. I'm doing some tests with JDeveloper and OC4J on my local machine with a Web Services based on a PL/SQL function within a package. Right now that function only returns one value. So the xml response only has one output.
    I'd like to know how can I return multiple values with my PL/SQL Web Service. For example, if I want to return an employee's name and id? And that the xml contains two output : <employee>, <empid>?
    Reginald
    ps : I have searched the forum and I couldn't find an answer to this question, if that has been discussed AND answered before, can you please post the link? Thanks

    Alright, I actually found my answer. Since this was asked I think as a followup somewhere else I'll give my answer.
    It is very simple, all you have to do is create an Object Type and then Return that object type. After that, JDeveloper will take care of everything and you will have an xml response with multiple values. Here
    {color:#ff0000}
    create or replace TYPE person AS OBJECT
    ( id_interv number,
    first_name VARCHAR2(50),
    last_name VARCHAR2(50),
    date_birth date
    );{color}
    Then your function used in your Web Service should look something like this :
    {color:#ff0000}
    function info_emp (p_empno IN VARCHAR2) RETURN person AS
    l_emp person := person(-1,'','','');
    BEGIN
    SELECT first_name
    ,last_name
    ,emp_no
    INTO l_emp.first_name
    ,l_emp.last_name
    ,l_emp.emp_no
    FROM emp
    WHERE upper(emp_no) = upper (emp_no);
    {color}
    {color:#ff0000}
    RETURN l_emp;
    EXCEPTION WHEN NO_DATA_FOUND THEN
    l_emp := person (-1,'n/a','n/a','n/a');
    RETURN l_emp ;
    END info_emp;{color}
    {color:#ff0000}{color:#000000}After that, this is what the xml response looks like :{color}{color}
    &lt;first_name xsi:type="xsd:string"&gt;John&lt;/first_name&gt;
    &lt;last_name xsi:type="xsd:string"&gt;Doe&lt;/last_name&gt;
    &lt;emp_no xsi:type="xsd:string"&gt;0250193&lt;/emp_no&gt;

  • How can I display multiple column results of a sql query?

    I'm wanting to display the results of a query selecting from multiple columns, but I can't seem to find an item type that will allow this. I've tried LOV, multiselect, display as text and others. Any ideas on how to do this. Here is my basic query:
    Select ul.meaning,
    rqa.submission_date,
    rqa.location_num
    from
    cfa_rqa_doc_submit_dates rqa,
    cfa_user_lookups ul
    where
    rqa.location_num in (Select location_num from cfa_current_locations_mv
    where operator_person_id = :P1_PERSON_ID and substr(location_num,1,1) = '8')
    and
    ul.lookup_type_id='1269'
    and
    to_char(rqa.submission_date, 'month') = to_char(sysdate, 'month')
    and
    rqa.submission_date >= (SYSDATE-365)
    and ul.lookup_ID= rqa.document_type_id
    ;

    Hi,
    Do you just wish to display the result of the query? If so, you can simply parse it out in HTML.
    You can then choose if you want to use tables or css.
    Multiple column layout in tables are based on <tr> and <td>.
    <tr> is a table row, where <td> is a column.
    All tags should be closed.
    Example:
    <table>
    <tr>
    <td>col1</td><td>col2</td>
    </tr>
    <tr>
    <td colspan="2">spans over 2 cols</td>
    </tr>
    </table>If you want to do the same in css:
    (Seems this forum removes the styles!):
    float:left; width:50; << first div and 2 div (col 1 and col 2 style)
    float:left;clear:both; width:100%; << clear both, double width (spans over 2)
    <div>
    <div style="float:left; width:50;">col1</div><div style="float:left;width:50%;">col2</div>
    <div style="float:left;clear:both; width=100%;">Spans over 2 cols</div>
    </div>The div might look more complicated, but if you refrain from styling in the tags them selves, you can define different styles in the .css file.
    You need the clear:both to start a new line with the divs that float.
    I usually run a dedicated "new line" div, without content.. (exception beeing the html-entities version of ' ' (& nbsp ; << without the spaces)).
    eg.:
    <div style="cls"> </div>Parsing out the values from the PL SQL you do like so:
    begin
    declare
       cursor c_search is 
    Select ul.meaning,
    rqa.submission_date,
    rqa.location_num
    from
    cfa_rqa_doc_submit_dates rqa,
    cfa_user_lookups ul
    where
    rqa.location_num in (Select location_num from cfa_current_locations_mv
    where operator_person_id = :P1_PERSON_ID and substr(location_num,1,1) = '8')
    and
    ul.lookup_type_id='1269'
    and
    to_char(rqa.submission_date, 'month') = to_char(sysdate, 'month')
    and
    rqa.submission_date >= (SYSDATE-365)
    and ul.lookup_ID= rqa.document_type_id
    begin  
    htp.p('<div style="width:80%;">');
    for v_search in c_search loop
    htp.p('<div style="float:left;clear:none;">'||v_search.location_num||'</div>');
    htp.p('<div style="float:left;clear:none;">'||v_search.submission_date||'</div>');
    end loop;
    htp.p('</div>');
      end;
    end;Ps. hope I understood you correctly, also this code is untested.. but I hope it can still help.
    Edited by: Olav Alexander Mjelde on May 12, 2010 9:36 AM

  • How Can I Put Multiple Columns in a Drop-Down Menu?

    We are trying to put multiple columns in a drop-down menu, similar to what is on these web sites...
    http://www.cabelas.com/
    http://www.target.com/  (This site has the multiple columns on the Women, Home, Kitching & Dining, Toys, Electronics, and See More categories).
    If anyone has any suggestions for coding, please reply.
    Thank you.
    Wil Radcliffe

    As an <li> tag is not a block level element like a <p> or <div> tag you can store a <div> container within the <li> tag and create an element in that menu item and us the following tutorial to create multiple columns depending on the ordering:
    http://www.alistapart.com/articles/multicolumnlists
    Depending on your target browser you could also use the CSS3 column-count to define the amount of columns.  But with just a quick glance at this I would say it only works in the the later versions of Firefox, Chrome, Safari and IE9+.
    http://www.w3schools.com/cssref/css3_pr_column-count.asp

  • How to pass a multiple value parameter to SQL Command?

    Hi,
    I created a SQL Command with parameter.  But, I need the parameter to be set as multiple value.  After creating the SQL Command and it's parameter under the Database Expert, I went to Field Explorer --->  Parameter Fields and found the parameter that I had created for the SQL Command.  But when I wanted to edit the parameter to make it a multiple value parameter, the multiple value option was fix grayed as single parameter and I couldn't change it to multiple parameter.  Is there any way that I can set a parameter that is attached to SQL Command as multiple value rather than single value?  Thanks.
    Cheers,
    Al

    Al,
    That's a feature that, apparently, is only available in CR 2008.  If you are using CR 2008, use this link to see how to do it.
    [https://boc.sdn.sap.com/node/19268]
    Cheers,
    Jason

  • How do I unhide multiple columns at a time in a response table?

    I feel like I have done this before, but now I cannot seem to figure out how.  Any help would be appreciated.

    but is there any other way? Like changing something in the properties that will make the Divs bump up to the Div aoove that when you remove one out of there
    I'm afraid not.
    I  imported the whole site as divs by splitting the images in photoshop and saving it for web and devices.
    This is approach is OK for quick comps to show a client but definitely NOT suitable for a production site.  As soon as you attempt to edit your layout, the page will explode and fall apart.  This is caused by the rigid/fragile code that graphics apps attempt to generate based on the images sizes.
    Start over.  Use graphics apps to slice and optimize images only.
    Use DW to build your HTML and CSS code.
    Creating  your first web site in DW CS5 -
    http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt1.html
    Adobe Developer's Center - Getting Started tutorials
    http://www.adobe.com/devnet/dreamweaver/?view=gettingstarted
    Using  DW Page Properties to create a basic CSS style sheet
    http://kb2.adobe.com/community/publishing/505/cpsid_50576.html
    APDivs as a primary layout method seldom works well. Here is why:
    http://apptools.com/examples/pagelayout101.php
      Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • How can I separate one column into multiple column?

    How can I separate one column into multiple column?
    This is what I have:
    BUYER_ID ATTRIBUTE_NAME ATTRIBUTE_VALUE
    0001 PHONE_NUMBER 555-555-0001
    0001 EMAIL [email protected]
    0001 CURRENCY USD
    0002 PHONE_NUMBER 555-555-0002
    0002 EMAIL [email protected]
    0002 CURRENCY USD
    0003 PHONE_NUMBER 555-555-0003
    0003 EMAIL [email protected]
    0003 CURRENCY CAD
    This is what I would like to have:
    BUYER_ID PHONE_NUMBER EMAIL CURRENCY
    0001 555-555-0001 [email protected] USD
    0002 555-555-0002 [email protected] USD
    0003 555-555-0003 [email protected] CAD
    Any help would be greatly appreciated.

    This is another solution. Suppose your actual table's name is test(which has the redundant data). create a table like this:
    CREATE TABLE test2 (BUYER_ID number(10),PHONE_NUMBER varchar2(50),EMAIL varchar2(50),CURRENCY varchar2(50));
    then you will type this procedure:
    declare
    phone_number_v varchar2(50);
    EMAIL_v varchar2(50);
    CURRENCY_v varchar2(50);
    cursor my_test is select * from test;
    begin
    for my_test_curs in my_test loop
    select ATTRIBUTE_VALUE INTO phone_number_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='PHONE_NUMBER';
    select ATTRIBUTE_VALUE INTO EMAIL_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='EMAIL';
    select ATTRIBUTE_VALUE INTO CURRENCY_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='CURRENCY';
    INSERT INTO test2
    VALUES (my_test_curs.person_id,phone_number_v,EMAIL_v,CURRENCY_v);
    END LOOP;
    END;
    Then you will create your final table like this:
    create table final_table as select * from test2 where 1=2;
    After that write this code:
    INSERT ALL
    into final_table
    SELECT DISTINCT(BUYER_ID),PHONE_NUMBER,EMAIL,CURRENCY
    FROM TEST2;
    If you have a huge amount of data in your original table this solution may take a long time to do what you need.

  • How can I use multiple row insert or update into DB in JSP?

    Hi all,
    pls help for my question.
    "How can I use multiple rows insert or update into DB in JSP?"
    I mean I will insert or update the multiple records like grid component. All the data I enter will go into the DB.
    With thanks,

    That isn't true. Different SQL databases have
    different capabilities and use different syntax, That's true - every database has its own quirks and extensions. No disagreement there. But they all follow ANSI SQL for CRUD operations. Since the OP said they wanted to do INSERTs and UPDATEs in batches, I assumed that ANSI SQL was sufficient.
    I'd argue that it's best to use ANSI SQL as much as possible, especially if you want your JDBC code to be portable between databases.
    and there are also a lot of different ways of talking to
    SQL databases that are possible in JSP, from using
    plain old java.sql.* in scriptlets to using the
    jstlsql taglib. I've done maintenance on both, and
    they are as different as night and day.Right, because you don't maintain JSP and Java classes the same way. No news there. Both java.sql and JSTL sql taglib are both based on SQL and JDBC. Same difference, except that one uses tags and the other doesn't. Both are Java JDBC code in the end.
    Well, sure. As long as you only want to update rows
    with the same value in column 2. I had the impression
    he wanted to update a whole table. If he only meant
    update all rows with the same value in a given column
    with the same value, that's trivial. All updates do
    that. But as far as I know there's know way to update
    more than one row where the values are different.I used this as an example to demonstrate that it's possible to UPDATE more than one row at a time. If I have 1,000 rows, and each one is a separate UPDATE statement that's unique from all the others, I guess I'd have to write 1,000 UPDATE statements. It's possible to have them all either succeed or fail as a single unit of work. I'm pointing out transaction, because they weren't coming up in the discussion.
    Unless you're using MySQL, for instance. I only have
    experience with MySQL and M$ SQL Server, so I don't
    know what PostgreSQL, Oracle, Sybase, DB2 and all the
    rest are capable of, but I know for sure that MySQL
    can insert multiple rows while SQL Server can't (or at
    least I've never seen the syntax for doing it if it
    does).Right, but this syntax seems to be specific to MySQL The moment you use it, you're locked into MySQL. There are other ways to accomplish the same thing with ANSI SQL.
    Don't assume that all SQL databases are the same.
    They're not, and it can really screw you up badly if
    you assume you can deploy a project you've developed
    with one database in an environment where you have to
    use a different one. Even different versions of the
    same database can have huge differences. I recommend
    you get a copy of the O'Reilly book, SQL in a
    Nutshell. It covers the most common DBMSes and does a
    good job of pointing out the differences.Yes, I understand that.
    It's funny that you're telling me not to assume that all SQL databases are the same. You're the one who's proposing that the OP use a MySQL-specific extension.
    I haven't looked at the MySQL docs to find out how the syntax you're suggesting works. What if one value set INSERT succeeds and the next one fails? Does MySQL roll back the successful INSERT? Is the unit of work under the JDBC driver's control with autoCommit?
    The OP is free to follow your suggestion. I'm pointing out that there are transactions for units of work and ANSI SQL ways to accomplish the same thing.

  • How do I select multiple columns in a recordset

    I am very new to Dreamweaver/PHP/MYSQL
    I have created my recordset but I cant work out how I select multiple columns.
    How do I select multiple columns, I want to search for data that is spread over different columns.
    My recordset looks like this just now.
    SELECT *
    FROM names
    WHERE nameone = john
    I have 11 columns where the name john my or may not appear so how would I select all the columns. What would the recordset look like.
    As I have said I,m very new to this  and forgive me if what i have just said makes no sense.
    Thanks

    >I have 11 columns where the name john my
    >or may not appear so how would I select all
    >the columns. What would the recordset look like.
    You could try a Full-Text search (if mysql supports it) but on the surface, this sounds like a badly designed data structure. What does your database and table design look like?

  • How can I insert multiple page contents in the page layout properly?

    I wanted to create 4 columns on the page layout. These 4 columns are of page contents.
    After creating new web page based on that page layout, I attempted to enter 4 different inputs on all 4 columns.
    Then, the result (from all columns) becomes the same.
    Image - edit the web page based on 4 columns page layout:
    Image - after edit & save:
    How can I insert multiple page contents in the page layout properly?

    First, I copied the HTML snippet for the Page Content on Sharepoint's Design Manger. The code of Page Content HTML snippet is shown below:
    <div data-name="Page Field: Page Content">
    <!--CS: Start Page Field: Page Content Snippet-->
    <!--SPM:<%@Register Tagprefix="PageFieldRichHtmlField"
    Namespace="Microsoft.SharePoint.Publishing.WebControls"
    Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0,
    Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
    <!--MS:<PageFieldRichHtmlField:RichHtmlField
    FieldName="f55c4d88-1f2e-4ad9-aaa8-819af4ee7ee8" runat="server">-->
    <!--PS: Start of READ-ONLY PREVIEW (do not modify)-->
    <div id="ctl02_label" style="display:none">Page Content</div>
    <div id="ctl02__ControlWrapper_RichHtmlField" class="ms-rtestate-field"
    style="display:inline" aria-labelledby="ctl02_label"><div align="left"
    class="ms-formfieldcontainer"><div class="ms-formfieldlabelcontainer"
    nowrap="nowrap"><span class="ms-formfieldlabel"
    nowrap="nowrap">Page Content</span></div>
    <div class="ms-formfieldvaluecontainer"><div class="ms-rtestate-field">
    Page Content field value. Lorem ipsum dolor sit incididuntet dolore.</div>
    </div></div></div><!--PE: End of READ-ONLY PREVIEW-->
    <!--ME:</PageFieldRichHtmlField:RichHtmlField>-->
    <!--CE: End Page Field: Page Content Snippet-->
    </div>
    After I published the page layout, I found the code for Page Content from its ASPX page. The code is shown below:
    <div data-name="Page Field: Page Content">
    <PageFieldRichHtmlField:RichHtmlField FieldName="f55c4d88-1f2e-4ad9-aaa8-819af4ee7ee8" runat="server"/></div>
    So, I attempted to create 4 columns by using 4 HTML snippets of Page Content on the same page layout. The page layout is generated from HTML file to ASPX file.
    Then I edited some parts in ASPX page layout:
    <asp:Content runat="server" ContentPlaceHolderID="PlaceHolderMain">
    <table>
    <tr>
    <td style="width:70px;">&nbsp;</td>
    <td style="width:250px; text-align:right;">
    <div data-name="Page Field: Page Content">
    <PageFieldRichHtmlField:RichHtmlField FieldName="f55c4d88-1f2e-4ad9-aaa8-819af4ee7ee8" runat="server"/>
    </div>
    </td>
    <td style="width:40px;">&nbsp;</td>
    <td style="width:200px;">
    <div data-name="Page Field: Page Content">
    <PageFieldRichHtmlField:RichHtmlField FieldName="f55c4d88-1f2e-4ad9-aaa8-819af4ee7ee8" runat="server"/>
    </div>
    </td>
    <td style="width:25px;">&nbsp;</td>
    <td style="width:200px;">
    <div data-name="Page Field: Page Content">
    <PageFieldRichHtmlField:RichHtmlField FieldName="f55c4d88-1f2e-4ad9-aaa8-819af4ee7ee8" runat="server"/>
    </div>
    </td>
    <td style="width:25px;">&nbsp;</td>
    <td style="width:200px;">
    <div data-name="Page Field: Page Content">
    <PageFieldRichHtmlField:RichHtmlField FieldName="f55c4d88-1f2e-4ad9-aaa8-819af4ee7ee8" runat="server"/>
    </div>
    </td>
    <td style="width:175px;">&nbsp;</td>
    </tr>
    </table>
    </asp:Content>
    The 4 columns for Page Contents appeared on the web page when I created new page using that page layout. But the problem is that all 4 columns displayed the same result from 4th column.

  • How can I add multi columns to a JCombo Box ?

    Dear experts,
    How can I add multi columns to a JCombo Box ?
    Thankx in advance
    Unique

    What do you mean by adding Multiple columns? JCombobox is a component in which you can choose a value from a list(rows) of values. Could you please explain why do you want multiple columns in the JComboBox. I suppose JComboBox is not meant for that.
    Thanks,
    Jana

  • OBIEE 11g How to Exclude/Include Multiple columns on BI Report at Run Time

    OBIEE 11g How to Exclude/Include Multiple columns on BI Report at Run Time

    Exclude:
    you Can exclude columns in either Table view or pivot table view by placing those columns in Excluded section but you will notice that it will appear in bi server parsed sql query.
    Not sure you were asking about runtime??
    would you please explain your question!!
    Thanks
    NK
    Edited by: DNK on May 8, 2013 9:48 PM

  • How can I have multiple users on iTunes (in order to connect to a shared office iPad)?

    How can I have multiple users on iTunes (in order to connect to a shared office iPad)? Currently each of us has our own iTunes account, so I've made an "all office" Apple ID. However, I can't seem to get two different accounts (my personal and the office) to work on my machine. Even when I login as "the office", my personal library is still showing. Additionally, when I try to setup with a first-time use in iTunes, I get an error that I don't meet the minimum age requirement - no matter what birthdate I enter!

    The library exists regardless of which user is logged in.
    The only way around that is to create different user accounts on the computer.
    There is no way to have 20 unique iTunes users access a shared iTunes under a single login on the computer.

Maybe you are looking for

  • Add Bookmark in PDF File

    Hi, I have to add bookmark in pdf file, i tried so many ways. But no use. i have a PDf with full text information, i want to add few text (Some words with in the PDF) from the content and need to add them in bookmark. i know i can add manulay but my

  • Is There any fm having the same Functionality of CUSTOMER_DUE_DATE_ANALYSIS

    Hi ,          Is there any function module which have same functionality of the fm CUSTOMER_DUE_DATE_ANALYSIS. Here i am facing the Problem is It is showing the amounts in company code currency and we want in Document Currency. Next issue is regardin

  • How can I descreen and scale the target image size with a HP 8600 n911 premium?

    I recently purchased an new HP 8600 n911 premium all-in-one, HP's top of the line all in one inkjet printer/scanner.  I cannot find any settings that permit me to descreen an image (such as one in a newspaper) or to adjust the size of the target imag

  • Synaptics enables / disables itself in a loop

    I have GT70 2OD Synaptics 18.1.30.4 08Oct14 Synaptics TouchPad V7.2 I recently installed the synaptic drivers and I can see that sometimes enter an enable/disable loop (I can see that is enabling and disabled both by the system tray icon and the led

  • Workaround for internet access that needs to 'log in'??

    Hi, I recently got internet service (Consolidated Smart Systems) in my apartment. The trouble is that I need to enter a username and password each time I want to use the internet. Think of it like accessing the internet in Starbucks. Of course this m