Home » SQL & PL/SQL » SQL & PL/SQL » passing blanks
passing blanks [message #37984] Tue, 12 March 2002 08:29 Go to next message
ron
Messages: 50
Registered: July 1999
Member
Hi,
I have two columns OLD and NEW in a table.
for few rows I have either blanks values in OLD column, but in NEW there are values.

my function takes values from OLD as parameter and converts them into values (that are in NEW column).
it works for all values of OLD column except ''(blanks), which have corresponding values in NEW column.
when I pass ' '(blank), the function gives follo. error
============
ORA-20163: function did not find value for ' '
=====

but actually, there is a value exists for ' ' in table.

I wonder why its giving that error.

Thanks
Re: passing blanks [message #38000 is a reply to message #37984] Wed, 13 March 2002 01:13 Go to previous messageGo to next message
Pratibha
Messages: 29
Registered: November 2001
Junior Member
Hi,

I think u can make use of chr(32) , where value 32 is for blank & to check for presence of blank in a column, u can use instr like below example

SQL> select empno,stars,instr(stars,chr(32)) from empp

the above query will give u the location of blank.
Based on the result u can take decision

Bye
Re: passing blanks [message #38003 is a reply to message #37984] Wed, 13 March 2002 01:29 Go to previous message
Pratibha
Messages: 29
Registered: November 2001
Junior Member
Hi,

I think u can make use of chr(32) , where value 32 is for blank & to check for presence of blank in a column, u can use instr like below example

SQL> select empno,stars,instr(stars,chr(32)) from empp

the above query will give u the location of blank.
Based on the result u can take decision

Bye
Previous Topic: utility which selectively updates/inserts a record for given fields
Next Topic: explain Re: Procedures
Goto Forum:
  


Current Time: Fri Apr 26 13:19:30 CDT 2024