How to filter data in cursors within the procedure

Hello

Yesterday, I tried all night, but couldn't do it.

I know that is incomplete, I just want to know how to filter the data based on the setting in

Basically, here I want to get only the records that match the id_fichier


create or replace PROCEDURE clearing_details (p_file_id in varchar2)
IS
strStatusCode VARCHAR2 (6);
CURSOR PD1 IS
SELECT COUNTRY_CODE, EOD_MARK OF LINK_STATUS WHERE FILE_ID is p_file_id


Can someone help me on this please:


Thanks for reading.

Does do the same if you run the query itself in SQL * Plus with the same value you pass as a parameter?

Without seeing your data and which parameter you're passing, we will fight help more as the concept itself works great as you have been demonstrated.

Tags: Database

Similar Questions

  • How to insert as an entry within the formula variable, the total time on the scope window?

    How to insert, as an entry within the formula variable, the window of total time on the scope (i.e. of 20ms/div x 10 div = 200ms)?

    HERE'S A SAMPLE QUESTION:

    FORMULA FOR INTEGRAL ACTION:

    STATISTICS:

    Input variable: DPO4034 (CH1);

    Box: number of samples.

    FORMULA

    Input variable 0: DPO4034 (CH1); alias: x 0

    Input variable 1: 'time window Total out of scope?. " alias: x 1

    Input variable 2: number of samples (CH1); alias: x 2

    Under the operation Configuration: formula

    Y = (x 0 ^ 2) *(x1/x2)

    Output: Data 1 (CH1)

    THEN, WITH THE HELP OF STATISTICS:

    Input signal: data processing 1 (CH1)

    Checkbox: SUM

    Output: CH1 integral Action [has ^ 2s].


  • HOW TO FILTER DATA IN MICROSOFT ACCESS

    HOW TO FILTER DATA IN MICROSOFT ACCESS BASED ON THE DATE AND TIME AND GIVE THE RESULT IN A TABLE?

    I need a few examples of files, can someone help me please?

    Fix your keyboard. If it has not been broken, be a little more polite and stop screaming.

    Research, are thousands of examples on the web related to the jet and sql database. This is a very basic select statement. Access to a query wizard that can then show the sql code. If you don't know how to design a query in access, you need a Basic for this tutorial. No question of LabVIEW here.

  • How to pass the value of the cursor in the procedure to use as dblink

    Hello

    I have a cursor in the procedure. I am inserting some values into the destination table by querying the source table using dblink. And I'm collecting this db link in the cursor. So, my question is how I will pass on the value of dblink values read from the cursor in each iteration? This is my procedure.

    CREATE OR REPLACE
        PROCEDURE desktop_proc
        AS
          v_name VARCHAR2(10);
          v_dblink  VARCHAR2(10);
          CURSOR db_cur
          IS
            SELECT PNAME,OLTP_DBLINK
            FROM PDATA
            WHERE pname in ('RMA','RNA')
            ORDER BY PNAME;
        BEGIN
          OPEN db_cur;
          LOOP
            FETCH db_cur INTO v_name,v_dblink;
            EXIT WHEN db_cur%NOTFOUND;
            INSERT INTO desktop_lite
              (
                Datestamp,
                pname,
                Db_name,
                Company_name
              )
            SELECT Date_Range,
              v_name,   -- local variable
              dbname,
              Company_name
              FROM
              (SELECT bu.datestamp Date_Range,
                      (SELECT name FROM v$database@v_dblink) dbname,
                      bu.name Company_name
               FROM dboltp.s_org_ext@v_dblink bu
               INNER JOIN com_unique uusers ON (uusers.bu_id = bu.row_id)
              );
          END LOOP;
          CLOSE db_cur;
        END desktop_proc;
    

    Thank you

    Maybe this can work for you:

    CREATE OR REPLACE
        PROCEDURE desktop_proc
        AS
          v_name    VARCHAR2(10);
          v_dblink  VARCHAR2(10);
          v_statement varchar2(2000);
          CURSOR db_cur
          IS
            SELECT 'test_name' dual_name, 'test_dbl' dual_link
            FROM dual;
        BEGIN
          OPEN db_cur;
          LOOP
            FETCH db_cur INTO v_name,v_dblink;
            EXIT WHEN db_cur%NOTFOUND;
            v_statement := '
            INSERT INTO desktop_lite
              (
                Datestamp,
                pname,
                Db_name,
                Company_name
              )
            SELECT Date_Range,
              '''|| v_name || ''',
              dbname,
              Company_name
              FROM
              (SELECT bu.datestamp Date_Range,
                      (SELECT name FROM v$database@' || v_dblink || ') dbname,
                      bu.name Company_name
               FROM dboltp.s_org_ext@' || v_dblink || ' bu
               INNER JOIN com_unique uusers ON (uusers.bu_id = bu.row_id)
              )';
            dbms_output.put_line (v_statement);
    --            execute immediate v_statement;    -- first look at the statments you produce, then uncomment and test it
           END LOOP;
           CLOSE db_cur;
    END desktop_proc;
    /
    show err
    
    exec desktop_proc
    

    This is my result, it seems that this can work:

    INSERT INTO desktop_lite

    (

    Timestamp,

    PName,

    Db_name,

    Company_name

    )

    SELECT Date_Range,

    "test_name."

    dbname,

    Company_name

    Of

    (SELECT bu.datestamp Date_Range,

    Dbname (SELECT name FROM v$database@test_dbl).

    Bu.Name Company_name

    Dboltp.s_org_ext@test_dbl drunk

    INNER JOIN com_unique uusers ON (uusers.bu_id = bu.row_id)

    )

  • How do I date stamp photo with the date that it was created?

    How do I date stamp photo with the date that it was created?

    donaldm80418165 wrote:

    How do I date stamp photo with the date that it was created?

    Use the text tool.

    Note that you can select the font, color, size of the pt.

  • How to transfer data from oracle to the web service using ODI with axis2 tech

    Hi all

    Can someone cause a document or markets about 'How to transfer data from oracle to the web service with the help of ODI with AXIS2 technology'
    If any person with a document or markets, please share it with me

    Thank you
    Phani

    I can give you a few examples of web services in ODI, perhaps that you find them useful?
    Try: -.
    http://John-Goodwin.blogspot.com/2009/04/ODI-series-Web-services.html
    http://John-Goodwin.blogspot.com/2009/05/ODI-series-Web-services-part-3.html
    http://John-Goodwin.blogspot.com/2009/05/ODI-series-Web-services-part-4.html

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • HOW to: Filter data in an html CFGRID with the defined query attribute tag

    Does anyone know how can I filter data in an html cfgrid, not through a link from AJAX, but perhaps by exposing some of the features of the code behind the controls cfgrid EXT?

    Any help would be greatly appreciated.

    --
    Jorge loyo

    I have it!

    MY ENTRY:

    <>
    ID = "searchString".
    name = "searchString".
    Type = "text".
    OnKeyUp is "ColdFusion.Grid.getGridObject('dg'). GetDataSource () .filterBy (myfilterfunc)"/ >

    MY FUNCTION

    MY GRID:

    <>
    name = "dg".
    Query = "employees".
    format = "html" >



  • How the index data are managed within the cluster?

    Hello

    We are evaluating the consistency.

    Regarding indexes, am I right in thinking that the data in the index are stored in a (managed internally) cache on the same node that the attendant at the following indexed values? I'm not interested in getting the data in the index, but rather just to understand how the data in the index itself are stored or processed within the cluster.

    So in a 2 cluster node where an index is applied to a distributed cache that has only 2 entries, will there be a key cache on each node 1 {binary,} to enter key where the key points to the value that is stored on this same node? In other words, I'm sure that the index data to be spread out in the cluster in the case of a partitioned topology?

    Concerning
    Peter

    user11279467 wrote:
    Hello

    We are evaluating the consistency.

    Regarding indexes, am I right in thinking that the data in the index are stored in a (managed internally) cache on the same node that the attendant at the following indexed values? I'm not interested in getting the data in the index, but rather just to understand how the data in the index itself are stored or processed within the cluster.

    So in a 2 cluster node where an index is applied to a distributed cache that has only 2 entries, will there be a key cache on each node 1 {binary,} to enter key where the key points to the value that is stored on this same node? In other words, I'm sure that the index data to be spread out in the cluster in the case of a partitioned topology?

    Concerning
    Peter

    Hi Peter,.

    up to 3.4.x index have been supported only on partitioned topology, and Yes, the index on each node contain only the data corresponding to the entries that have their main copy on this node (referred to as entered local subsequently).

    The indexes are not stored in a cache, but they are managed under the information that maintains consistency in terms of backup (the map that contains local entries).

    The indexes are in 2 parts:

    -index to the front: this is a mapping of the cache key in an internal representation (Playback key card in the future) the value extracted with the extractor used to create the index of the entry to membership of the cache key (value extracted later)

    -reverse index (aka. reversed card): this is a map of the value extracted from a backup set of the keys of the map of entries which we extract the index key reversed with the extractor used to create the index

    The index can be sorted, which means that the index reversed a SortedMap (sort order is the order of the extracted values)

    Let's see an example. Assuming you have the contents of the following cache within a particular extension storage node:

    A--> Object (PositionX = 5,...)
    B--> object (getA = 3,...)
    C--> object (getA = 3,...)
    D--> object (getA = 4,...)

    The index forward in this node will contain:

    Binary (A)--> 5
    Binary (B)--> 3
    Binary (C)--> 3
    Binary (D)--> 4

    The reverse index will contain:

    3--> {Binary (B), Binary (C)}
    4--> {Binary (D)}
    5--> {Binary (A)}

    Where Binary (...) designates the internal representation (binary) of the... object.

    If the index is not ordered, then the order of iteration over the entries in the index reversed are not deterministic.

    If the index is ordered, the iteration of the entries into the inverted index will be as stated above. Also, you can convert the SortedMap inverted index in order to have the very useful headMap and tailMap and firstKey and lastKey methods.

    I hope this helps.

    Best regards

    Robert

  • How to filter dates between the current date and the number of dates past

    Hello

    On the answers, how can I do to return a report that contains data between the current dates and 31 days in the past?

    Users want to connect display the report and the report should show only data 31 days to the date of the day... How would I be able to set it up on the answers that since I have not access to RPD?

    Please let me know

    Thank you

    use the date filter between current_date and timestampadd (sql_tsi_day, -31, current_date)

    fixed

  • How to get data hardbounce retrospective of the most recent date?

    I want out of backdata Hard bounce by last date using the API.

    Can someone help me?

    Any suggestion is appreciated.

    Kind regards

    Shashi Kant

    BLOCK has an API "/ activities" endpoint, you can use to define an excerpt. You can programmatically add a filter him every time you kick off your snippet (something like ActivityDate > = and set the current date as the side right of the > = parameter). You can then use the ' /extracts/data "endpoint to extract the data returned by eloqua sync. See the documentation for the API BLOCK to get an idea of a typical eloqua extraction process.

  • SQL query: I want to know how to filter data...

    I want to filter these data

    yearDATA_TYPEproduct_nameamount
    20131Apple100
    20131Mango200
    20141Apple300
    20141Mango150
    20141banana250
    20151Apple350
    20152Apple300
    20153Apple320
    20152Mango400
    20153Mango400
    20153banana500

    In each year and each product, I want to filter the data that has no data in data type 1

    When he has not given in data of type 1, using data in data type 2.

    and if he has not given data type 2, use the data in data of type 3.

    This is the result I was expecting

    yearDATA_TYPEproduct_nameamount
    20152Mango400
    20153banana500

    Thanks for your help.

    Or more simply...

    SQL > ed
    A written file afiedt.buf

    1 with t (year, data_type, product_name, amount) as)
    2 Select 2013, 1, 'apple', 100 double Union all
    3 select 2013, 1, "mango", 200 double Union all


    4 Select 2014, 1, 'apple', 300 double Union all
    5 Select 2014, 1, "mango", 150 double Union all
    6 select 2014, 1, 'banana', 250 double Union all
    7 if he would choose 2015, 1, 'apple', 350 dual Union all
    8 select 2015, 2, 'apple', 300 double Union all
    9 select 2015, 3, 'apple', 320 double Union all
    10. Select 2015, 2, "mango", 400 double Union all
    11. Select 2015, 3, "mango", 400 double Union all
    12. Select 2015, 3, 'banana', 500 double
    13        )
    14-
    15 end of test data
    16-
    17 select year
    18, max (data_type) keep (first order by data_type dense_rank) as data_type
    19, product_name
    20, max (amount) to keep (first order by data_type dense_rank) as the amount
    21 t
    Group 22 by product_name, year
    23 * have max (data_type) Dungeon (first order by data_type dense_rank)! = 1
    SQL > /.

    YEAR AMOUNT DATA_TYPE PRODUCTION
    ---------- ---------- ------ ----------
    2015 mango 2 400
    2015 banana 3 500

    2 selected lines.

  • Invalid cursor within the service in pipeline

    The simple example following illustrates a mistake that I am experiencing with development code more complex.

    I try to reuse a complex procedure that I do not have duplication of code and business logic.

    It runs correctly.

    exec PKG_TEST.complex_proc(:p_cursor);

    This property returns an error:

    exec PKG_TEST.select_rows(:p_cursor);

    The error is ORA-01001: Invalid cursor.

    I checked and the cursor is opened and % notfound is false.

    Any ideas?

    Thank you in advance for your help!

    create the table employees

    (

    primary key ID number,

    name varchar2 (100)

    );

    insert into employee values (1, 'Joe');

    insert into employee values (2, 'Bob');

    insert into employee values (3, 'Peter');

    create table contractor

    (

    primary key ID number,

    name varchar2 (100)

    );

    insert into a values (4, 'Henry') contractor;

    insert into contractor values (5, 'William');

    create or replace package PKG_TEST

    is

    type t_rec is rendered

    (

    Identification number,

    name varchar (100)

    );

    type t_tab is table of the t_rec;

    procedure complex_proc (p_cursor to sys_refcursor);

    function select_fn (p_cursor sys_refcursor)

    return PKG_TEST.t_tab in pipeline;

    select_rows (p_cursor to sys_refcursor) procedure;

    end pkg_test;

    create or replace package PKG_TEST body

    is

    procedure complex_proc (out p_cursor sys_refcursor)

    is

    Start

    Open the p_cursor for

    Select *.

    the employee;

    end complex_proc;

    function select_fn (p_cursor sys_refcursor)

    return PKG_TEST.t_tab pipeline

    is

    v_tab PKG_TEST.t_tab;

    v_rec PKG_TEST.t_rec;

    Start

    loop

    collect the fetch p_cursor in bulk in the v_tab limit 100;

    because me in 1... v_tab. Count

    loop

    v_rec: = v_tab (i);

    pipe row (v_rec);

    end loop;

    When the output p_cursor % NOTFOUND;

    end loop;

    return;

    end select_fn;

    select_rows (exit p_cursor sys_refcursor) procedure

    is

    v_cursor sys_refcursor;

    Start

    PKG_TEST.complex_proc (v_cursor);

    Open the p_cursor for

    Select *.

    table (PKG_TEST.select_fn (v_cursor))

    Union of all the

    Select *.

    contractor;

    select_rows end;

    end pkg_test;

    Problem is that your variable v_cursor in SELECT_ROWS is out of scope when the procedure ends.

    So the ref cursor returned by this method cannot be referenced it more.

    If you are on 11g and beyond, a workaround is to declare v_cursor DBMS_SQL cursor (for example an INTEGER data type) and use DBMS_SQL.to_cursor_number / DBMS_SQL.to_refcursor to convert between the two.

    In this way, the query pointed to by the final Ref cursor will always have a valid binding variable when the procedure ends.

    function select_fn( p_cursor in integer )
    return PKG_TEST.t_tab pipelined
    is
    
      v_tab         PKG_TEST.t_tab;
      v_rec         PKG_TEST.t_rec;
      v_cursor_num  integer := p_cursor;
      v_cursor      sys_refcursor := dbms_sql.to_refcursor(v_cursor_num);
    
    begin
    
      loop
    
        fetch v_cursor bulk collect into v_tab limit 100;
    
        --exit when p_cursor%NOTFOUND;
        exit when v_tab.count = 0;
    
         for i in 1 .. v_tab.count
         loop
            v_rec := v_tab(i);
            pipe row(v_rec);
         end loop;
    
      end loop;
    
      close v_cursor;
    
      return;
    
    end select_fn;
    
    procedure select_rows ( p_cursor out sys_refcursor )
    is
       v_cursor  sys_refcursor;
       v_cursor2 integer;
    begin
       PKG_TEST.complex_proc(v_cursor);
    
       v_cursor2 := dbms_sql.to_cursor_number(v_cursor);
    
       open p_cursor for
       select *
       from TABLE(PKG_TEST.select_fn(v_cursor2))
       union all
       select *
       from contractor;
    
    end select_rows;
    
  • How to get data that are created the or before the last Wednesday

    Hi, can someone please tell me how to write a query to retrieve the data that are created the or before last Wednesday.

    Thanks in advance...

    Hello

    Here's one way:

    WHERE created_date< next_day="" (="" trunc="" (sysdate="" )="" -="">

    , "THURSDAY".

    )

    "Before Thursday' means the same as 'the or before Wednesday '.

    This assumes that NLS_DATE_LANGUAGE is English.  If you are not sure what is NLS_DATE_LANGUAGE, you can do this:

    WHERE created_date< next_day="" (="" trunc="" (sysdate="" )="" -="">

    , TO_CHAR (DATE ' 2014-03-06' - or any Thursday)

    , 'DAY '.

    )

    )

    There is nothing magical about March 6, 2014; will do any Thursday.  To_char will return the translation of 'Thursday' in all that is the current NLS_DATE_LANGIUAGE, and NEXT_DAY can use this value.

  • How to change data objects and update the corresponding task and task forms?

    Hi all

    I modified this thread because I found that I had many questions to ask.

    1.
    I'm quite new to OBPM and would like to know how to change data - for clarity objects add a new attribute "Dependents of the Client" "Customer care" - and therefore update the task that uses the 'customer information' what makes via data binding - I get an error message here - or via the data about the data Task-The chosen tab it does not appear to be linked to my approach in some sort.

    2.
    Will be the task form that I generated earlier in < 1 > update automatically? Is it possible to update manually if the task has been clearly customized?

    3.
    What are the objects of project data? They do not store values in my process. They are for the arguments only - like reusable process?

    Thanks in advance,

    Kind regards

    Yanis

    Hi Yanius,

    (1) assume that you start from scratch. First, you declare your data object structure. To do this, you must go to the BPM project Naviagtor, right-click on 'Catalogue of trades' and create a new Module. Then you can right click on the module you created and select the new object of trade. Add all the attributes you need. It is the same to declare a class in Java. Second, you must declare a variable of the type process you have created: select the process, go to the Structure display (if you don't go and activate it in menu view Jdev-> Structure). Right click on the Process data object and create your variable. It's like setting a variable in Java. In short, answering your question, make the path opposite: find in your process of type "Customer Details", then go to your catalog Business, right click and change the definition to add what you need.

    (2) the human task will not update automatically (annoying). If you change the object itself, so you don't need to change your mappings because actually there the same object you are through the task as in / out argument. There are two things here: the human task and form associated with it (where probably change you the subject i.e. customer details). Go to the form (.jspx) - click on the tab links (by default, you are in the Design). In the links page, there is a link on top: "Page Définition File" (something like proj/pageDef/...xml). Open the XML file and go to the source. There you can add manually now all the attributes you need and that were not available before (i.e. dependent Client). It's a little complicated, but at least you don't have to recreate it. particularly useful if you have already implemented and subsequently form, you need to add more things (business is very good to say otherwise, "I would like to see something else in the form" ;)

    (3) project data objects are visible by all processes that you have in the project rather than the object of process data that are visible only to the method where you set the variable to. This means that you declare an object of data of the project once and then it will be available to all processes. Keep in mind that each process has a copy of it. In other words, it is not like a global variable that everyone sees. If edit you in a single process, other processes will not see the new value.

    I hope that I have answered your questions.
    See you soon,.
    Felipe

  • dynamic action... How to make date is always before the "to date".

    Hello

    using a form, I ask my users to provide the dates...

    can I know (step by step) how to set up a dynamic action so that if it dates back to article P20_FROM_DATE after P20_TO_DATE then an error message to be generated...

    Thanks in advance

    OK, let's start again. Delete your current setup you date pickers and try these.

    P22_FROM_DATE settings

    Display on focus
    View other months Yes

    Use the same settings for P22_TO_DATE.

    Create a dynamic Action called say, Compare the Dates

    Event Before the Page is sent
    Condition Expression of JavaScript
    Value $v(P22_TO_DATE')<>

    Real Actions
    Action Draw the attention of
    Fire when the result of the event is True
    Text The date cannot be less than this day.

    Another real Action
    Action Update fixed
    Fire on the loading of the Page Checked
    Assigned to elements Selection type Article (s) P22_TO_DATE

    Jeff

Maybe you are looking for