Dinamic Select

Hi all,
I am trying to do a dynamic select in which I don´t know which are going to be the conditions of the clause WHERE.
This is my code;
DATA: BEGIN OF it_selopt OCCURS 0,
        field      TYPE string,
        value      TYPE string,
      END OF it_selopt,
      wa_selopt LIKE LINE OF it_selopt.
DATA cond_syntax TYPE string.
it_selopt-field = 'MATNR'.
it_selopt-value = 'Hello'.
APPEND it_selopt.
LOOP AT it_selopt.
  wa_selopt = it_selopt.
* First condition
  AT FIRST.
       CONCATENATE wa_selopt-field '=' wa_selopt-value
         INTO cond_syntax SEPARATED BY space.
    CONTINUE.  "
  ENDAT.
* Other conditions 
       CONCATENATE cond_syntax 'AND' wa_selopt-field '=' wa_selopt-value
            INTO cond_syntax SEPARATED BY space.
ENDLOOP.
TRY.
    SELECT SINGLE *
           FROM eban
           WHERE (cond_syntax).
  CATCH cx_sy_dynamic_osql_error.
    MESSAGE `Wrong WHERE condition!` TYPE 'I'.
ENDTRY.
The problem is that in runtime gives a syntax error for the following thing:
In runtime the variable cond_syntax has the following:  MATNR = Hello
And it should have this: MATNR = 'Hello'
within quotation marks.
Because if it does not take Hello as if it was a variable.
Also I have tried the following thing:
DATA: field_2_read TYPE string.
  DATA: d_tabix TYPE n.
  LOOP AT it_selopt.
       wa_selopt = it_selopt.
       d_tabix = sy-tabix.
       CONCATENATE 'IT_SELOPT[' d_tabix ']-low' INTO field_2_read.
* First condition
       AT FIRST.
          CONCATENATE wa_selopt-field '=' field_2_read 
            INTO cond_syntax SEPARATED BY space.
          CONTINUE.
       ENDAT.
* Other conditions 
       CONCATENATE cond_syntax 'AND' wa_selopt-field '=' field_2_read
            INTO cond_syntax SEPARATED BY space.
  ENDLOOP.
But it continues giving me a error.
Any idea how?
Thanks in advance

it_selopt-value = '''Hello'''.
Thomas

