Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 03-06-2011 22:42:00

From: England!
Registered: 11-21-2008
Posts: 1104

MySQL CONCAT and REGEXP - How To Include Table Names - ?

I am wanting to use the statement shown below and need to know whether there is some way of entering table names, as dynamic values, into the CONCAT and REGEXP sections.

As it stands trying to enter table name, , for example, will result in that being taken as a literal value, which is not I want.


UPDATE `gbu0_prod` SET xcat = CONCAT(xcat, ', test_four') WHERE xcat regexp '[[:<:]]test_one[[:>:]]' AND id = 'test';

What I had in mind for this particular statement was adding the  of certain categories to the  table, but only where the  does not match any existing instance of that  in the  table.

As can be seen from the above, this can be done if you are prepared to enter the name for a table, but that is not much use if you are wanting to potentially modify several hundred entries.

Last edited by Design_Wholesale (03-06-2011 22:45:05)



Board footer