1)I created a table with NUMBER(10) datatype.
When i ran sel * from table;
I got the following error:
unable to obtain data value because the teradata database indicated that the data type is ambiguous
2)Whereas when i ran the same table without removing NUMBER(10) along with the column names i got the result.
SEL Col1,Col2 from table
3) When i changed the datatype it worked fine.
SEL * FROM table;
I would like to understand as to what the ambiguity was when i given the primary key and primary index in the table.
And which doc should i refer in info.teradata.com to get an indepth understanding on EXPLAIN PLAN and LOCKING.
I am using 14.0.3 the VM developer version. I tried the below sample DDL:
CREATE MULTISET TABLE jugal.Employee,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
(EmpId INT CONSTRAINT PK_1 PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1 INCREMENT BY 1 MAXVALUE 20 MINVALUE 5 CYCLE),
ManagerId BIGINT NOT NULL,
EmpName CHAR(20) CASESPECIFIC NOT NULL,
DeptName VARCHAR(10) NOT CASESPECIFIC UPPERCASE,
DeptId BYTEINT NOT NULL DEFAULT 100 CONSTRAINT UK_1 UNIQUE,
Roles SMALLINT ,
GrossSal FLOAT CHECK (GrossSal > 10000),
NetSal DEC(8,2) FORMAT '$b$$,$$9.99'
When i removed the PF NUMBER(10), the SEL query worked fine.
It seems you are missing a coma at the end of NetSal DEC(8,2) FORMAT '$b$$,$$9.99' .
Maybe you can try with it?
There is a comma missing after "NetSal DEC(8,2) FORMAT '$b$$,$$9.99'"
If an application executes a query that returns a NUMBER data value from the Teradata Database while using an old version of the Teradata JDBC Driver that does not support the NUMBER data type, then the following exception may be thrown.
[Error 1245] [SQLState HY000] Unable to obtain data value because the Teradata Database indicated that the data type is ambiguous
The solution is to upgrade to a newer version of the Teradata JDBC Driver that supports the NUMBER data type.
I would have missed it, while copying the code.
I am using the TDExpress14.0.3_Sles10_4GB VMware Developer Version. N i am not aware of the Driver been used. I had no prob creating the table(So it means it supports). When i executed it with the following query:
SEL * FROM jugal.employee; -- I got this error --Unable to obtain data value because the Teradata Database indicated that the data type is ambiguous
When i executed the query with the column list. Like Follows it showed no error:
SEL EmpId,ManagerId FROM jugal.employee;
Maybe you can upgrade to 14.10. It is more stable.
Many functions are also stable there.
If you include the NUMBER column in your query, you get an error. If you omit the NUMBER column from your query, it works OK. It seems clear that the problem is due to a lack of NUMBER data type support in the Teradata JDBC Driver version that you are using.
What tool or application are you using to execute your query? Are you using Teradata Studio? (Teradata Studio uses the Teradata JDBC Driver to access the Teradata Database.)