Operating System - HP-UX
1752490 Members
5688 Online
108788 Solutions
New Discussion юеВ

ORA-00908 when try to update table

 
Ratzie
Super Advisor

ORA-00908 when try to update table

I am trying to update a table
when i run this I get a:
ERROR at line 1:
ORA-00908: missing NULL keyword


cat file |while read i
do
echo `date` "Changing $i"
sqlplus -s user/passwd < UPDATE table SET CUSTOMER = 'cust1' WHERE ph_num is $i;
commit;

EOF
5 REPLIES 5
Uwe Zessin
Honored Contributor

Re: ORA-00908 when try to update table

http://ora-00908.ora-code.com/

My guess is that 'cat file' contains an empty line which results in the error.
.
Ratzie
Super Advisor

Re: ORA-00908 when try to update table

No it does not.
Uwe Zessin
Honored Contributor

Re: ORA-00908 when try to update table

But something is creating this syntax error.

Have you tried to find out when the error happens? You apparently have a logging function via the 'echo' command.


I can sort-of produce this (Cygwin on Windows xP) if I complete the final line with a line-feed:

$ od -x a.txt
0000000 0a61 0a62 0a63 000a
0000007

$ cat a.txt
a
b
c

$ cat a.txt | while read i ; do echo .$i.; done
.a.
.b.
.c.
..
$
.
Ratzie
Super Advisor

Re: ORA-00908 when try to update table

I can not see anything odd in the file.
I eve dos2ux it. No blank lines, carridge returns nothing.
Ratzie
Super Advisor

Re: ORA-00908 when try to update table

Wrong syntax again!
where pn_num = '$i'
not like!!!