Similar Messages

  • Dinamic SELECTION

    Hi,
    I have to update the selection screen of a program (change two fields from RANGE to SINGLE VALUE). So, I check the technical information (F1) to know the name of the field. then I got to the program and look for it, but it is not there!.
    Is there somthing like dinamic slection screen???? I really don't understand how this screen was made. when executing, I can see 7 fields (all of them RANGE, that means have LOW and HIGH boxes to enter values). But when I look in the SE80 Layout editor, y can see only 1 !!!
    any ideas??
    thansk for the help.
    Mauricio

    this is the flow logic (what does the % symbol do?)
    PROCESS BEFORE OUTPUT.
    MODULE %_INIT_PBO.
    MODULE %_PBO_REPORT.
    MODULE %_PF_STATUS.
    MODULE %_I_USER.
    MODULE %_END_OF_PBO.
    PROCESS AFTER INPUT.
      MODULE %_BACK AT EXIT-COMMAND.
      MODULE %_INIT_PAI.
    CHAIN.
      FIELD  I_USER-LOW.
      FIELD  I_USER-HIGH.
      MODULE %_I_USER.
    ENDCHAIN.
    FIELD !CK_NEW MODULE %_CK_NEW .
    CHAIN.
      FIELD  I_USER-LOW.
      FIELD  I_USER-HIGH.
      FIELD CK_NEW .
        MODULE %_BLOCK_0500001.
    ENDCHAIN.
    CHAIN.
      FIELD  I_USER-LOW.
      FIELD  I_USER-HIGH.
      FIELD CK_NEW .
      MODULE %_END_OF_SCREEN.
      MODULE %_OK_CODE_1000.
    ENDCHAIN.

  • Dinamic select list !

    Hi,
    I have the costum to creat static select list, but now i have creat a report based in lines template, with 5 coluns:
    NAME-----DATE------TEXT-------ID---------STATUS
    The status can be : FREE, OPEN or CLOSED
    I need to creat a select with the status, where i can chose more then 1 status at each time, and display display the the rows with folowing status:
    FREE AND OPEN OR
    OPEN AND CLOSED OR
    FREE AND OPEN AND CLOSED
    Dislay one colons with 1 status is easy, but with 2 or more status values gives me lot´s of problems.
    Thank´s, Luis

    Hi!
    Try the multiselect list.
    Jure

  • Using a LoV in each row of a report (SELECT)

    Hi everyone,
    I have a report of a table in APEX and I'd like to show a column with a Select list that I have saved (LoV). I mean, for each row of the table it must appear this dinamic select list. In addition, I want a button next to every Select list, every row.
    I know how to show a static select list using HTML in my SELECT query. I do something like:
    SELECT atribute1, atribute2, .... , '<html> select code </html>' as "list"
    FROM table1
    But I need to use an existing LoV. And then, if the user change one value of one select list, and presses the button in the same row, this value should be processed and do an UPDATE of this row in the DataBase.
    I suppose it is possible to do this in APEX, but I still didn't fins the way to do this.
    Can you help me, please? If my english is too bad, I can try to explain it better.

    It's not necessary any answer.
    I was wrong about inserting LoVs with HTML. It is not that hard, it's more simple and I know how to do this now.

  • Using service Locator pattern to dynamically access remote EJBs

    Hi All,
    Please help to guide me how I can use a service locator to retrieve a remote object (residing on another application but on same domain) .
    I do not want to use Dependency Injection since I want to dynamically discover them ( there are many implementations of same interface (POJO)). Each EJB implementation implements its own remote/local interface that extends this global POJO interface.
    I have two J2ee-Applications on same domain. J2EE-Application 1 has an EJB module (EJB Module 1) that intends to access an EJB Module (EJB Module 2) in J2EE-Application 2. Following observations:
    1. Dependency Injection fails if (include the EJB Module 2 jar in J2EE-Application 1). Reason App Server complains the EJB has been deployed (Deployment fails)
    2. Dependency Injection works if (exclude the EJB Module 2 jar in J2EE-Application 1) and include the Remote Interface in EJB Module 1(J2EE-Application 1).Positive Observation (Deployment success and DI also success)
    3.Using Service Locator to retrieve the remote object if (exclude the EJB Module 2 jar in J2EE-Application 1) and include the Remote Interface in EJB Module 1(J2EE-Application 1). Negative and Positive Observation.
    Positive Observation: Using dependency injection I can still retrieve the Remote Object
    Another Positive: The Service Locator remote lookup to another Bean in same Application but different EJB Module is successful.
    Negative Observation:
    The Service Locator lookup to this same remote object with Successful Dependency Injection fails (An Ejb in a different application).
    Can't retrieve the Remote Object with Service Locator. Message from Server:.
    NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial.
    Thanks in advance

    "I do not want to use Dependency Injection since I want to dynamically discover them ( there are many implementations of same interface (POJO))"
    If you're calling ejbs from other ejbs or servlets, the same could probably be acomplished by using dependency injection (@EJB) in a number of instance variables typed with different remote/local interfaces or even with different beanName attributes (for when more than one bean implements the same managed interface in the same app - not sure how it works outside the same jee app...) , and dinamically selecting one of them; or encapsulating those injected variables into a stateless ejb as your service locator to make them accessible from POJOs too (which, due to concurrent acess, wouldn't work for statefull ejbs references...).
    Anyway, using the jndi lookup service locator pattern seems ok in this case.
    What doesn't seem ok, given the nature of the error for the negative observation - jndi context initialization - is that
    Another Positive: The Service Locator remote lookup to another Bean in same Application but different EJB Module is successful.
    Can you check your code and reconfirm that you're using the same context initialization code for both the positive and negative observations ?

  • S_ALR_87012093 (Vendor) e S_ALR_87012186 (Customer) x Business Area

    Hi,
    I executed the standards reports: S_ALR_87012093 (Vendor business) and
    S_ALR_87012186 (Customer Sales), in the first screen in "Hide Dinamic
    Selection" I put "Business Area", but when the reports ran, nothing
    filter by business area was consider.
    For example:
    Vendor 123
    Business Area (BA)= 0050 > Balance = 120,00
    Business Area (BA)= 0070 > Balance = 250,00
    I try to filter by BA = 0050 (120,00), but the total of the report show
    me the total of the both BA = 370,00.
    Thanks.
    Soraia

    Hi Soraia,
    Unfortunately, selection by business area for S_ALR_87012172 is not possible.
    Please review note 50370 for more details on system's design.
    The dynamic selection for business area does not work for reports which use customer / vendor transaction tables (KNC1 LFC1), i.e., business area is not stored in transaction tables.
    The reports that read indexes (better performance) do not read GSBER as this info is contained in the cluster BSEG. The dynamic selections are available cause this is a mask using for developing all reports no matter if they will read the indexes or the cluster.
    Dynamic selections can only be used with customer / vendor, company code or fiscal year fields.  The following reports are affected by this program design, i.e., business area cannot be used in dynamic
    selection criteria:
    S_ALR_87012082 - Vendor Balances in Local Currency
    S_ALR_87012093 - Vendor Business
    S_ALR_87012079 - Transaction Figures: Account Balance
    S_ALR_87012080 - Transaction Figures: Special Sales
    S_ALR_87012081 - Transaction Figures: Sales
    S_ALR_87012105 - List of Down Payments open at Key Date - Vendors
    S_ALR_87012172 - Customer balances in local currency
    S_ALR_87012186 - Customer sales
    RFKSLD00       - F.42
    RFDSLD00       - F.23
    I regret not giving you a more positive answer
    Best Regards,
    Vanessa Barth.

  • Vendor & Customer Balance On Profit Center Group

    Hi experts,
    I have a client Requirement.
    They need to display Vendor & Customer On Profit Center Group Level.
    Also Customer & Vendor Balance On  Same Level.
    Is it possible in classic G/l or i have to implement new g/l?
    any report program or t-code for display ?
    Please give any input.
    Cheers.

    Dear Friend,
    You may enter t-code FBL1N and FBL5N, vendor and customer repectively, and fetch document number. Go to t-cde FBL3N and hit Shift + F4 for dinamic selections. Paste BELNR document number in he field and execute F8.
    Inside list you can display Profit Center Column by Ctrl+F8.
    This is a way you have a report with this requirements, however to have a report with more practical and efficiecy you should develop a Report Writer or an ABAP development. Hope that helps.
    Regards

  • DUMP: Mistake in Logical Databases

    I'm trying  to run a program wich use logical databases but a DUMP is raised into a dinamic select single of a standard program (SAPDBSDF). The field wich is read is empty, What's wrong?
    SELECT SINGLE (bkpf_fields) FROM bkpf INTO CORRESPONDING FIELDS OF xbkpf
              WHERE bukrs = save_bukrs
              AND   belnr = save_belnr
              AND   gjahr = save_gjahr.
    - bkpf_fields is empty.

    Hi,
    Place break point at select single and check bkpf_fields is initial or not.If it is initial,you will definitely get the dump as you don't have fieds to select.
    Thanks.
    Ramya.

  • Executing Transacction F111 in backgroud

    Hello to all !
    I need to know if is possibel executing F111 in background, (create parameter, create porposal and execute proposal).
    I tryed to use shdb, but doesn't work, because in the firts step, create parameter - Automatic payment Transaction for Payment Request, i need to put the key number in Dinamic Selection.
    I look for bapis, user-exits and BTE but I didn´t find anything.
    If any one has done someting like this, please tell me.
    Best regard's,
    EFonseca

    Check the OSS Note 301600 and also see https://websmp205.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700004289631999E
    Kanagaraja L
    Edited by: Kanagaraja  Lokanathan on Aug 31, 2009 12:58 PM

  • How to find the difference between 2 rows in a table

    Hi all
    I have a table say emp which has only 2 rows
    emp
    empno name age sex deptno
    1 X 20 M 10
    2 Y 21 M 20
    The output should be
    empno name age deptno
    1 X 20 10
    2 Y 21 20
    Since the sex are same , so it is not included in the output.
    thanks
    Hari

    Hi there rajkumar,
    Although your lead solution is more elegant than the one presented below,
    I believe the complete answer it would be:
    with mytable as (
    SELECT ROW_NUMBER() OVER (ORDER BY EMPNO) POS, Z.* FROM (
    select 1 empno, 'X' name, 20 age, 'M' sex, 10 deptno from dual
    union
    select 2, 'Y', 21, 'M', 20 from dual) Z
    SELECT
    DECODE(A.EMPNO,B.EMPNO,NULL,A.EMPNO) EMPNO,
    DECODE(A.NAME,B.NAME,NULL,A.NAME) NAME,
    DECODE(A.AGE,B.AGE,NULL,A.AGE) AGE,
    DECODE(A.SEX,B.SEX,NULL,A.SEX) SEX,
    DECODE(A.DEPTNO,B.DEPTNO,NULL,A.DEPTNO) DEPTNO
    FROM
    (SELECT * FROM mytable WHERE POS = 1) A,
    (SELECT * FROM mytable WHERE POS = 2) B
    UNION
    SELECT
    DECODE(B.EMPNO,A.EMPNO,NULL,B.EMPNO) EMPNO,
    DECODE(B.NAME,A.NAME,NULL,B.NAME) NAME,
    DECODE(B.AGE,A.AGE,NULL,B.AGE) AGE,
    DECODE(B.SEX,A.SEX,NULL,B.SEX) SEX,
    DECODE(B.DEPTNO,A.DEPTNO,NULL,B.DEPTNO) DEPTNO
    FROM
    (SELECT * FROM mytable WHERE POS = 1) A,
    (SELECT * FROM mytable WHERE POS = 2) B
    Your query indeed returns NULL in the column for which values are the same, but still, you get just the first row.
    Anyway, the question is how to dinamically select the columns that hold NULL values, in the newly generated result. Because i believe the request is like this, if column holds equal values on both rows, then don't select the column (maybe i'm wrong).
    If this is the case then just by one sql it will not solve your problem, it needs to be more, with sqlplus and some other scripts checking the values in the columns, if it's not null then set an operator, and in the end (in sqlplus)
    select operator1, operator2 etc. from mytable.
    Hope it helps,
    Michael.
    [All the above presented is based on the fact that you shall always have TWO rows to be compared, having more or less it will fail!]
    Message was edited by:
    kjt

  • Dinamic variant for selection screen

    Hi,
    I got a requirement where i need  a Dynamic variant for selection screen .There is a date field in the selection screen i want to create  a variant such that when i choose it,it should give the current day date in selection screen.can anyone help me.
    Regards,
    Ravi

    Hi,
    Using Customer Exit code you can give it.
    Create a Customer Exit Variable and write simple code in CMOD. See the usefull Exit code for reports in the following url.
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    WHEN 'ZV_DAT'.
        IF i_step = 1 .
          CLEAR l_s_range.
          l_s_range-low = sy-datum.
          l_s_range-opt = 'EQ'.
          l_s_range-sign = 'I'.
          APPEND l_s_range TO e_t_range.
        ENDIF.
    Thanks
    Reddy

  • Problem with PremiereProCS5 and AfterEffectsCS5 Dinamic Link!

    Problem with PremiereProCS5 and AfterEffectsCS5 Dinamic Link!
    I installed PremiereProCS4, and after, "Adobe Master Collection Suite CS5" in Italian Language, with PremiereProCS5 and AfterEffectsCS5 on OS Windows7x64Bit.
    I made a first composition with AfterEffects, from PremierePro by choosing "Adobe Dinamic Link">"Replace with AE Composition".
    After that, I made another second version of the same project, directly with AfterEffects.
    I want replace this AE version with existing version, in PremierePro.
    Thus, I selected "Adobe Dinamic Link">"Import AE Composition".
    1) But, the problem is that the new, fresh AE composition is not found!
    The Dinamic Link, in PremierePro, doesn't refresh the window where it is located the new AE Composition called "n°2" made last with AE, (not with DynamicLink)!
    There are available 3 files, that I made, but all the files display only the old composition called "n°1", made with DynamicLink, and with "Replace with AE Composition" command!
    The composition made with AE directly, is not displayed!
    Why?
    In fact, I tried to right click the clip, in PremiereProCS5 timeline, choosed "Replace with Clip">"From Folder" and selected the last imported AE composition: the composition is allways the OLD file made with DynamicLink, not the file made directly with AE!
    Why?
    Help!
    Horsepower0171.

    "...or if you must use multiple projects, start each one from scratch instead of duplicating and renaming..."
    Yes!
    I made from scratch these new projects with AECS5, called:
         "Montaggio_02_CS5_04_Franzi_AECS5 - Composizione collegata 02.avi" and
         "Montaggio_02_CS5_04_Franzi_AECS5 - Composizione collegata 03.avi",
    not renamed, nor duplicated.
    -But PremierePro and DynamicLink doesn't display those in the window!

  • How to create a condition based on a select that retrieve dynamically a LOV

    Hi all, I need to create a condition based on a select that retrieve dynamically a LOV.
    So, the condition have to be:
    inventory_item_id NOT IN (SELECT inventory_item_id FROM apps.mtl_system_items_kfv WHERE concatenated_segments = 'GENERAL_FAULTS_IPTV')
    I need to create a LOV based on this select without making any join with the folder which contains the field inventory_item_id, because otherwise I have the contradiction:
    and o124757.INVENTORY_ITEM_ID = o118741.INVENTORY_ITEM_ID -- join between the main custom folder (o118741) and the LOV custom folder (o124757)
    and o118741.INVENTORY_ITEM_ID NOT IN (o124757.INVENTORY_ITEM_ID) -- condition
    These two condition together don't show any data, obviously....This means also, that I can't use a calculated field, because if I want to see this field, I have to create a join, another time, with the main custom folder.
    I tried to create a LOV on the Administrator, but when I create the condition I have to check manually the values....and if in the future this LOV will increase I need every time to re-check all the values.....instead I need that the inventory_item_id have to be NOT IN dinamically in the list of values retrieved by the select.
    Anybody has inplemented something similar ??
    Thanks in advance
    Alex

    Hi alex,
    SELECT incidents.INVENTORY_ITEM_ID,
    pcodes.PROBLEM_NAME
    FROM apps.cs_incidents_all_b incidents,apps.jtf_rs_problem_codes_v pcodes
    WHERE incidents.category_id IN (SELECT category_id
    FROM mtl_categories_kfv
    WHERE concatenated_segments = 'IPTV')
    AND incidents.PROBLEM_CODE = pcodes.PROBLEM_CODE
    where incidents.INVENTORY_ITEM_ID NOT IN SELECT inventory_item_id
    FROM apps.mtl_system_items_kfv
    WHERE concatenated_segments = 'GENERAL_FAULTS_IPTV'
    You want to add this condition to the first query it holds good for this scenerio.All the items which are NOT IN will be retrieved.Here you are selecting other than "General_faults_iptv"
    But again your trying to select in the second query where you want "General_faults_iptv"
    SELECT inventory_item_id
    FROM apps.mtl_system_items_kfv
    WHERE concatenated_segments = 'GENERAL_FAULTS_IPTV'
    If you carefully go through what your doing,you will understand.In the above explantion ,there will be no records generated.First query your saying NOT IN and again your saying for the same IN,how will records retrieve its meaningless.
    I dont know what you want to get from second query.I would suggest you to do is dont use the second query and just use the first query and you will get.Here is the query and this will give you result.
    SELECT incidents.INVENTORY_ITEM_ID,
    pcodes.PROBLEM_NAME
    FROM apps.cs_incidents_all_b incidents,apps.jtf_rs_problem_codes_v pcodes
    WHERE incidents.category_id IN (SELECT category_id
    FROM mtl_categories_kfv
    WHERE concatenated_segments = 'IPTV')
    AND incidents.PROBLEM_CODE = pcodes.PROBLEM_CODE
    AND incidents.INVENTORY_ITEM_ID NOT IN SELECT inventory_item_id
    FROM apps.mtl_system_items_kfv
    WHERE concatenated_segments = 'GENERAL_FAULTS_IPTV'
    Regards,
    Kranthi.

  • Problem with nested select in procedure and order by

    Hi,
    I have this procedure:
    CREATE OR REPLACE PROCEDURE Mkt_Flussi_Giornalieri2
    ( idGruppo IN VARCHAR2
    , dataInizio IN DATE
    , dataFine IN DATE
    , startRow IN NUMBER
    , endRow IN NUMBER
    , column_order in varchar2
    --, order_name in varchar2
    , recordsetCursor OUT SYS_REFCURSOR
    , countRow OUT NUMBER
    ) IS
    order_clause varchar2(200) := ' ';
    sql_stm varchar2(32000);
    BEGIN
    IF column_order IS NOT NULL
    THEN
    order_clause := column_order;
    ELSE
    order_clause := ' stato DESC ';
    END IF;
    dbms_output.put_line('clausola:'||order_clause);
    sql_stm:='
         SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
            stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
            exec_seq, provider_description, log_info FROM
      (SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
            stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
            exec_seq, provider_description, log_info FROM
      (SELECT
    temp.flow_id AS idFlusso,
    MKT_FLOW.flow_id || '' - '' || MKT_FLOW.flow_description || ''('' || temp.exec_seq || '')'' AS descrizioneFlusso,
    TO_DATE(temp.date_id,''yyyymmddhh24miss'') AS dataRiferimento,
    TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''dd/mm/yyyy'')||'' h. ''||TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''hh24:mi'') AS strDataRiferimento,
    temp.status AS stato, temp.end_time AS dataElaborazione, DECODE(temp.status,3, ERROR_DESC, 1, TRACE_DES) AS ultimoMessaggio,
    DECODE(temp.status,3, error_level, 1, fk_trace_level) AS livello,
    Get_Group_Description(MKT_FLOW.flow_id) AS utentiRiferimento, temp.exec_seq AS exec_seq, mp.provider_description,
                             mp.provider_link, mfc.log_info
    FROM (
      SELECT v.*, tr.TRACE_ID, tr.TRACE_DES , tr.trace_date, tr.fk_trace_level, e.ERROR_ID, e.ERROR_CODE, NVL(e.ERROR_DESC, er.ERROR_DESC) AS ERROR_DESC, e.error_date, e.error_level,
      MIN(e.error_id) OVER (PARTITION BY e.fk_exec_seq) eid,
      MAX(tr.trace_id) OVER (PARTITION BY tr.fk_exec_seq) tid
      FROM (
        SELECT fc.*, MAX(exec_seq) OVER (PARTITION BY flow_id, flow_frequency, n_run, date_id) exsq
        FROM mkt_flow_conf_view fc
        WHERE TRUNC(end_time) >= :1
          AND TRUNC(end_time) <= :2
      ) v, MKT_ERROR er, MKT_FLOW_ERROR e, MKT_FLOW_TRC tr
      WHERE v.exec_seq        = v.exsq
        AND e.fk_exec_seq (+) = v.exec_seq
        AND tr.fk_exec_seq (+) = v.exec_seq
        AND er.error_id (+) = e.error_code
    ) temp
    INNER JOIN MKT_FLOW
    ON MKT_FLOW.flow_id = temp.flow_id AND MKT_FLOW.n_run = temp.n_run AND MKT_FLOW.flow_frequency = temp.flow_frequency
    INNER JOIN MKT_FLOW_GROUP ON MKT_FLOW_GROUP.flow_id = MKT_FLOW.flow_id
    LEFT OUTER JOIN
                             (SELECT DISTINCT flow_id, log_info
                                         FROM mkt_flow_conf) mfc
                             ON mkt_flow.flow_id = mfc.flow_id
                             , mkt_provider mp
    WHERE NVL(error_id, -1) = NVL(eid, -1)
      AND NVL(trace_id, -1) = NVL(tid, -1)
      AND MKT_FLOW_GROUP.group_id=:3
      AND NVL (mkt_flow.fk_provider_id, '' '') =
                                                         NVL (mp.provider_id, '' '') )
      WHERE ROWNUM <= :4
      MINUS
      (SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
            stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
            exec_seq, provider_description, log_info FROM
      (SELECT
    temp.flow_id AS idFlusso,
    MKT_FLOW.flow_id || '' - '' || MKT_FLOW.flow_description || ''('' || temp.exec_seq || '')'' AS descrizioneFlusso,
    TO_DATE(temp.date_id,''yyyymmddhh24miss'') AS dataRiferimento,
    TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''dd/mm/yyyy'')||'' h. ''||TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''hh24:mi'') AS strDataRiferimento,
    temp.status AS stato, temp.end_time AS dataElaborazione, DECODE(temp.status,3, ERROR_DESC, 1, TRACE_DES) AS ultimoMessaggio,
    DECODE(temp.status,3, error_level, 1, fk_trace_level) AS livello,
    Get_Group_Description(MKT_FLOW.flow_id) AS utentiRiferimento, temp.exec_seq AS exec_seq, mp.provider_description,
                             mp.provider_link, mfc.log_info
    FROM (
      SELECT v.*, tr.TRACE_ID, tr.TRACE_DES , tr.trace_date, tr.fk_trace_level, e.ERROR_ID, e.ERROR_CODE, NVL(e.ERROR_DESC, er.ERROR_DESC) AS ERROR_DESC, e.error_date, e.error_level,
      MIN(e.error_id) OVER (PARTITION BY e.fk_exec_seq) eid,
      MAX(tr.trace_id) OVER (PARTITION BY tr.fk_exec_seq) tid
      FROM (
        SELECT fc.*, MAX(exec_seq) OVER (PARTITION BY flow_id, flow_frequency, n_run, date_id) exsq
        FROM mkt_flow_conf_view fc
        WHERE TRUNC(end_time) >= :5
          AND TRUNC(end_time) <= :6
      ) v, MKT_ERROR er, MKT_FLOW_ERROR e, MKT_FLOW_TRC tr
      WHERE v.exec_seq        = v.exsq
        AND e.fk_exec_seq (+) = v.exec_seq
        AND tr.fk_exec_seq (+) = v.exec_seq
        AND er.error_id (+) = e.error_code
    ) temp
    INNER JOIN MKT_FLOW
    ON MKT_FLOW.flow_id = temp.flow_id AND MKT_FLOW.n_run = temp.n_run AND MKT_FLOW.flow_frequency = temp.flow_frequency
    INNER JOIN MKT_FLOW_GROUP ON MKT_FLOW_GROUP.flow_id = MKT_FLOW.flow_id
    LEFT OUTER JOIN
                             (SELECT DISTINCT flow_id, log_info
                                         FROM mkt_flow_conf) mfc
                             ON mkt_flow.flow_id = mfc.flow_id
                             , mkt_provider mp
    WHERE NVL(error_id, -1) = NVL(eid, -1)
      AND NVL(trace_id, -1) = NVL(tid, -1)
      AND MKT_FLOW_GROUP.group_id=:7
      AND NVL (mkt_flow.fk_provider_id, '' '') =
                                                         NVL (mp.provider_id, '' '') )
      WHERE ROWNUM <= :8
      )  ) ORDER BY :9 ' ;
    dbms_output.enable(30000);
    dbms_output.put_line(sql_stm);
    OPEN recordsetCursor FOR sql_stm USING dataInizio, dataFine, idGruppo, endRow, dataInizio, dataFine, idGruppo, startRow, order_clause;
       SELECT COUNT(*) INTO countRow FROM
      (SELECT
    temp.flow_id AS idFlusso,
    MKT_FLOW.flow_id || ' - ' || MKT_FLOW.flow_description || '(' || temp.exec_seq || ')' AS descrizioneFlusso,
    TO_DATE(temp.date_id,'yyyymmddhh24miss') AS dataRiferimento,
    TO_CHAR(TO_DATE(temp.date_id,'yyyymmddhh24miss'),'dd/mm/yyyy')||' h. '||TO_CHAR(TO_DATE(temp.date_id,'yyyymmddhh24miss'),'hh24:mi') AS strDataRiferimento,
    temp.status AS stato, temp.end_time AS dataElaborazione, DECODE(temp.status,3, ERROR_DESC, 1, TRACE_DES) AS ultimoMessaggio,
    DECODE(temp.status,3, error_level, 1, fk_trace_level) AS livello,
    Get_Group_Description(MKT_FLOW.flow_id) AS utentiRiferimento, temp.exec_seq AS exec_seq, mp.provider_description,
                             mp.provider_link, mfc.log_info
    FROM (
      SELECT v.*, tr.TRACE_ID, tr.TRACE_DES , tr.trace_date, tr.fk_trace_level, e.ERROR_ID, e.ERROR_CODE, NVL(e.ERROR_DESC, er.ERROR_DESC) AS ERROR_DESC, e.error_date, e.error_level,
      MIN(e.error_id) OVER (PARTITION BY e.fk_exec_seq) eid,
      MAX(tr.trace_id) OVER (PARTITION BY tr.fk_exec_seq) tid
      FROM (
        SELECT fc.*, MAX(exec_seq) OVER (PARTITION BY flow_id, flow_frequency, n_run, date_id) exsq
        FROM mkt_flow_conf_view fc
        WHERE TRUNC(end_time) >= dataInizio
          AND TRUNC(end_time) <= dataFine
      ) v, MKT_ERROR er, MKT_FLOW_ERROR e, MKT_FLOW_TRC tr
      WHERE v.exec_seq        = v.exsq
        AND e.fk_exec_seq (+) = v.exec_seq
        AND tr.fk_exec_seq (+) = v.exec_seq
        AND er.error_id (+) = e.error_code
    ) temp
    INNER JOIN MKT_FLOW
    ON MKT_FLOW.flow_id = temp.flow_id AND MKT_FLOW.n_run = temp.n_run AND MKT_FLOW.flow_frequency = temp.flow_frequency
    INNER JOIN MKT_FLOW_GROUP ON MKT_FLOW_GROUP.flow_id = MKT_FLOW.flow_id
    LEFT OUTER JOIN
                             (SELECT DISTINCT flow_id, log_info
                                         FROM mkt_flow_conf) mfc
                             ON mkt_flow.flow_id = mfc.flow_id
                             , mkt_provider mp
    WHERE NVL(error_id, -1) = NVL(eid, -1)
      AND NVL(trace_id, -1) = NVL(tid, -1)
      AND MKT_FLOW_GROUP.group_id=idGruppo
      AND NVL (mkt_flow.fk_provider_id, ' ') =
                                                         NVL (mp.provider_id, ' '));
    END Mkt_Flussi_Giornalieri2;
    /When I call the procedure, from java, I receive this error:
    >
    Caused by: java.sql.SQLException: invalid column index
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
         at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:385)
         at it.edison.markettracker.dao.spring.VistaFlussiGiornalieriDaoImpl.mapRow(VistaFlussiGiornalieriDaoImpl.java:155)
         at it.edison.markettracker.dao.spring.VistaFlussiGiornalieriDaoImpl.mapRow(VistaFlussiGiornalieriDaoImpl.java:1)
         at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:92)
         at org.springframework.jdbc.core.JdbcTemplate.processResultSet(JdbcTemplate.java:1124)
         at org.springframework.jdbc.core.JdbcTemplate.extractOutputParameters(JdbcTemplate.java:1085)
         at org.springframework.jdbc.core.JdbcTemplate$5.doInCallableStatement(JdbcTemplate.java:997)
         at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:936)
         ... 26 more
    When I call the procedure from toad in this way:
    SET serveroutput ON
    DECLARE
    TROVATI SYS_REFCURSOR;
    NUMERO_TROVATI NUMBER;
    BEGIN
          DBMS_OUTPUT.ENABLE(30000);
          dbms_output.put_line('INIZIO');
          Mkt_Flussi_Giornalieri2(1, trunc(sysdate), trunc(sysdate), 100, 50, null, TROVATI, NUMERO_TROVATI);
          dbms_output.put_line('RECORD TROVATI:'||NUMERO_TROVATI);
    END; I don't receive any error messages but I don't see any message.
    Why this behaviour? I work on this procedure from the last monday. Please help me. I need to call the procedure from java.
    Thanks, bye bye.
    Edited by: Abdujaparov on Mar 5, 2009 3:44 PM

    Hi,
    I have solved the problem, I forgot a parameter in the select, so java tells the an error. But now I have another problem. The procedure doesn't execute the order by. I pass the couple column_name order_type in a string as ("provider_description desc") dinamically but the procedure doesn't execute the ordering. Why?
    The problem is in the dynamic query, I think:
    sql_stm:='
         SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
            stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
            exec_seq, provider_description, provider_link, log_info FROM
      (SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
            stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
            exec_seq, provider_description, provider_link, log_info FROM
      (SELECT
    temp.flow_id AS idFlusso,
    MKT_FLOW.flow_id || '' - '' || MKT_FLOW.flow_description || ''('' || temp.exec_seq || '')'' AS descrizioneFlusso,
    TO_DATE(temp.date_id,''yyyymmddhh24miss'') AS dataRiferimento,
    TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''dd/mm/yyyy'')||'' h. ''||TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''hh24:mi'') AS strDataRiferimento,
    temp.status AS stato, temp.end_time AS dataElaborazione, DECODE(temp.status,3, ERROR_DESC, 1, TRACE_DES) AS ultimoMessaggio,
    DECODE(temp.status,3, error_level, 1, fk_trace_level) AS livello,
    Get_Group_Description(MKT_FLOW.flow_id) AS utentiRiferimento, temp.exec_seq AS exec_seq, mp.provider_description,
                             mp.provider_link, mfc.log_info
    FROM (
      SELECT v.*, tr.TRACE_ID, tr.TRACE_DES , tr.trace_date, tr.fk_trace_level, e.ERROR_ID, e.ERROR_CODE, NVL(e.ERROR_DESC, er.ERROR_DESC) AS ERROR_DESC, e.error_date, e.error_level,
      MIN(e.error_id) OVER (PARTITION BY e.fk_exec_seq) eid,
      MAX(tr.trace_id) OVER (PARTITION BY tr.fk_exec_seq) tid
      FROM (
        SELECT fc.*, MAX(exec_seq) OVER (PARTITION BY flow_id, flow_frequency, n_run, date_id) exsq
        FROM mkt_flow_conf_view fc
        WHERE TRUNC(end_time) >= :1
          AND TRUNC(end_time) <= :2
      ) v, MKT_ERROR er, MKT_FLOW_ERROR e, MKT_FLOW_TRC tr
      WHERE v.exec_seq        = v.exsq
        AND e.fk_exec_seq (+) = v.exec_seq
        AND tr.fk_exec_seq (+) = v.exec_seq
        AND er.error_id (+) = e.error_code
    ) temp
    INNER JOIN MKT_FLOW
    ON MKT_FLOW.flow_id = temp.flow_id AND MKT_FLOW.n_run = temp.n_run AND MKT_FLOW.flow_frequency = temp.flow_frequency
    INNER JOIN MKT_FLOW_GROUP ON MKT_FLOW_GROUP.flow_id = MKT_FLOW.flow_id
    LEFT OUTER JOIN
                             (SELECT DISTINCT flow_id, log_info
                                         FROM mkt_flow_conf) mfc
                             ON mkt_flow.flow_id = mfc.flow_id
                             , mkt_provider mp
    WHERE NVL(error_id, -1) = NVL(eid, -1)
      AND NVL(trace_id, -1) = NVL(tid, -1)
      AND MKT_FLOW_GROUP.group_id=:3
      AND NVL (mkt_flow.fk_provider_id, '' '') =
                                                         NVL (mp.provider_id, '' '') )
      WHERE ROWNUM <= :4
      MINUS
      (SELECT idflusso, descrizioneFlusso, dataRiferimento, strDataRiferimento,
            stato,  dataElaborazione, ultimoMessaggio, livello, utentiRiferimento,
            exec_seq, provider_description, provider_link, log_info FROM
      (SELECT
    temp.flow_id AS idFlusso,
    MKT_FLOW.flow_id || '' - '' || MKT_FLOW.flow_description || ''('' || temp.exec_seq || '')'' AS descrizioneFlusso,
    TO_DATE(temp.date_id,''yyyymmddhh24miss'') AS dataRiferimento,
    TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''dd/mm/yyyy'')||'' h. ''||TO_CHAR(TO_DATE(temp.date_id,''yyyymmddhh24miss''),''hh24:mi'') AS strDataRiferimento,
    temp.status AS stato, temp.end_time AS dataElaborazione, DECODE(temp.status,3, ERROR_DESC, 1, TRACE_DES) AS ultimoMessaggio,
    DECODE(temp.status,3, error_level, 1, fk_trace_level) AS livello,
    Get_Group_Description(MKT_FLOW.flow_id) AS utentiRiferimento, temp.exec_seq AS exec_seq, mp.provider_description,
                             mp.provider_link, mfc.log_info
    FROM (
      SELECT v.*, tr.TRACE_ID, tr.TRACE_DES , tr.trace_date, tr.fk_trace_level, e.ERROR_ID, e.ERROR_CODE, NVL(e.ERROR_DESC, er.ERROR_DESC) AS ERROR_DESC, e.error_date, e.error_level,
      MIN(e.error_id) OVER (PARTITION BY e.fk_exec_seq) eid,
      MAX(tr.trace_id) OVER (PARTITION BY tr.fk_exec_seq) tid
      FROM (
        SELECT fc.*, MAX(exec_seq) OVER (PARTITION BY flow_id, flow_frequency, n_run, date_id) exsq
        FROM mkt_flow_conf_view fc
        WHERE TRUNC(end_time) >= :5
          AND TRUNC(end_time) <= :6
      ) v, MKT_ERROR er, MKT_FLOW_ERROR e, MKT_FLOW_TRC tr
      WHERE v.exec_seq        = v.exsq
        AND e.fk_exec_seq (+) = v.exec_seq
        AND tr.fk_exec_seq (+) = v.exec_seq
        AND er.error_id (+) = e.error_code
    ) temp
    INNER JOIN MKT_FLOW
    ON MKT_FLOW.flow_id = temp.flow_id AND MKT_FLOW.n_run = temp.n_run AND MKT_FLOW.flow_frequency = temp.flow_frequency
    INNER JOIN MKT_FLOW_GROUP ON MKT_FLOW_GROUP.flow_id = MKT_FLOW.flow_id
    LEFT OUTER JOIN
                             (SELECT DISTINCT flow_id, log_info
                                         FROM mkt_flow_conf) mfc
                             ON mkt_flow.flow_id = mfc.flow_id
                             , mkt_provider mp
    WHERE NVL(error_id, -1) = NVL(eid, -1)
      AND NVL(trace_id, -1) = NVL(tid, -1)
      AND MKT_FLOW_GROUP.group_id=:7
      AND NVL (mkt_flow.fk_provider_id, '' '') =
                                                         NVL (mp.provider_id, '' '') )
      WHERE ROWNUM <= :8
      )  ) ORDER BY :9' ;
    OPEN recordsetCursor FOR sql_stm USING dataInizio, dataFine, idGruppo, endRow, dataInizio, dataFine, idGruppo, startRow, order_clause;Where order_clause is defined so:
    IF column_order IS NOT NULL
    THEN
    order_clause := column_order;
    ELSE
    order_clause := ' stato DESC ';
    END IF;If I insert manually a name of a column and a type of ordering (asc or desc) the ordering is executed correctly. How can I solve this issue?
    Thanks, bye bye.

  • Values dinamically with custom components

    Hi everyone, i have a problem with flex, i developed a main aplication in witch i have added a container (sesionGroup), also i did a custom component witch contains one button and one label. the main application creates several components dinamically using the custom component with values assigned dinamically by an external xml file, this is the code of the main application:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/halo"
    minWidth="1024" minHeight="768"
    creationComplete="init()">
    <fx:Declarations>
    <s:HTTPService id="sesionService" url="PHPClases/sesiones.php"
    resultFormat="object"  result="sesionService_resultHandler(event)"/>
    </fx:Declarations>
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.rpc.events.ResultEvent;
    import spark.components.VGroup;
    public var grupoSesion:sesion;
    public var cont:int=0;
    [Bindable]
    public var sesionDatos:ArrayCollection;
    public function init():void
    sesionService.send();
    protected function sesionService_resultHandler(event:ResultEvent):voi   d
    sesionDatos=event.result.sesiones.sesion;
    var i:int=event.result.sesiones.sesion.getItemAt(0).fi  las;
    while(cont<i)
    grupoSesion=new sesion();
    grupoSesion.nombreSesion=event.result.sesiones.ses   ion.getItemAt(cont).nombre;
    grupoSesion.indexSesion=cont.toString();
    grupoSesion.name=cont.toString();
    grupoSesion.addEventListener(MouseEvent.CLICK,most  rarEventos);
    sesionGroup.addElementAt(grupoSesion,cont);
    cont++;
    public function mostrarEventos(event:MouseEvent):void
    Alert.show();
    ]]>
    </fx:Script>
    <s:VGroup id="sesionGroup" x="270" y="150">
    <s:Label id="prueba"/>
    </s:VGroup>
    </s:Application>
    And this is the code of the custom component
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/halo" width="400"  height="20">
    <fx:Script>
    <![CDATA[
    [Bindable]
    public var nombreSesion:String;
    [Bindable]
    public var indexSesion:String;
    ]]>
    </fx:Script>
    <s:Button id="sesionButton"
    label="{nombreSesion}"/>
    <s:Label text="{indexSesion}"/>
    </s:Group>
    Like you can see i have added for each component one event clic, and i want that when a user clic one component the red alert of the main aplication shows him the value of the selected component, for example, if a user clic the first component it must show 0 (or 1), if the user clic the second component it must show 1 (or 2), etc. I have found other ways like getChilindex and others but those give me the same result for all the components, the value of the first or the last component.
    If you can help me i thank you much, and thanks for your attention.

    I've gotten to where it will display the model values but each tag's components are displaying the value of the first item in the data model.
    It looks like there is only one instance of my custom component being constructed. Why would this be happening? I would think that for each row in the datatable, there would be one instance of my custom component. Here's the relevant fragment from the jsp.
    <h:panelGrid id="anotherGrid" columns="1">
         <h:dataTable id ="TwoStringList" value="#{TwoStringList.model}" var="twoStringBean">
         <h:column>
              <myTags:twoString value="#{twoStringBean}"/>
         </h:column>
         <h:column>
              <h:commandButton value="#{twoStringBean.simpleResponse}"/>
         </h:column>
         </h:dataTable>
    </h:panelGrid>
    There is only one 'twoString' component created. The text for the command button is correctly displaying the simpleResponse field for the underlying model row to which it is bound. My component binds to the bean itself, not one of its fields. It does the work of setting the contained standard values.

Maybe you are looking for

  • Time Capsule Flashing Amber - Macbook Doesn't Scan It

    here's the situation: i just moved. at my old place i used the time capsule exclusively as an external hard drive and not a wireless router. i had it connected to my router wirelessly though. in my new place i want to make the time capsule the router

  • My I iphone 4 isn't being recognized by any computer.

    i have checked mulitple cables and computer and the iPhone doesn't shoe under my computer althou it does charge when i plug it to the computers usb

  • Iphone 3gs not being recognised by itunes

    When i connect my iphone to my computer it is recognised as a removable disk but not recognised by itunes. I registered my iphone on a friends PC. is this maybe the reason? i got her applications but none of her music etc. is there a simple soloution

  • Logical Database PCH

    Hi experts. I need to use the logical database PCH because is necessary to report on Personnel Planning data, my business requirement is get all the employees that participated in all  training course types. My development by a selection screen to pr

  • Help! Problem when running CF under a non-default service account

    I am running ColdFusion 9 with IIS 7 on Windows Server 2008. The CF application service is running under a domain application account rather than the default local. The problem is when doing so failed templates keep an active request open indefinatel