maximum current of query n6700 stopwatch
I have the N6700 chassis and installing the driver of the IVI for her. I have two different modules in the chassis. Both have the same question. I initialize them, which works very well. I disable the outputs and then apply the maximum voltage level. All these works and good retunrs data. So I try TSE query the current max. I tried with the IVI function and the function of specific driver. The two timeout. I've tried passing 0V, 20V and the release of maximum tension in its input voltage. He dislikes the 0V, the other two options just timeout. I use this same routine to E363x supplies for the querya couple and it works very well on them. Any thoughts on this specific VI does not work why?
Okay, it's the driver again. I won't download all drivers over the Web site of NOR. This is the third bad driver I got on their part. Got the right large Agilents site and it works great.
Tags: NI Hardware
Similar Questions
-
I can parallel two solid state relay ports for a maximum current of 1 AMP USB-6525?
Hello
I plan use USB-6525 to change a PSU 7VDC/1 AMP DC.
USB-6525 having only 500 my maximum current for each channel, I can two parallel ports of relay to solid state for a maximum current of 1 AMP?
Is it safe to use in this way?
If not, is there any other USB device can provide 1 channel AMP relay?
Thank you
Ben
Hi Ben,
Yes you can do this, please refer to the KB, it contains the information you need
Can I use several relay on one device to allow power to pass?
Kind regards
Margasan
-
Maximum current NOR 9280 absolute
I would like to know the absolute maximum current for NI 9208 through AI1-AI15 rods. The operating instructions and the PDF specification claims that the absolute maximum current through the Vsup stems is 2A. The typical input range is from + / 22mA, but what is an absolute maximum. It is clear that NI 9208 is unable to measure currents 22mA superiors, but he is able to withstand it? It will bring a permanent damage or he used?
Hi enter,.
The 22mA is the maximum current that the device can flow. Anything beyond this current may damage the unit.
-
Increase the maximum number of query results
Hello
I need to increase the maximum search results, when I'm looking for data with data-> ValueMaxCount
I'd like to 2000
I tried tho change it with the help of the property page and the example given.
The result looks like this:
Define DataFinder = Navigator.ConnectDataFinder (Navigator.Display.CurrDataFinder.Name)
Set IndexedFileProperties = DataFinder.GetIndexedProperties (eSearchFile)
Set IndexedProperty = IndexedFileProperties ("fileName")
Define ValueList = IndexedProperty.GetValueList
DataFinder.ValueMaxCount = 2000
Define ValueList = IndexedProperty.GetValueListBut the quantity of serach result remains at 200
I am referring to the wrong object or do I need to increase it to a certain point?
Concerning
Janick
Hi Janick,
your script increases the number of values that are returned if you ask for all values that are indexed to a specific property (in the BROWSER QueryForm you will receive this list by clicking the... button to the right of the line a condition).
To increase the maximum number of search results, you would use the MaxCount property for the elements of results.
DataFinder.Results.MaxCount = 2000' in the search without the GUI
or
Navigator.Display.CurrDataFinder.ResultsList.Elements.MaxCount ' in the search with the BROWSER GUI
What version of DIAdem do you use? 2015 tiara, it is also possible to determine the maximum number of search results in the search method:
DataFinder.SearchElements (Query, 2000)
I hope this helps.
Good day
Eva
-
maximum current output module ni9401
Hello, how mA is the current maximum that I can use in the module e/s DIGITAL NI9401?
Thank you
Hi, mariomoskis,
Each digital line on the 9401 is capable of 100 au and sinking 2mA supply, you can find more information in the specifications for the 9401: NI 9401 Manual of Instructions and specifications:
http://digital.NI.com/manuals.nsf/WebSearch/ABFB7FE8BF99B55B862573D0006D5F8B
The 9401 protection against overcurrent, the following excerpt from this manual explains how this works:
"On the NI 9401 overcurrent protection allows only a specified amount of current for the switching of channels DIO or sourcing the output load. If the NI 9401 enters a State of over-current, exceeding the specified maximum switching frequency or the output load, the power supply of the module begins to decline
power until it goes off completely or the overcurrent condition is removed. When the module is in this State, it can accept the new direction of the line
configuration and output data State but can't pass the valid input data for the software. See the features section for more information on the
output and maximum load for each channel switching frequency. »
I hope that helps!
Saludos!
-
Maximum nominal current of the + 5V terminal in PXI-7813R
Hello
I'm a little confused on the maximum nominal current of the + 5V terminal of PXI-7813R in 'NI R Series multifunction RIO specifications '. I understand that there are four connectors for PXI-7813R and each connector has two terminals of 5V +. If I use this + 5V to power my external circuit, what is the maximum current that can be supplied by each terminal?
Thank you
Gwenaëlle
I got your point, in this case I can do separately.
Thank you
Gwenaëlle
-
is that any limits the current entry for the digital I/o?
Hi all
I wonder if there is no limit on the input to the digital I/o port. I have a device about 0.2 volt voltage outputing and the manual says the maximum sink current is 25mA. I connect this signal to a DI entry in my 6711 map. I wonder if the current is too large for the entrance of DI or the PFI?
As we have already mentioned, there is no current flowing on the device in low level mode.
The current specifications mentioned see the maximum current that can be managed by the device in low level mode.
I hope not to confuse you more than necessary. On a row of data to the TTL level, nothing flowing from the device to the main circuit in level mode high current. In low mode, there is flowing in the main circuit in the current device. This current is inherently limited by the circuit.
So, if you have a file specification of 25mA max. of the peripheral device in low level mode, it will never sink too much power from the main circuit. You can connect two devices without any risk. The maximum current is just specified in case you manage more current with the device, a led or a relay for example. In this case, the charge current must be limited, so that you do not damage the device. But - as mentioned - this is NOT the case in your application.
-
Simple stopwatch for façade (resettable)
Hello
I'm relatively new to Labview and programming in general, but I am slowly
Learn the basics and am setting up a test cell engine jet engine monitoring system using a Daytronic System 10 acquisition unit. I'm almost done with the VI that I created (it works, too!), but now I'm developing a simple, real-time clock and stopwatch/use timer running, not in the events of synchronization System , but for the calendar of outdoor events. We currently use a manual stopwatch, but it would be much easier to have something on the screen in front of the motor operator we could click on start/stop and reset. It seems that all the screws included in the vis for synchronization events. Any help would be appreciated!Todd Munsell
Turbine engine Test Cell Tech
Wood Group Pratt & Whitney industrial Turbine Services, LLC
Plattsburgh, NY
-
FRM-40353 - query cancelled on Execute_Query
Hello
I have a simple code - followed go_block ('blk') execute_query;
After running "Execute_query", I get an error message "frm-40353 - cancelled query". "." Why is it so? When I run the select query on the DB table on which rests the block, I can see the documents.
Thank youThis is the description of forms for the Mode of Interaction property using:
Specifies the mode of interaction for the module of the form. Interaction mode dictates how a user can interact with a form during a query.
If the Interaction is set on blocking, then users cannot resize or otherwise interacting with the form until that records for a query are retrieved from the database.
If the value of Non-blocking, then end users can interact with the form while the records are be recovered.
Non-blocking interaction mode is useful if you plan that the query will take a lot of time and you want that the user can interrupt or cancel the request.
In this mode, the runtime of forms will display a dialog box that allows the user to cancel the query.
You cannot set the mode programmatic interaction, however, you can get the interaction by programming mode using the built-in function GET_FORM_PROPERTY.
If you want to leave the Mode of Interaction = Non-blocking (by default),
then comes to Maximum length of query = 0 (default, medium unlimited time) in order to avoid "frm-40353 - cancelled request".
Concerning
-
How to use the api to query / vcloud api to filter records by ID AdminVAppTemplate?
I tried the following REST calls:
Here, I tried to use the href of the vAppTemplate:This means "com.vmware.vcloud.api.rest.parser.QueryParseException: Bad request: href unknown property name.
Here, I tried to use the ID of the vAppTemplate (preferred method):
https://VCD.dDEV/API/query?type=adminVAppTemplate & Filter = ID is urn:vCloud:vapptemplate:ed8aa4df - 64be-454-bis-9acc-48ad25248092the two returned "com.vmware.vcloud.api.rest.parser.QueryParseException: Bad request: name id unknown property.
Here I was filtering by the parent organization (WORKS)
https://VCD.dDEV/API/query?type=adminVAppTemplate & Filter = org is 0913b09e-7f78-4DE0-87cd-99f6cbf3227aAny thoughts on how I can sort by ID? or same href?
Hi jarhorn,
Currently the query Service does not support filtering based on the href or id property, but you can use the entity resolver to help you since you already know that the property ID take a look at this article for more details - http://blogs.vmware.com/vsphere/2012/05/entity-resolver-in-the-vcloud-api.html
FYI - we are aware of this limitation today with the query Service and it will be fixed.
Thank you
-
Current archive log has been deleted, how to recover using the previous archive log?
Hello
My current log sequence #819 and it has been deleted and no other choice to get it back and I have previous newspapers archived with sequences #814 à 818.
When I start my database is to show that the use ' MUST USE RESETLOGS or NORESETLOGS option of database open, then I used the command
SQL > ALTER DATABASE OPEN RESETLOGS;
ALTER DATABASE OPEN RESETLOGS
*
ERROR on line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: ' E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01. DBF'
SQL > alter database recover;
ALTER database recover
*
ERROR on line 1:
ORA-00283: cool cancelled due to errors
ORA-01610: recovery using BACKUP CONTROLFILE option must be
SQL > alter database recovery using backup controlfile;
change the database recovery using backup controlfile
*
ERROR on line 1:
ORA-00279: change 8433746 September at 15/01/2013 19:51:59 needed to screw 1
ORA-00289: suggestion:
E:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2013_01_16\O1_MF_1_819_
% U_. ARC
ORA-00280: change 8433746 thread 1 is in sequence #819
now, I don't have the log archiving with 819 sequence, I recover from 818. Please tell me how to do?Hello
1. select * from v$log and see which log file is current. Query v$logfile to check physical file location belonging to current log group. 2. Take bacup of your curent control file using copy/paste of your OS 3. Issue following command in mount state recover database until cancel using backup controlfile 4. When it finishes applying available archived logs, still it will ask for the location of archived logs which have not been applied, here provide path of current redo log file you got in first step. Here your recovery will finish after applying current redo log 5.alter database open resetlogs.
Salman
-
Hello
I get an error during the calculation of the maximum value, the syntax is less than
<? maximum (current-group () [12 months = 'Y' and NAME = xdoxslt:get_variable($_XDOCTX,_'vname')] / RATE)? >
rate is a numeric field
Can anyone help figure out if the syntax is incorrect?
Thank youUse the function:
Thank you
Bipuser -
Maximum size of uploading files
Hi all
I use ADF 11.1.1.3 and I'm develpoing my application using page fragment.
I entered on the my page fragment component file. And I want my user only add up to certain size file. To this end, I've changed my web.xml but his does not work.
I changed the value of maximum size of 1 also but I'm able o upload file and no warning/error from any idea the same aboyt.
My changes of web.xml
* < context-param > *.
* < param-name > javax.faces.STATE_SAVING_METHOD < / param-name > *.
* < customer param-value > < / param-value > *.
* < / context-param > *.
* < context-param > *.
* <!-maximum memory per query (in bytes) - > *.
* < param-name > oracle.adf.view.faces.UPLOAD_MAX_MEMORY < / param-name > *.
* <!-use 500 K - > *.
* < param-value > 1 < / param-value > *.
* < / context-param > *.
* < context-param > *.
* <! - maximum per application (in bytes) of disk space - > *.
* < param-name > oracle.adf.view.faces.UPLOAD_MAX_DISK_SPACE < / param-name > *.
* <!-use 5 000 K-> *.
* < param-value > 1 < / param-value > *.
* < / context-param > *.
Thank you
ShubhangiThe following parameters must be used
org.apache.myfaces.trinidad.UPLOAD_MAX_MEMORY
org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACEInstead of
oracle.adf.view.faces.UPLOAD_MAX_MEMORY
oracle.adf.view.faces.UPLOAD_MAX_DISK_SPACEPlease check the following post:
For the ADF file download sizeThank you
Nini -
Hierarchical + analysis of query for the parameters of the OU
Hello gurus,
I'm trying for a couple of hours there is a query works as I want.
Our application needs to store settings for our organizational units. These organizational units are generally organized in a hierarchy manner: a high-level unit many units of the child. The settings are stored in another table with 1:1 relationship.
For ease of visualization, here are the data of the organization unit and parameter table in a more visual format:
The application queries the table of parameters to get a parameter value for a given unit.SQL> select * from organization_unit; UNIT_CODE UNIT_NAME PARENT_UNIT_CODE ---------- -------------------- ---------------- 00000 Top level 10 L2 unit #10 00000 10-01 L3 unit #10-01 10 10-02 L3 unit #10-02 10 20 L2 unit #20 00000 20-01 L3 unit #20-01 20 20-02 L3 unit #20-02 20 SQL> select * from org_unit_parameters; UNIT_CODE PARAM1 PARAM2 PARAM3 PARAM4 ---------- -------------------- -------------------- -------------------- -------------------- 00000 Default value Default value Default value {null} 10 {null} Value from 10 Value from 10 {null} 10-01 {null} {null} Value from 10-01 {null} 10-02 {null} {null} {null} Value from 10-02 20 Value from 20 Value from 20 Value from 20 {null} 20-01 {null} Value from 20-01 {null} {null} 20-02 {null} Value from 20-02 {null} {null}
The parameter resolution algorithm is pretty simple: when you query a unit, the applicable parameter is set to the required level. If the parameter is undefined (null) to the required level, the value of the parameter to be returned is defined next in the hierarchy parent. In some rare cases, it can be null if a parameter is not set anywhere from required at the top level.
I made a request that seems to work when querying a unit at a time. It uses hierarchical operators (start by + connect by) with a bit of analytical functions. Here's a test & the raw output example:
Seems pretty good, higher settings are well "propagated" down with the LAST_VALUE function. But, I don't understand why the use of FIRST_VALUE and oppposite command does not give the same result. A little more play with the last query to get the final result of a given unit code:SQL> WITH hierarchy 2 AS 3 ( 4 SELECT ou.unit_code, 5 LEVEL AS lvl 6 FROM organization_unit ou 7 START WITH 8 ou.unit_code = '20-01' 9 CONNECT BY 10 ou.unit_code = PRIOR ou.parent_unit_code 11 ) 12 SELECT h.*, 13 p.param1 AS param1_raw, 14 LAST_VALUE (p.param1 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param1_with_last, 15 FIRST_VALUE(p.param1 IGNORE NULLS) OVER (ORDER BY h.lvl ASC) AS param1_with_first, 16 p.param2 AS param2_raw, 17 LAST_VALUE (p.param2 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param2_with_last, 18 FIRST_VALUE(p.param2 IGNORE NULLS) OVER (ORDER BY h.lvl ASC) AS param2_with_first, 19 p.param3 AS param3_raw, 20 LAST_VALUE (p.param3 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param3_with_last, 21 FIRST_VALUE(p.param3 IGNORE NULLS) OVER (ORDER BY h.lvl ASC) AS param3_with_first, 22 p.param4 AS param4_raw, 23 LAST_VALUE (p.param4 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param4_with_last, 24 FIRST_VALUE(p.param4 IGNORE NULLS) OVER (ORDER BY h.lvl ASC) AS param4_with_first 25 FROM hierarchy h 26 LEFT JOIN org_unit_parameters p 27 ON h.unit_code = p.unit_code 28 ORDER BY h.lvl DESC; UNIT_CODE LVL PARAM1_RAW PARAM1_WITH_LAST PARAM1_WITH_FIRST PARAM2_RAW PARAM2_WITH_LAST PARAM2_WITH_FIRST PARAM3_RAW PARAM3_WITH_LAST PARAM3_WITH_FIRST PARAM4_RAW PARAM4_WITH_LAST PARAM4_WITH_FIRST ---------- ---- -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- 00000 3 Default value Default value Value from 20 Default value Default value Value from 20-01 Default value Default value Value from 20 {null} {null} {null} 20 2 Value from 20 Value from 20 Value from 20 Value from 20 Value from 20 Value from 20-01 Value from 20 Value from 20 Value from 20 {null} {null} {null} 20-01 1 {null} Value from 20 {null} Value from 20-01 Value from 20-01 Value from 20-01 {null} Value from 20 {null} {null} {null} {null}
Works well!SQL> SELECT * 2 FROM 3 ( 4 WITH hierarchy 5 AS 6 ( 7 SELECT ou.unit_code, 8 LEVEL AS lvl 9 FROM organization_unit ou 10 START WITH 11 ou.unit_code = '20-01' 12 CONNECT BY 13 ou.unit_code = PRIOR ou.parent_unit_code 14 ) 15 SELECT h.*, 16 LAST_VALUE (p.param1 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param1, 17 LAST_VALUE (p.param2 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param2, 18 LAST_VALUE (p.param3 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param3, 19 LAST_VALUE (p.param4 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param4 20 FROM hierarchy h 21 LEFT JOIN org_unit_parameters p 22 ON h.unit_code = p.unit_code 23 ORDER BY h.lvl 24 ) 25 WHERE ROWNUM = 1; UNIT_CODE LVL PARAM1 PARAM2 PARAM3 PARAM4 ---------- ---- -------------------- -------------------- -------------------- -------------------- 20-01 1 Value from 20 Value from 20-01 Value from 20 {null}
But my ultimate goal is to create a view that properly solve all these parameters for each level of the organization with the good spread rather in new queries for each unit at once. I played a little, but without success. :( My current gross query is the following:
As you can see, it's not that I was expecting. I know there is something to do with a PARTITION BY clause, but do not know how.SQL> WITH hierarchy 2 AS 3 ( 4 SELECT ou.unit_code, 5 LPAD(' ',2*(LEVEL-1)) || ou.unit_code AS tree, 6 LEVEL AS lvl 7 FROM organization_unit ou 8 START WITH 9 parent_unit_code IS NULL 10 CONNECT BY 11 PRIOR unit_code = parent_unit_code 12 ) 13 SELECT h.*, 14 p.param1 AS param1_raw, 15 LAST_VALUE (p.param1 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param1_with_last, 16 FIRST_VALUE(p.param1 IGNORE NULLS) OVER (ORDER BY h.lvl ASC) AS param1_with_first, 17 p.param2 AS param2_raw, 18 LAST_VALUE (p.param2 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param2_with_last, 19 FIRST_VALUE(p.param2 IGNORE NULLS) OVER (ORDER BY h.lvl ASC) AS param2_with_first, 20 p.param3 AS param3_raw, 21 LAST_VALUE (p.param3 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param3_with_last, 22 FIRST_VALUE(p.param3 IGNORE NULLS) OVER (ORDER BY h.lvl ASC) AS param3_with_first, 23 p.param4 AS param4_raw, 24 LAST_VALUE (p.param4 IGNORE NULLS) OVER (ORDER BY h.lvl DESC) AS param4_with_last, 25 FIRST_VALUE(p.param4 IGNORE NULLS) OVER (ORDER BY h.lvl ASC) AS param4_with_first 26 FROM hierarchy h 27 LEFT JOIN org_unit_parameters p 28 ON h.unit_code = p.unit_code 29 ORDER BY h.unit_code; UNIT_CODE TREE LVL PARAM1_RAW PARAM1_WITH_LAST PARAM1_WITH_FIRST PARAM2_RAW PARAM2_WITH_LAST PARAM2_WITH_FIRST PARAM3_RAW PARAM3_WITH_LAST PARAM3_WITH_FIRST PARAM4_RAW PARAM4_WITH_LAST PARAM4_WITH_FIRST ---------- ---------- ---- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- 00000 00000 1 Default value Default value Default value Default value Default value Default value Default value Default value Default value {null} Value from 10-02 {null} 10 10 2 {null} Value from 20 Default value Value from 10 Value from 10 Default value Value from 10 Value from 10 Default value {null} Value from 10-02 {null} 10-01 10-01 3 {null} {null} Default value {null} Value from 20-02 Default value Value from 10-01 Value from 10-01 Default value {null} Value from 10-02 Value from 10-02 10-02 10-02 3 {null} {null} Default value {null} Value from 20-02 Default value {null} Value from 10-01 Default value Value from 10-02 Value from 10-02 Value from 10-02 20 20 2 Value from 20 Value from 20 Default value Value from 20 Value from 10 Default value Value from 20 Value from 10 Default value {null} Value from 10-02 {null} 20-01 20-01 3 {null} {null} Default value Value from 20-01 Value from 20-02 Default value {null} Value from 10-01 Default value {null} Value from 10-02 Value from 10-02 20-02 20-02 3 {null} {null} Default value Value from 20-02 Value from 20-02 Default value {null} Value from 10-01 Default value {null} Value from 10-02 Value from 10-02
Anyone know how to solve my problem?
Thank you
Bruno
For the purposes of reproducibility, here is the code to create the structure and data:
Here is the format of my paintings and a few samble data:CREATE TABLE organization_unit ( unit_code VARCHAR2(5 CHAR) NOT NULL PRIMARY KEY, unit_name VARCHAR2(100 CHAR) NOT NULL, parent_unit_code VARCHAR2(5 CHAR) ); CREATE TABLE org_unit_parameters ( unit_code VARCHAR2(5 CHAR) NOT NULL PRIMARY KEY, param1 VARCHAR2(100 CHAR), param2 VARCHAR2(100 CHAR), param3 VARCHAR2(100 CHAR), param4 VARCHAR2(100 CHAR) ); -- Inserting data INSERT INTO organization_unit (unit_code, unit_name, parent_unit_code) VALUES ('00000', 'Top level', NULL); INSERT INTO organization_unit (unit_code, unit_name, parent_unit_code) VALUES ('10', 'L2 unit #10', '00000'); INSERT INTO organization_unit (unit_code, unit_name, parent_unit_code) VALUES ('10-01', 'L3 unit #10-01', '10'); INSERT INTO organization_unit (unit_code, unit_name, parent_unit_code) VALUES ('10-02', 'L3 unit #10-02', '10'); INSERT INTO organization_unit (unit_code, unit_name, parent_unit_code) VALUES ('20', 'L2 unit #20', '00000'); INSERT INTO organization_unit (unit_code, unit_name, parent_unit_code) VALUES ('20-01', 'L3 unit #20-01', '20'); INSERT INTO organization_unit (unit_code, unit_name, parent_unit_code) VALUES ('20-02', 'L3 unit #20-02', '20'); INSERT INTO ORG_UNIT_PARAMETERS (unit_code, param1, param2, param3) VALUES ('00000', 'Default value', 'Default value', 'Default value'); INSERT INTO ORG_UNIT_PARAMETERS (unit_code, param2, param3) VALUES ('10', 'Value from 10', 'Value from 10'); INSERT INTO ORG_UNIT_PARAMETERS (unit_code, param3) VALUES ('10-01', 'Value from 10-01'); INSERT INTO ORG_UNIT_PARAMETERS (unit_code, param4) VALUES ('10-02', 'Value from 10-02'); INSERT INTO ORG_UNIT_PARAMETERS (unit_code, param1, param2, param3) VALUES ('20', 'Value from 20', 'Value from 20', 'Value from 20'); INSERT INTO ORG_UNIT_PARAMETERS (unit_code, param2) VALUES ('20-01', 'Value from 20-01'); INSERT INTO ORG_UNIT_PARAMETERS (unit_code, param2) VALUES ('20-02', 'Value from 20-02'); COMMIT;
Hi, Bruno.
You almost had it!
Take your query that gets good results for a single node. Remove the START WITH clause so that it does the same thing for each node. You will need to add CONNECT_BY_ROOT to remember what node you started with in each case and PARTITION BY calling value in all the LAST_VALUE function:WITH hierarchy AS ( SELECT ou.unit_code AS ancestor_unit_code, LEVEL AS lvl, CONNECT_BY_ROOT ou.unit_code AS descendant_unit_code FROM organization_unit ou CONNECT BY ou.unit_code = PRIOR ou.parent_unit_code ) , got_params AS ( SELECT h.descendant_unit_code AS unit_code , h.lvl , LAST_VALUE (p.param1 IGNORE NULLS) OVER ( PARTITION BY h.descendant_unit_code ORDER BY lvl DESC ) AS param1 , LAST_VALUE (p.param2 IGNORE NULLS) OVER ( PARTITION BY h.descendant_unit_code ORDER BY lvl DESC ) AS param2 , LAST_VALUE (p.param3 IGNORE NULLS) OVER ( PARTITION BY h.descendant_unit_code ORDER BY lvl DESC ) AS param3 , LAST_VALUE (p.param4 IGNORE NULLS) OVER ( PARTITION BY h.descendant_unit_code ORDER BY lvl DESC ) AS param4 FROM hierarchy h LEFT OUTER JOIN org_unit_parameters p ON h.ancestor_unit_code = p.unit_code ) SELECT unit_code, param1, param2, param3, param4 FROM got_params WHERE lvl = 1 ;
Output:
NIT_ PARAM1 PARAM2 PARAM3 PARAM4 ----- ---------------- ---------------- ---------------- ---------------- 00000 Default value Default value Default value 10 Default value Value from 10 Value from 10 10-01 Default value Value from 10 Value from 10-01 10-02 Default value Value from 10 Value from 10 Value from 10-02 20 Value from 20 Value from 20 Value from 20 20-01 Value from 20 Value from 20-01 Value from 20 20-02 Value from 20 Value from 20-02 Value from 20
I hope that's what you want. I don't see the exact results you wanted posted anywhere.
Thanks for posting the CREATE TABLE and INSERT statements; It is very useful.
The difference between LAST_VALUE (... DESC) and FIRST_VALUE (... CSA) has to do with the default windowing.
Say that we try to calculate FIRST_VALUE and LAST_VALUE on a line where lvl = 1, and it has 2 and 3 lvls in the same partition.
LAST_VALUE (... ORDER BY DESC lvl) means the window includes lvl = values 1 and all the highest (i.e., 2 and 3).
FRIST_VALUE (...) ORDER BY DESC lvl) means the window includes lvl = 1 and all the values (which, of course, their absence)
It is because the widow of default is BETWEEN UNBOUNDED PREVIOUS AND CURRENT ROW, where "preceding" means lower values if you use ascending order, but higher values if you use descending order. We could use FIRST_VALUE to get the same results, but we will have to explicitly set the window in BETWEEN CURRENT_ROW AND UNBOUNDED FOLLOWING.Published by: Frank Kulash, November 12, 2010 12:46
Additional explanation of LAST_VALUEPublished by: Frank Kulash, November 12, 2010 13:04
Beheading has been corrected. -
Problem with the query result set * STILL a QUESTION *.
Summary
What I am tring to do is to return output to the data points that currently have no values.
* Here it is sample data for reasons explaining my question (my data set is MUCH bigger)
xTable
Desired outputYEAR PEOPLE ITEMS TYPE_NUMBER TYPE_DESC CLASS 2010 1 1 REG 1 2010 2 3 2 MISC 1 2010 5 4 3 WEEK 1 2010 1 REG 2 2010 2 MISC 2 2010 3 WEEK 2 2009 1 1 REG 1 2009 2 3 2 MISC 1 2009 5 4 3 WEEK 1 2009 1 REG 2 2009 2 MISC 2 2009 3 WEEK 2 ... (there's over 100 other unique CLASS values)
Oracle: 10.2 GYR PEOPLE ITEMS TOTAL PEOPLE TOTAL_ITEMS 2010 - - - - -- (Class 2 result set) /* FYI, If i wanted the class 1 result set it would look like this: YR PEOPLE ITEMS TOTAL PEOPLE TOTAL_ITEMS 2010 8 7 16 14 -- (Class 1 result set)*/
Currently, the query above will return no rows.select 2010 as yr, nvl(f.people,'-') as people nvl(f.items,'-') as items nvl(to_char(sum(f.people)),'-') as total_people, nvl(to_char(sum(f.items)),'-') as total_items, from Xtable, (2010 as yr, sum(items)as items sum(people) as people from xTable where person_id = 99999 and type_number in (1,2,3) and year = 2010 and class = 2 or class = 1 ) f where person_id = 99999 and type_number in (1,2,3) and yr = f.yr and (year <= 2010 or year = 2010) and (class = 2 or class = 1) group by f.people, f.items
Published by: user652714 on February 2, 2010 13:04How about this?
SQL> WITH xTable AS 2 ( 3 SELECT 2010 AS YEAR, 1 AS PEOPLE, 0 AS ITEMS, 1 AS TYPE_NUMBER, 'REG' AS TYPE_DESC, 1 AS CLASS FROM DUAL UNION ALL 4 SELECT 2010 AS YEAR, 2 AS PEOPLE, 3 AS ITEMS, 2 AS TYPE_NUMBER, 'MISC' AS TYPE_DESC, 1 AS CLASS FROM DUAL UNION ALL 5 SELECT 2010 AS YEAR, 5 AS PEOPLE, 4 AS ITEMS, 3 AS TYPE_NUMBER, 'WEEK' AS TYPE_DESC, 1 AS CLASS FROM DUAL UNION ALL 6 SELECT 2010 AS YEAR, NULL AS PEOPLE, NULL AS ITEMS, 1 AS TYPE_NUMBER, 'REG' AS TYPE_DESC, 2 AS CLASS FROM DUAL UNION ALL 7 SELECT 2010 AS YEAR, NULL AS PEOPLE, NULL AS ITEMS, 2 AS TYPE_NUMBER, 'MISC' AS TYPE_DESC, 2 AS CLASS FROM DUAL UNION ALL 8 SELECT 2010 AS YEAR, NULL AS PEOPLE, NULL AS ITEMS, 3 AS TYPE_NUMBER, 'WEEK' AS TYPE_DESC, 2 AS CLASS FROM DUAL 9 ) 10 -- END SAMPLE DATA 11 SELECT YEAR 12 , NVL(TO_CHAR(SUM(PEOPLE)),'-') AS PEOPLE 13 , NVL(TO_CHAR(SUM(ITEMS)),'-') AS ITEMS 14 , CLASS 15 FROM xTable 16 WHERE CLASS IN (1,2) 17 AND YEAR = 2010 18 GROUP BY YEAR 19 , CLASS 20 ORDER BY CLASS DESC; YEAR PEOPLE ITEMS CLASS -------------------- ------ ----- ----- 2010 - - 2 2010 8 7 1
Maybe you are looking for
-
My battery life is now up to two hours, which is a problem for my work... How can I get this resolved? My computer laptop 15 "retina is 3 years old.
-
Recent bizarre behavior of Firefox, safe mode doesn't help not, any help is welcome
I have used Firefox for a while now, since Firefox 3, but my browser has recently ben having a very odd behavior. While browsing, Firefox suddenly crashes (work in the background or cursor busy", then"continuous normal navigation". It also has proble
-
Satellite L855 - 13 G - can't adjust the brightness after update Win8
Hello After update of windows 8 and installed the latest AMD driver on the Toshiba site, I cannot adjust the brightness of the screen using the Fn F2 or F3. In this thread: http://forums.computers.toshiba-europe.com/forums/thread.jspa?threadID=69752&
-
I like flat anywhere, if it is the part of their $105 a month toll, which is no hay. So, apparently it won't (easily) doodah with Windows7. Formerly Windows would be with chrome, but Now, it is apparently not available separately since at least my Wi
-
problem with blu ray player playing
My computer has played a blu - ray player before and now it will not. It is said that a program is running that is not compatible with what I want to do. I can't find the program. I downloaded an update, she needed and I was in everything I do. It is