View Single Post
  #1 (permalink)  
Old 09-05-10, 13:11
narayanyr narayanyr is offline
Registered User
 
Join Date: Apr 2010
Posts: 30
Mysql Stored Procedure

Hi All,
I am trying to migrate data from a temporary table to the actual table.I am using simple insert query.I want to write in a procedure to check if the data for the fields that are being migrated exist in their parent tables.By doing so I can migrate data as and when I receive it,after it is checked if exists in the parent tables.The data I am importing is in a csv format.

Query I am using now is

INSERT INTO `table`
SELECT field1,field2
FROM temp_table
WHERE column_name = 'A'

Now I need help to migrate data checking if the values exist in another table

Kindly help me with a sample script to do so.Thanks in Advance.

Last edited by narayanyr; 09-06-10 at 02:06.
Reply With Quote