MySQL Forums
Forum List  »  MySQL Workbench

Problem using sql mode - 'NO_BACKSLASH_ESCAPES'
Posted by: Sunetra Dabke
Date: December 30, 2015 12:32AM

Hi all,

I am using MySQL Workbench 6.1. I am not a database professional; I am Java Developer working in a reputed software company. I am working on database stuff right now. I need to create one generic script which should execute properly on famous RDBMS technologies. Though it is not possible to do so for DROP TABLE syntax so we have created different independent scripts now. We have used ANSI SQL syntax for creating other queries. But they want other queries as it is in ANSI SQL.
MySQL Workbench and driver too giving us trouble in doing so because of below query:

CREATE TABLE PatternMasterGranularBRMatch
(
PatternId INT NOT NULL,
PrimaryCommand VARCHAR(50) NULL,
Pattern VARCHAR(2000) NULL,
EquivalentCode varchar(4000) NULL,
PseudoCode VARCHAR(10) NULL,
LanguageType VARCHAR(50) NULL,
ClientName VARCHAR(50) NULL
) ;

INSERT INTO PatternMasterGranularBRMatch (PatternId, PrimaryCommand, Pattern, EquivalentCode, PseudoCode, LanguageType)VALUES (8, 'CALLROUTINES2TLINK', '*<IDENTIFIER> * </IDENTIFIER>.', 'S2T{a href=&quot;javascript:OpenNewWindow(\''./<<1>>-<<2>>.html\'',\''<<2>>\'')&quot;S2T}S2T{font color="#006400"S2T}S2T{bS2T}<<2>>S2T{/bS2T}S2T{/fontS2T}S2T{/aS2T}', NULL, 'FORTE');


Because all other RDBMS (SQL Server, Oracle) support single quote (') as escape character; but only MySQL requires backslash (\) as escapse character. When I searched for this on Internet, they told me below settings:
SET GLOBAL sql_mode = 'NO_BACKSLASH_ESCAPES';
SET SESSION sql_mode = 'NO_BACKSLASH_ESCAPES';

But these are not working in workbench environment. I have tried this in Command Line mode and these are working correctly. But we want this solution in MySQL workbench and driver as well because we are going to use Advanced Installer for running a script file. Can someone please advice me some solution so that we can use generic script??

Thank you so much in advance...

Options: ReplyQuote


Subject
Views
Written By
Posted
Problem using sql mode - 'NO_BACKSLASH_ESCAPES'
1587
December 30, 2015 12:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.