How to create sequence 0.1,0.2....0.6 1,1.1,1.2...1.6,2
hi to all,
i tried to do above type sequence which similar circket over sequence , i tried to do but increament and start with are allowing only integer value..
if anny one know the answer please share with us ....
thnaks in advance ....
Hello
I'll take a wild stab and make an assumption that you need this in a query rather than using it for some sort of primary key generation...
SELECT
TO_CHAR(first_num)||'.'||TO_CHAR(second_num)
FROM
( SELECT
ROWNUM - 1 first_num
FROM
dual
CONNECT BY LEVEL <=10
( SELECT
ROWNUM second_num
FROM
dual
CONNECT BY LEVEL <=10
ORDER BY first_num,second_num
TO_CHAR(FIRST_NUM)||'.'||TO_CHAR(SECOND_NUM)
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0.10
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
2.1
2.2
select
rtrim(xmlagg(xmlelement(e, seq || ',')).extract('//text()').extract('//text()') ,',') seq
from ( SELECT
TO_CHAR(first_num)||'.'||TO_CHAR(second_num) seq
FROM
( SELECT
ROWNUM - 1 first_num
FROM
dual
CONNECT BY LEVEL <=10
( SELECT
ROWNUM second_num
FROM
dual
CONNECT BY LEVEL <=10
ORDER BY first_num,second_num
SEQ
0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.10,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,1.10,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,2.10,3.1,3.2,3.3,3.4,3.5,3.6,3.7
,3.8,3.9,3.10,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,4.9,4.10,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,5.10,6.1,6.2,6.3,6.4,6.5,6.6,6.7,6.8,6.9,6.10,7.1,7.2,7.3,7
.4,7.5,7.6,7.7,7.8,7.9,7.10,8.1,8.2,8.3,8.4,8.5,8.6,8.7,8.8,8.9,8.10,9.1,9.2,9.3,9.4,9.5,9.6,9.7,9.8,9.9,9.10but without more info, it is just a wild stab.
HTH
David
Similar Messages
-
How to create sequence(Auto generated no in oralce) with out using Triggers?
If i create trigger sequence of numbers are getting generated but in case if i want to include explicit sequence no at the end of the table say like '9999'...it is not getting updated
Pls help very urgent..user2134711 wrote:
How to create sequence(Auto generated no in oralce) with out using Triggers? Sequence is an oracle object used to create unique number sequence. It has no connection with trigger.
Generally Sequence is used in a Trigger to generate some column value automatically. Something like the IDENTITY column used in SQL Server.
If i create trigger sequence of numbers are getting generated but in case if i want to include explicit sequence no at the end of the table say like '9999'...it is not getting updated This totally depends on how you have written the trigger. If you can show your trigger code we can help you out. -
How to CREATE SEQUENCE in one table
dear all
the one thing i want to know when i use CREATE SEQUENCE in one table like this and then at that table
CREATE SEQUENCE oproduct_sequence
START WITH 1 INCREMENT BY 1
nocache
create table oproduct(
tname varchar2(20) not null,
tid int default oproduct_sequence.nextval
the system indicat that i cannot use this way to create table , so i really want to know how can i achieve this method
becuase when i want to insert inot table oproduct only use
insert into oproduct valuse('aaaa');
and the result like
aaaaa 1
bbbb 2Actual name is before insert trigger. Some examples are listed below:
Example Number 1 ...
create sequence product_seq start with 1 increment 1
create or replace trigger product_insert before insert for each row begin
select productseq.nextval
into :new.product_id
from dual;
end;
Example Number 2 ...
How to create an autoincrement field in a table with a sequence ...
SQLWKS> create table bob(a number , b varchar2(21));
Statement processed.
First create a sequence
SQLWKS> create sequence x ;
Statement processed.
Then create the trigger.
create trigger y before insert on bob
for each row
when (new.a is null)
begin
select x.nextval into :new.a from dual;
end;
Example Number 3 ...
First create a sequence:
create sequence emp_no_seq;By default it increments by 1 starting at 0.
Use its values when inserting data into the table:
insert into t_emp values (emp_no_seq.nexval, 'Joe Black');~ Madrid. -
How to create sequence when minvalue is unknown?
I am currently migrating a lot of tables (that already have data) over to using sequences. I'd like to have a script that creates these sequences without having to hardcode the minimum value that the sequence should start at.
I am trying to do something like this:
create sequence mySeq minvalue (select max(id)+1 from table) increment BY 1 cache 20;
This always gives the error "Invalid number". Can anyone provide some guidance on how to solve this problem?Like this..?
SQL> declare
2 min_val number;
3 str varchar2(1000);
4 begin
5 select nvl(max(empno),0)+1
6 into min_val
7 from emp;
8 str := 'create sequence seq1 start with '||min_val||' increment by 1 cache 20';
9 execute immediate str;
10 end;
11 /
PL/SQL procedure successfully completed.
SQL> select seq1.nextval
2 from dual;
NEXTVAL
7935
http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_dynamic_sql.htm#i1006172 -
How to create Sequence Diagrams in Jdev 10.1.3?
Hi there,
I´m migrating (trying) from Eclipse to JDeveloper and I´m having several dificulties....
I´m creating a new project in JDeveloper:
0) create an application workspace [ok]
1) create a web application project [ok]
2) create some packages and Java classes [ok]
3) create a class diagram related to the
above classes [ok]
4) create a sequence diagram [ok]
5) use the classes into the sequence
diagram [more and less]
6) use the methods of the classes into
the message lines of the sequence
diagram [no]
Some observations that are messing me:
1) Do I need to create an "Object Lifetime" for
every class and after that select "Attach Classifier" ?? Why I can´t just drag the classes into the diagram (like Jude) ?
2) Can I use the methods already defined in the classes to create messages in the sequence diagram?
3) The sequence diagram od JDeveloper is disconnected from the project classes? i.e., is it just a draw ?
best regards,
Felipe GaúchoHi,
I am glad to find that you are working on the sequence diagram. I take your point about selecting the methods and assigning them to the messages. Unfortunately this feature is gated by some architecture changes and it something I will be actively pursuing as soon as it is possible.
In reply to your other points:
1) Do I need to create an "Object Lifetime" for
every class and after that select "Attach Classifier" ?? > Why I can´t just drag the classes into the diagram (like > Jude) ?The reason for this is that the sequence modeler is simply a view onto a single diagram type that can contain any object. This allows the mingling of different UML type on the same diagram. It can be usefull to mix usecase and seqeunce for example.
For that reason the default action for java class is to model a java class, and you do indeed need to create a lifeline first. Did you know you could drag and drop the classifier, in your case a java class, from the navigator onto the lifeline. This might be quicker in your case.
2) Can I use the methods already defined in the classes > to create messages in the sequence diagram?As noted before in the preview you can't select existing messages. This is something we would like to add as soon as it is possible.
3) The sequence diagram od JDeveloper is disconnected
from the project classes? i.e., is it just a draw ?The sequence modeler isn't totally disconnected from the project classes; but it wont update as you edit the code if this is what you mean.
Could you perhaps expand on this point a little bit?
Thanks,
Gerard Davison
UML Modelers -
How to create sequence based (SERIAL) primary key?
Does anybody know any workaround to modify dictionary table outside Web Dynpro?
I specify default column value in SQL Studio:
ALTER TABLE PB_ORGANIZATION COLUMN ORG_ID ADD DEFAULT SERIAL(1)
Everything is OK, but when I try to insert values in modified table from Web Dinpro EJB application I get the error:
com.sap.engine.services.ejb.exceptions.
BaseReliableNoSuchEntityException: The entity does not
exist in the database. Its value in the cache has to be
refreshed.
It seems WebAS keeps some metadata, generated by Web Dynpro, and manual changes in a database table put it out of sync with this metadata.
I need serial primary keys in my project. Is it possible to solve the above problem?I'll better send You entire application. It has Web Service frontend (PhoneBook) which can be used for testing. Method createOrganization() throws the exception.
No, this error appears in EJB application only.
BTW, I have even made attempt to replace <default-value>0</default-value> by <default-value>SERIAL(1)</default-value> but it didn't help. -
Hi all
please
How to create sequence with alpha
like example
aaa
aab
aac
aad
aaz
aba
abb
abc
abd
abz
aca
acb
acc
acd
acz
ada
adb
adc
add
adz
xyz
xza
...DROP SEQUENCE S
CREATE SEQUENCE S START WITH 0 MINVALUE 0
DECLARE
v_decimal NUMBER;
v_base26 VARCHAR2(10);
BEGIN
FOR rec in (select s.nextval v_i from dual connect by level <= 52) LOOP
v_decimal := rec.v_i;
v_base26 := NULL;
LOOP
v_base26 := CHR(ASCII('A') + MOD(v_decimal,26)) || v_base26;
EXIT WHEN v_decimal < 26;
v_decimal := TRUNC(v_decimal / 26) - 1;
END LOOP;
DBMS_OUTPUT.PUT_LINE(TO_CHAR(rec.v_i,'999.') || ' ' || v_base26);
END LOOP;
END;
0. A
1. B
2. C
3. D
4. E
5. F
6. G
7. H
8. I
9. J
10. K
11. L
12. M
13. N
14. O
15. P
16. Q
17. R
18. S
19. T
20. U
21. V
22. W
23. X
24. Y
25. Z
26. AA
27. AB
28. AC
29. AD
30. AE
31. AF
32. AG
33. AH
34. AI
35. AJ
36. AK
37. AL
38. AM
39. AN
40. AO
41. AP
42. AQ
43. AR
44. AS
45. AT
46. AU
47. AV
48. AW
49. AX
50. AY
51. AZ
PL/SQL procedure successfully completed.
SQL> SY. -
hi
can you anyone please tell me how to create sequence in xmii suppose if i use syntax like this
CREATE SEQUENCE supplier_seq
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH 1
INCREMENT BY 1
CACHE 20;
its showing an error
<b>A SQL Error has occurred on query, ORA-00911: invalid character
Thanks in advanceHi DevaKrishnan,
u can use the same as used first , that is
CREATE SEQUENCE supplier_seq
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH 1
INCREMENT BY 1
CACHE 20
and choosing the same mode(command) the only difference is remove the semicolon then it works fine.
Regards,
chaitanya -
How to create a sequence for an particular item in my apex form
Hi friends,
I created an database application, of a form with a report, and it is working fine...
But in my form, i have a requirement....The below are the existing fields in my form
issue no
created by
start date
status
priority
due date
Among these fields in my form i need to create a 'Sequence' for my field "issue no",
So that whenever i opened the form the 'issue number' must generate automatically like 1 for the first time, 2 for the second time and so on..
For that i created a sequence
CREATE SEQUENCE "ORDERS_SEQ"
MINVALUE 1
MAXVALUE 999999999999999999999999999
INCREMENT BY 1
START WITH 1000
NOCACHE
NOCYCLE;
But for validation where i need to write the sequence query for the particular item 'issue no'....i dont have any idea of where to write the validation query for the sequence..
please tell where i need to write in step wise manner..please help me friends...
As the below is my validated sequence query for item 'issue no'
'select seq.issue_id.nextval into issue_no'
This is my above validation query whether the query that i mentioned is right..if not let me know the validation query..
And also i need where to apply this validation query in steps..
Thanks in advance
Regards,
Harry...Harry,
Rik is on the right track. Here is a sample insert trigger: Would need to substitute you sequence ORDERS_SEQ with my sequence las_log_seq, how you define or use timestamps is up to you.
DROP TRIGGER LASDEV.BINS1_LAS_LOG_TBL;
CREATE OR REPLACE TRIGGER LASDEV."BINS1_LAS_LOG_TBL"
BEFORE INSERT
ON las_log_tbl
FOR EACH ROW
BEGIN
-- Description: Insert log_seq, creation_dt, creation_id,
-- lst_updt_dt and lst_updt_id.
-- Maintenance:
-- Date Actor Action
-- ==== ===== ======
-- 07-Sep-2010 J. Wells Create.
:new.creation_id := nvl( v( 'app_user' ), user );
:new.creation_dt := SYSDATE;
:new.lst_updt_dt := :new.creation_dt;
:new.lst_updt_id := :new.creation_id;
SELECT las_log_seq.NEXTVAL
INTO :new.las_log_seq
FROM DUAL;
END bins1_las_log_tbl;
/Heff -
How to create the Access sequence for the Vendor+material+plant combination
Hi all
Please let me know How to create the Access sequence for the Vendormaterialplant combination..
Whats the use? What its effect in purhcase and taxe..
brief me pleaseHi,
you are asked to maintain the access sequence for the tax condition for which you are putting 7.5%.
goto OBQ1 or img..financial accounting new...global settings.... taxes on sales and purchases ......basic settings.....
find the tax condition type. see in it which access sequence is attached.
if there is none then use JTAX used for taxes in India.
or you can create the similar one for your.
to create the same goto OBQ2.
new entry or copy JTAX.
and assign the access sequence to condition type.
this will resolve your problem if you just need to assign the access sequence.
regards,
Adwait Bachuwar -
How to create a SEQUENCE in MSSQL2005
Hi
I am also having a similar problem which opened the thread
Actually i am using a Repositery which is created in MSSQL2005.
Now i want to create a SEQUENCE similar to Oracle and populate My surrogate Key Column.
Can u tell me how to create a SEQUENCE in MSSQL2005?
Does anyone is having the sql syntax?
Thanks
GourisankarHi Gourisankar,
There is no sequence concept in MS SQL Server rather it has IDENTITY.
In MS SQL Server if you declare a column type as a Identity it will be auto increment when a new record inserts.
So in you underlying table create a column as ID and type as "Identity" and in your mapping leave that field un mapped.
Have a look and google more on "identity in ms sql server" ;)
http://www.sqlteam.com/article/autonumbering-identity-columns
http://www.craigsmullins.com/ssu_0599.htm
Thanks,
G -
How to create a a labview sequence with teststand
hi everybody,
it might be this question but i haven't found any. I am using TestStand 2.0 and LabVIEW 7.0 and i wanna use labView Sequence adapter to create sequences by using labView step.
So that's how i do.
1) After choosing the labveiw standard prototype adapter, i select a step in the sequence let's say the numeric limit step
2) then I specify the module and choose the option create VI...
3) Then I have a labview front panel window that appears with test data and error out
4) I just add a sequence context in the front panel, take a set property value module, link that module to the sequence context and in the test data as show as in different examples i found
5) but after all when i run the step that is error message i have:
LabVIEW : parameter Sequence Context not found in the VI's connector pane.
-18002; LabVIEW reported an error. See 'LabVIEW : ' message for more details.
it's seems that i don't connect my sequence context to the VI's connector pane but i don't know how to do it. i tried to figure that out by reading some previous post but i still can't.
First what's is a VI's connector pane and do you have access to that? Can you explain me that step by step
Thanks in advance for your help.
ChristelleHi,
In the Specify LabVIEW Module is a checkbox if you need the Sequence Context in your VI.
You should enbale this before creating the VI. If this is done, then you will not have to add the sequence context control to your VI, because it will already be there.
But from your notes, you dont appear to be adding the Sequence Context control to your VI connector pane.
If you do this, then it should all start to work.
Regards
Ray Farmer
Regards
Ray Farmer -
How to Create Test Sequence Document in HTML using command line
How to Create Test Sequence Document in HTML using command line
I have lot of sequences and I want to create Test Sequence Documentation in HTML format using Command Line automatically, is there a way to automate this task using .bat file or using C# .NetIf you aren't able to figure out how to call a C++ DLL in .net then there may be another option. Unfortunately I don't know how to do this off the top of my head and I don't have an example.
The other option would be to change docgen.seq a little bit to the dialog doesn't display and you just hardcode the options. Then you can use a command line to call testexec.exe: http://zone.ni.com/reference/en-XX/help/370052K-01/tsfundamentals/infotopics/startup_opt/
Hope this helps,
jigg
CTA, CLA
teststandhelp.com
~Will work for kudos and/or BBQ~ -
How i create a simple sequence in OWB (Example)
Hi,
i want create an simple sequence in OWB. But how i make a simple sequence in the oracle data Warehouse Builder.
Until now i goes into expression Builder of the sequence.
where already written is:
*"SEQ_ACCOUNT".NEXTVAL*
so my idea was to write behind this start with 1 increment by 1
also looks it practically so
*"SEQ_ACCOUNT".NEXTVAL start with 1 increment by 1*
but this doesn´t work. But was is wrong?
Can me give anyone an concrete example for a simple sequence or show how it must write that it will be correct.
I look forward for your replies :)I have found the solution for this problem :) To create a seqeunce goes to sequences in project explorer ---> new sequences ---> give name and bla bla bla --> right click on to created sequence and choose confiugre. Here you can under sequence parameter configure things as Increment By and Start with But how goes it into expression builder of a sequence?
-
How to create a sequence using Toplink for DUAL table
Hi All,
How do I create below sequence using TOPLINK
CREATE sequence my_seq start WITH 1;
Regards,
DheerajHi Dheeraj,
Sequence Object should be created in Database and specify the type of sequence that will be used in toplink to create sequence value.For example,sequence objects created in database needs to be configured using Native Sequence.
For more information refer to the below link.Use JDeveloper Toplink Wizards for declarative programming of Toplink native Sequencing.
http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/reldscfg003.htm.
Regards,
P.Vinay Kumar
Maybe you are looking for
-
I was migrating from macbook to a new imac. Nothing showed up until I turned off the imac. When I restarted the imac everythign I'd previously done was gome and the migrated macbook desktop had taken over. How do I bring back the original imac settin
-
USB/firewire board killed Firewire
I had an Adaptec usb2.0/firewire board which worked fine for several years, I had to give up sleep mode but not a big deal. I started having problems with usb camera file transfers. They would start and then hang. I bought an IOgear board pci board a
-
After capacity leveling dependent requirement s to be adjusted
hi iam planning a fert product on 30 th agust for 100nos created md61 -pir for 100 nos done mrp run at mdo2 and got scheduled dates for 100nos which has gone beyond the requirement date as i was chhosed leed time scheduling and made dependent reqire
-
I cannot right-click open in new tab. The link I click on is javascript so it just opens the javascript instead of the site I am trying to go to. So I am just trying to stop the re-focus.
-
Google chrome plug in not loading
im on windows 7 OS. it wont load games or videos. ive tried unistalling and installing, deleting browsing cache, making sure plug ins are enabled. i nothing has fixed the problem. registry has been cleared. maleware and virus scans came back clean. i