Hi,
I'm using CR XI developer on my PC (latest updates have been applied). I'm connecting to a Teradata database via ODBC.
I've created an Add Command SQL statement. The statement is below and when executed it returns the message: Database Connector Error: 'Cannot obtain error message from server.'
Kicker though is the SQL statement does exeute and inserts 3 rows.
I know it should insert 3 rows because I can use another database query tool I have and run the exact same SQL and it inserts 3 rows. This other query tool connects to the exact same database with the exact same ODBC connection. No error encountered in this query tool though. And yes when I ran the SQL in Add Command I made sure the target table had been emptied out - no duplicate errors.
I know that CR is supposed to pass an Add Command statement directly to the database without changing it. So I'm not sure why its getting an error back. It's almost like its choking on the success or fail return code.
Any ideas why CR is barking or what it isn't understanding (as far as I know there isn't any error message coming back from the server)?
Thanks in advance.
I'm using CR XI developer on my PC (latest updates have been applied). I'm connecting to a Teradata database via ODBC.
I've created an Add Command SQL statement. The statement is below and when executed it returns the message: Database Connector Error: 'Cannot obtain error message from server.'
Kicker though is the SQL statement does exeute and inserts 3 rows.
I know it should insert 3 rows because I can use another database query tool I have and run the exact same SQL and it inserts 3 rows. This other query tool connects to the exact same database with the exact same ODBC connection. No error encountered in this query tool though. And yes when I ran the SQL in Add Command I made sure the target table had been emptied out - no duplicate errors.
I know that CR is supposed to pass an Add Command statement directly to the database without changing it. So I'm not sure why its getting an error back. It's almost like its choking on the success or fail return code.
Any ideas why CR is barking or what it isn't understanding (as far as I know there isn't any error message coming back from the server)?
Thanks in advance.
Code:
INS INTO MS130628.HOLD
SEL
program_no
,STR1.str1_web_id_cnt
,touch_desc
,touch_date
,SUBSTRING(comment_text,1,7) AS web_id
,SUBSTRING(comment_text FROM POSITION('|' IN comment_text) + 1) AS comment_text2
,POSITION(';' IN comment_text) + 1 AS start_pos_string_1
,SUBSTRING(comment_text FROM start_pos_string_1) AS rest_of_comment_text_1
,POSITION(';' IN rest_of_comment_text_1) + 1 + start_pos_string_1 - 1 AS start_pos_string_2
,SUBSTRING(comment_text FROM start_pos_string_2) AS rest_of_comment_text_2
,POSITION(';' IN rest_of_comment_text_2) + 1 + start_pos_string_2 - 1 AS start_pos_string_3
,SUBSTRING(comment_text FROM start_pos_string_3) AS rest_of_comment_text_3
,POSITION(';' IN rest_of_comment_text_3) + 1 + start_pos_string_3 - 1 AS start_pos_string_4
,SUBSTRING(comment_text FROM start_pos_string_4) AS rest_of_comment_text_4
,POSITION(';' IN rest_of_comment_text_4) + 1 + start_pos_string_4 - 1 AS start_pos_string_5
,start_pos_string_2 - start_pos_string_1 - 1 AS len_string_1
,start_pos_string_3 - start_pos_string_2 - 1 AS len_string_2
,start_pos_string_4 - start_pos_string_3 - 1 AS len_string_3
,start_pos_string_5 - start_pos_string_4 - 1 AS len_string_4
,LENGTH(comment_text) AS string_length
,(string_length - start_pos_string_5) + 1 AS len_string_5
,CASE WHEN start_pos_string_1 = 1 THEN 'N' ELSE 'Y'
END AS string_1_flag
,CASE WHEN string_1_flag = 'N' THEN 'N'
WHEN string_1_flag = 'Y' AND start_pos_string_2 = start_pos_string_1 THEN 'N'
WHEN string_1_flag = 'Y' AND start_pos_string_2 <> start_pos_string_1 THEN 'Y'
END AS string_2_flag
,CASE WHEN string_1_flag = 'N' THEN 'N'
WHEN string_1_flag = 'Y' AND start_pos_string_3 = start_pos_string_2 THEN 'N'
WHEN string_1_flag = 'Y' AND start_pos_string_3 <> start_pos_string_2 THEN 'Y'
END AS string_3_flag
,CASE WHEN string_1_flag = 'N' THEN 'N'
WHEN string_1_flag = 'Y' AND start_pos_string_4 = start_pos_string_3 THEN 'N'
WHEN string_1_flag = 'Y' AND start_pos_string_4 <> start_pos_string_3 THEN 'Y'
END AS string_4_flag
,CASE WHEN string_1_flag = 'N' THEN 'N'
WHEN string_1_flag = 'Y' AND start_pos_string_5 = start_pos_string_4 THEN 'N'
WHEN string_1_flag = 'Y' AND start_pos_string_5 <> start_pos_string_4 THEN 'Y'
END AS string_5_flag
,CASE WHEN string_1_flag = 'Y' and string_2_flag = 'N'
THEN SUBSTRING(comment_text FROM start_pos_string_1)
WHEN string_1_flag = 'Y' and string_2_flag = 'Y'
THEN SUBSTRING(comment_text FROM start_pos_string_1 FOR len_string_1)
ELSE 'N/A'
END AS string_1
,CASE WHEN string_2_flag = 'Y' and string_3_flag = 'N'
THEN SUBSTRING(comment_text FROM start_pos_string_2)
WHEN string_2_flag = 'Y' and string_3_flag = 'Y'
THEN SUBSTRING(comment_text FROM start_pos_string_2 FOR len_string_2)
ELSE 'N/A'
END AS string_2
,CASE WHEN string_3_flag = 'Y' and string_4_flag = 'N'
THEN SUBSTRING(comment_text FROM start_pos_string_3)
WHEN string_3_flag = 'Y' and string_4_flag = 'Y'
THEN SUBSTRING(comment_text FROM start_pos_string_3 FOR len_string_3)
ELSE 'N/A'
END AS string_3
,CASE WHEN string_4_flag = 'Y' and string_5_flag = 'N'
THEN SUBSTRING(comment_text FROM start_pos_string_4)
WHEN string_4_flag = 'Y' and string_5_flag = 'Y'
THEN SUBSTRING(comment_text FROM start_pos_string_4 FOR len_string_4)
ELSE 'N/A'
END AS string_4
,CASE WHEN string_5_flag = 'Y'
THEN SUBSTRING(comment_text FROM start_pos_string_5 FOR len_string_5)
ELSE 'N/A'
END AS string_5
FROM
RMDB.rmal_v_programtouch PGMTOUCH
JOIN
(
SEL
SUBSTRING(comment_text FROM (POSITION('(' IN comment_text) + 1) FOR 7)
,COUNT(*)
FROM
RMDB.rmal_v_actualtouch ACTTOUCH
JOIN RMDB.rmal_v_actualtouch_touchresult TOUCHRES
ON ACTTOUCH.touch_no = TOUCHRES.touch_no
WHERE
touchresult_no = 3065
AND touchtype_no = 16
AND program_no = 3083
GROUP BY 1
) STR1 (str1_web_id, str1_web_id_cnt)
ON web_id = STR1.str1_web_id
WHERE
program_no = 3083;