Print Page | Close Window

Teradata Producing Bad Query Error

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17862
Printed Date: 19 Apr 2024 at 10:47pm


Topic: Teradata Producing Bad Query Error
Posted By: BlakeJ
Subject: Teradata Producing Bad Query Error
Date Posted: 28 Oct 2012 at 8:22am
I posted this in the wrong forum earlier.
 
I'm getting an error in a sub-report that uses custom SQL in a command using a union query.  This query works fine when I run it in Teradata SQL Assistant but when I run it from Crystal Reports on my desktop I get this error:
"HY000:[NCR][ODBC Teradata Driver][Teradata Database] TDWM Filter Violation for Query Result: For Rule Name ‘LimitEndUserBadQuery3’[Database Vendor Code: -3149]"

The report uses one parameter for loan number.  I haven't been able to find reference to this error anywhere else on the Internet.  Has anyone seen this error before or know anything about it?



-------------
Blake



Replies:
Posted By: hilfy
Date Posted: 29 Oct 2012 at 6:17am

This is a Terradata error, not a Crystal Error.  I just did a quick Google search on:

 
Terradata error 3149
 
which came up with over 34K results.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: BlakeJ
Date Posted: 29 Oct 2012 at 9:29am
Finally figured it out.  It seems to be both Teradata and Crystal and how they're communicating.
 
The report ran fine for 2 years, and then after a Teradata driver update, began producing the error.
 
After much research and testing, finally figured out that Crystal was sending a loan number parameter as numeric now when it used to send it as a string (should be a string since it as leading zeros).  I solved the issue by putting single quotes around the parameter object in the SQL command.
 
Curiously, all other sub-reports in this report also use the loan number parameter, and it is sent correctly as a string in all of those.  It's only in the custom SQL where it suddenly started sending it as numeric.


-------------
Blake



Print Page | Close Window