Problem to write a select statement

[\code]
/* Formatted on 6/9/2011 5:30:17 PM (QP5 v5.149.1003.31008) */
CREATE TABLE temp
AS
SELECT 111 id, '72 ( 1/02/2011);73 ( 1/02/2011);' dt FROM DUAL
UNION
SELECT 232 id, '74 ( 1/02/2011);' FROM DUAL
UNION
SELECT 242 id, '73 ( 1/02/2011);72 ( 1/02/2011); ' FROM DUAL
UNION
SELECT 252 id, '74 ( 1/02/2011);13 ' FROM DUAL
UNION
SELECT 262 id, '77 ( 1/02/2011);72' FROM DUAL
UNION
SELECT 252 id, '53 ( 1/02/2011);44 ' FROM DUAL
UNION
SELECT 252 id, '55 ( 1/02/2011); 45 ' FROM DUAL
UNION
SELECT 252 id, '55 ( 1/02/2011);13 ' FROM DUAL
UNION
SELECT 252 id, '56 ( 1/02/2011);13 ' FROM DUAL
UNION
SELECT 2992 id, '56 ( 1/02/2011);13 : 72 73,74 ' FROM DUAL;
note : DT column is a STRING (varchar2(400))
i want to get rows with 72 ,73,74 and 13
if the row has both numbers mentioned above then my result should be
id 72 73 74 13
111 1 1 0 0
232 0 0 1 0
242 1 1 0 0
252 0 0 1 0
2992 1 1 1 1
sample data:
784027892     13 (12/13/10); 300 (12/13/10);
784027919 72 (06/06/11);
784027977 72 (06/06/11); 73 (06/06/11);
784028005     74 (06/06/11);
78402802 73 (06/06/11);
281398723     300 (06/09/11); 74 (06/09/11);
281399095 72 (06/09/11); 13 (06/09/11);
281399162     73 (06/09/11);
281399177     74 (06/09/11);
can any one help me
Thanks
[\code]
Edited by: 846773 on Jun 9, 2011 6:26 PM
Edited by: 846773 on Jun 9, 2011 6:28 PM

