Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
Oracle sequence errors
ghiberti
follow
0
11-1-2006 8:08 AM
880 views
tags:
oracle
,
sequences
,
database
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Today's Top Clips
50 Beautiful Watercolor Paintings
100 Billion Galaxies
How the Mysterious Giant Spiral Happened. Sorry people, no alien invasions. Yet.
Ireland"s strict abortion laws challenged
Brilliant Beck: Catches Acorn LYING AGAIN
Diane Francis, Canadian lunatic, calls for a "GLOBAL ONE CHILD POLICY, LIKE CHINA'S"
10 Recycled Christmas Trees
A Father is a Father is a Father
6 Reasons Bacon Is Better Than True Love
Chemistry student killed by 'exploding chewing gum'
visit the
Top Clips page
View the Top Clips from
November 1, 2006
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://www.clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/009dea77-9ff8-4f28-97c0-f9f000480617/651B695A-923A-43A4-B745-75B214AC130F/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://www.techonthenet.com/oracle/errors/ora08002.php" href="http://www.techonthenet.com/oracle/errors/ora08002.php" style="font-size: 11px;">www.techonthenet.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.techonthenet.com/oracle/errors/ora08002.php"><table background="undefined" bgcolor=""><tr><TD><DIV id="content"> <H1>Oracle/PLSQL: ORA-08002 Error</H1> <HR /> <TABLE width="100%" cellspacing="0" cellpadding="9" border="0" class="parm_values"><TBODY><TR class="tr_left_top"><TD width="50"><U>Error:</U></TD><TD>ORA-08002: sequence NAME.CURRVAL is not yet defined in this session</TD></TR><TR class="tr_left_top"><TD><U>Cause</U>:</TD><TD>You tried to execute a CURRVAL command on a <A href="http://www.techonthenet.com/oracle/errors/../sequences.php">sequence</A> before the NEXTVAL command was executed at least once.</TD></TR><TR class="tr_left_top"><TD><U>Action</U>:</TD><TD>The options to resolve this Oracle error are: <OL> <li style="margin-left:16px;padding-left: 0px;">Try executing the NEXTVAL command for the sequence, initially. Then call the CURRVAL command.</LI> </OL> <BLOCKQUOTE> <P>For example, if you created the following sequence.</p> <BLOCKQUOTE class="sql_command"> <P>CREATE SEQUENCE supplier_seq MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 INCREMENT BY 1 CACHE 20;</p> </BLOCKQUOTE> <P>Then tried to call the CURRVAL command for this sequence:</p> <BLOCKQUOTE class="sql_command"> <P>SELECT supplier_seq.CURRVAL FROM dual;</p> </BLOCKQUOTE> <P>You would receive the following error message:</p> <P><IMG width="462" height="122" border="0" src="http://www.techonthenet.com/oracle/errors/images/ora08002_001.png" /></p> <P>Your sequence does not yet have a value until you call the NEXTVAL command at least once as follows:</p> <BLOCKQUOTE class="sql_command"> <P>SELECT supplier_seq.NEXTVAL FROM dual;</p> </BLOCKQUOTE> <P>Now your sequence has a value assigned to it, so it is okay to execute the CURRVAL command, as follows:</p> <BLOCKQUOTE class="sql_command"> <P>SELECT supplier_seq.CURRVAL FROM dual;</p> </BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TBODY></TABLE></DIV></TD></tr></table></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/651B695A-923A-43A4-B745-75B214AC130F/blog/" title="blog or email this clip"><img src="http://content7.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
New from the makers of Clipmarks:
Amplify.com - Don't just share the news...Amplify it!
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Copyright
Privacy
EULA
OK