Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sona_sa
Creator II
Creator II

Incremental Reload - SQL END Error

Hi For Incremental Reload, I have use this code :

SET vLastExecTime          = 0; // resetting vLastExecTime
LET vLastExecTime          = timestamp(if(isnull(QvdCreateTime('$(RawQVD_Path_Stage1_Data)\AP_INVOICES_ALL.QVD')), 0, ConvertToLocalTime(QvdCreateTime('$(RawQVD_Path_Stage1_Data)\AP_INVOICES_ALL.QVD'), 'GMT', 1)), 'MM/DD/YYYY hh:mm:ss');
LET vExecTime                  = timestamp(UTC(), 'MM/DD/YYYY hh:mm:ss');
LET vTodaysDate     = today();

LET FirstReload = isnull(QvdCreateTime('$(RawQVD_Path_Stage1_Data)\AP_INVOICES_ALL.QVD'));

if Not $(FirstReload) then
// Read Reload History Data
AP_INVOICES_ALL_HISTORY:
Load
*
FROM $(RawQVD_Path_Stage1_Data)\AP_INVOICES_ALL.QVD (qvd);
End if
AP_INVOICES_ALL_HISTORY:
LOAD
RowNo() as No,
'$(vLastExecTime)'
as [Last Reload Ended],
'$(vExecTime)'
as [Reload Started]
Autogenerate(1);

//ReloadHistory.qvd will keep track of when the last reload occurred for incremental loading purposes. If you need to reload all the data then delete ReloadHistory.qvd from your file structure.
STORE * FROM AP_INVOICES_ALL_HISTORY INTO $(RawQVD_Path_Stage1_Data)\AP_INVOICES_ALL_HISTORY.qvd;
DROP TABLE AP_INVOICES_ALL_HISTORY;
//*****************Add a list of tables to be loaded from your data source below.  Keep the first row "TableName".  This is the name of the field.
//TablesList:
//Load * Inline [
//TableName
//AP_INVOICES_ALL
//];
//
//For i = 0 to (NoOfRows('TablesList')-1);
//Let varTableName = Peek('TableName',$(i), 'TablesList');

// Load Tables
AP_INVOICES_ALL_SQL:
LOAD "INVOICE_ID",
"INVOICE_DATE";
SQL SELECT "INVOICE_ID",
"INVOICE_DATE"
FROM APPS."AP_INVOICES_ALL"
WHERE INVOICE_DATE >=
$(vLastExecTime) and INVOICE_DATE < $(vExecTime);
If Not $(FirstReload) and not isnull(QvdCreateTime('$(RawQVD_Path_Stage1_Data)\AP_INVOICES_ALL_SQL.qvd')) then
CONCATENATE 
Load *
FROM $(RawQVD_Path_Stage1_Data)\AP_INVOICES_ALL_HISTORY.qvd (qvd) WHERE NOT EXISTS(INVOICE_ID);   //
End if
If NoOfRows(AP_INVOICES_ALL_SQL) > 0 Then
STORE AP_INVOICES_ALL_SQL INTO $(RawQVD_Path_Stage1_Data)\AP_INVOICES_ALL_SQL.qvd;
DROP TABLE AP_INVOICES_ALL_SQL;
End if
Drop Table AP_INVOICES_ALL_SQL;
EXIT SCRIPT;

I am getting this error. So Can you suggest me on the same.


SQL##f - SqlState: S1000, ErrorCode: 933, ErrorMsg: [Oracle][ODBC][Ora]ORA-00933: SQL command not properly ended

SQL SELECT *

FROM APPS."AP_INVOICES_ALL"

WHERE INVOICE_DATE >= 06/22/2014 16:48:06 and INVOICE_DATE < 07/01/2014 09:34:58

0 Replies