Unexpected conversion error while converting value [BigNumber] to a BigNumber - pentaho

I am getting the field X from a lookup and trying to Load into a table using Insert/Update. But I get an error saying "Unexpected conversion error while converting value [BigNumber] to a BigNumber"
I have even used select values and gave type with Big Number and still doesn't work. Any Suggestions?
Insert / update.0 - ERROR (version 8.2.0.0-342, build 8.2.0.0-342 from 2018-11-14 10.30.55 by buildguy) : Error in step, asking everyone to stop because of:
2019/04/13 18:48:37 - Insert / update.0 - ERROR (version 8.2.0.0-342, build 8.2.0.0-342 from 2018-11-14 10.30.55 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseException:
2019/04/13 18:48:37 - Insert / update.0 - offending row : [visitGroupRefnum BigNumber], [visitRefnum BigNumber], [questionRefnum BigNumber], [answerid Integer(9)]
2019/04/13 18:48:37 - Insert / update.0 -
2019/04/13 18:48:37 - Insert / update.0 - Error setting value #3 [BigNumber] on prepared statement
2019/04/13 18:48:37 - Insert / update.0 -
2019/04/13 18:48:37 - Insert / update.0 - Unexpected conversion error while converting value [questionRefnum BigNumber] to a BigNumber
2019/04/13 18:48:37 - Insert / update.0 -
2019/04/13 18:48:37 - Insert / update.0 -
2019/04/13 18:48:37 - Insert / update.0 -
2019/04/13 18:48:37 - Insert / update.0 - at org.pentaho.di.core.database.Database.setValues(Database.java:1076)
2019/04/13 18:48:37 - Insert / update.0 - at org.pentaho.di.trans.steps.insertupdate.InsertUpdate.lookupValues(InsertUpdate.java:83)
2019/04/13 18:48:37 - Insert / update.0 - at org.pentaho.di.trans.steps.insertupdate.InsertUpdate.processRow(InsertUpdate.java:299)
2019/04/13 18:48:37 - Insert / update.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2019/04/13 18:48:37 - Insert / update.0 - at java.lang.Thread.run(Thread.java:748)
2019/04/13 18:48:37 - Insert / update.0 - Caused by: org.pentaho.di.core.exception.KettleDatabaseException:
2019/04/13 18:48:37 - Insert / update.0 - Error setting value #3 [BigNumber] on prepared statement
2019/04/13 18:48:37 - Insert / update.0 -
2019/04/13 18:48:37 - Insert / update.0 - Unexpected conversion error while converting value [questionRefnum BigNumber] to a BigNumber
2019/04/13 18:48:37 - Insert / update.0 -
2019/04/13 18:48:37 - Insert / update.0 -
2019/04/13 18:48:37 - Insert / update.0 - at org.pentaho.di.core.row.value.ValueMetaBase.setPreparedStatementValue(ValueMetaBase.java:5473)
2019/04/13 18:48:37 - Insert / update.0 - at org.pentaho.di.core.database.Database.setValue(Database.java:1058)
2019/04/13 18:48:37 - Insert / update.0 - at org.pentaho.di.core.database.Database.setValues(Database.java:1074)
2019/04/13 18:48:37 - Insert / update.0 - ... 4 more
2019/04/13 18:48:37 - Insert / update.0 - Caused by: org.pentaho.di.core.exception.KettleValueException:
2019/04/13 18:48:37 - Insert / update.0 - Unexpected conversion error while converting value [questionRefnum BigNumber] to a BigNumber
2019/04/13 18:48:37 - Insert / update.0 -
2019/04/13 18:48:37 - Insert / update.0 - at org.pentaho.di.core.row.value.ValueMetaBase.getBigNumber(ValueMetaBase.java:2205)
2019/04/13 18:48:37 - Insert / update.0 - at org.pentaho.di.core.row.value.ValueMetaBase.setPreparedStatementValue(ValueMetaBase.java:5455)
2019/04/13 18:48:37 - Insert / update.0 - ... 6 more
2019/04/13 18:48:37 - Insert / update.0 - Caused by: java.lang.ClassCastException

Your PDI transformation is parsing the header row. It's trying to convert the literal string "questionRefnum" to a number. If you're reading from a file make sure you have the right number of header rows set.

Related

Reporting Services - Excel column with number format

I am using the following function to format a calculation in Reporting Services 2012:
=Format(DateAdd("s", (DateDiff(DateInterval.Second, Fields!FechaInicio.Value, Fields!FechaFinal.Value)), "00:00:00"), "HH:mm:ss")
When I export the file to Excel it shows me the column with the General data type. Is there a way for the column to be exported with the Numeric data type?
You have two options; Cast and Convert. See the code below and adapt to your needs
--Drop Table t
SELECT *
INTO t
FROM (VALUES
(45, 'alex'),
(98, 'diana'),
(32, 'peter'),
(98, 'daniel'),
(45, 'alex'),
(23, 'bob'),
(98, 'peter')
)
v (id, name)
Select *
From t
SELECT CAST(id AS INT) FROM t;
GO
SELECT CONVERT(INT,id) FROM t;
GO
Here is a link for more info.
https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-ver15

Does Derby support INTERVAL for date

I am doing performance testing on Apache Derby (10.14.2). I am using TPCH benchmarking for the same. I have completed the dbgen part of the TPCH and populated the database. There are 22 queries in the TPCH benchmarking queries. I am not able to convert the 1st query to suit the syntax of the Apache Derby. In the make file, I gave the DB as DB2. Since there is no Apache Derby option present there.
Query is as follows:
select
l_returnflag,
l_linestatus,
sum(l_quantity) as sum_qty,
sum(l_extendedprice) as sum_base_price,
sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
avg(l_quantity) as avg_qty,
avg(l_extendedprice) as avg_price,
avg(l_discount) as avg_disc,
count(*) as count_order
from
lineitem
where
l_shipdate <= '1998-12-01' - interval ':1' day (3)
group by
l_returnflag,
l_linestatus
order by
l_returnflag,
l_linestatus;
Error from the ij tool:
ERROR 42X01: Syntax error: Encountered "\':1\'" at line 15, column 47.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
Is there a way to generate the queries for Apache Derby in TPCH. Or tool which can covert the queries to Apache Derby.
Thanks in advance.
You can try the TIMESTAMPADD() function:
WHERE l_shipdate <= CAST({fn TIMESTAMPADD(SQL_TSI_DAY, -1, CAST('1998-12-01 00:00:00' AS TIMESTAMP))} AS DATE)

Warning : Trigger created with compilation errors

I wrote this trigger to update the date of avaibility of a video when a broadcast is added
CREATE OR REPLACE TRIGGER update_avaibility
AFTER INSERT ON CAST FOR EACH ROW
DECLARE
lastCast DATE;
BEGIN
SELECT MAX(diffusionDate)
INTO lastCast
FROM CAST
WHERE idVideo = :NEW.idVideo;
UPDATE VIDEO
SET diffusionDate = (lastCast + 14 day)
WHERE idVideo = :NEW.idVideo;
END;
/
However I have the following warning when I run it :
Warning: Trigger created with compilation errors.
I have the following errors :
LINE/COL ERROR
---------- -------------------------------------
5/2 SQL Statement ignored
5/61 ORA-00907: missing right parenthesis
Can someone help me and tell me what i am doing wrong ? Thanks.
the first error is
lastCast + 14 day
if lastCast is date. you should change to
lastCast + 14
or to
lastCast + interval '14' day

unable to delete records from DB Browser for SQLite

I am trying to delete all records from a table which is older than 10 minutes and keep only those which are 10 mins away from the current time. I tried using the following query statements but keep getting errors. exire_time Here is how it shows in DB Browser for SQLite
"2016-07-25 04:47:05.452000"
"2016-07-25 04:51:44.892000"
"2016-07-25 04:47:31.052000"
"2016-07-25 04:40:13.068000"
"2016-07-25 04:54:56.284000"
Please help.
DELETE FROM mytable WHERE expire_time < (UNIX_TIMESTAMP() - 600);
Error: no such function: UNIX_TIMESTAMP:
DELETE FROM `mytable` WHERE `expire_time` < ADDDATE(NOW(), INTERVAL -10 MINUTE);
Error: near "MINUTE": syntax error:
DELETE FROM mytable WHERE expire_time < (NOW() - INTERVAL 10 MINUTE)
Error: near "10": syntax error:
DELETE FROM mytable WHERE expire_time < DATE_SUB(NOW(),INTERVAL 15 MINUTE);
Error: near "15": syntax error:

VB to SQL Power Of Calculation

I am trying to convert this calculation from VB into SQL, how would I go about this? -
1.2 * 10 ^ -7
The value it returns in the VB app is 0.00000012
I have tried the following with no success -
select (1.2 * power(10, -7))
select (power((1.2 * 10), -7))
Any help would be appreciated...
Thanks in advance
try
select (1.2 / power(10, 7))