Channels for the identification of the records by using the syntax for Connect By

Hello

Can someone help with the following problem please?

Our database records evaluations of the child for families in difficulty. When get us in touch with them, ideallu:
A child receives a preliminary assessment (evaluation).
If they are deemed to have need for additional support, they are given a second assessment (B) that is triggered by the assessment and an ID of the trigger to identify what assessment he comes.
If they are deemed to need further support, they are given a third evaluation (C) that is triggered by the 2 assessment and an ID of the trigger to show that it comes from the b. assessment
This is also true for a fourth assessment (assessment) report that is triggered by the evaluation C.

However, due to the poor implementation of this concept by our provider database and the lack of knowledge by the workers, we have 2 problems:

(1) analysis has isn't always the starting point as a worker can start any assessment at any time, i.e. from c assessment.

(2) in view of this, a child can have several evaluations of the same type, i.e. a x 3 C, 2 x B assessment assessment in no particular order.

The problem:

I need to identify the separate strings (desired_output) of intervention using the relationship between the registration ID and the ID of the trigger, as shown in the table below:
CHILD_ID RECORD_ID TRIGGER_ID ASM_NAME REC_START_DATE            REC_END_DATE              DESIRED_OUTPUT         
-------- --------- ---------- -------- ------------------------- ------------------------- ---------------------- 
A00001   R297931              B        18-JUN-10                 18-JUN-10                 1                      
A00001   R299381   R297931    C        23-JUN-08                 23-JUN-08                 1                      
A00001   R133219              A        12-AUG-08                 12-AUG-08                 2                      
A00001   R240118              A        30-OCT-09                 30-OCT-09                 3                      
A00001   R604913              A        17-AUG-12                 17-AUG-12                 4                      
A00001   R604943   R604913    B        17-AUG-12                 17-AUG-12                 4                      
A00001   R604961   R604943    C        17-AUG-12                 03-SEP-12                 4                      
A00001   R605195              B        25-AUG-12                 25-AUG-12                 5                      
A00001   R605214              A        28-AUG-12                 28-AUG-12                 6                      
A00001   R609999   R604961    D        03-SEP-12                 05-SEP-12                 4                     
 
Data:
select * from
(select * from
 
(select 'A00001' as child_id, 'R297931' as record_id, null  as trigger_id, 'B' as asm_name, to_date('18-06-2010','dd/mm/yyyy') as rec_start_date, to_date('18-06-2010','dd/mm/yyyy') as rec_end_date, 1 as desired_output from dual) union all
(select 'A00001' as child_id, 'R299381' as record_id, 'R297931' as trigger_id, 'C' as asm_name, to_date('23-06-2008','dd/mm/yyyy') as rec_start_date, to_date('23-06-2008','dd/mm/yyyy') as rec_end_date, 1 as desired_output from dual) union all
(select 'A00001' as child_id, 'R133219' as record_id, null as trigger_id, 'A' as asm_name, to_date('12-08-2008','dd/mm/yyyy') as rec_start_date, to_date('12-08-2008','dd/mm/yyyy') as rec_end_date, 2 as desired_output from dual) union all
(select 'A00001' as child_id, 'R240118' as record_id, null as trigger_id, 'A' as asm_name, to_date('30-10-2009','dd/mm/yyyy') as rec_start_date, to_date('30-10-2009','dd/mm/yyyy') as rec_end_date, 3 as desired_output from dual) union all
(select 'A00001' as child_id, 'R604913' as record_id, null as trigger_id, 'A' as asm_name, to_date('17-08-2012','dd/mm/yyyy') as rec_start_date, to_date('17-08-2012','dd/mm/yyyy') as rec_end_date, 4 as desired_output from dual) union all
(select 'A00001' as child_id, 'R604943' as record_id, 'R604913' as trigger_id, 'B' as asm_name, to_date('17-08-2012','dd/mm/yyyy') as rec_start_date, to_date('17-08-2012','dd/mm/yyyy') as rec_end_date, 4 as desired_output from dual) union all
(select 'A00001' as child_id, 'R604961' as record_id, 'R604943' as trigger_id, 'C' as asm_name, to_date('17-08-2012','dd/mm/yyyy') as rec_start_date, to_date('03-09-2012','dd/mm/yyyy') as rec_end_date, 4 as desired_output from dual) union all
(select 'A00001' as child_id, 'R605195' as record_id, null as trigger_id, 'B' as asm_name, to_date('25-08-2012','dd/mm/yyyy') as rec_start_date, to_date('25-08-2012','dd/mm/yyyy') as rec_end_date, 5 as desired_output from dual) union all
(select 'A00001' as child_id, 'R605214' as record_id, null as trigger_id, 'A' as asm_name, to_date('28-08-2012','dd/mm/yyyy') as rec_start_date, to_date('28-08-2012','dd/mm/yyyy') as rec_end_date, 6 as desired_output from dual) union all
(select 'A00001' as child_id, 'R609999' as record_id, 'R604961' as trigger_id, 'D' as asm_name, to_date('03-09-2012','dd/mm/yyyy') as rec_start_date, to_date('05-09-2012','dd/mm/yyyy') as rec_end_date, 4 as desired_output from dual)) child_records
Originally, I thought to use Oracle Connect By syntax, but it does not (as far as I can work on!) because I have no start condition (the string of assessments can start A or B or C or D) which leads to duplication of lines.

