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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
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
Support
Support

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