on 12-30-2015 7:25 PM
Hi Tommy
Below syntax seems to be working perfectly fine for me.
I just declared one local variable and assigned my input parameter ( IP_ZC) to local variable lv.
Then I checked if lv is blank , if yes, then I assigned a default value to it.
So, if this procedure is called with blank IP , it would use default value.
Cheers
Anindya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure if I got your question correctly. Can you please explain little bit what you are trying to achieve?
Please note NULL and Blank values are not same although they look similar. You have to see your underlying data and see what is the default value for that column. You can use the SQLs below.
SELECT *
FROM "SYS"."TABLE_COLUMNS"
WHERE "SCHEMA_NAME" = <'YOUR_SCHEMA'> AND IS_NULLABLE = 'TRUE'.
SELECT *
FROM "SYS"."TABLE_COLUMNS"
WHERE "SCHEMA_NAME" = <'YOUR_SCHEMA'> AND IS_NULLABLE = 'FALSE' .
Notice the change in DEFAULT_VALUE Column for the above statements .
You can also add TABLE_NAME in your Where clause to further restrict the data set.
Cheers
Anindya
that depends on the data type
Did you try with 0 or ' ' , i.e a space between single quotes?
What is the data type of the field you are trying to filter with input parameter? What is the data type of the input parameter ?
If my understanding is correct, you are creating a procedure with Input Parameter .
Cheers
Anindya
Hi Tommy,
One workaround which I used to do is to check if length is zero.
Eg :
if length(:ip_join_set_id) = 0 then
/* Do the operation which needs to be done upon null condition being met.
Regards,
Anil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Null can be handle like this:
DROP PROCEDURE CHECK_NULL;
CREATE PROCEDURE CHECK_NULL (IN NAME VARCHAR (1), OUT USERNAME VARCHAR (20) ) AS
BEGIN
IF :NAME IS NULL THEN
USERNAME := 'N/A';
ELSE
USERNAME := 'USER IS NOT NULL';
END IF;
END;
CALL CHECK_NULL(?,?) returns "N/A" (do not input anything and execute)
CALL CHECK_NULL('RAJ',?) returns "USER IS NOT NULL"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.