I thought I could use connect_by_root to group common assessments, but I am not convinced that this will give consistent results.

-------------------------
select
child_records.*, 
connect_by_root(nvl(trigger_id,record_id)) chain_id
from child_records
connect by trigger_id = prior record_id
--------------------

Is an alternative, possibly using trigger_id = above lag(record_id,1,null) (child_id order partition of...) but the assessments are in no particular order, I don't think I can specify a command clause...?

Can anyone help to generate the desired output please?

Thank you

TP

Hello

Little Penguin says:
... However, due to the poor implementation of this concept by our provider database and the lack of knowledge by the workers, we have 2 problems:

(1) analysis has isn't always the starting point as a worker can start any assessment at any time, i.e. from c assessment.

(2) in view of this, a child can have several evaluations of the same type, i.e. a x 3 C, 2 x B assessment assessment in no particular order.

This isn't necessarily a bad design. If it really fits your business rules is another matter. But as a means to represent events from cause to effect, to be used to CONNECT BY queries, it makes sense.

The problem:

I need to identify the separate strings (desired_output) of intervention using the relationship between the registration ID and the ID of the trigger, as shown in the table below:

Let me assure you that I understand. You don't really have an desired_output column; you will need to that derived from other columns. Right?

CHILD_ID RECORD_ID TRIGGER_ID ASM_NAME REC_START_DATE            REC_END_DATE              DESIRED_OUTPUT
-------- --------- ---------- -------- ------------------------- ------------------------- ----------------------
A00001   R297931              B        18-JUN-10                 18-JUN-10                 1
A00001   R299381   R297931    C        23-JUN-08                 23-JUN-08                 1
A00001   R133219              A        12-AUG-08                 12-AUG-08                 2
A00001   R240118              A        30-OCT-09                 30-OCT-09                 3
A00001   R604913              A        17-AUG-12                 17-AUG-12                 4
A00001   R604943   R604913    B        17-AUG-12                 17-AUG-12                 4
A00001   R604961   R604943    C        17-AUG-12                 03-SEP-12                 4
A00001   R605195              B        25-AUG-12                 25-AUG-12                 5
A00001   R605214              A        28-AUG-12                 28-AUG-12                 6
A00001   R609999   R604961    D        03-SEP-12                 05-SEP-12                 4                     

Data:...

Thanks for the display of the data of the sample; that really helps.

Originally, I thought to use Oracle Connect By syntax, but it does not (as far as I can work on!) because I have no start condition (the string of assessments can start A or B or C or D) which leads to duplication of lines.

Is not

