How to fetch record 1 by 1 in a stored procedure ????
Posted on 2008-10-15
I am using MYSQL to write a stored procedure.
i have a table (UserTable ) which contains UserID and UserName fields.
I have another table (ShortCutInfo) which contains UserID and ShortCutURL fields.
I want to write a stored procedure (moreover a conversion script) which is intented to change
update or insert record in ShortCutInfo table depending on the value of UserID present in UserTable.
If a UserID of table UserTable exists in ShortCutInfo table then update ShortCutURL field with "URLUpdated"
If a UserID doesnot exists in ShortCutInfo table then Insert a new record with UserID (same as in UserTable) and ShortCutID as "URLInserted".
Can anyone suggest me how to read and do operation in an Stored procedure ???????