Simulate the 1 - N N - N relationship using the Parent-child structure

Hello

I have a 1-N relation between SKILL tables and the USER, which means 1 skill can be applied to multiple users. A jurisdiction may have a parent jurisdiction, which means that a ParentSkill inherits all the privileges of his child.

I would like to simulate a N - N relation between the users and the skills by building a vision that goes through the parent-child relationship. This is possible for the construction?


Current structure:
|USERID | USERNAME | SKILLID  |
+-------+----------+----------+
|   1   |  Jack    |      1   |
|   2   |  Simon   |      1   |
|   3   |  Fred    |      3   |
+-------+----------+----------+


|SKILLID | DESCRIPTION   | PARENTSKILL  |
+--------+---------------+--------------+
|   1    |  Mechanic     |      2       |
|   2    |  Inspector    |      3       |
|   3    |  Supervisor   |      null    |
+--------+---------------+--------------+
Favorite exit (the skillid order is not important):
|USERID | USERNAME | SKILLID  |
+-------+----------+----------+
|   1   |  Jack    |      1   |
|   2   |  Simon   |      1   |
|   3   |  Fred    |      3   |
|   3   |  Fred    |      2   |
|   3   |  Fred    |      1   |
+-------+----------+----------+

I hope that answers your needs:

WITH
users as
(
    SELECT 1 as USERID, 'Jack' as USERNAME, 1 as SKILLID FROM DUAL UNION ALL
    SELECT 2 as USERID, 'Simon' as USERNAME, 1 as SKILLID FROM DUAL UNION ALL
    SELECT 3 as USERID, 'Fred' as USERNAME, 3 as SKILLID FROM DUAL
),
skills as
(
    SELECT SKILLID,CONNECT_BY_ROOT SKILLID AS ANCESTORS
    FROM
        (
            SELECT 1 as SKILLID, 'Mechanic' as DESCRIPTION, 2 as PARENTSKILL FROM DUAL UNION ALL
            SELECT 2, 'Inspector', 3 FROM DUAL UNION ALL
            SELECT 3, 'Supervisor', NULL FROM DUAL
        )
    CONNECT BY PRIOR PARENTSKILL = SKILLID
)
SELECT USERID,USERNAME,ANCESTORS
FROM skills, users
WHERE users.skillid = skills.skillid
/
    USERID USERN  ANCESTORS
---------- ----- ----------
         1 Jack           1
         2 Simon          1
         3 Fred           3
         3 Fred           2
         3 Fred           1

I hope this helps!

Tags: Database