START WITH  trigger_id  IS NULL

identify a starting point? If something has not been triggered by something else, it is not a starting point? It is actually quite common in the hierarchical tables.

I thought I could use connect_by_root to group common assessments, but I am not convinced that this will give consistent results.

I'm not sure that you understand the problem. What do you mean by "consistent results? The doubt that you are worried, what exactly?

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

select
child_records.*,
connect_by_root(nvl(trigger_id,record_id)) chain_id
from child_records
connect by trigger_id = prior record_id

You got right. If I understand what you mean by consistent results, it will bring them. You want to START to condition, of course, and as the starting lines will never have a trigger_id, there is no need to tell

CONNECT_BY_ROOT  NVL (trigger_id, record_id)   AS chain_id

You can simply say

CONNECT_BY_ROOT  record_id   AS chain_id

This will be particularly well idnetify the strings of their record_ids. Looks like you want to assign new sequence numbers (1, 2, 3,...) to identify the channels. Which takes an extra step.

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

Is an alternative, possibly using trigger_id = above lag(record_id,1,null) (child_id order partition of...) but the assessments are in no particular order, I don't think I can specify a command clause...?

Right; LAG depends on the order and order tells us nothing to this problem.
In fact, feeds means so little to this problem that an event can come before the event that triggered it.
For example, if I understand the first two lines of your output

CHILD_ID RECORD_ID TRIGGER_ID ASM_NAME REC_START_DATE            REC_END_DATE              DESIRED_OUTPUT
-------- --------- ---------- -------- ------------------------- ------------------------- ----------------------
A00001   R297931              B        18-JUN-10                 18-JUN-10                 1
A00001   R299381   R297931    C        23-JUN-08                 23-JUN-08                 1                      

C event was triggered by the event B, even if C took place two years before B.
(Not that it is important for the SQL problem, but can you explain the logic of how events can come before or after the events that triggered them?) "I'm just curious.)

Here's a way you can assign sequential numbers to identify the channels:

WITH     got_d_num     AS
(
     SELECT     c.*
     ,     ROW_NUMBER () OVER ( PARTITION BY  child_id     -- Just guessing
                               ORDER BY          NVL2 ( trigger_id
                                              , 2     -- rows with trigger_ids come 2nd
                                   , 1     -- rows without come 1st
                                   )
                         ,             rec_start_date
                         ,             asm_name
                       )      AS d_num
     FROM    child_records  c
)
SELECT     child_id, record_id, trigger_id, asm_name, rec_start_date, rec_end_date
,     desired_output               -- if needed
,     CONNECT_BY_ROOT d_num     AS chain_num
FROM     got_d_num
START WITH     trigger_id     IS NULL
CONNECT BY     trigger_id     = PRIOR record_id
ORDER BY  child_id
,            rec_start_date
,       asm_name
;

Output:

