Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
amba1
Contributor III
Contributor III

Database values are not imported but are visible in logrow

Hi everyone,

I have a strange issue here.

Basically I retrieve data from some files and import them in a database.

In my database I have a a table with a column called licenseplatekey. If no match is found, the value is set to -1.

When testing my job with a tlogrow, everything works perfectly, as you can see in the screenshot:

0695b00000H8rKNAAZ.png 

But when I import the data in my database, none of the data for the licenseplatekey column is imported. Each row just contains a NULL

All other columns are imported normally...

0695b00000H8rKwAAJ.png 

I also tried outputting the data in a csv files and it works as well.

 

Does anyone know what I might be doing wrong here?

Thanks!

Labels (6)
1 Solution

Accepted Solutions
amba1
Contributor III
Contributor III
Author

@guenneguez jeremy​ I was able to find the issue!

The licenseplatekey is a column that i added with an alter table after the table was created. I use a function to partition the tables and forgot to update the function with the new column. It is now working! Thanks for your help 🙂

View solution in original post

14 Replies
gjeremy1617088143

Hi @Not defined Not defined​ , could you share picture of your job ,component used and schema of them ?

also when you try to import them have you specific message in the console ?

 

When you say you try to import, does carpark_id already exist.(do you update or insert or both ?)

Maybe you have to check autocommit in you dbconnection component advanced settings.

Send me love and kudos

amba1
Contributor III
Contributor III
Author

hi @guenneguez jeremy​,

 

Here's a screenshot of the whole job to give you an idea of what I'm doing:

 

0695b00000H8rYyAAJ.pngAnd here's a picture of the last tMap (tmap-5)

 

0695b00000H8rWPAAZ.pnglicenseplatekey if else: Relational.ISNULL(licenseplate.licenseplatekey)?

(Relational.ISNULL(row7.key)?-1:row7.key):licenseplate.licenseplatekey 

 

Schema of target table:

 

0695b00000H8raGAAR.png

gjeremy1617088143

why you don't use tpostjob and tdbclose to close all your db connection ?

do you select auto commit on advanced settings of you tDBConnection component ?

the issue don't seem to be on the data but more on the database

also i see you have different db type for carpark id et licenceplate :

INT8 and INT4,maybe check your database tp see if you have the good db type

amba1
Contributor III
Contributor III
Author

I do use it, had no place left for the screenshot sorry:

 

0695b00000H8rcSAAR.png0695b00000H8rjIAAR.png 

gjeremy1617088143

if for example you use a tdbinput and a query on your table , a select * for example, and you do guess schema have you the same DB type in the schema as your db output ?

amba1
Contributor III
Contributor III
Author

The Schema seems to be the same as in the database:

 

0695b00000H8rmgAAB.pngWhen trying to get the schema with a tdbinput, i get the following error, database connection failed:

 

0695b00000H8roIAAR.pngjdbc:postgresql://localhost:5432/USERNAME?"" does not work as string of connection, am i missing something?=

 

gjeremy1617088143

in your tDBOutput advanced settings you can select debug query mode and you can acces to the query with this variable :

((String)globalMap.get("tDBOutput_1_QUERY"))

it can be a good way to investigate

gjeremy1617088143

put an empty string "" on jdbc parameters

amba1
Contributor III
Contributor III
Author

Database connection failed, but works when testing it from the metadata directly...