UPPER returning doubles [message #36872] |
Fri, 28 December 2001 20:34 |
j.smith
Messages: 21 Registered: December 2001
|
Junior Member |
|
|
in sql file....
GOALS is to increase dept_id_seq by 10 ...
SEQUENCE CODE: (no problem)
CREATE SEQUENCE dept_id_seq
START WITH 60
INCREMENT BY 10
MAXVALUE 200;
CODE 1: WITH UPPER (PROBLEM)
SET ECHO OFF
SET VERIFY OFF
ACCEPT name CHAR PROMPT "Please enter new department name: "
INSERT INTO department (id, name)
VALUES (dept_id_seq.NEXTVAL, UPPER('&name'))
/
SET VERIFY ON
SET ECHO ON
UNDEFINE name
Some reason: increases NEXTVAL by 20
ie, 60, 80, ...
CODE 2B: NO UPPER (NO PROBLEM)
SET ECHO OFF
SET VERIFY OFF
ACCEPT name CHAR PROMPT "Please enter new department name: "
INSERT INTO department (id, name)
VALUES (dept_id_seq.NEXTVAL, '&name')
/
SET VERIFY ON
SET ECHO ON
UNDEFINE name
...increases NEXTVAL by 10:
ie. 60, 70, ...
Any idea's on why this happens: I've been racking my brains trying to figure this thing out
----------------------------------------------------------------------
|
|
|
|
Re: UPPER returning doubles [message #36888 is a reply to message #36872] |
Mon, 31 December 2001 07:48 |
Tim
Messages: 49 Registered: October 2000
|
Member |
|
|
Its in your sequence, you set INCREMENT to 10. That means NEXTVAL will increment it by 10. Set that to 1 if you want it to increase by 1 each time, or to what ever number you wish it to be.
----------------------------------------------------------------------
|
|
|