`                                              DESIRED
CHILD_ RECORD_ TRIGGER A REC_START REC_END_D   _OUTPUT  CHAIN_NUM
------ ------- ------- - --------- --------- --------- ----------
A00001 R299381 R297931 C 23-JUN-08 23-JUN-08         1          3
A00001 R133219         A 12-AUG-08 12-AUG-08         2          1
A00001 R240118         A 30-OCT-09 30-OCT-09         3          2
A00001 R297931         B 18-JUN-10 18-JUN-10         1          3
A00001 R604913         A 17-AUG-12 17-AUG-12         4          4
A00001 R604943 R604913 B 17-AUG-12 17-AUG-12         4          4
A00001 R604961 R604943 C 17-AUG-12 03-SEP-12         4          4
A00001 R605195         B 25-AUG-12 25-AUG-12         5          5
A00001 R605214         A 28-AUG-12 28-AUG-12         6          6
A00001 R609999 R604961 D 03-SEP-12 05-SEP-12         4          4

This example uses rec_start to affect chain_num and also sort the output, but not to determine wht in a string. The first 3 events untrigered (in rec_start order) have been in August 2008, October 2009 and June 2010, while they were assigned chain_nums 1, 2 and 3, in that order. Antyhting that was triggered by them, directly or indirectly, gets the same chain_num if it happened before or after the starting point of the chain. Thus, the first line of the output, in June 2008, gets chain_num = 3. You have assigned desired_output = 1 on this line. If you can explain how you got the number 1, we can probably find a way to code, so that the calculated chain_num is identical to desired_num. In the above query, they are not the same, but they are related. Everywhere you specified desired_output = 1, the above query produces chain_num = 3. If the numbers are the same (for example desired_output = 4 = chain_num) it's just a coincidence.

Note that when I used ROW_NUMBER, I did in a subquery, not in the main query where the CONNECT BY were made. Never use the analytical functions (for example, ROW_NUMBER) in the same query with CONNECT BY. The analytical functions are often the cause CONNECT BY conditions to be incorrectly evuated. I have never seen any literature on this subject and it doesn't always happen, but I suggest that you avoid to mix everything well.

Published by: Frank Kulash, Sep 15, 2012 10:00

Published by: Frank Kulash, Sep 15, 2012 10:44

I just read the answer from John, who has a nice illustration of my last point: use of the separate petitions for both analytical and CONNECT BY. You can use the analytic function first, and then CONNECT BY, as I did, or you can do the first CONNECT BY and then use the analytic function (in a solution of John DENSE_RANK) later. Whatever it is, you must separate them.

Tags: Database

Similar Questions

  • Set the scale of thermocouple at table for a channel in the task

    I create a task that contains 9 measures voltage and 10 by thermocouple programmatically. All the thermocouples are of Type T. I just want to read one of the thermocouples up to the limit of 30 k. NOR for the Type T is 73 K.

    I understand that the lira below their limit thermocouples OR is to change the scale type to table using a property DAQmx Channel node. However, because I take different types of measures, I need to isolate the channel particularly thermocouple. If I move the entire task to the node property DAQmx channel and try to set the scale of the type of thermocouple to table, I get an error because the voltage channels do not support this property. I can't understand how to get individually on channels of the task. I don't want to separate the measures into two tasks, because then I have to do to synchronize the clocks of additional programming.

    I have more than one idea: use a DAQmx create task VI at the beginning. Do a global virtual channel to MAX for the thermocouple that I want to change the type of ladder for. Place a constant for this virtual channel and run through the DAQmx Channel property. Use the task of creating DAQmx to create a task containing this global virtual channel. Pass this task to a bunch of DAQmx create Virtual Channel screws to add other measures to the task.

    This makes a lot of the scalability of my program and seems to be the wrong shape in general. Looks like there should be an easier way to do it. Any ideas? Thank you!

    Hello

    Try to use the property node of channel Active channels (ActiveChans) that is by specifying the string "isolated" as its input, and then adding the (HAVE. Themcpl.ScaleType) in developing the property node even by setting its entry. The property node Active channels specifies a list of virtual to change channels or virtual channel. Virtual channels are in a specific job. NOR-DAQmx configure all channels in the task if you do not set this property

    Best regards

    M Ali

    Technical sales engineer

    National Instruments

  • Definition of various mitigating factors for each channel on the virtual bench MSO

    I'm trying to measure two very different signals, using both channels of the 8012 virtual bench programmed in LabView. The signals are very different amplitudes, which means that the definition of the vertical range for the largest signal is not truncated causes the smallest signal to become very agitated that the resolution today is very low. The only way I know to use two channels simultaneously is to index the waveforms with channel number when the measurement is complete. This means that both channels of parameters are defined at the same time by the same command sequence. Is it possible to set separate settings for each channel during intialize?

    I enclose my referral program that there is much more than just this part. If someone need clarifications just ask!

    Thanks in advance!

    Kai

    I thought about it. If anyone runs into this problem let me know and I can show you how I did it

  • How to get the physical channel for USB card as ENET

    Hello

    For my application (VB .NET, using NIDAQmx 8.8), I need to access the 2 cards:

    a USB-6008 and an ENET9163.

    I would like to read the physical channels automatically with this feature NI-DAQmx

    Physicalchannel1ComboBox.items.AddRange (DaqSystem.Local.GetPhysicalChannels (PhysicalChannelTypes.AI, PhysicalChannelAccess.External))

    Unfortunately, he didn't get a single card at once.

    When the USB card is connected, he read the physical channels of the USB card

    When the USB adapter is not plugged in, it read the physical channels of the ENET card.

    I hope someone can help me with this problem!

    Thank you

    RB

    Hello RB.

    To read from multiple channels, you can enter in the drop-down list box "Physical channel", the comma separated channels, custom channels or if you read physics, the string "DevX/Benjamin: Z", where X is the number of device, and X and are the first and the last channel you want to analyze (for example to read to ai0 to ai4 from your device 1 enter "Dev1 / ai0:4"). Among the names of your channels, I guess they are global channels created in MAX? You can always read channels multiple and different advice by separating the comma.

    I hope this helps!

    Kind regards

  • Change the channel for Virtual Wifi Miniport Adapter

    Hello!

    I was experiencing problems of interference when using the module of Virtual wifi miniport, and I would like to know if there is any way I can change the channel on the v-wifi is bradcasting?

    THX!

    Lee

    Well, I tried to find the latest driver for my card, I could find anything to the atheros website (what gives?).

    Win 7 told me I got the latest driver, but I wouldn't trust windows update, as they said that my ethernet card was up-to-date (see 7.04) and when I went on the Realtek site, driver to v.7.23...

    Anywho! I was not able to change the channel for the ad - hoc connection. I tried the connection with a PC and still cannot connect (so not a problem related to Mac).

    I don't know what is happening with the miniport module or the wireless card (I tried different settings in properties and the Advanced Options tab, as power management), but it just would not work. So I got this router, and everything works fine.

    This is!

  • Library meets live TV with the error: "there are currently no TV signal detected for this channel. The channel may be temporarily off the air. »

    I recently changed my TV card to an analogue of Hauppauge PVR150 at a Hauppauge DVB - S Nova S more. Media Center has worked well before.

    Media Library will recognize the new card, search and branch on 239 satellite channels, but may not display the channels giving the error message "there is currently no TV signal detected for this channel. The channel may be temporarily off the air. »

    I have installed WinTV 7 and that you can view all the channels very well in this program so obviously the map and the intensity of the signal are not the problem.

    In my quest through other forums, I heard problems re codec: mpeg2 and we tried several packs of codecs (including shark007) but with no improvement.

    My last move was to uninstall Media Center, uninstall all codec packs, uninstall the TV card and drivers, then reinstall the media library and the TV card and am still unable to view TV channels.

    Suggestions have greatly accepted.

    I've searched the Internet high and low for a solution to this problem and can lead to nothing more than what is proposed here by Divya.

    The problem seems to be fairly common and seems to be associated with codec. Most of the solutions I've come across related to the installation of media center alternatives and after several tries I finally opted for new version of Media Portal 1.1.0 beta

    Installed without a hitch and so far the interface is similar to the media library but has better customization and the ability to incorporate plug-ins.

    I did try the latest version (1.0.2) of the media portal, but said she had a few problems of stability (probably related to the W7 compatibility).

    Very happy now with Media Portal 1.1.0 Beta so will not need any other solution to this problem.

  • Changing channels of the hotspot wifi for your laptop

    Mr President.

    Sir I have transformed my cell phone as a wifi hotspot, success, but I can change the channels of this wifi signals? and if I can, then how?

    Hi Kunal,

    Ideally, the Wi - Fi channels are changed for the router in router configuration page.  It is not possible to change the channel of Wi - Fi if you connect using Hotspot. If you want to change the channel for hotspot Wi - Fi connection, then you can download and install the third-party software is available online.

    Note: using third-party software or a link, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third party software or link can be resolved. Using third-party software or a link is at your own risk.

    Please refer to the article for the wireless network profile management:

    http://Windows.Microsoft.com/en-us/Windows-8/manage-wireless-network-profiles

    It will be useful. If you have additional questions on the computer, please ask your question about Windows and we will be happy to help you.

  • no channels for audio or video in the timeline

    I use a mac and on my calendar, there is no channels for audio or video, for example, V1, V2 etc, and I can't drag videos or images on the timeline. How to rectify this please?

    I suspect that you might not have created a sequence, or it loaded in your editing panel.

    Do you have?

  • Several channels with the launch of unique digital dashboard

    I have a simple vi where the two analog channels is read in and stored simultaneously in a file of lvm and plotted on a graph of a waveform. I need a numerical advantage to post trigger data for both channels.

    I can get this vi to work with one analog channel and the onset of digital edge very well.

    When I remove the digital edge trigger, I can get the vi to work with two analog channels. The two signals of ground on a waveform graph and record nicely in the file of lvm.

    The question is how do I set up the digital triggering (see table).  The program never enters the while loop. Where I'm going wrong?

    Chassis: cDAQ-9172

    Analog card: NI 9205 (Source PFI0 the shutter button)

    LabView: 8.6

    OS: Windows XP


  • reading of multiple channels on the oscilloscope

    Hey there everyone,

    First of all, thank you for taking the time to read this. I'm still relatively new to LabVIEW, but I read most of the bases.

    How is this issue work VISA.

    I have an oscilloscope which has sensors to 3 channels and I want to display 3 channels on the same graph. The example of VI, which is included with the driver allows me to access a channel however it also adds other features, such as the control device that I didn't need, I just want to read data from the oscilloscope.

    I will not be able to access the gear for a few days, but have started coding. Here's what I've coded so far.

    The first blue function is 'Reading of Array wave' and the second 'wave in table scale ".

    Am I allowed to access the VISA like this? Or is it illegal access that would cause problems?

    I tried to access several channels before, so I was in the laboratory, however they have always produced errors.

    I use an oscilloscope tektronix TDS2013C, Labview 2013 and that you have downloaded the driver concerned for my model.

    All relative links to learning tools or help would be greatly appreciated!

    -Nam

    Please read the manual on a reading and extraction.

    As I said, the reading will launch a new capture. When you call it 3 times, each record returned will be later time than the previous capture. Either do what I said or call an extraction 3 times now.

  • Several passwords for pop account are lost and the remote DESKTOP connections is no longer have registered credentials after logging out of the laptop to the domain and rebooted.

    Original title: passwords lost after reboot

    I have a user with multiple pop accounts and multiple rdp servers to which it connects

    When the laptop is connected to the domain he is allowed to save the credentials of rdp as usual and also its pop accounts work fine

    If the laptop is removed from the dock and hibernating come off hibernation works very well

    the problem starts when it restarts in fact the laptop when it is on the road.

    When he goes in outlook passwords for pop account are lost and all its Remote Desktop connections is no longer have recorded identification information

    his outlook passwords will save is no longer and rdp connections will save is no longer

    Once he returned to the office and connects back to the field all his pop account passwords are restored, the credentials of the rdp remain missing, but it can re - save them

    any ideas where to look for problem

    I also noticed inot laptopn with another user and will not experience the issue

    Hi, Robert Allen,.

    Thanks for posting your question in the Microsoft Community Forum.

    According to the description, you have a user facing problems with multiple pop accounts and rdp credentials when the connection / disconnection of a domain.

    Since the problem is associated with multiple pop accounts and rdp credentials when the connection / disconnection of a domain, the question you posted would be better suited for the IT Pro on TechNet public. I would recommend posting your query in the TechNet Forums to get help:

    Windows 7 networking TechNet Forums

    It will be useful.

    Let us know if you need help with Windows related issues. We will be happy to help you.

  • measure with the two channels of the virtual bench simultaneously in labview, error 375903

    Hi, I am trying two measurements simultaneously using two channels of analog input of the virtual bench. I chose the channel MSO 1 and 2 for the measures but I get error 375903 returned evewry time say the requested resource is reserved. I'm not under any other software which should use the virtual bench. The error occurs when I'm initializing the session, even before a measurement was made. Can someone tell me how to call each channel so that I don't get this conflict of resource reservation?

    I have included the VI and a screenshot of the error.

    Thank you!

    NGKai wrote:

    Hi, I am trying two measurements simultaneously using two channels of analog input of the virtual bench. I chose the channel MSO 1 and 2 for the measures but I get error 375903 returned evewry time say the requested resource is reserved. I'm not under any other software which should use the virtual bench. The error occurs when I'm initializing the session, even before a measurement was made. Can someone tell me how to call each channel so that I don't get this conflict of resource reservation?

    ASM takes only supported a session unique instrument and your VI uses two. To use both channels, delete the second session MSO and specify channels in the MSO configure Analog Channel.vi

    Here's an example that uses two channels brought:

    VirtualBench: Bode Analyzer with the FGEN and MSO

    http://www.NI.com/example/52076/en/

  • ArraytoChannels error 'cannot be added because the channels of the target are not all the same length.

    Hello!

    After the end of my second day of test error, I put this question on the table:

    I use ArraytoChannels function to store ADO recordsets as strings. What is strange, is that for the first Recordset, it works; but for the next time through the loop, it always fails with the error message 'cannot be added because the channels of the target are not all the same length.

    I confirmed that:

    the RowData sizes and the ChannelNames are equal,

    both spend the isarray = true test,

    I change the order of the ChannelNames,.

    I have reconnected/disconnected from the oConnexion every time, nothing has changed.

    Apparently I'm missing something - but crazy to know what! -If anyone can share his opinion I'll so much appriciate. Here is my code:

    oTables = Array ("WellStates", "ChokeData", "WellParameters", "FlowData", "PumpData", "SensorsData", "ModelCalculatedData")

    Call OpenSQLConnection
    Set oRecordset = CreateObject ("ADODB. Recordset')
    Call SelectWell
    Call GetWellStateIDs

    Data.Root.Clear
    for j = 0 to ubound(oTables,1)

    sSQLSting = "select * []" & oTables (j) & "] where [WellStateID] between" & WellStateIDFirst & "and" & WellStateIDLast ".
    oRecordset.Open sSQLSting, oConnexion
    Protected oFieldNames: table: ReDim oFieldNames (orecordset. Fields.Count - 1).
    for i = 0 to orecordset. Fields.Count - 1
    oFieldNames (i) = orecordset. Fields.Item (i) .name
    next
    oArray = oRecordset.GetRows (-1, 0, oFieldNames)
    Set oGroup = Data .root .ChannelGroups .Add (oTables (j))

    oArray, oFieldNames arraytochannels
    oRecordset.close
    oConnection.Close
    next

    Sub GetWellStateIDs
    sSQLSting = "select * from [WellStates] where [wellid] =" & WellID
    oRecordset.Open sSQLSting, oConnexion
    oArray = oRecordset.GetRows)
    WellStateIDFirst = oArray (0,0)
    WellStateIDLast = oArray (0, ubound(oArray,2))
    oRecordset.close
    EndSub

    Sub OpenSQLConnection
    Set WshNetwork = CreateObject
    oComputerName = WshNetwork.ComputerName
    oDB = "MX2. Player.DB ".
    Set oConnexion = CreateObject ("ADODB. Connection")
    oProvider = "Provider = SQLOLEDB.1; Integrated Security = SSPI; PeoExecuteist Security Info = True; Data Source ='
    oProvider = oProvider & oComputerName & "\MX; Use procedure for prepare = 1; Machine translation = True; The packet size = 4096; Workstation ID ="
    oProvider = oProvider & oComputerName & " Use encryption for data = False; Tag with column collation when possible = False; Initial Catalog ='
    oProvider = oProvider & oDB
    oConnection.ConnectionString = oProvider
    oConnection.Open
    EndSub

    Another clue. If you check using DIAdem

    Microsoft Windows Script Debugger

    you are able to install the debugger in DIAdem.

    It would potentially have shown that the command does not work as expected.

    Sorry for the inconveniance

    Andreas

  • Configuration of the individual channels on the PXI-4472 b

    Hi, I use the card PXI-4472 b to acquire data of vibration using sensors with different frequency ranges. The problem I have is that some of the transducers require being fed by the jury (via IEPE) and some don't and I can't find a way to turn the excitement on and off for individual channels, only each other.

    I am using LabVIEW 8.6 and that you have configured all channels using the nodes property to activate the excitement and specify the current, but not all channels require that.

    It says clearly in the data sheet of the map of 4472 channels are individually configurable for the IEPE, can someone please tell me how to proceed?

    Thanks in advance,

    Darren.

    Howdy Darren,

    Please see the following screenshot that illustrates how to set different values for different channels of IEPE all in a single task using DAQmx. The key point here is the property of ActiveChans. Otherwise, as you know, 3GEF55NQ knowledge base: How can I activate IEPE excitement on my DSA in DAQmx device? would do the trick.

    I hope this helps!

  • Can I use USRP 2 channels at the same time to receive a signal?

    Hello world

    I want to do an implementation of the time difference of arrival between two receivers (antenna) estimate. I have a kit USRP, Remora and two antennas. There is only one signal source (it is transmitted in nowhere is not serious).

    Can I use two channels at the same time the USRP to receive a signal?

    I need the original source signal and the delayed signal version.

    Thanks a lot for your help.

    Sincerely yours.

    Uysal.

    Hello

    I found this post on the forum that can be useful for you.  Looks like you can not receive two antennas in the way you describe.  I think that this would require a configuration USRP two.

  • samples per channel and the number of samples per channel

    in my DAQ mode samples finished program, there are two screws: timing and read.vi DAQmx DAQmx.

    I have to set the parameter to "samples per channel" DAQmx timing.vi and 'number of samples per channel' on DAQmx read.vi... Is there a relationship between these two?

    My laser runs at 1 K Hz. I want to go to the wavelength, wait for a number of shooting lasers, read the data and move on to the next page...

    Thank you

    Lei

    In your case, the VI will acquire the lesser of either:

    The "samples per channel" that you have defined on the timing DAQmx VI

    -OR-

    The number of iterations of your for loop (N) times the 'number of samples per channel"that you have defined on the DAQmx read VI

    The "samples per Channel" VI DAQmx of timing for a finite acquisition dictates how many samples the DAQ hardware should acquire in it's onboard buffer before indicating that the acquisition is complete.  "The number of samples per Channel" on the read DAQmx VI dictates how many samples the DAQmx driver must return buffer on board the aircraft to your application.

    Let's say the "samples per channel" on the calendar DAQmx VI is set to 50.  Thus, the card will acquire 50 samples and place them in the edge of the buffer, then stops.  Suppose we have the 'number of samples per Channel"on the DAQmx reading VI the value 3 and what we call the VI in a loop For which runs 10 times.  Thus, every time the DAQmx lu VI is called, it will wait until there are at least 3 samples in the buffer, and then return these three.  We call the VI a total of 10 times, then we will answer 30 total samples.  Thus, the last 20 samples acquired the card remains in the buffer and are destroyed when the task is disabled.

    Now let's say that we increase the "number of samples per Channel" on our DAQmx Read VI at 10.  VI Read will wait until 10 or more samples are in the buffer, and then return these 10. Thus, we will be back all 50 samples map acquired by the 5th iteration of the loop For.  The 6th time we call him VI DAQmx Read it expires, because there will never be another 10 samples in the buffer, and the VI returns a warning.

    This clarifies things?

    The purpose of this behavior is to allow you to both set the total number of samples that the DAQ hardware will acquire and also control how much of these samples is returned whenever you call the DAQmx Read VI.

    Kind regards

Maybe you are looking for