Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

spaces before a value

Status
Not open for further replies.

Casiopea

Programmer
Jan 15, 2003
47
ES
I have a field defined as NVARCHAR2(4). If I insert a row with a four length value in that field it's ok, however if I try to assign a value such as rs.fields("cp1")='R' when it executes rs.update the application hungs up without error.
I have noticed that this table has a foreign key with the same definition, whe I drop it, it also works storing the value 'R', the problem is when I create the foreign key again.
I have also updated the table referenced by the foreign key, because I realised that the value was ' R' and not 'R', but anyway it doesn't work.
Any idea?
 
Casiopea,

Can you please send us abbreviated "CREATE TABLE...", some "INSERT INTO...", and "SELECT..." statement that allows us to recreate your problem?

Thanks,

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
CREATE TABLE BDAPL.camb_tur
(
cp1 NVARCHAR2(4),
cp2 NVARCHAR2(4),
midate DATE,
ftime NVARCHAR2(5),
ttime NVARCHAR2(5),
obs NVARCHAR2(70),
PRIMARY KEY (cp1,cp2,fecha),
FOREIGN KEY (cp1) REFERENCES personal (codigo_p),
FOREIGN KEY (cp2) REFERENCES personal (codigo_p)
) TABLESPACE TS_PL;

INSERT INTO camb_tur (cp1,cp2,midate,ftime,ttime,obs) VALUES
('1','F174',to_date('01/01/2008','dd/mm/yyyy'),'10:15','15:15','')

if I drop foreign key for cp1, it works, if it exists it hungs up the program.
If I do it from sqlplus it works even with the foreign key.
 
It is solved. I erased the spaces and give format to the field date. I have also turned off the database.
Thank you anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top