I have a table called product which contains a column called 'Description'. The values of the description column will be like
'NAME:ITEM1;COST:20;QUANTITY:23;'
'NAME:ITEM2;COST:20;QUANTITY:23;'
'NAME:ITEM4;COST:24;QUANTITY:24;'
'NAME:ITEM6;COST:26;QUANTITY:25;'
'NAME:ITEM3;COST:27;QUANTITY:27;'
Now I have another table called PRODUCT_DETAILS
which has three columns NAME
, COST
, QUANTITY
.
I have to split the values by ':',';'
and extract the values alone into the PRODUCT_DETAILS
table.
I should use stored procedure to do this. Please help me to sort this out as I had written only simple queries and stored procedures in SQL