| Author |
Topic |
|
Jeskit@hotmail.co.uk
Starting Member
20 Posts |
Posted - 2008-01-03 : 11:26:17
|
| hii'm creating a sql hoilday database and i need to write a sequence but i've been told its wrong but i dont know why, can anyone help?CREATE SEQUENCE SEQ_HOILDAY_SITESINSERT INTO Details_of_sites_visited(Code_of_the_sites, Sites_name)VALUES(SEQ_HOILDAY_SITES.NEXTVAL,'124','Yosemite National Park');thanksjessica |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2008-01-03 : 11:38:32
|
| Dont understand what you mean by "but i've been told its wrong..". You mean someone told you the approach is wrong or do you get errors from SQL? Your INSERT has 2 columns and your VALUES has 3 values.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
Jeskit@hotmail.co.uk
Starting Member
20 Posts |
Posted - 2008-01-03 : 11:49:19
|
| i've been told the sql command is ended wrongly. how do my values have three values? |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-01-03 : 11:50:35
|
| Are you talking about ORACLE here?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Jeskit@hotmail.co.uk
Starting Member
20 Posts |
Posted - 2008-01-03 : 11:53:13
|
| thats the application i'm using why? |
 |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2008-01-03 : 12:40:27
|
because this forum is for ms sql server, not oracle. elsasoft.org |
 |
|
|
Jeskit@hotmail.co.uk
Starting Member
20 Posts |
Posted - 2008-01-03 : 12:43:10
|
| well i have to write it in ql first before i can put it in oracle |
 |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2008-01-03 : 12:56:18
|
oracle's flavor of sql is different from ms. you will have better luck asking your question on an oracle forum.www.orafaq.com for example. elsasoft.org |
 |
|
|
KenW
Constraint Violating Yak Guru
391 Posts |
Posted - 2008-01-03 : 13:59:40
|
quote: Originally posted by Jeskit@hotmail.co.uk i've been told the sql command is ended wrongly. how do my values have three values?
Jessica,Because Dinakar can count and you can't? Your code:CREATE SEQUENCE SEQ_HOILDAY_SITESINSERT INTO Details_of_sites_visited(Code_of_the_sites, Sites_name) /* ^^^ Col 1 ^^^ Col 2 */VALUES(SEQ_HOILDAY_SITES.NEXTVAL, '124', 'Yosemite National Park'); /* ^^^ Col 1 ^^Col 2 ^^^ Col 3 */ Jezemine is right, too. Oracle's PL/SQL is much different than SQL Server's T-SQL. For instance, CREATE SEQUENCE and SEQ_HOILDAY_SITES.NEXTVAL are both Oracle-specific and don't exist in SQL Server's dialect; in SQL Server, it's done with a data type assigned to the column, as in 'ID IDENTITY(1, 0)'. |
 |
|
|
|