Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Topic-icon Merged specific/Rdbms/Sybase IQ/REJECT Sybase IQ

  • Nicolas Verscheure
  • Nicolas Verscheure's Avatar Topic Author
  • Offline
More
28 Oct 2014 17:30 - 30 Oct 2014 18:09 #1 by Nicolas Verscheure
specific/Rdbms/Sybase IQ/REJECT Sybase IQ was created by Nicolas Verscheure
In action "insertion of rejects for AK" line 26, uses CONSTRAINT_REF instead of REF.
Here comes the correct code :

insert into %x{md:physicalPath($REF,'rejectName')}x%
(
	row_id,	
	REJECT_MODE,
	REJECT_MESSAGE,
	REJECTED_BY,
	RULE_NAME,
	RULE_TYPE,
	REJECT_DATE,
	%x{md:patternList($REF/ref:columns()[tech:isMapped()],'[colName]', ',\n\t')}x%
)
select
	rowid(CTRL),
	'%x{$REF/tech:rejectMode()}x%', 
	'%x{$CONSTRAINT_REF/tech:rejectMessage()}x%',
	'%x{$REF/tech:rejectedBy()}x%',
	'%x{$CONSTRAINT_REF/tech:name()}x%',
	'%x{$CONSTRAINT_REF/tech:constraintCode()}x%',
	%x{$REF/ref:target()/tech:dateFunction()}x%,
	%x{md:patternList($REF/ref:columns()[tech:isMapped()],'CTRL.[colName]', ',\n\t')}x%
from	%x{md:physicalPath($REF,'checkedName')}x% AS CTRL 
where	exists (
		select 	'R'
		from 	%x{md:physicalPath($REF,'checkedName')}x% TARG
		where		%x{md:patternList($REF/ref:columns()[if ($REF/tech:rejectMode()='S') then tech:isPK() else tech:isUK()],'TARG.[colName]=CTRL.[colName]', '\n\t\tand\t\t')}x%
		group by 	%x{md:patternList($CONSTRAINT_REF/ref:columns()[tech:isAk()],'TARG.[colName]', ',\n\t\t\t')}x%
		having 	count(1) > 1
)
%x{$REF/tech:filterPart()}x%
Last edit: 30 Oct 2014 18:09 by Nicolas Verscheure. Reason: Correct title