Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Incremental Loading problem (Insert, Update Delete)

Hello

This is my first post on the community although I have learn almost everything I know for Qlikview from it the last 3 years.

So thank you qlikview and qlikview fans for this massive knowledge offered so widely.

I have a problem with incremental loading script getting an error message as seen below.

Also I am attaching the script file I am using.

(the DB is SQLSERVER 2008)

The COSTMAIN_COSTDATE is (datetime , null) field and the select gives 2016-05-04 00:00:00.000.

Thanks in advance for any help provided

Michael M.

Script error.png

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try to add an

Exit Script;

statement just before the line with the STORE statement (it seems this line is throwing an error, right?) and check your data model created up to this using the table viewer (CTRL-T).

Which tables do you see and how many rows do each table show?

View solution in original post

10 Replies
swuehl
MVP
MVP

If you want to access a table on a database server, you need to establish a database connection and then use a SELECT statement to load the data.

A LOAD statement can be used as preceding load statement on top of the SQL select, but not as a standalone statement to access the DB.

Not applicable
Author

Mr Wuhl

Thanks for your reply.

The database connection is on the MAIN TAB and the script runs smoothly up to the point that the variable '$(LAST_UPDATED_DATE)' gives the value on the where clause. So except from the connection I must have an incorrect load order or syntax on my script.because

So I made some changes replacing LOAD with select and I am getting a new error message (attached).

Probably I messed the script up.

new_error message.png

Please advice

thanks in advance

Michael

Ricardo_Gerhard
Employee
Employee

Dear Michael,

  Try to use the Wizard to connect.

  Anyway, bellow, two videos to help you how connect to databases.

Loading ODBC Data into QlikView - YouTube

QlikView - Connect and Query Data - YouTube

   Please, mark the CORRECT/HELPFULL comments.

Regards,

Ricardo Gerhard

Ricardo Gerhard
OEM Solution Architect
LATAM
Clever_Anjos
Employee
Employee

Does z_constmain is a SQL table? If yes, please use SQL Select instead of LOAD

swuehl
MVP
MVP

Try enclosing your variable in the WHERE clause in single quotes (looks like you did this in the attached script, but can't see the single quotes in your first screenshot) and also format the variable as timestamp:

//Store Last Modified Date

let LAST_UPDATED_DATE = Timestamp(PEEK('MaxDate',0,'LAST_UPDATED_DATE'),'YYYY-MM-DD hh:mm:ss.fff');

[...]

WHERE

COSTMAIN_COSTDATE > '$(LAST_UPDATED_DATE)';

Not applicable
Author

Mr Wuhl thanks for your reply

Please spare 5 minutes to see some screen shots.

Thanks for the HELP to you an all community

swuehl
MVP
MVP

Try to add an

Exit Script;

statement just before the line with the STORE statement (it seems this line is throwing an error, right?) and check your data model created up to this using the table viewer (CTRL-T).

Which tables do you see and how many rows do each table show?

Not applicable
Author

Yes,

This was it. The 'Exit Script;'

Thank you very much for the precious knowledge transfer.

Very much obliged Mr Wuhl.

 

swuehl
MVP
MVP

Just to clarify, the 'exit script;' should just help you finding the cause of your issue, if you leave it in your script, your QVD is probably not getting updated.

So, I assume the issue was something else, right?