Hi
My oracle version is 11g
I am trying to write a pl/sql where it checks whether the row exists and inserts if not.
if its exists it will return the primary key.
I have a table searchaddress which has column searchaddress_pk,town,street,postcode.
I have attached the package .The procedure works fine when it compares with all the table columns.
i manually inserted 3 rows
searchaddress_pk town street postcode
1 london high street eh245gh
2 london
3 london high street
if i pass all 3 values then it return the primary key 1 fine.
But if i pass 1 or 2 values then its not returning the primary key and inserting each and everytime.
in the procedure if i pass only town value london or town value london and street value high street,its inserting each and everytime.
I expected it to return 2 when i pass london
and 3 when i pass london and high street.
The procedure only works when i pass all 3 values.
as i am new to pl/sql looking for some help if someone came across same scenario.
Thanks