Link to home
Start Free TrialLog in
Avatar of radical_mit
radical_mitFlag for Switzerland

asked on

selecting a * (star) from a field, removing it and update, flag field.

Hello
I have a list of names and address, Some of the field are flaged with a *(star), i need to clean the data so I need to remove the * field and then update a flag field to show that the record containg the star in the first place. Sorry for writing star not * just trying to clear things up.
so sort record:

smith, john, *0123456, fax, *0234568

what I want is
smith, john, 0123456, fax, 0234568, flag

the star marker can me on upto six fields, but I only need to set the flag field once
++++++++++++++++++++++++++++++
my id was
begin
for MAST in (SELECT * from M_NAME)
loop
     IF ( left(MAST.TELEPHONE_1,0) ='*' ) THEN
     update m_name
     set FLAG='Y', MAST.TELEPHONE_1= TRIM (LEADING '*' from TELEPHONE_1 );
     END IF;
     ----- next field  to check etc..........
COMMIT;
END LOOP;

EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SCREEN);
END;
/

I get identifier left must be declared.

thanks in advance
R

Avatar of Helena Marková
Helena Marková
Flag of Slovakia image

What database is it ? It seems to me that it is Oracle, isn't it ?
ASKER CERTIFIED SOLUTION
Avatar of Nievergelt
Nievergelt
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial