Home » SQL & PL/SQL » SQL & PL/SQL » UPPER returning doubles
UPPER returning doubles [message #36872] Fri, 28 December 2001 20:34 Go to next message
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 #36885 is a reply to message #36872] Mon, 31 December 2001 07:19 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
no, its not correct.
check whether 2 rows are insering..

----------------------------------------------------------------------
Re: UPPER returning doubles [message #36888 is a reply to message #36872] Mon, 31 December 2001 07:48 Go to previous message
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.

----------------------------------------------------------------------
Previous Topic: Problems with procedures- SQL statement.
Next Topic: Help needed urgent
Goto Forum:
  


Current Time: Mon Aug 03 05:20:14 CDT 2020