Use of source rule

CREATE TABLE SOURCE_RULE_DETAIL

(

SOURCE_TYPE VARCHAR2 (8) NOT NULL,

SOURCE_SEQ NUMBER OF NON-NULL,

NUMBER OF SR_INST

)

/

Insert into SOURCE_RULE_DETAIL

(SOURCE_TYPE, SOURCE_SEQ, SR_INST)

Values

('BILL', 1, 116);

Insert into SOURCE_RULE_DETAIL

(SOURCE_TYPE, SOURCE_SEQ, SR_INST)

Values

('BILL', 2, 21);

Insert into SOURCE_RULE_DETAIL

(SOURCE_TYPE, SOURCE_SEQ, SR_INST)

Values

('BILL', 3, 29);

Insert into SOURCE_RULE_DETAIL

(SOURCE_TYPE, SOURCE_SEQ, SR_INST)

Values

('BILL', 4, 57);

/

CREATE TABLE INVOICES

(

EFFECTIVE_DATE DATE NOT NULL,

VARCHAR2 (8) ACCOUNT_ID NOT NULL,.

BILL_ID NUMBER NOT NULL,

SR_INST NUMBER NOT NULL

)

/

Insert in BILLS

(EFFECTIVE_DATE, ACCOUNT_ID, BILL_ID, SR_INST)

Values

