I have SQL files that define a business model inside my application. In order to make them more readable and 'debugable' by humans I would like to use a preprocessor before sending them to the mysql database. I'm trying to use filepp (http://rpm.pbone.net/manpage_idpl_2294391_numer_1_nazwa_filepp.html) generic preprocessor but when I define a string as a macro it will not output the rest of the line e.g.:
#define CCSTRING INSERT INTO DOMPOSPBS(ID,POS,PBS,VARIANT,PATTERN,SUBPART,PVARS,km3pos,VISIBLE)
set @TOPH_nv := ' 3.4 3.4.5.1.1 3.4.5.1.2 3.4.5.1.3 3.4.5.1.4 3.4.5.5.5' ;
set @TOPH := ' 3.4.5.1';
set @TOPS_nv := ' 3.4 3.4.5.1.2 3.4.5.1.3 3.4.5.1.4 3.4.5.5.5';
set @TOPS := ' 3.4.5.2';
set @BOTS := ' 3.4.5.1.0 3.4.5.4';
set @BOTHE := ' 3.4.5.1.0 3.4.5.3';
set @BOTS_nv := ' 3.4 3.4.5.3.1 3.4.5.3.2 3.4.5.3.3 3.4.5.5.5';
set @BOTHF := ' 3.4.5.3.3 3.4.5.5.4';
set @BOTHF_nv := ' 3.4 3.4.5.5.5';
set @DOM := ' 3.4';
set @DOMF := ' 3.4.5.5.5';
CCSTRING VALUES('1','PM_T00_F4 (0)','3.4.2.3','','',@TOPS,'ANY','0',1);
CCSTRING VALUES('1','PM_T00_F4 (0)','3.4.2.3','','',@TOPS_nv,'ANY','0',0);
CCSTRING VALUES('2','PM_T01_E5 (1)','3.4.2.3','','',@TOPS,'ANY','1',1);
will output:
set @TOPH_nv := ' 3.4 3.4.5.1.1 3.4.5.1.2 3.4.5.1.3 3.4.5.1.4 3.4.5.5.5' ;
set @TOPH := ' 3.4.5.1';
set @TOPS_nv := ' 3.4 3.4.5.1.2 3.4.5.1.3 3.4.5.1.4 3.4.5.5.5';
set @TOPS := ' 3.4.5.2';
set @BOTS := ' 3.4.5.1.0 3.4.5.4';
set @BOTHE := ' 3.4.5.1.0 3.4.5.3';
set @BOTS_nv := ' 3.4 3.4.5.3.1 3.4.5.3.2 3.4.5.3.3 3.4.5.5.5';
set @BOTHF := ' 3.4.5.3.3 3.4.5.5.4';
set @BOTHF_nv := ' 3.4 3.4.5.5.5';
set @DOM := ' 3.4';
set @DOMF := ' 3.4.5.5.5';
INSERT INTO DOMPOSPBS(ID,POS,PBS,VARIANT,PATTERN,SUBPART,PVARS,km3pos,VISIBLE)
INSERT INTO DOMPOSPBS(ID,POS,PBS,VARIANT,PATTERN,SUBPART,PVARS,km3pos,VISIBLE)
INSERT INTO DOMPOSPBS(ID,POS,PBS,VARIANT,PATTERN,SUBPART,PVARS,km3pos,VISIBLE)
without the rest of the line. Any suggestion ?
After many tests I have found that the problem was a CRLF at the end of macro definition line. Leaving only the LF has solved the problem.