Query DAQmx module model

Hello,
How do you query the model name of the module plugged in a cDAQ9172? 
Thanks,
A

angelmcdoggie,
I used the following code snippet to grab the devices in my system and determine their device types.  You will need to add code to manage an array of strings to keep the device list throughout your program.
NI::CNiStringVector myVector = CNiDAQmxSystem::GetDevices();
CString deviceType;
for(int i=0; i<myVector.GetSize(); i++) {
      deviceType = CNiDAQmxSystem::LoadDevice(myVector[i]).ProductType;  //Gets device name for every element in the vector then returns the product type
Ryan N
National Instruments
Application Engineer
ni.com/support

Similar Messages

  • Problem of Query of Module Purchase Order, Good Receipt PO, Good Return

    Hi,
    I would like to seek for assistance regarding double entries of documents,  I have used the query and found out lately the it has a problem, Please refer to thread "Query of Module Purchase Order, Good Receipt PO, Good Return" for details.
    You help is very much appreciated.
    Regards,
    Clint

    Hi Clint,
    Try this one:
    SELECT DISTINCT 'GRPO' AS TYPE, T1.DOCNUM
    'GRPO/RET#', T3.DOCNUM 'PO#',T1.CARDCODE,
    T1.CARDNAME , T1.DOCDATE, T0.ITEMCODE, T0.QUANTITY,
    T0.PRICE, T0.LINETOTAL
    FROM DBO.PDN1 T0
    INNER JOIN DBO.OPDN T1 ON T1.DOCENTRY = T0.DOCENTRY
    LEFT JOIN DBO.POR1 T2 ON T0.BASEENTRY = T2.DOCENTRY
    INNER JOIN DBO.OPOR T3 ON T2.DOCENTRY = T3.DOCENTRY
    WHERE T1.DOCNUM = '[%0]' AND T0.ITEMCODE IS NOT NULL
    UNION ALL
    SELECT DISTINCT 'RETR', T1.DOCNUM,T3.DOCNUM,
    T1.CARDCODE, T1.CARDNAME , T1.DOCDATE, T0.ITEMCODE,
    T0.QUANTITY, T0.PRICE, T0.LINETOTAL
    FROM PDN1 T0
    INNER JOIN OPDN T1 ON T1.DOCENTRY = T0.DOCENTRY
    LEFT JOIN RPD1 T2 ON T0.TRGETENTRY = T2.DOCENTRY
    INNER JOIN ORPD T3 ON T2.DOCENTRY = T3.DOCENTRY
    WHERE T1.DOCNUM = '[%0]' AND T0.ITEMCODE IS NOT NULL
    If you still have duplicates, let me know any differences in those lines.
    Thanks,
    Gordon

  • Running a SPARQL query across all models

    Is there a concise way of running a SPARQL query against all models in the database (or at least all models owned by a db user) via the Oracle Jena Adapter? Do I have to manually find all models, add them to a GraphOracleSem, and pass a composite model (from the graph) to a QueryFactory.create() method or is there a simpler way like something synonymous to DatasetStore.create() that would pass back the entire dataset?
    Thanks

    I want to run the query against a merged graph of all the models.
    I see you can do this by attaching an Attachment containing the list of all model names to a graph. I could be dealing with several models. I really want to be able to query against the entire data set but this mean I must know the names of all the models (which means selecting from MDSYS>RDF_MODEL$). Here is the code I came up with. This gives me a Dataset that I can then pass to QueryExecutionFactory.create(Query, Dataset). Any suggestions?
    private static final String SELECT_MODELS =
    "SELECT model_name FROM MDSYS.RDF_MODEL$ WHERE owner=? and model_name != ?";
    private static final String MODEL_NAME = "model_name";
    * The name of a reserved model representing all semantic data in the database.
    private static final String DATASET_MODEL_NAME = "DATASET";
    public Dataset getDataSet() {
    Dataset ds = null;
    Oracle oracle = getOracle();
    // The hard way: manually
    try {
    // Get all accessible models in the store
    PreparedStatement stmt = oracle.getConnection().prepareStatement(SELECT_MODELS);
    stmt.setString(1, oracle.getConnection().getUserName());
    stmt.setString(2, DATASET_MODEL_NAME);
    ResultSet rs = stmt.executeQuery();
    // Add them to a composite model                    
    List<String> modelNames = new ArrayList<String>();
    while ( rs.next() ) {
    modelNames.add(rs.getString(MODEL_NAME));          
    stmt.close();
    // create a dataset from the composite model
    Attachment attachment = Attachment.createInstance(
    (String[])modelNames.toArray(new String[0]),
    new String[0],
    InferenceMaintenanceMode.NO_UPDATE,
    QueryOptions.QUERY_VALID_ONLY );
    GraphOracleSem graph = new GraphOracleSem( oracle,
    DATASET_MODEL_NAME, attachment );
    ds = DatasetFactory.create(new ModelCom(graph));
    } catch (SQLException e) {
    log.warn("SQL Exception caught", e);               
    } catch (Exception e) {
    log.warn("Exception thrown.", e);
    return ds;
    Thanks!

  • A query in module pool

    hi all,
               I have a query in module pool, my problem is
    lets say i have two fields in a screen.
           out of which one is a date field and other one is a field which has got F4 help.
    When i pick some values from the F4 help i have to populate the date field simaultaneously.
    EG: when i pick value 1 from F4 help then i have to pass
    the date value to screen as soon as i pick.
    Can anybody help me out..
    Regards,
    Krishnakumar

    Hi,
    Check this sample code and kindly reward points by clicking the star on the left of reply,if it helps.
    PROCESS BEFORE OUTPUT.
    PROCESS AFTER INPUT.
    FIELD s_begru MODULE abc ON INPUT.
    Process on value-request.
    field s_begru module f4_help.
    *& Report  ZZZ_JAYTEST1                                                *
    REPORT  ZZZ_JAYTEST1                            .
    tables kna1.
    data:
    begin of t_values occurs 2,
    value like kna1-begru,
    end of t_values,
    t_return like ddshretval occurs 0 with header line.
    data s_begru like kna1-begru.
    call screen 9000.
    *&      Module  f4_help  INPUT
          text
    module f4_help input.
    refresh t_values.
    t_values = 'PAR*'.
    append t_values.
    t_values = 'UGG'.
    append t_values.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
    retfield = 'BEGRU'
    value_org = 'S'
    tables
    value_tab = t_values
    return_tab = t_return
    exceptions
    parameter_error = 1
    no_values_found = 2
    others = 3.
    if sy-subrc = 0.
    read table t_return index 1.
    s_begru = t_return-fieldval.
    *Populate the date field also here
    endif.
    endmodule.                 " f4_help  INPUT
    *&      Module  abc  INPUT
          text
    module abc input.
    read table t_values with key value = s_begru.
    if sy-subrc ne 0.
    clear s_begru.
    endif.
    endmodule.                 " abc  INPUT

  • How do i query the module object for the interface of the module-specific interface I require

    Hi there.
    Currently using LabVIEW 2012/TestStand 2012.
    I am attempting to edit the LabVIEW Text Sequence Translator, and in the CreateStep.vi I am trying to create a step that is of type WIS_Sequence_Call (a custom version of NI_Types.ini-->SequenceCall).
    I need to set the file pathname, sequence name and parameter values in the step.  I believe I need to get access to the SequenceCallModule class to do this.
    This help file SequenceCallModule states in the description: "To access the properties and methods of a specific module class, query the Module object for the interface of the module-specific interface you want to acquire.".
    What exactly is meant by "query" here?  It looks like "Specify" might be what I am after, but I want this done programmatically, ie no dialog boxes.
    See my snippet below.
    Thanks.

    Thanks for the reply Charles.
    I have been using the 2012 version of the poster.
    I can get access to the Module class from the Step Class as shown in the snippet above, but I can't see how to get to SequenceCallModule? The "To more specific class" VI doesn't seem to work for TS refs. Is there no way to derive the SequenceCallModule from this?
    Also I can use the TSAdp.SequenceCallModule reference, but I need to link this to the relevant step that I've just created.  Can NI please provide me with a link to any examples on this?
    Thanks

  • How do i query the module object for the interface of the module-spe​cific interface I require

    Hi there.
    Currently using LabVIEW 2012/TestStand 2012.
    I am attempting to edit the LabVIEW Text Sequence Translator, and in the CreateStep.vi I am trying to create a step that is of type WIS_Sequence_Call (a custom version of NI_Types.ini-->SequenceCall).
    I need to set the file pathname, sequence name and parameter values in the step.  I believe I need to get access to the SequenceCallModule class to do this.
    This help file SequenceCallModule states in the description: "To access the properties and methods of a specific module class, query the Module object for the interface of the module-specific interface you want to acquire.".
    What exactly is meant by "query" here?  It looks like "Specify" might be what I am after, but I want this done programmatically, ie no dialog boxes.
    See my snippet below.
    Thanks.
    Christopher Farmer
    Certified LabVIEW Architect
    Certified TestStand Developer
    http://wiredinsoftware.com.au
    Solved!
    Go to Solution.

    Thanks for the reply Charles.
    I have been using the 2012 version of the poster.
    I can get access to the Module class from the Step Class as shown in the snippet above, but I can't see how to get to SequenceCallModule? The "To more specific class" VI doesn't seem to work for TS refs. Is there no way to derive the SequenceCallModule from this?
    Also I can use the TSAdp.SequenceCallModule reference, but I need to link this to the relevant step that I've just created.  Can NI please provide me with a link to any examples on this?
    Thanks
    Christopher Farmer
    Certified LabVIEW Architect
    Certified TestStand Developer
    http://wiredinsoftware.com.au

  • CEM - Network Module - Model Number Query

    I know Cisco no longer supports Circuit Emulation, but our company is still required to support a number of Cisco 3800's running the following module:
    NM-CEM-4TE1
    Unfortunately, a number of these modules have failed and are no longer purchasable - we are, however, able to purchase the following module:
    NM-CEM-4TE1=
    Does anyone know the significance of the "=" sign?

    Still no luck. When attempting to test the application module using the new configuration, and after setting the jbo.server.internal_connection property, I got the following error:
    (oracle.jbo.common.ampool.ApplicationPoolException) JBO-30003: The application pool (.106DFDB6123) failed to checkout an application module due to the following exception:
    ----- LEVEL 1: DETAIL 0 -----
    (oracle.jbo.JboException) JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-27200: JNDI failure. Unable to lookup Data Source at context jdbc/HRCoreDS
    ----- LEVEL 2: DETAIL 0 -----
    (oracle.jbo.JboException) JBO-27200: JNDI failure. Unable to lookup Data Source at context jdbc/HRCoreDS
    ----- LEVEL 3: DETAIL 0 -----
    (javax.naming.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
    Did I miss something? And if/when I do get the datasource working, will that enable the data controls on the jsp to start working?
    Here's some more info that might be helpful. In an attempt to figure this out, I walked throught a basic ADF tutorial step-by-step to see what would happen. I used:
    http://www.oracle.com/technology/products/jdev/101/tutorials/e2ebcfaces/buildmaster-detailpagewithjdevandadfbc.htm
    I created a "plain" JSP instead of a JSF JSP and used a read-only table based on CustomersView1 instead of a master-detail table. I did not get any errors when I ran the JSP, but the table appeared blank (no rows of data). The application module, however, tested successfully (I saw the expected data). Maybe this info suggests what might be wrong?
    Thanks for all your help,
    Andy

  • Query help with Model clause

    Hi Gurus,
    Can someone please help me out.
    I've a below tables.
    1) tbl_link --> this table contains information at profile level
    2) tbl_summary --> this table contains summary at parent profile level derived from tbl_link table
    One parent profile contains multiple child profiles and each child profile links to a code (which is B, W, G or P) and the code is linked to a category (i.e. ONL and OFL). In this case code B is linked to category 'ONL' and codes W,G,P linked to OFL category.
    ONL category needs 100 points. If it don't have enough points then i need to borrow from OFL category which i'm doing and populating into tbl_summary table at parent profile level.
    Now i need to insert data into tbl_link table at profile level with howmany points used, expired based on tbl_summary table. Rule is at the end of month if we add points for each profile in tbl_link table it should come as 0.
    with
    tbl_SUMMARY as
    select 1 as ppid,'ONL' as catgcode, 53 as earned_points,47 BORROWED_POINTS,100 CERT_POINTS,0 DISCARD_POINTS,100 used from dual
    union
    select 1 as ppid,'OFL' as catgcode, 223 as earned_points,0 BORROWED_POINTS,176 CERT_POINTS,76 DISCARD_POINTS,100 used from dual
    union
    select 2 as ppid,'ONL' as catgcode, 39 as earned_points,61 BORROWED_POINTS,100 CERT_POINTS,0 DISCARD_POINTS,100 used from dual
    union
    select 2 as ppid,'OFL' as catgcode, 90 as earned_points,0 BORROWED_POINTS,29 CERT_POINTS,29 DISCARD_POINTS,100 used from dual
    union
    select 3 as ppid,'ONL' as catgcode, 109 as earned_points,0 BORROWED_POINTS,109 CERT_POINTS,9 DISCARD_POINTS,100 used from dual
    union
    select 3 as ppid,'OFL' as catgcode, 223 as earned_points,0 BORROWED_POINTS,223 CERT_POINTS,23 DISCARD_POINTS,200 used from dual
    union
    select 4 as ppid,'ONL' as catgcode, 109 as earned_points,0 BORROWED_POINTS,109 CERT_POINTS,9 DISCARD_POINTS,100 used from dual
    union
    select 4 as ppid,'OFL' as catgcode, 169 as earned_points,0 BORROWED_POINTS,169 CERT_POINTS,69 DISCARD_POINTS,100 used from dual
    tbl_link as
    select 1 as ppid,1 as pid, 'B' as code,'ONL' as catgcode, 53 as earned_points from dual
    union
    select 1 as ppid,12 as pid, 'W' as code,'OFL' as catgcode, 26 as earned_points from dual
    union
    select 1 as ppid,13 as pid, 'G' as code,'OFL' as catgcode, 87 as earned_points from dual
    union
    select 1 as ppid,14 as pid, 'P' as code,'OFL' as catgcode, 110 as earned_points from dual
    union
    select 2 as ppid,2 as pid, 'B' as code,'ONL' as catgcode, 39 as earned_points from dual
    union
    select 2 as ppid,22 as pid, 'W' ,'OFL' as catgcode, 30 as earned_points from dual
    union
    select 2 as ppid,23 as pid, 'G' ,'OFL' as catgcode, 29 as earned_points from dual
    union
    select 2 as ppid,24 as pid, 'P' ,'OFL' as catgcode, 31 as earned_points from dual
    union
    select 3 as ppid,3 as pid, 'B' as code,'ONL' as tier_catgcode, 109 as earned_points from dual
    union
    select 3 as ppid,32 as pid, 'W' ,'OFL' , 26 as earned_points from dual
    union
    select 3 as ppid,33 as pid, 'G' ,'OFL', 87 as earned_points from dual
    union
    select 3 as ppid,34 as pid, 'P' ,'OFL' , 110 as earned_points from dual
    union
    select 4 as ppid,4 as pid, 'B' as code,'ONL' as catgcode, 109 as earned_points from dual
    union
    select 4 as ppid,42 as pid, 'W' as code,'OFL' , 26 as earned_points from dual
    union
    select 4 as ppid,43 as pid, 'G' as code,'OFL' , 87 as earned_points from dual
    union
    select 4 as ppid,44 as pid, 'P' as code,'OFL' , 56 as earned_points from dual
    final (PARENT_PROFILE_ID,PROFILE_ID,catgcode,EARNED_POINTS,BORROWED_POINTS,CERT_POINTS,DISCARD_POINTS,USED)
    as (
    select A.PPID PARENT_PROFILE_ID,B.PID PROFILE_ID,A.catgcode,B.EARNED_POINTS,BORROWED_POINTS,CERT_POINTS,DISCARD_POINTS,USED
    from tbl_SUMMARY a,tbl_link b where a.ppid=b.ppid AND A.catgcode=B.catgcode
    ORDER BY PROFILE_ID
    select * from final order by 1;
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED
    1                  1           ONL       53             47               100          0               100
    1                  14          OFL       110            0                176          76              100
    1                  13          OFL       87             0                176          76              100
    1                  12          OFL       26             0                176          76              100
    2                  2           ONL       39             61               100          0               100
    2                  24          OFL       31             0                29           29              100
    2                  23          OFL       29             0                29           29              100
    2                  22          OFL       30             0                29           29              100
    3                  32          OFL       26             0                223          23              200
    3                  33          OFL       87             0                223          23              200
    3                  34          OFL       110            0                223          23              200
    3                  3           ONL       109            0                109          9               100
    4                  42          OFL       26             0                169          69              100
    4                  43          OFL       87             0                169          69              100
    4                  44          OFL       56             0                169          69              100
    4                  4           ONL       109            0                109          9               100
    Need Output as below :
    For parent profile 1, whatever i mentioned above is not correct. Borrowed 47 points from OFL to ONL to make ONL and also from OFL category has 176 points remaining after lending to ONL and using only 100 points, remaining 76 points are discarded. Need to deduct these 76 points also from child profiles. Output will be as below.
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    1                  1           ONL       53             47               100          0               100   -53       0
    1                  12          OFL       26             0                176          76              100   -26       0
    1                  13          OFL       87             0                176          76              100   -74       -13
    1                  14          OFL       110            0                176          76              100   -47       -63
    For parent profile id 2 --> ONL category has 39 points, so borrowed 61 points from OFL category to make ONL points 100.
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 22,23,24).
    Borrowed 61 points from OFL and need to deduct this points from the profile which has highest earned points, in this case deduct from profile 24 which has 31 points, from profile 22 which has 30 points. Need output like below
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    2                  2           ONL       39             61               100          0               100   -39       0
    2                  22          OFL       30             0                29           29              100   -30       0
    2                  23          OFL       29             0                29           29              100   0         -29
    2                  24          OFL       31             0                29           29              100   -31       0
    For parent profile id 3 --> ONL category has 109 points, so no need to borrow points from OFL category
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 32,33,34).
    in this case ONL has 100 points, so move the remaining 9 points will be expired. OFL category has 223 points total. need only 200 points (i.e. mutiple of 100) for our process, 23 points will be expired and has to deduct from the profile which has highest earned points, in this case from profile 34. Output :
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    3                  3           ONL       109            0                109          9               100   -100      -9
    3                  32          OFL       26             0                223          23              200   -26       0
    3                  33          OFL       87             0                223          23              200   -87       0
    3                  34          OFL       110            0                223          23              200   -87       -23
    For parent profile id 4 --> ONL category has 109 points, so no need to borrow points from OFL category
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 42,43,44).
    in this case ONL has 100 points, so move the remaining 9 points will be expired. OFL category has 169 points total. need only 100 points (i.e. mutiple of 100) for our process, 69 points will be expired and has to deduct from the profile which has highest earned points, in this case from profile 43. Output :
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    4                  4           ONL       109            0                109          9               100   100       9
    4                  42          OFL       26             0                169          69              100   -26       0
    4                  43          OFL       87             0                169          69              100   -18       -69
    4                  44          OFL       56             0                169          69              100   -56       0
    Can someone help with the query. I googled about looping in sql and came to know that Oracle has a feature MODEL to loop in SQL, but i don't have idea on using MODEL clause.
    Appreciate your help!
    Thanks
    Sri

    Hi Gurus,
    Can someone please help me out.
    I've a below tables.
    1) tbl_link --> this table contains information at profile level
    2) tbl_summary --> this table contains summary at parent profile level derived from tbl_link table
    One parent profile contains multiple child profiles and each child profile links to a code (which is B, W, G or P) and the code is linked to a category (i.e. ONL and OFL). In this case code B is linked to category 'ONL' and codes W,G,P linked to OFL category.
    ONL category needs 100 points. If it don't have enough points then i need to borrow from OFL category which i'm doing and populating into tbl_summary table at parent profile level.
    Now i need to insert data into tbl_link table at profile level with howmany points used, expired based on tbl_summary table. Rule is at the end of month if we add points for each profile in tbl_link table it should come as 0.
    with
    tbl_SUMMARY as
    select 1 as ppid,'ONL' as catgcode, 53 as earned_points,47 BORROWED_POINTS,100 CERT_POINTS,0 DISCARD_POINTS,100 used from dual
    union
    select 1 as ppid,'OFL' as catgcode, 223 as earned_points,0 BORROWED_POINTS,176 CERT_POINTS,76 DISCARD_POINTS,100 used from dual
    union
    select 2 as ppid,'ONL' as catgcode, 39 as earned_points,61 BORROWED_POINTS,100 CERT_POINTS,0 DISCARD_POINTS,100 used from dual
    union
    select 2 as ppid,'OFL' as catgcode, 90 as earned_points,0 BORROWED_POINTS,29 CERT_POINTS,29 DISCARD_POINTS,100 used from dual
    union
    select 3 as ppid,'ONL' as catgcode, 109 as earned_points,0 BORROWED_POINTS,109 CERT_POINTS,9 DISCARD_POINTS,100 used from dual
    union
    select 3 as ppid,'OFL' as catgcode, 223 as earned_points,0 BORROWED_POINTS,223 CERT_POINTS,23 DISCARD_POINTS,200 used from dual
    union
    select 4 as ppid,'ONL' as catgcode, 109 as earned_points,0 BORROWED_POINTS,109 CERT_POINTS,9 DISCARD_POINTS,100 used from dual
    union
    select 4 as ppid,'OFL' as catgcode, 169 as earned_points,0 BORROWED_POINTS,169 CERT_POINTS,69 DISCARD_POINTS,100 used from dual
    tbl_link as
    select 1 as ppid,1 as pid, 'B' as code,'ONL' as catgcode, 53 as earned_points from dual
    union
    select 1 as ppid,12 as pid, 'W' as code,'OFL' as catgcode, 26 as earned_points from dual
    union
    select 1 as ppid,13 as pid, 'G' as code,'OFL' as catgcode, 87 as earned_points from dual
    union
    select 1 as ppid,14 as pid, 'P' as code,'OFL' as catgcode, 110 as earned_points from dual
    union
    select 2 as ppid,2 as pid, 'B' as code,'ONL' as catgcode, 39 as earned_points from dual
    union
    select 2 as ppid,22 as pid, 'W' ,'OFL' as catgcode, 30 as earned_points from dual
    union
    select 2 as ppid,23 as pid, 'G' ,'OFL' as catgcode, 29 as earned_points from dual
    union
    select 2 as ppid,24 as pid, 'P' ,'OFL' as catgcode, 31 as earned_points from dual
    union
    select 3 as ppid,3 as pid, 'B' as code,'ONL' as tier_catgcode, 109 as earned_points from dual
    union
    select 3 as ppid,32 as pid, 'W' ,'OFL' , 26 as earned_points from dual
    union
    select 3 as ppid,33 as pid, 'G' ,'OFL', 87 as earned_points from dual
    union
    select 3 as ppid,34 as pid, 'P' ,'OFL' , 110 as earned_points from dual
    union
    select 4 as ppid,4 as pid, 'B' as code,'ONL' as catgcode, 109 as earned_points from dual
    union
    select 4 as ppid,42 as pid, 'W' as code,'OFL' , 26 as earned_points from dual
    union
    select 4 as ppid,43 as pid, 'G' as code,'OFL' , 87 as earned_points from dual
    union
    select 4 as ppid,44 as pid, 'P' as code,'OFL' , 56 as earned_points from dual
    final (PARENT_PROFILE_ID,PROFILE_ID,catgcode,EARNED_POINTS,BORROWED_POINTS,CERT_POINTS,DISCARD_POINTS,USED)
    as (
    select A.PPID PARENT_PROFILE_ID,B.PID PROFILE_ID,A.catgcode,B.EARNED_POINTS,BORROWED_POINTS,CERT_POINTS,DISCARD_POINTS,USED
    from tbl_SUMMARY a,tbl_link b where a.ppid=b.ppid AND A.catgcode=B.catgcode
    ORDER BY PROFILE_ID
    select * from final order by 1;
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED
    1                  1           ONL       53             47               100          0               100
    1                  14          OFL       110            0                176          76              100
    1                  13          OFL       87             0                176          76              100
    1                  12          OFL       26             0                176          76              100
    2                  2           ONL       39             61               100          0               100
    2                  24          OFL       31             0                29           29              100
    2                  23          OFL       29             0                29           29              100
    2                  22          OFL       30             0                29           29              100
    3                  32          OFL       26             0                223          23              200
    3                  33          OFL       87             0                223          23              200
    3                  34          OFL       110            0                223          23              200
    3                  3           ONL       109            0                109          9               100
    4                  42          OFL       26             0                169          69              100
    4                  43          OFL       87             0                169          69              100
    4                  44          OFL       56             0                169          69              100
    4                  4           ONL       109            0                109          9               100
    Need Output as below :
    For parent profile 1, whatever i mentioned above is not correct. Borrowed 47 points from OFL to ONL to make ONL and also from OFL category has 176 points remaining after lending to ONL and using only 100 points, remaining 76 points are discarded. Need to deduct these 76 points also from child profiles. Output will be as below.
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    1                  1           ONL       53             47               100          0               100   -53       0
    1                  12          OFL       26             0                176          76              100   -26       0
    1                  13          OFL       87             0                176          76              100   -74       -13
    1                  14          OFL       110            0                176          76              100   -47       -63
    For parent profile id 2 --> ONL category has 39 points, so borrowed 61 points from OFL category to make ONL points 100.
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 22,23,24).
    Borrowed 61 points from OFL and need to deduct this points from the profile which has highest earned points, in this case deduct from profile 24 which has 31 points, from profile 22 which has 30 points. Need output like below
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    2                  2           ONL       39             61               100          0               100   -39       0
    2                  22          OFL       30             0                29           29              100   -30       0
    2                  23          OFL       29             0                29           29              100   0         -29
    2                  24          OFL       31             0                29           29              100   -31       0
    For parent profile id 3 --> ONL category has 109 points, so no need to borrow points from OFL category
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 32,33,34).
    in this case ONL has 100 points, so move the remaining 9 points will be expired. OFL category has 223 points total. need only 200 points (i.e. mutiple of 100) for our process, 23 points will be expired and has to deduct from the profile which has highest earned points, in this case from profile 34. Output :
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    3                  3           ONL       109            0                109          9               100   -100      -9
    3                  32          OFL       26             0                223          23              200   -26       0
    3                  33          OFL       87             0                223          23              200   -87       0
    3                  34          OFL       110            0                223          23              200   -87       -23
    For parent profile id 4 --> ONL category has 109 points, so no need to borrow points from OFL category
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 42,43,44).
    in this case ONL has 100 points, so move the remaining 9 points will be expired. OFL category has 169 points total. need only 100 points (i.e. mutiple of 100) for our process, 69 points will be expired and has to deduct from the profile which has highest earned points, in this case from profile 43. Output :
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    4                  4           ONL       109            0                109          9               100   100       9
    4                  42          OFL       26             0                169          69              100   -26       0
    4                  43          OFL       87             0                169          69              100   -18       -69
    4                  44          OFL       56             0                169          69              100   -56       0
    Can someone help with the query. I googled about looping in sql and came to know that Oracle has a feature MODEL to loop in SQL, but i don't have idea on using MODEL clause.
    Appreciate your help!
    Thanks
    Sri

  • Query of Module Purchase Order, Good Receipt PO,  Good Return

    Hi,
    Like to ask assistance regarding Module Purchase Order, Good Receipt PO,  Good Return under Purchasing A/P.
    I have a hard time to linking the tables above:
    PO Module have table : OPOR and OPOR1
    GRPO have table : OPDN and PDN1
    Good Return have table : ORPD and RPD1
    Its very mind bubling linking this 6 tables can anyone please can assist regarding the situation, a query that shows that they are connected to each other.
    Thank very much!
    Clint

    Clint,
    Like Suda said, this query assumes your have normal business practise.
    One more thing to mention, the lower part of union all needs some other change.  Here is the complete query:
    SELECT     DISTINCT 'GRPO' AS TYPE, T1.DOCNUM "GRPO/RET#", T3.DOCNUM PO#,T1.CARDCODE, T1.CARDNAME , T1.DOCDATE, T0.ITEMCODE, T0.QUANTITY, T0.PRICE, T0.LINETOTAL, T0.TOTALFRGN, T0.RATE
    FROM         PDN1 T0
    INNER JOIN OPDN T1 ON T1.DOCENTRY = T0.DOCENTRY
    LEFT JOIN POR1 T2 ON T0.BASEENTRY = T2.DOCENTRY
    INNER JOIN OPOR T3 ON T2.DOCENTRY = T3.DOCENTRY
    WHERE    T1.DOCNUM LIKE '[%0]'
    UNION ALL
    SELECT     DISTINCT 'RETR', T1.DOCNUM,T3.DOCNUM, T1.CARDCODE, T1.CARDNAME , T1.DOCDATE, T0.ITEMCODE, T0.QUANTITY, T0.PRICE, T0.LINETOTAL, T0.TOTALFRGN, T0.RATE
    FROM         PDN1 T0
    INNER JOIN OPDN T1 ON T1.DOCENTRY = T0.DOCENTRY
    LEFT JOIN RPD1 T2 ON T0.TRGETENTRY = T2.DOCENTRY
    INNER JOIN ORPD T3 ON T2.DOCENTRY = T3.DOCENTRY
    WHERE    T1.DOCNUM LIKE '[%0]'

  • How to make linkage query In Data Model for search

    I want to make an linkage query as a condition for my  report in BI Publisher. how to make the linkage in Date Model ?

    This is the forum for SQL Developer, not for general SQL or PL/SQL questions.
    Please repost this in the SQL and PL/SQL forum.

  • Query : Function module

    Hi every body,
    I need in a query to calculate duration from 2 dates/ Times.
    There is a function module to calculate a duration. How can i use it in my query.
    Please guide if there is another proposition.
    Thanks in advance.

    You can use this SD_DATETIME_DIFFERENCE But I'm not sure if you can use it inside a SAP Query (SQ01)....I remember that there is a way to include ABAP code...But I just used SQ01 one time...
    Greetings,
    Blag.

  • How capture query in data model report

    Hi,
    I have multiples queries in my data model report >clause WHERE is dynamic in all queries<. I need capture the final query and look what query execute.
    Is this posible?, Are there any API that I can use? .
    Viktor.

    Viktor,
    you can trace the report including the sql. Look in te builder at the menu program. there's a tracing option.
    Regards
    Rainer

  • Querying DAQmx channel types in LabVIEW

    I want to have my LabVIEW application look through all the DAQmx tasks
    defined on the computer and display to the user a list of only analog
    input tasks.  I tried to do this by:
    Use the DAQmx System property node to retrieve a list of all tasks.
    For each tasks, use the DAQmx Task property node to retrieve a list of all channels.
    For each channel, use the DAQmx Channel property node to query its ChanType.
    If all ChanTypes turn out to be Analog Input, then I admit the task into the list.
    The problem is that I have tasks that I know are analog output tasks,
    but the DAQmx Channel property node still return "Analog Input" as
    their ChanType.  Am I seeing things, or is this a bona fide
    problem?  Is there a better way to get a list of the tasks I'm
    interested in?

    Hello,
    That is strange.  I built a VI which queries the DAQmx Task Types like you describe, and it works correctly for me.  If all channels in a task are analog input (by the way, this is a little redundant as all channels in a task must be of the same type), then the task name is passed to an array.  Otherwise, an empty constant is passed.
    Try running the attached VI and see if it works correctly for you.
    Regards,
    Sean C.
    Attachments:
    QueryTaskType.vi ‏34 KB

  • Dynamic selection of query in data-model

    I have a report which has 3 disjoint queries in its data model. I have a lexical parameter (:p_where) for all the queries. In the afterform trigger, based on another parameter (:p_type) i am having the where clause built and assigned to the "where lexical parameter". In my layout, i have one repeating frame for each group(query) and displaying the appropriate frame based on the (:p_type).
    What i have acheived here is, based on the :p_type, my where caluse is built and the appropriate frame is displayed. But one problem here is since i am using the same ":p_where" for all the 3 queries, all of them will be executed but since only one frame is visible at a time, user doesnt see the results of the other 2 query though it is executed and fetched.
    Now my question is, is there a way to dynamically select the query to be executed in my datamodel. If so, i can avoid the execution of the all 3 queries always and the report will only execute the required one query based on the :p_type parameter.

    Hi,
    It is better to use Additional layouts if you have disjointed queries which gets the same parameter. This way the user is able to see all the results at a time.
    Regards

  • MDX query on Tabular Model

    Hi,
    I am very new to SSAS Tabular model and MDX query so I need some help in getting correct query.
    I am trying to build a query against a Tabular Model but not sure how to build the query.
    I have a Db called 'MyClient' in Analysis Services database. This db has Tables like 'Observations','Scan' etc.
    In table I have around 10 to 12 columns like 'Id','ScanId','Title','Date','Impact' etc.. What I am looking for is a MDX query to reterive all the information from Observations table filtered on ScanID? Can someone provide me with a query
    If SQL I could have written Select * from Observations where ScanID='22qwe-adfad-12322-adfsdf'.

    Hello,
    Is "Observation" a fact table or a dimension? In MDX it is not common to query a "detailed list", mostly you query aggregations; but you can query data from a diminsion. Here is an example for the "AdventureWorks" cube with dimension "Customers":
    SELECT {} ON 0
    { [Customer].[Customer].[Customer]
    * [Customer].[Gender].[Gender]
    * [Customer].[Marital Status].[Marital Status] } ON 1
    FROM $Customer
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for