dirtdog has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I'm hoping someone can assist with trying to get single quotes around a string of comma separated values. I have a variable containing a string such as CAT,DOG,BIRD,COW and I need that string to look like this 'CAT','DOG','BIRD','COW' because I'll be passing it to a sql statement as part of an "IN" clause and the datatype is a VARCHAR.
Any help would be greatly appreciated. I was attempting to use the join command but I can't quite get it to work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to add quotes to comma separated values in a String (updated)
by haukex (Archbishop) on Feb 12, 2018 at 22:06 UTC | |
by Laurent_R (Canon) on Feb 12, 2018 at 23:57 UTC | |
by Your Mother (Archbishop) on Feb 13, 2018 at 01:39 UTC | |
by Laurent_R (Canon) on Feb 13, 2018 at 17:17 UTC | |
by Your Mother (Archbishop) on Feb 13, 2018 at 18:05 UTC | |
by haukex (Archbishop) on Feb 13, 2018 at 21:32 UTC | |
| |
by dirtdog (Monk) on Feb 12, 2018 at 22:27 UTC |