Hello,
J'essai de mettre à jour une URL dans toute les tables qui contiennent %__akquickicons_icons
Dans un premier temps j'ai fait :
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '%__akquickicons_icons%'
J'ai bien toutes mes tables qui ce liste.
Donc maintenant je veux changer "index.php?option=com_content&view=articles&filter_category_id=" par "index.php?option=com_content&view=articles&filter[category_id]=", dans toutes les tables LIKE '%__akquickicons_icons', et de la colonne "link"
J'ai parcourus la toile et je suis tombé sur ça :
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| BEGIN
FOR r IN (
SELECT 'UPDATE ' || owner || '.' || table_name ||
' SET ' || column_name || ' = ''' || 'index.php?option=com_content&view=articles&filter[category_id]=' ||
''' WHERE ' || column_name || ' = ''' || 'index.php?option=com_content&view=articles&filter_category_id=' || '''' AS command
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name LIKE '%__akquickicons_icons'
)
LOOP
EXECUTE IMMEDIATE r.command;
END LOOP;
END;
COMMIT; |
Mais j'ai une erreur #1054 - Unknown column 'owner' in 'field list'
Une piste pour sortir de la toile ? :-)
PS : je pourrais faire une par une comme ceci :
1 2 3
| UPDATE pgs1200101__akquickicons_icons
SET link = REPLACE(link, 'index.php?option=com_content&view=articles&filter_category_id=', 'index.php?option=com_content&view=articles&filter[category_id]=')
WHERE link LIKE '%index.php?option=com_content&view=articles&filter_category_id=%' |
Mais j'ai plus d'une centaine de tables... et 3 liens à modifier...
Merci,
Partager