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

SQL Command Problem

Dear All,

I have a very basic query. I am not able to sort it out. the question seems to very silly though.

I am extracting data from ORACLE through SQL Command.. The data is very huge and I don't want to upload the whole data and I would like to do increment loading.

For that purpose I have written script as :

LET LastReloadTime = ReloadTime();

SQL SELECT * FROM HILCBS."XXHILCBS_MON_DETAILS_INST_ALL"
WHERE LAST_UPDATE_DATE >
$(LastReloadTime);

and the format of LAST_UPDATE_DATE is like for example 21.08.2015 18:00:00.

When executing the script, it is returning error as SQL Command not properly ended.

I know that the LastReloadTime should return as '21.08.2015 18:00:00'.

I mean to say between hyphen as shown above.

My RelaodTime is giving me desired format as I have modified the TimeStampFormat accordingly.

How to do that. Any help will be highly appreciated.

Thanks,

Manish Prasad

5 Replies
sinanozdemir
Specialist III
Specialist III

What is the format of "LAST_UPDATE_DATE"?

You can also format ReloadTime() with Date() funtion.

alex_millan
Creator III
Creator III

Hi Manish,

could you try this?

SQL SELECT * FROM HILCBS."XXHILCBS_MON_DETAILS_INST_ALL"

WHERE LAST_UPDATE_DATE > '$(LastReloadTime)';

HTH

Regards

kkkumar82
Specialist III
Specialist III

Hi,

Hi can you try by removing double quotes on the table name.

- KK -

Clever_Anjos
Employee
Employee

This should work

LET LastReloadTime = TimeStamp(ReloadTime(),'YYYY-MM-DD hh:mm:ss');

SQL SELECT * FROM HILCBS. XXHILCBS_MON_DETAILS_INST_ALL

WHERE LAST_UPDATE_DATE > '$(LastReloadTime)';

sasiparupudi1
Master III
Master III

try

if ReloadTime() returns the defualt timestamp format..

LET LastReloadTime = timestamp(ReloadTime(),'DD.MM.YYYY hh:mm:ss');


else if it returns a string in the odbc format

LET LastReloadTime = timestamp(timestamp#(ReloadTime(),'YYYY-MM-DD hh:mm:ss'),'DD.MM.YYYY hh:mm:ss');

SQL SELECT * FROM HILCBS."XXHILCBS_MON_DETAILS_INST_ALL"
WHERE LAST_UPDATE_DATE >'
$(LastReloadTime)';



hth

Sasi