Hi,
846773 wrote:
[\code]
/* Formatted on 6/9/2011 5:30:17 PM (QP5 v5.149.1003.31008) */
CREATE TABLE temp
AS ...
SELECT 252 id, '74 ( 1/02/2011);13 ' FROM DUAL
UNION
SELECT 252 id, '55 ( 1/02/2011);13 ' FROM DUAL
UNION
SELECT 252 id, '56 ( 1/02/2011);13 ' FROM DUAL
UNION
... So there are 3 rows that have id=252 and contain '13'
i want to get rows with 72 ,73,74 and 13
if the row has both numbers mentioned above then my result should be
id 72 73 74 13
111 1 1 0 0
232 0 0 1 0
242 1 1 0 0
252 0 0 1 0Why do you want 0 in the "13" column for id=252? Why not 3, corresponding to the 3 rows I pointed out earlier?
sample data:
784027892     13 (12/13/10); 300 (12/13/10);
784027919 72 (06/06/11);
784027977 72 (06/06/11); 73 (06/06/11);
784028005     74 (06/06/11);
78402802 73 (06/06/11);
281398723     300 (06/09/11); 74 (06/09/11);
281399095 72 (06/09/11); 13 (06/09/11);
281399162     73 (06/09/11);
281399177     74 (06/09/11); What is this?
I think you want something like this:
WITH     got_delimited_nums     AS
     SELECT     id
     ,     ' ' || TRIM ( REGEXP_REPLACE ( REGEXP_REPLACE ( dt
                                          , '\([^)]*\)'
                              , '[^0-9]+'
              || ' '     AS delimited_nums
     FROM     temp
SELECT       id
,       SUM (SIGN (INSTR (delimited_nums, ' 72 ')))     AS n_72
,       SUM (SIGN (INSTR (delimited_nums, ' 73 ')))     AS n_73
,       SUM (SIGN (INSTR (delimited_nums, ' 74 ')))     AS n_74
,       SUM (SIGN (INSTR (delimited_nums, ' 13 ')))     AS n_13
FROM       got_delimited_nums
GROUP BY  id
ORDER BY  id
;Output:
        ID       N_72       N_73       N_74       N_13
       111          1          1          0          0
       232          0          0          1          0
       242          1          1          0          0
       252          0          0          1          3
       262          1          0          0          0
      2992          1          1          1          1This ignores the numbers inside parentheses.
If the same number appears 2 (or more) times on the same row, it will be counted only once.
Whenever you have a problem, say which version of Oracle you're running. The query above will work in Oracle 10.1 (and up).
Edited by: Frank Kulash on Jun 9, 2011 10:33 PM

Similar Messages

  • Problem in Matrix Like Select Statement.

    Hi All,
    I have table like this
    Name Null? Type
    ROLL NUMBER
    DD DATE
    ATT VARCHAR2(2)
    Along with the data--
    SELECT * FROM ATT;
    ROLL DD AT
    2 02-FEB P
    2 01-FEB P
    2 03-FEB P
    2 04-FEB P
    2 05-FEB P
    2 06-FEB P
    2 07-FEB A
    2 09-FEB A
    1 01-FEB A
    1 02-FEB P
    1 03-FEB A
    1 04-FEB A
    1 05-FEB P
    1 06-FEB P
    1 07-FEB P
    1 09-FEB P
    I want to write the select statement which fetch the data in matrix like I shown below.
    ROLL 01-FEB = 02-FEB = 03-FEB = 04-FEB
    1 A P A A
    2 P P P P
    I tried with sub-queries but not working Any Help...
    SKM

    sorry i did not look at the problem complete.
    the first solution works with the number of values in the date columns are known.
    then you can hardcode them , but when the values are unknown you should use something like this.
    i have given my example, you just change the queries in the code accordingly and it works great. Thanks to Thomas Kyte who provided this example, i took it and modified for my own.
    CREATE TABLE TABL_RESULTDATA
    Loadpoints VARCHAR2(125)
    , LoadPointSteps VARCHAR2(125)
    , Variable VARCHAR2(125)
    , Step NUMBER
    , Value NUMBER
    , VariableType VARCHAR2(20)
    , ReadBackValue NUMBER
    insert into tabl_resultdata values('HA_000_LP_000','S_001', 'AD1Out(ADcard_1)',1,5, 'SET', 10)
    insert into tabl_resultdata values('HA_000_LP_000','S_001','N',1,100,'SET', 10)
    insert into tabl_resultdata values('HA_000_LP_000','S_001','Load(DDE)',1,1,'SET', null)
    insert into tabl_resultdata values('HA_000_LP_000','S_002','Q_quer(Emi2)',1,9.5,'MEAS', null)
    insert into tabl_resultdata values('HA_000_LP_000','S_002','T_I(Emi2)',1,0,'MEAS', null)
    insert into tabl_resultdata values('HA_000_LP_000','S_002','AD1Out(ADcard_1)',1,0,'SET', null)
    insert into tabl_resultdata values('HA_000_LP_000','S_002','N',1,100,'SET', null)
    insert into tabl_resultdata values('HA_000_LP_000','S_002','Load(DDE)',1,1,'SET', null)
    insert into tabl_resultdata values('HA_000_LP_001','S_001','Q_Ueber(KMM)',1,49.83,'MEAS', null)
    insert into tabl_resultdata values('HA_000_LP_001','S_001','T_Volkor(KMM)',1,0,'MEAS', null)
    insert into tabl_resultdata values('HA_000_LP_001','S_001','C1(LeCroy)',1,0,'MEAS', null)
    insert into tabl_resultdata values('HA_000_LPSCHL_000','S_001','AD1Out(ADcard_1)',1,10,'SET', null)
    insert into tabl_resultdata values('HA_000_LPSCHL_000','S_001','AD1Out(ADcard_1)',2,12,'SET', 17)
    insert into tabl_resultdata values('HA_000_LPSCHL_000','S_001','AD1Out(ADcard_1)',3,12,'SET', 19)
    insert into tabl_resultdata values('HA_000_LPSCHL_000','S_001','AD1(ADcard_1)',1,9.025,'MEAS', null)
    insert into tabl_resultdata values('HA_000_LPSCHL_000','S_001','AD1(ADcard_1)',2,9.05,'MEAS', null)
    create or replace package pivot
    as
    type rc is ref cursor;
    procedure data(p_cursor in out rc);
    end;
    create or replace package body pivot
    as
    procedure data( p_cursor in out rc )
    is
    l_stmt long;
    l_index number := 0;
    begin
    l_stmt := 'select loadpoints, loadpointsteps ,step ';
    for x in ( select distinct variable, variabletype from tabl_resultdata order by 2 )
    loop
    l_index := l_index + 1;
    l_stmt := l_stmt ||', max(decode(variable,' || ''''|| x.variable||''''||', value )) ' ||replace(replace(x.variable||'('||x.variabletype||')', '('), ')');
    end loop;
    l_stmt := l_stmt || ' from tabl_Resultdata group by loadpoints,loadpointsteps, step order by loadpoints';
    open p_cursor for l_stmt;
    end;
    end;
    set linesize 198
    column loadpoints format a17
    column loadpointsteps format a5
    column step format 999
    column value_1 format 999.999
    column value_2 format 999.999
    column value_3 format 999.999
    column value_4 format 999.999
    column value_5 format 999.999
    column value_6 format 999.999
    column value_7 format 999.999
    column value_8 format 999.999
    column value_9 format 999.999
    variable x refcursor
    set autoprint on
    exec pivot.data( :x );

  • Write a SELECT statement in different ways is not the same thing!!!

    Let's take a look
    use AdventureWorks2012
    go
    dbcc freeproccache
    go
    and now select something
    select * from [HumanResources].[vEmployeeDepartmentHistory]
    go
    so, analyzing 'Compiled Plan'
    SELECT usecounts, cacheobjtype, objtype, text
    FROM Sys.dm_exec_cached_plans
    CROSS APPLY sys.dm_exec_sql_text(plan_handle)
    where cacheobjtype = 'Compiled Plan'
    ORDER BY usecounts DESC;
    GO
    and now let's write some SELECT in "fuzzy case"
    dbcc freeproccache
    go
    select * from [HUMANResources].[vEmployeeDepartmentHistory]
    go
    select * from [HumanRESOURCES].[vEmployeeDepartmentHistory]
    go
    select * from [HumanResources].[VEmployeeDepartmentHistory]
    go
    select * from [HumanResources].[vEmployeeDEPARTMENTHistory]
    go
    select * from [HumanResources].[vEmployeeDepartmentHISTORY]
    go
    SELECT * from [HumanResources].[vEmployeeDepartmentHistory]
    go
    select * FROM [HumanResources].[vEmployeeDepartmentHistory]
    go
    and now let's see compiled plans again
    SELECT usecounts, cacheobjtype, objtype, text
    FROM Sys.dm_exec_cached_plans
    CROSS APPLY sys.dm_exec_sql_text(plan_handle)
    where cacheobjtype = 'Compiled Plan'
    ORDER BY usecounts DESC;
    GO
    So, write a SELECT statement in different ways is not the same thing!!!
    Hope it'll be useful
    P.Ceglie

    Yes.  There is little or no query normalization that happens in front of the query plan cache.  It would be a performance tradeoff to parse and normalize the query before matching it to the cached plans.  The benefit of reducing the number
    of plans in the cache probably wouldn't be worth it. 
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Can we write the select statement on maintence view for data retreval

    Can we use the select statement on maintence view
    Regrads
    Diva

    No. U cannot write a select on maintenance view.

  • Problem with writing SQL Select statement.

    Table structure
    Temp_tab
    App_no          Number
    Cln_no          Number
    Example data
    APP_NO          CLN_NO
    1          1
    1          2
    1          4
    2          3
    3          5
    3          7
    3          6
    4          9
    4          8
    7          13
    Output
    APP_NO          CLN_NO
    1          1,2,4
    2          3
    3          5,7,6
    4          9,8
    7          13
    You should not create any function to get this output. It should be a Select statement. You can use 8i features. You can exclude the comma between the values instead of that you can put spaces. No hard coding.
    Thank you in advance.
    Samujjwal Basu

    Table structure
    Temp_tab
    App_no          Number
    Cln_no          Number
    Example data
    APP_NO          CLN_NO
    1          1
    1          2
    1          4
    2          3
    3          5
    3          7
    3          6
    4          9
    4          8
    7          13
    Output
    APP_NO          CLN_NO
    1          1,2,4
    2          3
    3          5,7,6
    4          9,8
    7          13
    You should not create any function to get this output. It should be a Select statement. You can use 8i features. You can exclude the comma between the values instead of that you can put spaces. No hard coding.
    Thank you in advance.
    Samujjwal Basu

  • How do I write a select statement to see if table field is in variable list

    I was wondering if someone knew the best way to write a query to pull back rows where a table field is found in a a variable string.  I'm using Cold Fusion 10 on Microsoft SQL Server.
    The table has a series of fields such as
    carcode          carname
    G                Garage
    C                Carport
    A               Attached
    D               Detached
    And another query pulls back a field that stores as text all the abbreviations that apply
    I want to pull back all the carnames that would match the abbreviations stored in that field.  I thought I could use a contains line but that does not work.  How do I pull back matches against a variable string... I tried an IN statment but that didn't work.
    CFQUERY...
    Select carname from CarTable WHERE CONTAINS (carcode, '#query.carlist#') does not work. 
       select carname from CarTable WHERE CONTAINS(carcode, 'G,A')
    I'm stumped.  The list of abbreviations could be very LOOOONG or short and I just need to translate those abbreviations into the full names by grabbing it from another table.  It isn't just one abbreviation so I can't use LIKE in the one to one sense.
    Thank you so much.

    If you have records with these values,
    G,A
    0
    then your first mistake is that you designed your database poorly.  Storing lists in a single field is essentially stroring unuseable data.  A one to many relationship is better.  If you don't know what that is, I've heard good things about the book, Database Design for Mere Mortals.
    Next, this syntax, #queryname.car_storage#, only returns the first record.  To get all the records, use the valuelist function.
    Next, in sql, if you have a list of strings, each one has to be quoted.  Something like this.
    where myfield in ('a', 'b', 'c')
    The best way to achieve this in ColdFusion is to use the cfqueryparam tag with the list attribute set to yes.

  • How to write optimized select statements for this requirement

    I.     G/L Account No. Info: Get all the list of G/L Account no. , company code and the corresponding long description from SKB1 & SKAT tables based on the G/L Account no. and company code values entered in the selection screen.
    II.     No. of transactions posted: For each of the Company code & Posting date or fiscal year/ period combination, select all document numbers from BKPF table into an internal table. For each of the company code, GL Account no combination find out no. of distinct records in the BSEG table (or combination of BSIK, BSAK, BSID, BSAD, BSIS & BSAS tables) to get the No. of transactions posted.
    III.     For Last posting FY/period: for each G/L account, Company code combination, determine the MAX (Doc. No) in BSEG, and look up the corresponding document in BKPF table to get the last posting FY/Period.
    Thanks,
    Prakash.

    I) with a query (sq01/2) and logical database SDF
    or standard abap RFSKVZ00
    II)a) select bkpf
       b) select count( * ) from bsik...
    III) a)select max( belnr ) from bseg...
         b) selec single monat from bkpf
    A.

  • How to write select statement in XSL-FO type XML program

    Hi All,
    Could you please anyone explain briefly how to write select statement in XSL-FO XML Program.
    Requirement:
    In the seeded program, OAF page is creating one XML file and through XSL-FO type XML Pulisher loading data and generating PDF output. as per the requirement some of the informations are missing in the XML file and for modifing the OAF page will be taking someting. we are planing to write a select query inside the XSL-FO program to get the required information.
    Could you please help me how to write a select statement inside the XSL-FO type programs.
    Please give me some example program for this...
    Thanks in Advance.
    Regards,
    Senthil

    Hi ,
    Please check the below code and modified plant as select-option
    Check the below code :
    tables : mara,
    mast.
    data : begin of i_data occurs 0,
    matnr like mara-matnr,
    end of i_data.
    select-options : s_matnr for mara-matnr,
                           <b>S_werks for mast-werks.</b>
    start-of-selection.
    select a~matnr into table i_data
    from mara as a inner join mast as b on amatnr = bmatnr
    where <b>b~werks in s_werks</b>
    and a~matnr in s_matnr
    and a~mtart = 'AA'
    or a~mtart = 'UT'
    and b~stlan = '1'.
    loop at i_data.
    write:/ i_data-matnr.
    endloop.
    Hope you got it.
    Thanks
    Seshu

  • Problem in the select statement

    I have to select the values of the fields BEZEI  depending on tha sales order number vbeln. HOw can i write the select statement what will be the tables associated?

    Hi,
    tables: vbak.
    types: begin of ty_vbak,
               vbeln type vbeln,
               kokrs type kokrs,
              end of ty_vbak,
              begin of ty_it_tka01,
                kokrs type kokrs,
                bezei type bezei,
              end of ty_tka01.
    data: it_vbak type table of ty_vbak,
            wa_vbak type ty_vbak,
            it_tka01 type table of ty_tka01,
            wa_tka01 type ty_tka01.
    Select-options: s_vbeln for vbak-vbeln.
    Select VBELN KOKRS from VBAK into table it_VBAK where vbeln in s_vbeln.
    if sy-subrc = 0.
    select KOKRS BEZEI from TKA01 into it_tka01 for all entries in it_vbak where kokrs = it_vbak-kokrs.
    endif.
    Loop at it_vbak into wa_vbak.
    read table it_tka01 into wa_tka01 with key kokrs = wa_vbak-kokrs.
    if sy-subrc = 0.
    * Move data to final internal table.
    endif.
    endloop.
    Regards,
    Satish

  • Facing problem in select statement dump DBIF_RSQL_INVALID_RSQL CX_SY_OPEN_S

    Hi Experts,
    I  am facing the problem in the select statement where it giving the short dump
    DBIF_RSQL_INVALID_RSQL CX_SY_OPEN_S.
    i have searched many forms, but i found that the select option s_matnr have the limitaion 2000 entreis, but i am passing same s_matnr to other select statement with more than 2000 entries but it is not giving me any short dump.
    but i am facing problem with only one select statement where if i  pass select option s_matnr more than 1500 entris also giving short dump.
    my select statement is
    SELECT * FROM bsim                                       
             INTO CORRESPONDING FIELDS OF TABLE g_t_bsim_lean  
               FOR ALL ENTRIES IN t_bwkey   WHERE  bwkey = t_bwkey-bwkey
                                            AND    matnr IN matnr
                                            AND    bwtar IN bwtar
                                            AND    budat >= datum-low.
    in the internal table g_t_bsim_lean internal table contain all the fields of the table bsim with 2 fields from other table.
    Please let me know whether i need to change the select statement or any other solution for this.
    Regards,
    udupi

    my select query is like this:
    DATA: BEGIN OF t_bwkey OCCURS 0,                          "184465
              bwkey LIKE bsim-bwkey,                            "184465
            END OF t_bwkey.                                     "184465
      LOOP AT g_t_organ          WHERE  keytype  =  c_bwkey.
        MOVE g_t_organ-bwkey     TO  t_bwkey-bwkey.
        COLLECT t_bwkey.                                        "184465
      ENDLOOP.                                                  "184465
      READ TABLE t_bwkey INDEX 1.                               "184465
      CHECK sy-subrc = 0.                                       "184465
      SELECT * FROM bsim                                        "n443935
             INTO CORRESPONDING FIELDS OF TABLE g_t_bsim_lean   "n443935
               FOR ALL ENTRIES IN t_bwkey   WHERE  bwkey = t_bwkey-bwkey
                                            AND    matnr IN matnr
                                            AND    bwtar IN bwtar
                                            AND    budat >= datum-low.

  • How to write select statement into SCRIPT editor

    hello,
    i build a sap script for purchase order printing for exporting.
    now after all po order print fine then our client want some more should be print into layout regarding po header.
    At the soul my q is can i write select query into script editor itself.
    thanks and regards
    amit.

    You cannot write your select statement inside your SAPscript, to overcome this SAP has provided us an option of calling sub-routines.. go through the below example
    Go through this example
    Ex. SAPSCRIPT
    /: PERFORM <Subroutine name> IN PROGRAM <subroutine prog name>
    /:USING &<field name>&
    /:CHANGING &<field name1&    "It will be returned back from sub-routine
    /:ENDPERFORM
    Then create subroutine pool program(of your own name) and you have to write the code.
    FORM ><subroutine name> tables int_cond structure itcsy
    outt_cond structure itcsy.
    data : value(20), value1(20). "do your own declarations
    Read int_cond table index 1.
    value = int_cond-value.
    value1 = value1 + value.
    *****Write your select statement
    Read outt_cond table index 1.
    outt_cond-value = value1.
    Modify outt_cond index 1. 
    ENDFORM.
    Just rough idea given above.
    Regards,
    SaiRam

  • How to write select statement ?

    Hi,
    i have requirement like below :
    In selection screen we have material number as selection options  and plant as single entry.
    Based on the input.
    We have to extract  the material number and plant based on MTART = AA or UT in MARA table and STLAN = 1 in MAST table.
    how to write a select statment to pick values from selection option and extract those material and plant which fullfill above conditions.
    Please let me know..
    its urgent
    please help..
    i have written code like below..
    types: begin of x_it_mat,
           matnr type mkal-matnr,
           werks type mkal-werks,
           stlan type mast-stlan,
           end of x_it_mat.
    types: begin of x_it_mat1,
           matnr type mkal-matnr,
           werks type mkal-werks,
           mtart type mara-mtart,
           end of x_it_mat1.
    data : it_mat type table of x_it_mat,
           wa_mat like line of it_mat.
    data : it_mat1 type table of x_it_mat1,
           wa_mat1 like line of it_mat1.
    TABLES: MKAL , MAST , MARA.
    SELECTION-SCREEN BEGIN OF BLOCK matnr
                              WITH FRAME TITLE TEXT-001.
    select-options :
      so_matnr for mkal-matnr.
    SELECTION-SCREEN END OF BLOCK matnr.
    SELECTION-SCREEN BEGIN OF BLOCK plant
                              WITH FRAME TITLE TEXT-002.
    parameter p_werks type mkal-werks.
    SELECTION-SCREEN END OF BLOCK plant.
    select matnr
           werks
           stlan
           from mkal INTO table it_mat
           where matnr in so_matnr
           and werks = p_werks.
    after this how to write another select statement to extract material by satisfiying above 2 conditions..

    Hi ,
    Please check the below code and modified plant as select-option
    Check the below code :
    tables : mara,
    mast.
    data : begin of i_data occurs 0,
    matnr like mara-matnr,
    end of i_data.
    select-options : s_matnr for mara-matnr,
                           <b>S_werks for mast-werks.</b>
    start-of-selection.
    select a~matnr into table i_data
    from mara as a inner join mast as b on amatnr = bmatnr
    where <b>b~werks in s_werks</b>
    and a~matnr in s_matnr
    and a~mtart = 'AA'
    or a~mtart = 'UT'
    and b~stlan = '1'.
    loop at i_data.
    write:/ i_data-matnr.
    endloop.
    Hope you got it.
    Thanks
    Seshu

  • Plsql procedure containing select statement to fill page items

    I would like to fill items :P200_A and :P200_B and so on
    with the result of a SELECT which depends on the different values of many select lists.
    E.G. :P200_list_alpha with the list of values
    STATIC:less than 10;less,equal than 10;equal,above 10;above,indifferent;indiff
    :P200_list_beta with the list of values
    STATIC:active;active,passiv;passiv,excluded;excluded
    How do I write the select statement ? I think it has to be executed in an anonymous PLSQL Procedure (after submit).
    What is a convenient way to write the select statement ?
    I could imagine to use lots of IF , ELSIF, ELSE statements and in each branch (here 12 ) the whole/complet SELECT statement is written.
    How to solve this problem in an elegant way ?
    In my opinion the CASE statement could be helpful, but how to use it in the WHERE clause with this nested conditions ?

    I think I got it:
    SELECT col1, col2, col3, ...
    INTO :P200_A , :P200_B , ....
    FROM mytable_1, mytable_2
    WHERE mytable_1.col1 = mytable_2.col1
    AND (
    CASE
    WHEN :P200_LIST_ALPHA = 'less' AND NVL(TO_COL_WITH_ALPHA, 0) < 10 THEN 1
    WHEN :P200_LIST_ALPHA = 'equal' AND NVL(TO_COL_WITH_ALPHA, 0) = 10 THEN 1
    WHEN :P200_LIST_ALPHA = 'above' AND NVL(TO_COL_WITH_ALPHA, 0) > 10 THEN 1
    WHEN :P200_LIST_ALPHA = 'indiff' THEN 1
    ELSE 0
    END = 1 )
    AND
    ( CASE
    WHEN :P200_LIST_BETA = 'active' AND TO_COL_WITH_BETA IN ( 'a', 'A', 'akt', 'AKT' ) THEN 1
    WHEN :P200_LIST_BETA = 'passive' AND TO_COL_WITH_BETA IN ( 'p', 'P' ) THEN 1
    WHEN :P200_LIST_BETA = 'excluded' AND TO_COL_WITH_BETA = 'X' THEN 1
    ELSE 0
    END = 1 )
    ;Edited by: wucis on Oct 24, 2011 4:09 PM

  • Multiple Select statements in EXECUTE SQL TASK in SSIS

    Can we write multiple select statements in execute sql task(SSIS).
    If possible how to assign them to variables in result statement

    Hi ,
    You can use below steps to set result set to variable.
    1.In the Execute SQL Task Editor dialog box, on the General page, select the Single row, Full result set, or XML result set type(According to your result set).
    2.Click Result Set.
    3.To add a result set mapping, click Add.
    4.From the Variables Name list, select a variable or create a new variable.
    What is multiple selection ? May be below can be used in your scenario !
    http://stackoverflow.com/questions/17698908/how-to-set-multiple-ssis-variables-in-sql-task
    What you want to achieve ?
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • How to get all values from an interval using select statement

    Hi,
    Is it possible to write a select statement that returns all values from an interval? Interval boundaries are variable.
    something like this:
    select (for x in 1,1024 loop x end loop) from dual
    (this, of course, doesn't work)
    The result in this example should be 1024 rows of numbers from 1 to 1024. These numbers are parameters, so it is not possible to create a table with predefined values.
    Thanks in advance for your help,
    Mia.

    For your simple case, with a lower boundary of 1, you can use:
    SELECT rownum
    FROM all_objects
    WHERE rownum <= 1024For a set of number between say 50 - 100, you can use something like:
    SELECT rownum + (50 - 1)
    FROM all_objects
    WHERE rownum <= (100 - 50 + 1)Note, that all_objects was used only because it generally has a lot of rows. Any table with at least the number of rows in your range will work.
    TTFN
    John

Maybe you are looking for

  • How can I import Master files from my iPhoto library to my Aperture lib?...

    ... That is knowing that I have already imported all my iPhoto library but I selected the option "in their current location" from the "store files" pop-up menu. So right now, all my pictures are referenced images in Aperture but stored in their curre

  • Need some help trying to resolve some game crashes.

    Forgot to list OS in SIG.... anyway I am running XP pro.  What I am getting is hard locks during some (not all) games (Farcry and Rise of Nations are the worst). Anyway I get a God awful high pitched squawk out of my speakers and the games hardlock m

  • Item based on a formula in a custom folder

    Hi, actually I'm using Discoverer 4i and I have a problem when I create (with the administrator) an item based on a formula inside a custom folder. The item is based on the following formula : GET_THRESHOLD(Name,'XXI_SZF_SLA_Thresholds_Kormos') -- (1

  • Apache SSL not working

    Hello, I Have a SLES 11 SP1 Web access server running the newest groupwise. I have configured the SSL vhost but apache does not listen on port 443. In fact it appears as if the vhost is ignored. I have a SLES10 SP4 WebAcc server that runs SSL just fi

  • Problem in Monitor ('391 From 0 Records')

    Hi Guys, My standard extrator (2LIS_11_VAHDR) is extracting records properly. When i am uploading the data to BW, data has added properly into the cube. But in the monitor it is giving '391 From 0 Records' and always in yellow state. I am waiting mor