Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
CSIDE and OScript
How can I use % as a text in Str.Format function
Pranjali_Komawar
Hi, How can I use the "%" sign as a text content in Str.Format function. Following combinations I have tried and does not workstrSQL + Str.Format(" WSubWork.SUBWORK_TITLE like '%1%2%3'", "%", workflowTitle, "%")strSQL + Str.Format(" WSubWork.SUBWORK_TITLE like '%%1%'", workflowTitle)
Find more posts tagged with
Comments
Donna Nalls
Hello Pranjali,Give this syntax a try:strSQL + Str.Format(' WSubWork.SUBWORK_TITLE like %1', str.quote('%' + workflowTitle + '%') Regards,Donna
Donna Nalls
Sorry, i forgot the closing paren:strSQL + Str.Format(' WSubWork.SUBWORK_TITLE like %1', str.quote('%' + workflowTitle + '%') )
Carsten_Kulms
You could use Str.Format("%1 WSubWork.SUBWORK_TITLE like '%%%2%%'", strSQL, workflowTitle)_but_ I recommend not to work with Str.Format or string concatenation when building SQL statements, better use parameterized statements (for security reasons and also, imho, it is easier to read).
Pranjali_Komawar
Hey Donna, thanks a lot....as usual 'you are the best and the fastest'Regards,Pranjali.
Pranjali_Komawar
Thanks Carsten for replying to my topic, I will try this.Best Regards !