|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi there,
I get an error while replacing a table in SQL*Plus Worksheet: CREATE OR REPLACE TABLE testtable (a INTEGER); * FEHLER in Zeile 1: ORA-00922: Fehlende oder ungültige Option (in english: Error in line 1, missing or invalid option) What's wrong? Is there another way for getting a table replaced? Regards: Mirko |
|
#2
|
|||
|
|||
|
AFAIK:
There is no CREATE OR REPLACE TABLE statement. DROP TABLE testtable; CREATE TABLE testtable(a INTEGER); ... would be the right way. |
|
#3
|
|||
|
|||
|
Wow... I didn't realize, that the batch doesnt stop if the table doesn't exist. Thanks.
I'm a bloody beginner with oracle and I have another question: I created a sequence, lets say scott.my_sequence. Is there a select statement which gives me the next value of the sequence? select next_val from scott.my_sequence; doesn't do the job.... Thanks for your answer. |
|
#4
|
|||
|
|||
|
Use the dual table:
SELECT my_sequence.NEXTVAL FROM dual; But be awared: every time you select the next value, the sequence gets updated (incrementing it's value). You may select the current value of a sequence using my_sequence.CURRVAL. Before you can use CURRVAL you have to first (once) initialize the sequence with NEXTVAL. |
|
#5
|
|||
|
|||
|
Many thanks for your answer. I wonder, how someone can find such an information in the online databases at the otn... after your answer it was not a big deal to find an article about the dual table and its purpose.
Thanks again. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Oracle: Error while replacing a table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|