(TO_DATE (JULY 31, 2013 00:00:00 "," MM/DD/YYYY HH24:MI:SS'), 'EQ', 633692, 21);

Insert in BILLS

(EFFECTIVE_DATE, ACCOUNT_ID, BILL_ID, SR_INST)

Values

(TO_DATE (JULY 31, 2013 00:00:00 "," MM/DD/YYYY HH24:MI:SS'), 'EQ', 631622, 29);

Insert in BILLS

(EFFECTIVE_DATE, ACCOUNT_ID, BILL_ID, SR_INST)

Values

(TO_DATE (JULY 31, 2013 00:00:00 "," MM/DD/YYYY HH24:MI:SS'), 'EQ', 633753, 57);

/

Now, I want only the first record in the INVOICES table that has SOURCE_SEQ for the minimum value for the SOURCE_RULE_DETAIL table.

In this case I need registration of INVOICES with BILL_ID table as 633692 as the minimum SOURCE_SEQ of 2 and the data available for it in the table of INVOICES. If the data for SOURCE_SEQ-1(i.e.-116) would be available in the table of INVOICES, the recording would have been chosen.

Hello

This is called a Top - N query, because you want to N (N = 1 in this case) lines from the top of an ordered list.

Here's a way to do it:

WITH got_r_num AS

(

SELECT B.*

, EVALUATE () DURING (ORDER BY s.source_seq) AS r_num

BILL b

JOIN source_rule_detail s ON s.sr_inst = b.sr_inst

)

SELECT account_id, bill_id, effective_date, sr_inst

OF got_r_num

WHERE r_num = 1

;

Ouptut:

EFFECTIVE_D ACCOUNT_ BILL_ID SR_INST

----------- -------- -------- --------

July 31, 2013 EQ 633692 21

What results would you tie, where lines 2 or more have an equal claim that it is the 'top' 1?  For example, if you add this line in the sample data:

Insert in BILLS

(EFFECTIVE_DATE, ACCOUNT_ID, BILL_ID, SR_INST)

Values

(TO_DATE (29 MAY 2014 00:00:00 "," MM/DD/YYYY HH24:MI:SS'), 'EQ', 987654, 21);

The query above would show the two contenders.  If this isn't what you want, then you can add expressions of tiebreaker to the analytical ORDER BY clause, or use ROW_NUMBER instead of RANK.

Thanks for posting the CREATE TABLE and INSERT statements; It is very useful.

Tags: Database

Similar Questions

  • Hi, is there a way I can substitute for Sourcing rule.

    Hi, is there a way I can substitute sourcing rule. If on-site is not enough in rank 1 the sourcing rule planning should try and convince with grade 2 provider / organization.

    Best regards

    Sachin

    Hi Salah,

    You have no need to allow for this optimization.

    Please define the MSO profile: enable decision Yes rules... It will allow the decision rules tab in the plan options.

    You can use it together with constraint CAWC Plan.

    Hope that helps!

    Kind regards

    Mohan Balaji

  • Open interface for lists of approved suppliers and sourcing rules

    Hi all

    Is there an open interface or an API of accepted lists suppliers and sourcing rules.

    Thank you and best regards,

    MPH

    You can use the API, even if you do not use MFG.

    You must set up the sourcing
    You must enter the Organization of shipment if the SR gets other org inventory material. otherwise, you will need to enter the details of the seller.
    I think you can leave the receipt org id field.

    Hope this helps,
    Sandeep Gandhi

  • ASL and Sourceing rule

    Dear Experts

    Where is the link between the FSA and rule of Sourcing...
    ex in ASL (point x or xx goods) approved provider is "yy".
    Sourcing rule u just mensioned beg 'YY' we can dimension allocation % and grade... here there is no link with the point... .where is the link... which will be the important things you should know in ASL and Sourcing rule?

    To add to the answer of MS Dash,
    As a general rule,.
    Sourcing rules will tell you the supplier.
    FSA tells you the price and release method.

    You also asked about

    where is the link

    The link is in the mission screen Sourcing rule.
    Purchase > supply base > assign rules of sourcing.

    On this screen, you assign a sourcing rule to an element. This is how Oracle knows what supply section to use for a given element / org/item-org.

    Hope this helps
    Sandeep Gandhi
    Techno-Functional consultant

  • Sourcing rule works with min - max?

    Hello

    (1) Will Sourcing rule works with min - max planning? How?

    (2) and how you decide who use elements of planning elements u and wich Min - max, to the point of replenishment of development?

    Published by: 832641 on February 4, 2011 19:35

    (1) Yes, sourcing will work in the same way that it works with other sources such as kanban, etc. of the PSO. You must define the ASL for the rule point and sourcing with the corresponding transfer game.

    (2) according to my understanding logically point re - order is nothing but Min - Max, min, and max equal to Min value of the stock you want to maintain for the item

  • Can I connect a VGA cable simultaneously with a DVI cable to a monitor and use the source switch?

    I found a similar, but not exact question and I was wondering if I could use the VGA cable AND cable DVI simultaneously on a HP 2159 m monitor and switch back and forth from analog and digital using the source switch on the screen? I noticed that some casual games such as found at BigFish and other gaming sites works best on VGA on DVI but I like to watch movies and other DVI instead of VGA?

    I did two HP 2159 m monitor but it could in fact be wise space more convenient to just use the right now and switch from the analog to the digital format.

    Thanks for any response.

    Hello

    You will need to edit the video in the monitor source selection when you want to switch.  Don't put it on AUTO.

    For a test, connect two monitors and then configure your PC for two monitors. Then, remove the monitor as the secondary (VGA) and now connect the cable to the main monitor VGA port.  Now try the video source selection in the menu of the monitor.  I never tried it on my 2159 m but it can work.

    Some monitors do not react to two active flows.

  • Need to use the source code in VB6 for a Recordset multiple connection

    Hello
    I need different types of connection in a Recordset. How to use the source code in vb6. kindly help me.

    Thank you...

    Hi Alexander,.

    The question you have posted is better suited in the MSDN Forums. Please see the following link for more information.

    Category VB

  • Issue while loading data using the file Rules Essbase

    Hi all

    I am facing problem while loading data using the Rules file. In the rules file, I rejected several members in two areas (two dimensions). Now if I load the data using the rules file I'm getting errors for all members in the dataload.err file. If I reject mutiple members of a single field, the data load without settling errors in the dataload.err file.

    I want to know how rmany members of several fields of ejection for loading data using the file Rules Essbase? Is it possible?

    Okay, okay... I think that you must assign Global Select / reject Boolean in the parameters of loading data as 'Or':

  • How do we code using Concatfields/Connectfields rules in Documaker?

    Hello

    I knew that the concept of Concatfields/Connectfields these rules. I want to explore more on these rules. I still don't get how we code using these rules? Please help me to encode using this...

    I created a section with two fields named TEST1 and TEST2.
    Test1 - I used the rule MK_HARD and passing a value like "count:". "
    Test2 - I used the rule MK_HARD and passing a value like "December".


    In the level in accordance with article article section I select rule Concatfields and mentioned there as F = TEST1, R = TEST2;
    Now, I have added this section to the form and execution of the batch file, but I got the following error.

    DM10157: Error in < CONCATFIELDS >: < TEST2; > is an invalid field. Image: < TEST >. This rule does not work with the fields of type of barcode or multiline text fields.
    DM12086: Error in RPDoImageRules(): < CONCATFIELDS > (impossible).

    Means so I've coded it wrong. Please help me understand how the code using these rules?

    Note:
    (A) I'm using documaker 11.5.
    (B) I understood as the use of these rules, we can concatinating the fields.

    Thank you
    RAMAN C

    Hello Raman,

    CONCAT: This serves to concat two or more strings of text.
    For example: you have a HDR file and posted on 30 you have a text 'A', at position 40 you have a 'B' text and position 50 you have a text 'C '.
    In this case when you use CONCAT 1 fields, HDR 30,1,40,1,50,1 your output would be A B C

    CONNECTFIELDS/ConcatFields: This rule is used for the login fields that are horizontally aligned.
    For example: I have 3 domains Field_A Field_B Field_C of an image in a row. and when I use the Conenct Fields rule, F = Field_A, R = Field_B, R = Field_C. Now, I have no data printing in Field_B in this case, the output would be Field_A Field_C

    Just give the name of the rule as ConnectField and in the data column: F = Field_A, R = Field_B, R = Field_C without any semicolons.

    Let me know if you have any questions in case

    Thank you very much
    Deborah Vandenplas

  • No idea why, when you use the Source of the Image changes it overwrites the content?

    No idea why, when you use the Source of the Image changes it overwrites the content?

    Its a really great tool and I want to use it as I have a complicated trajectory I want multiple items to follow, but to have many different PNGs. but when I change them it overwrites the content?

    Thanks in advance

    Scott

    Hi, Scott.

    It is likely that you touch the question where the dimensions of the old image are used when change you to a new image.  It is a known issue for the latest version of edge animate CC and we try to fix it in a future release.  Unfortunately, the only thing you can do is to change the dimensions of the image after you exchange.  You can also copy and paste the path of an element to another, if it would help.

    Hope that helps,

    -Elaine

  • using the source code?

    Sorry for the noob questions, but I am confused on how to use the Flex source code.

    Say I have download office saqoosha Fireworks.

    http://saqoosha.NET//?s=Fireworks

    I ussually just extract the folder in my workspace, go to flex, create a new actionscript project, and name the name of the folder in my workspace. Most of the time this does not work because I do not know how what actionscript file launches the app. Does anyone have an tips for me? And if possible somone could explain how I can use the source code of saqooshas and launch through flex.

    Thank you very much

    Michael

    Try to decompress the folder file somewhere else and using-> import-> Flex project to bring this project into your workspace, rather than copy directly. Then Flex stands at what file to run etc. for you. I pulled down the Fireworks bill you mentioned and it ran without problem.

  • APEX shortcuts using the source of the body of the PL/SQL function

    Hi all

    Recently, I came across the feature of "Shortcuts" in the "Shared components" section of the APEX and thought great, somewhere to set the common/standard items once, then use these several times in different pages of my application.

    This seemed to work correctly when you use the 'Source' of "HTML Text" or "HTML text with special characters escaped", but then I wanted to explore the use of the "Body of the PL/SQL function" option to create a more dynamic shortcut/variable on the base.

    This is where I came across a particular problem in the APEX (Version 3.2.1.00.10 on GR 11, 2 on Oracle Enterprise Linux). When I set my shortcut, and then perform a reference to my shortcut (using "MY_SHORTCUT") in an area of a page, the value of shortcut is back, but is added with the reference variable (ie. the 'MY_SHORTCUT' chain).

    For simplicity, my example looks like this (of course, my real world example is a bit more complicated, but this example produces the same error):
    (a) I define my shortcut called "MY_SHORTCUT" and using the body of the PL/SQL function under "Source Type", define my procedure as "htp.p(:USER)."
    (b) I then create a new page (basic HTML page), and a new region of the 'type'-> 'HTML Text (with shortcuts).
    (c) in the "Source region", I define my shortcut like - "MY_SHORTCUT".
    (d) I apply changes and then run the page.

    I'll be back will be name of the current user with "MY_SHORTCUT" appended/added immediately after the user name - for example. the string:-' BRAD «MY_SHORTCUT»»

    Question is - how to stop the shortcut/reference text "MY_SHORTCUT" to be added to the variable you want to see the and thereafter on your page? I am just wanting the variable, NOT the reference for the shortcut.  I do something wrong using the HTP package, and if yes, what should I use?

    If "MY_SHORTCUT" is defined as "HTML text with special characters escaped" (where I can refer to elements of application using the syntax '& USER.') so that everything works correctly. My reason for using the PL/SQL is to generate a more dynamic output variable, based on elements of application throughout the entire application - and of course the use of shortcuts to minimize coding and duplication.


    Thanks in advance,
    Brad

    Hello

    The body of the PL/SQL function must RETURN a value.

    Try:

    RETURN :APP_USER;
    

    Andy

  • ACS 5.2 - authentication user 802. 1 x and MSCHAPv2 using LDAP Source identity

    Hello community,

    I use the ACS 5.2 as the solution of authentication in my network. I configured two situations: access with network access policies and peripheral Administration.

    Currently, I have a few configured devices: 1 ASA (using RADIUS), WLC-5508 (using RADIUS) 1, 1 2960 S (with GANYMEDE +). And I set up an external identity store, using LDAP (I can see and select all groups without problem).

    Everything works fine. My next step was to configure users to use 802. 1 x to authenticate using ACS with my LDAP database.

    Assuming that all configurations are correct on all computers (when I use an internal database works very well), these are the following newspapers/configurations in the ACS:

    At this point, we can see the error:

    22043 current identity store does not support the authentication method; He jumps.
    Header 1
    Request for access received RADIUS 11001

    11017 RADIUS creates a new session

    Assess Service selection strategy

    15004 Matched rule

    Access Service - access Police selected 15012
    11507 extract EAP-response/identity
    12500 prepared EAP-request with EAP - TLS with challenge
    11006 returned Challenge RADIUS access
    Request for access received RADIUS 11001
    11018 RADIUS re - use an existing session
    12301 extract EAP-response/NAK asking instead to use PEAP
    12300 prepared EAP-request with PEAP with challenge
    11006 returned Challenge RADIUS access
    Request for access received RADIUS 11001
    11018 RADIUS re - use an existing session
    12302 extracted EAP-response containing PEAP challenge-response and accepting as negotiated PEAP
    12318 has successfully PEAP version 0
    12800 first extract TLS record; TLS handshake has begun.
    12805 extracted TLS ClientHello message.
    12806 prepared TLS ServerHello message.
    12807 prepared the TLS certificate message.
    12810 prepared TLS ServerDone message.
    prepared 12305 EAP-request another challenge PEAP
    11006 returned Challenge RADIUS access
    Request for access received RADIUS 11001
    11018 RADIUS re - use an existing session
    12304 extract EAP-response containing PEAP stimulus / response
    12318 has successfully PEAP version 0
    12812 extracted TLS ClientKeyExchange message.
    12804 message retrieved over TLS.
    12801 prepared TLS ChangeCipherSpec message.
    12802 prepared TLS completed message.

    12816 TLS handshake succeeded.

    12310 full handshake PEAP completed successfully
    prepared 12305 EAP-request another challenge PEAP
    11006 returned Challenge RADIUS access
    Request for access received RADIUS 11001
    11018 RADIUS re - use an existing session
    12304 extract EAP-response containing PEAP stimulus / response

    12313 PEAP inner method started

    11521 prepared EAP-request/identity for inner EAP method
    prepared 12305 EAP-request another challenge PEAP
    11006 returned Challenge RADIUS access
    Request for access received RADIUS 11001
    11018 RADIUS re - use an existing session
    12304 extract EAP-response containing PEAP stimulus / response
    11522 extract EAP-Response/Identity for EAP method internal
    11806 prepared EAP-internal method call offering EAP-MSCHAP VERSION challenge
    prepared 12305 EAP-request another challenge PEAP
    11006 returned Challenge RADIUS access
    Request for access received RADIUS 11001
    11018 RADIUS re - use an existing session
    12304 extract EAP-response containing PEAP stimulus / response
    11808 extracted EAP-response containing EAP - MSCHAP VERSION challenge response to the internal method and accepting of EAP - MSCHAP VERSION such as negotiated

    Evaluate the politics of identity

    15006 set default mapping rule

    15013 selected identity store-

    22043 current identity store does not support the authentication method; He jumps.
    22056 object was not found in the identity of the point of sale.
    22058 advanced option that is configured for a unknown user is used.
    22061 the option 'Refuse' Advanced is set in the case of a request for authentication has failed.
    11815 inner EAP-MSCHAP VERSION authentication failed
    11520 prepared EAP-failure of the inner EAP method
    22028 authentication failed and advanced options are ignored.
    prepared 12305 EAP-request another challenge PEAP
    11006 returned Challenge RADIUS access
    Request for access received RADIUS 11001
    11018 RADIUS re - use an existing session
    12304 extract EAP-response containing PEAP stimulus / response

    Authentication PEAP 12307 failure

    11504 prepared EAP-failure

    11003 returned RADIUS Access-Reject

    So, what can be the cause? Compatibility with LDAP?

    Plinio,

    Watch this doc,

    http://www.Cisco.com/en/us/docs/net_mgmt/cisco_secure_access_control_system/5.2/user/guide/eap_pap_phase.html#wp1014889

    There is a table which indicates that LDAP is not a database compatible with our EAP type (MSCHAP VERSION-2).

    LDAP, you can use with TLS, PEAP-GTC, and EAP-FAST-GTC.

    TLS uses certificates on both sides, suplicant, and server authentication server.

    * GCT if I'm not mistaken is a WBS system to use with the EAP protocol.

    Authentication Protocol EAP compatibility of database user and table B-5

    Identity store
    EAP - MD5
    PEAP-EAP-MSCHAPv2
    EAP-FAST MSCHAPv2
    PEAP-GTC
    EAP-FAST-GTC

    ACS

    Yes

    Yes2

    Yes

    Yes

    Yes

    Yes

    Windows AD

    NO.

    Yes

    Yes

    Yes

    Yes

    Yes

    LDAP

    NO.

    Yes

    NO.

    NO.

    Yes

    Yes

    RSA identity store

    NO.

    NO.

    NO.

    NO.

    Yes

    Yes

    Identity of DEPARTMENT store

    NO.

    NO.

    NO.

    NO.

    Yes

    Yes

  • SQL 2012 still on the use of affinity rules

    Hey guys,.

    I use SQL 2012 alwaya time on in a virtual, but so far, it is not configured as best practices and environment I wanted to change that.

    At the moment I have no DRS rules in place so it can happen that two virtual machines running on the same host and it's something I want to avoid.

    However, my big problem is that I only got a SQL license for two hypervisors and best practices talked about four hosts who are needed to achieve my goal.

    Here is what I intend to implement:

    -Affinity rule machine virtual-VM to separate two virtual machines

    -Affinity VM host rule which VM1 MUST run on ESX1

    -Affinity VM host rule that VM2 MUST run on ESX2

    This configuration is a good idea or could / should I do something different?

    What I found that all the features how for example the evacuation and HA should still work?

    There are many more ESX servers in this group and they will be used in the case of an outtage, right?

    Also there is a dev environment that looks the same. I could include the hosts in the same VM-Host affinity rules or should I create new ones?

    BTW. I am using vCenter and ESX 5.5.0.

    Thank you very much!

    See you soon

    Nicolai

    Affinity rules those you intend to sense. These rules will not be those virtual machines to be on the same host most of the time.

    Note:

    1 rule of VM host is configured as "SHOULD", in extreme cases, DRS can break these rules. However, in the next invocation of DRS, DRS will try to resolve the violations.

    2. Note that: when you keep either the host in maintenance (ESX1 or ESX2) mode, you must manually migrate the VM to another host due to the virtual-VM anti rule machine affinity. DRS even in full auto mode, VM will not be migrated automatically. This will apply only if there are only 2 host in the cluster.

    3. Yes, HA should well with that: however HA is not aware of the rules 'EXPECTED' and in the case of host failure it can not respect 'SHOULD' rule.

    4 rule anti-affinite VM - VM can be sensitized HA using the advanced option. Let me know if you want to help with that.

    5. Yes, failure of other hosts in the cluster will be used but please updated on impact due to rules & licenses.

    6. "There is also an environment-dev which looks the same." I did not follow what exactly you mean here:

    7 migration threshold settings DRS is also important.

    8 DRS gives priority to the prevention of violations of anti-affinity rules machine virtual-VM that violations of rules of affinity. (it's just for your info.)

    Nevertheless,.

    1. If ESX1 falls down or affinity rule VM host that VM1 MUST run on ESX1 gets violated: VM1 can be migrated to other hosts in the cluster. As you have no licenses (more than 2) SQL, how it would be dealt with (I'm not very updated on the SQL licenses)

    2 point above applies to the second rule of VM HOST as well.

  • Build a relationship of Scripts to load data by using a load rule

    You can build a relationship of Scripts to load data using a rule charge and if so, what would this process

    Please notify

    The requirement is in reality a quest for the Holy Grail (instantaneous aggregation in the planning of the BSO)?  We could have a conversation down to level 1 "when there is 10 000' options without being noticed.

Maybe you are looking for

  • Satellite M70: Question about types of RAM

    Hey,. I plan to buy some additional RAM for my Satellite M70. On the Toshiba site, there are 2 types of 1 GB of RAM memory available: PA3411U-2M1G and PA3411S-2M1G. The other costs twice as much as the first, although they are all two 1 GB DDR2 PC2-4

  • file extension. Block

    I've recently been having all my photo files and CorelDraw files have a blocked extension.   There was a warning text asking 200.00 to send me the unlock code. I have virus scanned and digitized registry and files are blocked.  Is there any solution

  • Restore system disk

    I recently tried to do a restore of the system on my Dell inspiron n5010 and deleted somehow everything. I need a restore disk on the system, or in a very smart way to solve this problem without one. I'm no longer under warranty so I get a free, even

  • BlackBerry Z30 Z30 and deletion of email on desktop

    How to stop the removal of e-mails on my desk? On my "BOLD", I had a choice, it seems not to be here, so when I remove they are eliminated on the desktop and I need to search my trash folder.

  • Muse does not install

    My Muse will not correctly cloud install creative app, or the website after you have signed in. I have windows 7 64, it will load on any other Adobe program.I made sure that the last Adobe air has been installed, the latest flash player has been inst