Dates to be generated in a sequence
HelloA date as to_Date('05-june-2012') should be geneerate a sequence of dates with the gap between the date to 15 days. If a number of 5, then we must generate 5 dates in the order with an interval of 15 days.
The output can be like that
05-june-2012
20-june-2012
05-july-2012
30-july-2012
14-aug-2012
29-aug-2012
Hello
One way is:
SELECT DATE '2012-06-05' -- Starting date
+ ((LEVEL - 1) * 15) AS a_date
FROM dual
CONNECT BY LEVEL <= 6 -- Number of dates to show
;
Tags: Database
Similar Questions
-
Generate a binary sequence with the NI USB-6008
Hi all
I'm new to LabView and I am trying to generate a binary sequence with a box NI USB-6008. The sequence, I'm currently generate is a counter of 5 bits, i.e. 00000 00001 00010, 00011... 11110, 11111 placing each bit in a different digital IO of the of the 6008 NOR, so that I can use the County as the bits of selection in a decoder/demux.
I managed to simulate the binary sequence and produce a graphical interface, but I have not found how to generate the sequence of bits with the NI 6008.
Totally, I'd appreciate any help you could provide. Thank you very much.
Hi JosephM,
Good Afternooon and I hope your well today.
I just tested the code on a 6008 and also released the above code is very complex - I was for some reason any fixed on using Boolean tables.
Please see the attached code, in LabVIEW 8.6.
Mind you, I have configured the task as a channel for all lines. i.e. digital single I spent, is the task value should apply to all channels selected in the entry. So if you select only port0/Dev8/$line0 for example, the DAQmx driver will examine the LSB of the digital and work so $line0 must be true from the false. It will NOT update all other channels. So when I select line0:4 - it will update the first 5 lines (bits) in digital. As the code generates a number from 0-32 he emotional generates 00000 to 11111.
I hope this finds you well and sorry for the first post!
-
Generate a unique sequence number
Hello
I need generate a unique sequence number. I use Oracle 11.2, here are the details. The idSeq column is specific idType a unique interior. I don't want a sequence for each idType.
create table tb_test (idSeq number (5), number (5) idType, addr varchar2 (256));
insert into tb_test
(to select when idSeq is null then 1 another max (idSeq) + 1 end, 3, "Main street");
I have an ORA-00937: not a single-group function error, any suggestion?
Published by: 939569 on February 13, 2013 11:21Hello
939569 wrote:
HelloI need generate a unique sequence number.
Explain what you're trying to do, and why won't a sequence.
I use Oracle 11.2, here are the details. The idSeq column is specific idType a unique interior. I don't want a sequence for each idType.
create table tb_test (idSeq number (5), number (5) idType, addr varchar2 (256));
insert into tb_test
(to select when idSeq is null then 1 another max (idSeq) + 1 end, 3, "Main street");I have an ORA-00937: not an error of a single group group function,
Right. Given that the subquery uses an aggregate function (MAX), all in the SELECT clause must be an aggregate, a group of expression, a constant, or something that is entirely up to them. In this example, the CASE expression depends on idSeq, which is not an aggregate, not a group by expression (there is no GROUP BY clause) and not a constant.
In addition, the subquery must have a FROM clause. All queries and subqueries in Oracle require a FROM clause.
any suggestion?
Use a sequence. The numbers are not consecutive in each idType, but matter? Chances are, no matter what you do, you will not be able to maintain consecutive numbers within each idType anyway.
If you do not use a sequence, then you can try:
INSERT INTO tb_test (idSeq, idType, addr) SELECT 1 + NVL ( MAX (id_seq) , 0 ) , 3 , 'Main street; FROM tb_test WHERE idType = 3 ;
-
generate a different sequence for 32 different warehouse...!
We have around 32 different warehouse where the materials are stored...
I need to design a form that I generates a different sequence number for the materials stored in 32 different articles home
ex
can someone help me with this :)name:suhail pwd:123 warehouse: America Now after i login i want to generate a sequene number only for america's ware house say 21001 name:ANDREAS pwd:345 warehouse:France for this user the sequence number generted should be different say some thing like 31001
Published by: Chase Suhail on October 2, 2010 22:37I still prefer to use a "real" sequence Lets assume that your seuqneces are appointed as SEQUENCE_
. Create a stored procedure in the database, as
FUNCTION FK_SEQUENCE_FOR_WAREHOUSE(i_vcWarehouseCode IN VARCHAR2) RETURN NUMBER IS nId NUMBER; BEGIN EXECUTE IMMEDIATE 'SELECT SEQUENCE_'||i_vcWarehouseCode||'.NEXTVAL FROM DUAL' INTO nId; RETURN nId; END;
-
generate the debug sequence diagrams in JDev 11.1.1.2.0
Hi I'm new to JDeveloper.
How can you generate diagrams of sequence of the debugger? I did some googling pointing me to "Debug with diagram" but I don't see any diagram. I looked at this demo: http://www.oracle.com/technology/products/jdev/101/viewlets/101/sequencemodelerdebugging_viewlet_swf.html
After the demo, I also created a file of sequence diagram, but I can't find an option "Connect to Debugger", and the demo used Jdeveloper 10 g. But mine is 11.1.1.2.0.
The secrets I should know? Thank you!It turns out that the feature has been removed in this version of JDeveloper. (we forgot to remove the menu option well - I'm this bug).
For the record can you tell us what exactly you were designed to do?
Are you interested in generating a sequence for a specific method diagram? or you really interested in creating a diagram to get the procedure specific debugging? -
Transfer data from DoPreUUT to the main sequence
Hi all, I am working on editing a sequential model existing in NI TestStand.
In PreUUT do that I just wanted to have mu, own VI Custom which will require a path and once the path is selected, the VI will extract 2D Array of string values that I have to move my hand Sequence.I am facing a question of transfer data from table 2D-doPreUUT to mu from the main sequence.
http://forums.NI.com/T5/NI-TestStand/pass-parameters-from-PreUUT-to-main-SEQ/m-p/2850684#
who says the best way is to use the globals file, but I'm not able to get my values transferred to my main sequence.
Need help to solve...
Thanks in advance
If you are adding a FileGlobal to Test DUT and expecting to access this variable in your file of the client's sequence, you will not be able to read the FileGlobal directly. You will need to use the "RunState.Root.FileGlobals" string... »
for example if you have an array of strings FileGlobals.MyDataPaths you MainSequence, you can access using RunState.Root.FileGlobals.MyDataPaths of MyDataPaths.
Remember that this will only be available when you use the process model, therefore, it would be wise to test that you run with the process template.
Hope this helps
-
Data delay FlexRio (generate i/o of delay)
Hello
I use SMU-7961R + module NI 6583. I want to implement a synchronous digital communication IPs and I need control the master data of the clock delay.
To contact a master external IP address, I use the struc timed loop with a clock source the strobe line where I connect the singal clock. The result is satisfactory: each master clock climbing aboard, data are generated with a specific constant delay.
I have to control the delay (in the loop of the single clock cycle). This delay does not exceed 1 master clock cycle.
In this case, the best is to include the buffers in the i/o path to the longest path... How can I implement this in LV FPGA...
Note: Master clock isn't contineous.
Thank you.
Kay.
Hi Marjorie,.
Unfortunately, the maximum number of cuts will limit the total range of 5ns max, however 5ns is a period of clock at that point, you should be able to delay your data in the SCTL in LV FPGA.
With respect to the generation on the falling edge, you have two options.
The first can be done in LV FPGA but it's a little hard to explain. To build on the falling edge, we would first put the module in double data rate mode. Then, it will generate over and fronts. In order not to change the samples on the front, on the rising output must match the value of dashboard falling from the previous iteration of clock.
For example, suppose you wanted the following values in the output order: T, F, F, t. you have to give a value for the rising and falling each iteration of the SCTL edge.
Iteration 1:
Rising - F
Fall - T
Iteration 2:
Rising t
F down
Iteration 3:
Rising - F
Fall - F
Iteration 4:
Rising - F
Fall t
The one caveat to this approach is that you could generate only at 150 MHz DDR max of 300 MB/s.
Another approach would be to reverse the polarity of the strobe in the CLIP 6583. This would require a VHDL work but definitely would make the LV FPGA implementation somewhat easier. Reverse the strobe clock in VHDL would also allow the refresh rate of 200 MHz.
I hope this helps!
-
Generate a new sequence of query result
Hello
There are certain values of the sequence stored in the table below, I need to update with the values in the correct order, please help to suggest how can I achieve this.
Data source
ID sequence 123 34 123 35 12 s 1 12 s 2 12 s 3 673 13 673 16 673 20 Expected results
ID sequence 123 1 123 2 12 s 1 12 s 2 12 s 3 673 1 673 2 673 3 Kind regards
Germain
Analytical use ROW_NUMBER:
SELECT id,
ROW_NUMBER() over (partition by order of the identification of the sequence) sequence
from your_table
/For example:
with data_sample like)
Select the id 123, sequence 34 Union double all the
Select 123,35 Union double all the
Select 321,1 Union double all the
Select 321,2 Union double all the
Select 321,3 Union double all the
Select 673,13 from all the double union
Select 673,16 from all the double union
Select double 673,20
)
SELECT id,
ROW_NUMBER() over (partition by order of the identification of the sequence) sequence
of data_sample
/SEQUENCE ID
---------- ----------
1 123
123 2
1 321
2 321
3 321
1 673
2 673
3 6738 selected lines.
SQL >
SY.
-
Pump diagram remapping of data with the default value of sequence (12 c feature)
Hello
in the 12 c Oracle database there is a new feature that allows you to set default values directly from a sequence:
http://docs.Oracle.com/database/121/NEWFT/chapter12101.htm#NEWFT155
This helps us to save the use of triggers to get the next value of an ID column for example the DDL of such a table might look something like this:
CREATE TABLE "FOO"."MY_TABLE" ("ID" NUMBER(10,0) DEFAULT "FOO"."MY_TABLE_ID"."NEXTVAL", ... );
During the pattern FOO with Data Pump export and import the schema with the remap_schema option in the BAR diagram for example, mapping works fine for all the tables, triggers, etc. except those defaults (as Oracle always writes the schema information in these default values).
The error in the output log that says 'FOO. MY_TABLE_ID"sequence is unknown, because the sequence is now called 'BAR. MY_TABLE_ID' - mapping so does not work for default values.
Someone knows how to fix this?
Thanks in advance
Concerning
Hello
Read this note, I think that it is an expected behavior:
http://docs.Oracle.com/CD/E11882_01/server.112/e22490/dp_import.htm#SUTIL927
REMAP_SCHEMA
.
Restrictions
* The mapping cannot be 100 percent complete because there are some references to diagrams that importing is not able to find. For example, import will not find of references to patterns incorporated into the body of the definitions of triggers, types, views, procedures and packages. -I think in your case it is the default value.
* If any table in the schema are remapped contains object types defined by the user and this table changes between the time wherever it is exported and the time you are trying to import, and then import this table will fail. However, the import operation will continue.
HTH,
Pradeep
-
As to generate a specific sequence using ODI.
Hi guys,.
I am new to ODI. Currently working on version 10.1.3.6. I have a question about the sequence generate using ODI.
I have a requirement to generate a drill_key based on values in other columns of 4. If the values are the same in the columns then drill_id must be repeated if combination changes new drill id should be generated. Can we achieve by using the sequence in ODI? See the tables below:
Any help is appreciated in this regard.
Current table
Nominal CC CARS File_id Transac_id Drill_id
-------------------------------------------------------------------------------
A B C 10 1
A B C 10 2
A E F 10 1
A B C 10 3
A E F 10 2
Want to fill as below
Nominal CC CARS File_id Transac_id Drill_Id
-------------------------------------------------------------------------------
A B C 10 1 100
A B C 10 2 100
A E F 10 1 101
A B C 10 3 100
A E F 10 2 101
Yes, he does. In fact, it will work in all you want. This is a pretty cool command that helps a lot
-
How to generate the alphanumeric sequence under oracle
Hi Experts,
I need to create a primary key as below,
Its should start from a001, a002... a100 after reaching 100 the next value in the sequence must begin by b001... b100, like wise the sequence should go through until summer z001 alphabet... z100.
Please let me know for any information.
Kind regards
Millar
This will generate the a1 - a100, b1 - b100,... z1 - z100, aa1 - aa100, ab1 - ab100,... az1 - az100,...
SEQUENCE of s FALL
/
CREATE SEQUENCE s
/
CREATE OR REPLACE
FUNCTION get_s_nextval
RETURN VARCHAR2
IS
number of v_nextval;
number of v_alpha;
number of v_number;
v_base26 varchar2 (100);
BEGIN
v_nextval: = s.nextval;
v_number: = MOD(v_nextval,100) CASE
WHEN 0 THEN 100
Of OTHER MOD(v_nextval,100)
END;
v_alpha: = CEIL(v_nextval / 100) - 1;
v_base26: = NULL;
LOOP
v_base26: = CHR (ASCII ('a') + MOD(v_alpha,26)) | v_base26;
EXIT WHEN v_alpha<>
v_alpha: = TRUNC(v_alpha / 26) - 1;
END LOOP;
RETURN v_base26 | LPAD (v_number, 3, '0');
END;
/
WITH t AS)
SELECT s get_s_nextval,
level lvl
OF the double
CONNECT BY level<=>=>
)
SELECT s
T
WHERE MOD(lvl,100)<=>=>
ORDER BY lvl
/
S
------------------
A001
A100
B001
B100
C001
C100
D001
D100
E001
E100
F001S
------------------
F100
G001
G100
H001
H100
I001
i100
J001
J10020 selected lines.
SQL >
SY.
-
-DATE CALCULATION question - generate &; calculate date
Hi all
I need a suggestion concerning the calculation of the date in essbase.
the case is:
-first of all, I need to generate date for each month, depending on the size of the period and the year. and uses the last date of the month in the date.
IE: If the year = FY11, period = Feb, then it generates members date1 = 20110228 (date1 member is considering membership with the date type)
- then I need to calculate the difference in days between each month.
IE: day_diff = date1 (20110228) - date1 of the month previous (20110131)
anyone has idea or an idea that will help you?
Thank you
FeriYou can use CDFs for the same thing, to first take a look at:
http://download.Oracle.com/docs/CD/E12825_01/EPM.111/esb_dbag/frameset.htm?dcaudfs.htmStrings and Date for Essbase on SampleCode.Oracle.com functions:
https://www.samplecode.oracle.com/tracker/tracking/linkid/prpl1004/action/ExecuteQuery?sfLoginToken=6D547D1FA88748A089A3C63EC282807B&sfProj=codesamples&isLoggedIn=true&sfLoginToken=0D11D7FCD6438541703B23FFCF6B2AFA&sfProj=codesamples&jSessionId=93DB7560AE2FF2C5F9D9AD7DCA34D50B&isLoggedIn=false&query=essbase1&dapCheckedPassed=falseSee you soon... !!
-
Data time stamp generated without fractions of a second.
Hello
I do some testing with redefining online timestamp column.
When you try to generate timestamp data looks like fractions of a second are 0s
When I insert:insert into t select r , systimestamp+ 1+r/(24*60*60*2) from (select rownum r from dual connect by level <= 100); select * from t where rownum <= 3; ID DATA ----- ------------------------------------ 1 15-MAY-10 01.59.16.000000 PM 2 15-MAY-10 01.59.16.000000 PM 3 15-MAY-10 01.59.17.000000 PM
That's ok.insert into t (101, timestamp '2010-01-11 11:11:11.123456');
What's wrong with my data generator? :))
Kind regards.
GregHello
user10388717 wrote:
HelloI do some testing with redefining online timestamp column.
When you try to generate timestamp data looks like fractions of a second are 0sinsert into t select r , systimestamp+ 1+r/(24*60*60*2) from (select rownum r from dual connect by level <= 100); select * from t where rownum <= 3; ID DATA ----- ------------------------------------ 1 15-MAY-10 01.59.16.000000 PM 2 15-MAY-10 01.59.16.000000 PM 3 15-MAY-10 01.59.17.000000 PM
When I insert:
insert into t (101, timestamp '2010-01-11 11:11:11.123456');
That's ok.
What's wrong with my data generator? :))
Kind regards.
GregArithmetic, such as dates
x + 1+r/(24*60*60*2)
Suppose x is a DATE, not a TIMESTAMP and returns a DATE.
If x is a TIMESTAMP (as in your case), the system converts implicitly to a DATE, lose the fraction of a second.
Similarly, when you INSERT into your table, the system waits a TIMESTAMP, but if you pass it a DATE (as you do) the system implicitly converts a TIMESTAMP.Don't use no arithmetic dates with the TIMESTAMPS. There are other ways (although less convenient) to manipulate the timestamps.
For exampleSYSTIMESTAMP + NUMTODSINVERVAL ( (1+r/(24*60*60*2)) , 'DAY' )
-
Hello
How to add an Id(which is inputted in the Configure Lot Setting) a lot in the naming of the batch summary and report STDF files generated by the Test Module of the semiconductor.
Currently the default name is shown in the excerpt below
Thank you
Rovi
Hi Rovi,
Have you tried the recall of ConfigureLotSettings or some of the steps listed in Cusomizing behavior for batch parametersof edition?
Kind regards
John Gentile
Engineering applications
National Instruments
-
create table t (id int primary key, dt date, file_no int, batch_no int, data varchar2(5) ); insert into t values (1,trunc(sysdate),23,113,dbms_random.string('a',5)); -- 1.1.1 insert into t values (2,trunc(sysdate),23,345,dbms_random.string('a',5)); -- 1.2.1 insert into t values (3,trunc(sysdate),23,345,dbms_random.string('a',5)); -- 1.2.2 insert into t values (4,trunc(sysdate),23,543,dbms_random.string('a',5)); -- 1.3.1 insert into t values (5,trunc(sysdate),23,543,dbms_random.string('a',5)); -- 1.3.2 insert into t values (6,trunc(sysdate),23,543,dbms_random.string('a',5)); -- 1.3.3 -- insert into t values (7,trunc(sysdate),24,333,dbms_random.string('a',5)); -- 2.1.1 insert into t values (8,trunc(sysdate),24,333,dbms_random.string('a',5)); -- 2.1.2 insert into t values (9,trunc(sysdate),24,333,dbms_random.string('a',5)); -- 2.1.3 insert into t values (10,trunc(sysdate),24,222,dbms_random.string('a',5)); -- 2.2.1 insert into t values (11,trunc(sysdate),24,222,dbms_random.string('a',5)); -- 2.2.2 insert into t values (12,trunc(sysdate),24,111,dbms_random.string('a',5)); -- 2.3.1
Oracle 11.1
How can given this structure and data, I generate sequence at the end of each line numbers? Basically, the sequence number (x.y.z) is such that x (1.n) is awarded for each unique value in file_no. In each x, y (1.n) is assigned for each unique value of batch_no. Within each y, z (1.n) is assigned for all records of this batch. Sample data shows only dt but all sequences must reset and start over when dt changes.
I tried using row_number() over (partition by dt, file_no) and such but nothing quite gives me what I'm looking for.
Help? Thank you
Hello
HELEN wrote:
If you look at my CREATE TABLE, the ID column is a primary key and represents the order of the data in the file.
Done batch_no = 100 come before or after 101? Batch_no = 100 a ID so much until after the id for batch_no = 101.
Good point, but that won't happen because of the way the 'record' is generated. All batch_nos will be contiguous. So if batch_no 100 comes earlier in the file as 101, it should get some 2nd highest sequence number. Otherwise, lower. Basically, the 2nd part of the sequence must simialar logical number to the 3rd party (i.e. order by id) but that messes things. Still struggle with it. Any help appreciated.
I think I understand. You say that, because of the way that the ID is issued, it wouldn't matter if you used the highest id of the batch_no, or the lowest id, or the average, or if you chose one at random; you would get the correct order in all cases.
The following query uses the id low in the order file_no and batch_nos.
WITH got_min_ids AS
(
SELECT id, dt, file_no, batch_no, data
MIN (id) over (PARTITION BY dt
file_no
) AS min_id_file_no
MIN (id) over (PARTITION BY dt
file_no
batch_no
) AS min_id_batch_no
T
)
SELECT id, dt, file_no, batch_no, data
DENSE_RANK () OVER (PARTITION BY dt
ORDER BY min_id_file_no
)
|| '.'
|| DENSE_RANK () OVER (PARTITION BY dt
file_no
ORDER BY min_id_batch_no
)
|| '.'
|| ROW_NUMBER () OVER (PARTITION BY dt
file_no
batch_no
ORDER BY id
) AS seq
OF got_min_ids
ORDER BY dt, min_id_file_no, min_id_batch_no, id
;
The main request is in fact what I posted before, but instead of
"ORDER BY file_no" and "ORDER BY batch_no", she uses
"ORDER BY min_id_file_no" and "ORDER BY min_id_batch_no". These values are calculated in the subquery, got_min_ids.
Output (including the additional sample data I posted):
ID FILE_NO DT BATCH_NO SEQ DATA
---------- ----------- ---------- ---------- ----- ----------
1 23 25 April 2014 113 dXAad 1.1.1
2 345 23 25 April 2014 pumVG 1.2.1
3 345 23 25 April 2014 jLnbO 1.2.2
4 23 25 April 2014 543 xKhCL 1.3.1
5 23 25 April 2014 543 JQoWk 1.3.2
6 23 25 April 2014 543 YjJeC 1.3.3
7 24 25 April 2014 333 WjQNE 2.1.1
8 24 25 April 2014 333 ScWSL 2.1.2
9 24 25 April 2014 333 pXDSD 2.1.3
10 222 24 25 April 2014 OSajn 2.2.1
11 222 24 25 April 2014 QNpix 2.2.2
12 24 111 OwkjI 2.3.1 April 25, 2014
91 100 99 25 April 2014 sRWmT 3.1.1
93 100 99 25 April 2014 IAEFd 3.1.2
92 101 99 25 April odQxh 2014 3.2.1
I know you said that this situation is impossible (that is, if ID 91 and 93 have the same batch_no, then id 92 cannot have a different batch_no), but the application works even if this rule is broken.
Maybe you are looking for
-
New C6180 All in 1 does not recognize cartridge initialization.
I'm now putting in place a new-in-the-box C6180 that was purchased in August 2007. Cartridges provided, necessary for initialization, are badly timed out. The printer displays the message "the following ink cartridges appear to miss." All cartridg
-
I constantly tried to use the "NET USE" syntax to get a Windows XP Home system to keep & share mapped network drive on a Windows 7 Pro 64-bit of the system and nothing I tried or worked on ANY blog. I can map the current network through made normal d
-
How to keep a narrow subfolder in Outlook Express
Original title: Outlook Express I close a subfolder in OE: I then close OE. The next time I open OE, I find this subfolder is opened. Why, or how can I make sure that it remains closed, unless I open it again?
-
Win10 by releasing my motherboard used drivers Nvidia who were not compatible Win10. Have replaced the card mother, re-enabled Windows 7 but the upgrade of information contiinues to show my monitor driver as an incompatible Nvidia driver. How can I g
-
Options for blackBerry Z10 Snooze for calendar reminders
When I get a reminder on my new Z10, my only choice snooze is for a 5 minute NAP. Is it possible to get other choices - my old BB has allowed me to snooze a reminder up to a week.