This also extends to the object relationship hierarchy, such as [Parent Obj]? .[Field] just in case the is no parent or child objects instantiated in memory. notation on the field, in case it has no value assigned.Similarly you can use a null check on the record on your View Object records to ensure you're not going to get an error related to no data returned. Here are some examples: Obviously these can then be used to assign values to variables or adding data to field attributes (using set Attribute).
CREATE OR REPLACE PROCEDURE cust_pay (temp_ccode IN NUMBER, pay_amount IN NUMBER)AS BEGIN DECLARE Value_check NUMBER; cbalance NUMBER; BEGIN SELECT Count(cus_code) INTO value_check FROM customer WHERE cus_code = temp_ccode; IF value_check IS NULL THEN Dbms_Output.put_line('the value was not FOUND'); ELSE UPDATE customer SET cus_balance = cus_balance - pay_amount WHERE cus_code = temp_ccode; SELECT cus_balance INTO cbalance FROM customer WHERE cus_code = temp_ccode; IF cbalance doesn't raise an exception if it doesn't update anything.) Your procedure is generally too complicate already though.
This article is aimed at developers with little coding experience, to help with the quick creation of scripts that enforce good practices and some simple business rules.
I have to create a pl/sql function which takes seven input parameters.
Problem is user can pass any of these parameters, in any combination such that remaining parameters would be null. And I have to query a table using these parameters after removing null parameters.
This is useful as it includes both null and blank value checks.