Similar Questions

  • Default filters that users can delete (in the parent/child Setup)?

    Is it possible in Latitude 2.2.2 to have filters (filters of the range, refinement filters etc.) applied by default (which means that users see these filters when they log-in), but they can also remove (using bread crumbs portlet) if they wanted to? We tried to use the source of data (JSON) filters (using 'baseFunctions' setting) where we have a parent/child Setup, but it seems these filters cannot be removed once applied. Note that filters can be removed if we do not have a parent/child relationship between the data sources, but as soon as we introduce a parent/child relationship between the data sources (which we need), the GET of sticky filters and cannot be deleted. Any reason why the parent/child relationship causes the filters becoming sticky? Any way (alternate) to reach what we want?

    I think that it is a known problem (LSTUDIO-5088) and there could be a fix for this. You can contact technical support to obtain the fix.

    Dave

  • Update the data to uppercase in the parent/child tables

    Hi gurus!

    In production, we have a table product and that is in reference by many tables making parent child relationship. By mistake, we realized last month some products have been added to lowercase and now we have a request to update all these product codes uppercase so that existing code that use these tables have no impact. Appreciate if you can give an idea about how can I update the existing data in the table parent uppercase as well as child records?

    Concerning
    Sri

    Are the product code that you need to update what is stored in the tables of children? If Yes, then you must do it in several steps, something like:

    Identify the child tables

    SELECT table_name, constraint_name
    FROM user_constraints
    WHERE r_constraint_name = (SELECT constraint_name
                               FROM user_constraints
                               WHERE table_name = 'PRODUCT_TABLE' and
                                     constraint_type = 'P');
    

    Create new product of upper-case code in the product table:

    INSERT INTO product_table
    SELECT UPPER(product_code), other_columns
    FROM product_table
    WHERE product_code <> UPPER(product_code);
    

    Update the children tables for caps product codes

    UPDATE child1
    SET product_code = UPPER(product_code)
    WHERE product_code <> UPPER(product_code);
    

    Finally, remove the tiny product_table product codes

    DELETE FROM product_table
    WHERE product_code <> UPPER(product_code);
    

    John

  • Get the parent-child hierarchy of column delimited

    I've been on this forum once before, and someone helped me, so I hope I can get help again!

    4-15-5987');

    Thus, the hierarchy is divided on the hyphen. first parent being 4245, then the next value is-4 (including the hyphen) and what follows is - 1, for example

    CREATE TABLE REGEXTEST
      ( ITEM VARCHAR(20)); 
    
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-4');
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-4-1');
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-4-10');
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-4-11');
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-4-12');
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-4-13');
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-4-14');
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-4-15');
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-4-15-59A7');
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-4-15-59D7');
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-4-15-59F7');
      INSERT INTO REGEXTEST (ITEM) VALUES ('4245-
    
    

    I have to be able to bind-1, -4, 4245. Perhaps the simplest is to build a new table with a primary key where it is assigned the id of the parent to the child.
    I just can't understand how to divide the individual elements and maintain the hierarchy. As previously mentioned, someone helped me with another part of the problem before where I needed to maintain the entire path of each child with the following query:

    select  nvl(prior item,item) parent,
            nvl2(prior item,item,null) child
      from  REGEXTEST
      connect by substr(item,1,instr(item,'-',-1) - 1) = prior item
      order by child,parent
    
    

    Now, if I could extrapolate that into a new table:

    CREATE TABLE FileHierarchy
    (ItemID INT NOT NULL PRIMARY KEY,
    ItemName varchar(50) NOT NULL,
    ParentID INT NULL);
    
    

    ItemName is the 4245 or - 4 or - 1 (only) - Yes, including the hyphen.

    The ID of the parent-1 would be the ID-4, etc...

    Thank you very much in advance!

    J.F. Larente

    Solution for not having stored the high level:

    SQL > select *.
    regextest 2
    3.

    POINT LEV
    -------------------- ----------
    4245 4
    4245 4-1
    4245 4-10
    4245 4-11
    4245 4-12
    4245 4-13
    4245 4-14
    4245 4-15
    4245 4-15-59 A 7
    4245 4-15-59 D 7
    4245-4-15-59F7

    11 selected lines.

    SQL > with t1 as)
    2. Select item
    regextest 3
    4 Union all the
    5 select distinct substr (item, 1, instr(item,'-',1))
    6 of regextest
    7             ),
    8 t2 as)
    9. select element,
    10 row_number() on id (order by article)
    11 from t1
    12              )
    13. select id,
    14 regexp_substr (rtrim (point,'-'), case level when 1 then ' [^-] + $' other '-[^-] + $' end) child.
    parentID 15 prior id,
    16 regexp_substr (prior rtrim (point,'-'), case level - 1 when 1 then ' [^-] + $' other '-[^-] + $' end) parent
    17 of t2
    beginning 18 with substr(item,-1) = '-'
    19 connect by substr (item, 1, instr(item,'-',-1) - 1) = prior rtrim(item,'-')
    20 and article! point prior =
    21.

    ID PARENTID PARENT CHILD
    ---------- -------------------- ---------- --------------------
    1 4245
    2 -4                            1 4245
    3 -1                            2 -4
    4 -10                           2 -4
    5 -11                           2 -4
    6 -12                           2 -4
    7 -13                           2 -4
    8 -14                           2 -4
    9 -15                           2 -4
    10-59A 7 9-15
    11 59 D 7 9 - 15

    ID PARENTID PARENT CHILD
    ---------- -------------------- ---------- --------------------
    12 59F7 9-15

    12 selected lines.

    SQL >

    SY.

  • Rebuild the parent/child (connect by prior and where clause)

    Hi guys, you have a quick question for you - code as follows:


    with t1 as)

    Select 1 id, 'Name1' some_name, null, 'Y' parent_id of double some_flag

    Union select 2 id, 'Name2', 1 parent_id, 'Y' some_flag of the double

    Union select 3 id, "Name3", 2 parent_id, "n" of the double some_flag

    Union select id 4, 'Name4.1', 3 parent_id, 'Y' some_flag of the double

    Union select id 5, 'Name4.2', 3 parent_id, 'Y' some_flag of the double

    Union select id 6, 'Name4.3', 3 parent_id, 'Y' some_flag of the double

    Union select id 7, "Name5", 6 parent_id, 'Y' some_flag of the double

    )

    SELECT id, the_name, parent_id, null new_parent_id

    de)

    SELECT id, lpad (' ', (level 1) * 3) | some_name the_name, parent_id

    from t1

    where some_flag = 'Y '.

    Start with id = 1

    connect by parent_id = prior id

    brothers and sisters of order by some_name

    )

    Output:

    ID, THE_NAME, PARENT_ID, NEW_PARENT_ID

    1, Name1,

    2, name2, 1,.

    4, Name4.1,3,

    5, Name4.2,3.

    6, Name4.3, 3,.

    7, name5, 6,.

    As you can see, id = 3 is not displayed (because of where some_flag = 'Y'), but parent_id for id in (4,5,6) shows 3.

    -Only by using SQL - display 'current parent in valid results' as new_parent_id?

    In this example that would be showing new_parent_id = 2 for the id in (4,5,6)

    Currently on Oracle 11 g 1 material.

    Similar theme (manipulate path), but seems to work with the brothers and SŒURS of ORDER BY.

    SELECT id, the_name, parent_id, some_flag, new_parent_id

    FROM (SELECT id, lpad (' ', (LEVEL - 1) * 3): some_name the_name,)

    some_flag, parent_id,

    REGEXP_SUBSTR)

    REGEXP_SUBSTR)

    SYS_CONNECT_BY_PATH)

    DECODE (some_flag, 'Y', id), ' / ').

    '[0-9]+[/]+[0-9]+$'),

    (0-9] +') new_parent_id

    FROM t1

    WHERE some_flag = 'Y '.

    START WITH id = 1

    CONNECT BY PRIOR ID = parent_id

    ORDER OF brothers and SŒURS some_name);

  • Insert the parent/Child records in an xml file...

    XML file pasted below:

    I loaded the xml file in a table called xml_demo that has a column of type xmltype donnees_xml.

    The Select to parent record is thus, and it works:

    INSERT INTO balit_submissions (balitdoc, documentversion, datetime_from, job_id, status, creation_datetime)
    (SELECT 'MOL'
    ((, to_number(extract(x.xml_data,'/MolDocument/DocumentVersion/@v'))
    (, to_date(substr(extract(x.xml_data,'/MolDocument/ValidTimeInterval/@v'),1,16),
    "yyyy-mm-dd HH24" T"")
    123456
    "CREATED",
    NULL VALUE
    OF xml_DEMO x WHERE
    (([existsnode(x.xml_DATA,'/MolDocument/DocumentIdentification[@v="MOL_20100331_1500_1600"]') = 1).
    /

    Having problem creating records child. From this file, I expect to create 3 folders.

    insert into balit_energy_blocks
    (
    SO_ID,
    DATETIME_FROM,
    DIRECTION,
    BLOCK_NUMBER,
    ENERGY,
    LAST_SUBMIT_DATETIME,
    PRICE_POUNDS,
    PRICE_EUROS,
    BALIT_REF,
    STATUS,
    LAST_EDIT_DATETIME,
    MOL_REASON,
    ACQUIRING_SO_AREA)
    (SELECT 'TEN'
    (, to_date(substr(extract(x.xml_data,'/MolDocument/ValidTimeInterval/@v'),1,16),
    "yyyy-mm-dd HH24" T"")
    (, DECODE(extract(x.xml_data,'/MolDocument/MolTimeSeries/Direction/@v'),'AO1','Up','Down')
    (, to_number(substr(extract(x.xml_data,'/MolDocument/MolTimeSeries/ContractIdentification/@v'),19))
    ((, to_number(extract(x.xml_data,'/MolDocument/MolTimeSeries/Period/Interval/EnergyPrice/@v'))
    sysdate
    , null - price books
    , null - price euro
    (, extract(x.xml_data,'/MolDocument/MolTimeSeries/ContractIdentification/@v')
    "PRESENTED".
    , "A96.
    NULL - acquisition of area
    sysdate
    OF xml_DEMO x WHERE
    (([existsnode(x.xml_DATA,'/MolDocument/DocumentIdentification[@v="MOL_20100331_1500_1600"]') = 1).
    /

    For example, there are 3 ContractIdentification tags. Example 1:

    < ContractIdentification v = "RTE_20100331_1500_16" / >

    I expect this selection to snatch the last issue of this string. In this case, 16.
    The selection was:
    TO_NUMBER(substr(extract(x.xml_DATA,'/MolDocument/MolTimeSeries/ContractIdentification/@v'),19))

    The result I got was:

    16RTE_20100331_1500_20NG_20100331_1500_6

    All values of contractident are concatnated and returns posted 19 go.

    Can someone help me to extract the last number of each tag value of ContractIdentification and create the 3 files

    Thank you

    James Sathiaraj

    <? XML version = "1.0" encoding = "UTF-8"? >
    < MolDocument DtdVersion = "3" DtdRelease = "0" >
    < DocumentIdentification v = "MOL_20100331_1500_1600" / >
    < DocumentVersion v = "1" / >
    < V DocumentType = "A43" / >
    < CodingScheme = v "A01" SenderIdentification = "17X100Z100Z0001H" / >
    < SenderRole v = "35" / >
    < ReceiverIdentification codingScheme = v "A01" = "10XFR-TEN - Q" / >
    < ReceiverRole v = "A04" / >
    < CreationDateTime v = "2010-03 - 31 T 14: 10:00Z" / >
    < ValidTimeInterval v = "2010-03 - 31 T 15: 00Z / 2010-03 - 31 T 16: 00Z" / >
    < codingScheme domain = "A01" v = "10YDOM-1001A001A" / >
    < MolTimeSeries >
    < ContractIdentification v = "RTE_20100331_1500_16" / >
    < ResourceProvider codingScheme = v "A01" = "10XFR-TEN - Q" / >
    < CodingScheme = v "A01" AcquiringArea = "17Y100Z100Z00013" / >
    < ConnectingArea codingScheme = v "A01" = "10YFR-TEN - C" / >
    < AuctionIdentification v = "AUCTION_20100331_1500_1600" / >
    < BusinessType v = "10" / >
    < BidTimeInterval v = "2010-03 - 31 T 15: 00Z / 2010-03 - 31 T 16: 00Z" / >
    < MeasureUnitQuantity v = "MAW" / >
    < v currency = "EUR" / >
    < MeasureUnitPrice v = "MWH" / >
    < v direction = "A02" / >
    < MinimumActivationQuantity v = "50" / >
    < v status = "A06" / >
    < period >
    < v TimeInterval = "2010-03 - 31 T 15: 00Z / 2010-03 - 31 T 16: 00Z" / >
    < resolution v = "PT60M" / >
    <>interval
    < v pos = "1" / >
    < v Qty = "50" / >
    < character v = "50.45" / >
    < / interval >
    < / period >
    < / MolTimeSeries >
    < MolTimeSeries >
    < ContractIdentification v = "RTE_20100331_1500_20" / >
    < ResourceProvider codingScheme = v "A01" = "10XFR-TEN - Q" / >
    < CodingScheme = v "A01" AcquiringArea = "17Y100Z100Z00013" / >
    < ConnectingArea codingScheme = v "A01" = "10YFR-TEN - C" / >
    < AuctionIdentification v = "AUCTION_20100331_1500_1600" / >
    < BusinessType v = "10" / >
    < BidTimeInterval v = "2010-03 - 31 T 15: 00Z / 2010-03 - 31 T 16: 00Z" / >
    < MeasureUnitQuantity v = "MAW" / >
    < v currency = "EUR" / >
    < MeasureUnitPrice v = "MWH" / >
    < v direction = "A02" / >
    < MinimumActivationQuantity v = "50" / >
    < v status = "A06" / >
    < period >
    < v TimeInterval = "2010-03 - 31 T 15: 00Z / 2010-03 - 31 T 16: 00Z" / >
    < resolution v = "PT60M" / >
    <>interval
    < v pos = "1" / >
    < v Qty = "50" / >
    < character v = "50.48" / >
    < / interval >
    < / period >
    < / MolTimeSeries >
    < MolTimeSeries >
    < ContractIdentification v = "NG_20100331_1500_6" / >
    < ResourceProvider codingScheme = v "A01" = "10X1001A1001A515" / >
    < CodingScheme = v "A01" AcquiringArea = "17Y100Z100Z00013" / >
    < CodingScheme = v "A01" ConnectingArea = "10YGB - A" / >
    < AuctionIdentification v = "AUCTION_20100331_1500_1600" / >
    < BusinessType v = "10" / >
    < BidTimeInterval v = "2010-03 - 31 T 15: 00Z / 2010-03 - 31 T 16: 00Z" / >
    < MeasureUnitQuantity v = "MAW" / >
    < v currency = "EUR" / >
    < MeasureUnitPrice v = "MWH" / >
    < v direction = "A01" / >
    < MinimumActivationQuantity v = "50" / >
    < v status = "A06" / >
    < period >
    < v TimeInterval = "2010-03 - 31 T 15: 00Z / 2010-03 - 31 T 16: 00Z" / >
    < resolution v = "PT60M" / >
    <>interval
    < v pos = "1" / >
    < v Qty = "50" / >
    < character v = "17.0" / >
    < / interval >
    < / period >
    < / MolTimeSeries >
    < / MolDocument >

    Hello

    The result I got was:

    16RTE_20100331_1500_20NG_20100331_1500_6

    In the query have you tried, access you a single record if you can not expect to get three rows of "magic". The EXTRACT function works as planned, it retrieves the nodes required, but the result is always a fragment of XML (a scalar value).
    To achieve your goal, you must divide the sequence MolTimeSeries in relational lines.

    Two similar solutions are possible, XMLTable (10gr 2 and more) or Table/XMLSequence.
    In your other post, you mentioned db version 10.1, so I guess we go with XMLSequence:

    SELECT 'RTE'
           ,to_date(substr(extractvalue(x.xml_data,'/MolDocument/ValidTimeInterval/@v'),1,16),'yyyy-mm-dd"T"hh24:mi')
           ,decode(extractvalue(x2.column_value,'/MolTimeSeries/Direction/@v'),'A01','Up','Down')
           ,to_number(regexp_substr(extractvalue(x2.column_value,'/MolTimeSeries/ContractIdentification/@v'),'\d+$'))
           ,to_number(extractvalue(x2.column_value,'/MolTimeSeries/Period/Interval/EnergyPrice/@v'))
           ,sysdate
           ,null
           ,null
           ,extractvalue(x2.column_value,'/MolTimeSeries/ContractIdentification/@v')
           ,'SUBMITTED'
           ,'A96'
           ,null
           ,sysdate
    FROM xml_demo x,
         table(
           xmlsequence(
             extract(x.xml_data, '/MolDocument/MolTimeSeries')
           )
         ) x2
    WHERE existsnode(x.xml_data,'/MolDocument/DocumentIdentification[@v="MOL_20100331_1500_1600"]') = 1;
    

    Also note the use of instead of the ordinary SUBSTR REGEXP_SUBSTR because he has not worked for "NG_20100331_1500_6".

    Hope that helps.

    Published by: odie_63 on June 24, 2010 21:18 - comment added regexp

  • Add an object 3d without parent/child relationship.

    Hello

    I have a scene of 3d picture control, I have two objects in there, but when I created the scene I had to use the add object invoke node objects in the scene, so there is a parent/child relationship between the objects, which means that if I move the parent, I also move the child object. Is there a way to create a scene with several objects without the parent/child relationship.

    Thank you.

    -Luis

    Hello, I solved it by first moving the objects and then adding them to the scene. -Luis

  • parent/child relationship hirarchy

    Hi everyone, consider the sample data

    SELECT LFROM '1TR1Y6', NULL LTO, MID '11ZFDD', '21XHK7' double UNION ALL TID-

    SELECT '1TR1YF' LFROM, LTO NULL, '11ZFDD' MI '21XHK5' TID FROM dual UNION ALL-

    SELECT '1TR1X1' LFROM, LTO NULL, '11ZFDD' MI '21XHK8' TID FROM dual UNION ALL-

    SELECT '1LSZX1' LFROM, LTO NULL, '11ZFDD' MI '1TR1YD' TID FROM dual UNION ALL-

    SELECT LFROM "1LSZWQ", "21XHK7" LTO, MID '11ZFDD', '1TR1Y6' TID FROM dual UNION ALL-

    SELECT LFROM "1LSZX2", "21XHK5" LTO, MID '11ZFDD', '1TR1YF' TID FROM dual UNION ALL-

    SELECT LFROM "1LSZVG", "21XHK8" LTO, MID '11ZFDD', '1TR1X1' TID FROM dual UNION ALL-

    SELECT LFROM "4LSSVG", "21XHK9" LTO "11AAA' MI '1TR1X1' TID double UNION ALL

    SELECT "AAAAA" LFROM, LTO NULL, '11ABB' e, 'CCCCCC' double UNION ALL TID

    SELECT "BATH" LFROM, 'CCCCCC' LTO, MID '11ABB', 'AAAAA' double UNION ALL TID

    some of them have a parent/child releationship. for example, let take rank with LFROM = 1TR1Y6

    1TR1Y6 (lfrom) corresponds to the fifth line with TID 1TR1Y6.  TID 1TR1Y6 LTO COLUMN value corresponds to the first line TID (21XHK7)

    It before these two LINES are IN a parent/child relationship.

    lets take another example.  LINE two WITH LFROM = 1TR1YF matches sixth RANK WITH TID 1TR1YF.  the sixth LINE LTO COLUMN (21XHK5) corresponds to the SECOND TID of LINE.

    Once again the parent child relationship. There are two lines that do not have the relationship of parent/child (ex.  line 8)

    Im trying to write a query that can partition the data in the middle column and find the parent/child relationship. the output of the above data should be

    LTO LFROM MIDDLE TID FLAG

    1TR1Y6 NULL 11ZFDD 21XHK7 1

    1LSZWQ 21XHK7 11ZFDD 1TR1Y6 1

    1TR1YF NULL 11ZFDD 21XHK5 1

    1LSZX2 21XHK5 11ZFDD 1TR1YF 1

    1TR1X1 NULL 11ZFDD 21XHK8 1

    1LSZVG 21XHK8 11ZFDD 1TR1X1 1

    1LSZX1 NULL 11ZFDD 1TR1YD 0

    4LSSVG 21XHK9 11AAA 1TR1X1 0

    ABDELKÉBIR 11ABB CCCCCC NULL 1

    CCCCCC 11ABB AAAAA BATH 1

    For simplicity, I posted the release with parent/child, side by side in the sequence.  the order does not matter as long as the flag column (pull the column) is set to an appropriate value (1 if parent/child, 0 no parent/child)

    the flag column value is derived from column to indicate the parent/child relationship was found.

    I try using lead, the lag function but I have problem of sorting data from parent and child line could come at random order (they are not side by side).

    It is therefore difficult to use lead because you don't know how many lines to carry forward.

    can someone help me write a query that displays the output above

    SELECT T1. LFROM,

    T1. LTO,

    T1. ENVIRONMENT,

    T1. TID,

    (

    SELECT COUNT (*)

    OF TBL T2

    WHERE)

    T2. TID = T1. LFROM

    OR

    T2. LFROM = T1. TID

    )

    AND T2. MI = T1. MID

    ) FLAG

    OF TBL T1

    /

    LTO LFROM MIDDLE TID FLAG
    ------ ------ ------ ------ ----------
    1LSZWQ 21XHK7 11ZFDD 1TR1Y6 1
    1LSZX2 21XHK5 11ZFDD 1TR1YF 1
    1LSZVG 21XHK8 11ZFDD 1TR1X1 1
    CCCCCC 11ABB AAAAA BATH 1
    1TR1X1 11ZFDD 21XHK8 1
    1TR1X1 11ZFDD 21XHK8 1
    1LSZX1 11ZFDD 1TR1YD 0
    1TR1Y6 11ZFDD 21XHK7 1
    ABDELKÉBIR 11ABB CCCCCC 1
    1TR1YF 11ZFDD 21XHK5 1
    4LSSVG 21XHK9 11AAA 1TR1X1 0

    11 selected lines.

    SQL >

    SY.

  • Find the child's location in the coordinate space of the parent

    I created a map of the counties of Montana.  Each county is an MC inside separate the largest parent movie clip (allcnt_mc).

    When the user clicks on a County, I would like to focus this country on the scene and the zoom to its measurement.

    The hard part has said the parent (allcnt_mc) where the tween to.  Given that each individual County is a child of the parent, they have their own coordinate space with reference to the parent.

    Is there a way I can query the location (x, y) of a child in the coordinate space of the parent?  With this issue, I could calculate the distanct between the point of current regulation of the parent and the child, indicating the distance that the parent will have to move to focus on the scene.  I tried to use localToGlobal but could not understand how to use it.

    //calculate the stage's center
    var stagecentx:Number=stage.width/2
    var stagecenty:Number=stage.height/2
    
    function tweento(e:MouseEvent):void{
         // the first two variables are referncing the county that was most recently clicked on
         var calledx:Number=allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].x;
         var calledy:Number=allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].y;
         // these variables represent the current location of the stage
         var allcntx:Number=allcnt_mc.x;
         var allcnty:Number=allcnt_mc.y;
         //  I'd like to then tween the allcnt_mc to the location of (calledx,calledy)
         //  but in the coordinate space of allcnt_mc
    
    
    
    

    var pt:Point = new Point (parent.child.x, parent.child.y);

    PT = parent.localToGlobal (PT);

    PT now has the parent.child coordinates in space of the parent coord.

  • Parent - child relationship constraint Unique 5.0 apex oracle

    Oky so I will try to avoid duplicate values get inserted in the parent-child node.

    So basically when there's a node parent (Mobile) I can't create same node with the same name.

    Even for the child node, if there is a child node name there may be another named A.

    Structure:

    Mobile (parent) /Android (Child) /KitKat (subchild) (allowed)

    Mobile/apple/ios(Now allowed Same Parent name)

    Win7/Windows/win7(not allowed same child)

    So a big child and the parent must be unique at any time.

    77.JPG

    create an index of single "TEST_UK" on tablename (parent_id, upper (child_name));

    see this too for a case-insensitive unique constraint

    Case-insensitive unique constraint

  • Simulate the sine wave using LabVIEW FPGA with NOR-myRIO and display in real time

    Hello

    I'm relatively new to LabVIEW FPGA. I am trying to test (and later apply) controllers high speed on myRIO.

    At this point, I'm trying to simulate the sine wave from 1 to 10 kHz using Sinewave generator VI express. I also intend to display the sine wave on the time real (RT) using FIFO. However, I had a bit of trouble to understaing various synchronization parameters.

    1. how to encode information about the sampling frequency generating sine wave? (The side FPGA vi requires only the frequency of the signal and possibly phase and does not rate update lines)

    2. how to estimate the number of items in a FIFO? (that is, the relationship between the rate of updates to loop (RT), the signal frequency, sampling frequency and the number of items in the FIFO)

    It would be great if we could share a very simple program (side host and target) that did something similar.

    Thank you

    MILIN

    Milot,

    I think the problem is the type of data in your FIFO. Your FIFO is configured to use a data type of I16. The problem is the number, it displays only ever will be-1, 0 or 1. To resolve this problem, you must send the sine wave as a fixed point data and convert it to a double on the side of the RT. This should significantly improve your resolution.

  • Use the toggle button to simulate the Ctrl key now

    Hello

    I saw someone asked something very similar before, but nobody seemed to know the solution.

    I was wondering if it is possible to use a toggle button to simulate the CTRL key now, the idea being that the user could then zoom in on a rectangle of their choice on a field without having to press the button themselves. I know that you can use the FakeKeystroke function to simulate support that the key however is possible that it may be held?

    Thank you

    I forgot one thing. You must handle the case when you have a real EVENT_DOUBLE_CLICK. In this case, you don't want to reset the keyboardState. Here's the modified code.

    char oldKeyState [256] = {0};
    char newKeyState [256] = {0};
    int isFakeDouble = 0;

    Zoom CVICALLBACK int (int, int int event, control panel,
    void * callbackData, int eventData1, int eventData2)
    {
    HWND hwnd;
    toggleButton int = 0;
    switch (event)
    {
    case EVENT_LEFT_CLICK:

    get the current state of the keyboard
    GetKeyboardState (oldKeyState);
    get the State of the toggle button
    GetCtrlVal (panelHandle, PANEL_TOGGLEBUTTON, & toggleButton);

    If (ToggleButton)
    {
    create the new copy of the keystate
    memcpy (newKeyState, oldKeyState, 1);

    Active control key.
    newKeyState [VK_CONTROL] = 128;
    SetKeyboardState (newKeyState);

    generate left mouse button events that will be holding the CTRL active
    SetActiveCtrl (panelHandle, PANEL_GRAPH);
    GetPanelAttribute (panelHandle, ATTR_SYSTEM_WINDOW_HANDLE, (intptr_t *) &hwnd);)
    isFakeDouble = 1;
    SendMessage (hwnd, WM_LBUTTONDOWN, 0, 0);
    isFakeDouble = 0;
    }

    break;
    case EVENT_LEFT_DOUBLE_CLICK:

    mouse event generated will be taken as a double click. restore the old state of the keyboard
    If (isFakeDouble)
    SetKeyboardState (oldKeyState);

    break;
    }
    return 0;
    }

  • Should what I use to simulate the tabbed browsing

    Hello

    Should what I use to simulate the tabbed browsing? I have three tabs, and I would like a different status (in a box sliced under the tabs) depending on which tab I clicked. Clicked is the key word because the behaviors that I tried to swap the images on rotation, which is not what I'm looking for.

    And on a related issue, when I joined behaviors to a hotspot vs. a slice? I think this may be part of my problem.

    Thank you very much.

    Well, I've been able to determine what the problem was myself after much trial and error.

    In the dialog box Swap Image (behaviors panel > double-click behavior) I had chosen the slice which ended the tab instead of the range of the target that is on the lower part of the page. Once I chose the correct target slice, everything worked.

  • No option to simulate the peripheral cRIO after installing Labview and RT/FPGA Modules of downloads (lack of driver support?)

    Hi guys -.

    Basically, I need to simulate a cRIO device without yet having equipment on-site, like this:

    How to simulate the FPGA hardware target using with LabVIEW Project Explorer

    Instead, I only get the options presented in the attachment "Add Target Options.jpg.  I guess it's because of missing drivers, which I assume is due to an error that I made during a recent new LV installation installation went like this: I downloaded (not diskettes) and installed the following (in this order, the latest versions all around):

    (1) LabView development system

    (2) real-time module

    (3) FPGA module

    (4) NEITHER-RIO (previous installation-by-installation)

    (5) DAQmx

    At the end of (1) and (2), I got the screen shown in the second attachment ("Drivers Installer Message.jpg"), but could not able to recognize the folder "device drivers OR" (I also downloaded), or one of its subfolders.

    According to me, I'm missing an obvious option to load the necessary drivers after installation, but can't seem to find reference to it in the forums.  Could someone give me a little help in the right direction?

    Thanks a lot and have a nice day.


  • Trying to simulate the device USB-6366 (without success)

    I read through the tutorials DAQmx and MAX about the simulation of the device, but I can't yet find a way to effectively simulate the acquisition and generation of a signal using a device USB-OR-6366.

    I am a (given at the entrance of this VI) signal using DAQmx Write and then use DAQmx Read to read the signal captured from the internal memory of the card (which has a buffer of 32 MS). To do this, I created a task with DAQmx I feed in the writing block.

    I know that the approach is most likely wrong, but I can't understand not just how to do this in a simple way and documentation of NOR is anything but simple. All I want is to

    (a) test using 2 digital inputs to capture this signal by the device and then read what she has gained from its internal buffer

    (b) send the same signal to 2 digital outputs the signal output again.

    See you soon

    Yes! the simulation is designed to allow you to write a program and check that it works theoretically even if you do not have the material physically available. It has no interface programming to influence on the what the reading functions will return simulated data. And write the function has no notable effect anywhere, working as a receiver of data in nirvana. It is always useful because you can test software without getting all kinds of errors on the non existing hardware access attempt, but it has its limits, of course. However, a programming interface for manipulating that which and how the data are simulated, while it would be a very interesting feature, is almost certainly to complicated not only to implement but also to use.

Maybe you are looking for