Link to home
Start Free TrialLog in
Avatar of Paramhans
Paramhans

asked on

How to fetch record 1 by 1 in a stored procedure ????

Hi,
    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 ???????
ASKER CERTIFIED SOLUTION
Avatar of Tomas Helgi Johannsson
Tomas Helgi Johannsson
Flag of Iceland 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