Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello all,
can you tell if the syntax of the function below is correct ?
Normally i must have in the variable (gvNoOfRowsLastLoad ) at least 1 line but apparently i retrieve nothing in the database.
when i execute the request in the database i have a data.
LET pSQLWhereClause = 'WHERE DATE_APPLI = To_Date(' & CHR(39) & Date(Date#($(LVDateModif),'YYYYMMDD'),'MM/DD/YYYY') & CHR(39) & ',' & CHR(39) & 'MM/DD/YYYY' & CHR(39) & ') ';
sub SrcLoad_LISTE_DATE_APPLI (pSQLTableName,pSQLWhereClause )
LET gvNoOfRowsLastLoad = 0 ;
// Load the QVD Table from the SQL table
LISTE_DATE_APPLI_MODIFIED:
LOAD DATE_APPLI; SQL SELECT DATE_APPLI FROM $(gvDBOwner).$(pSQLTableName) $(pSQLWhereClause);
LET gvNoOfRowsLastLoad = NoOfRows('LISTE_DATE_APPLI_MODIFIED') ;
Trace gvNoOfRowsLastLoad : $(gvNoOfRowsLastLoad) ;
for vRow = 0 to NoOfRows('LISTE_DATE_APPLI_MODIFIED')
Let MyVar = Peek('DATE_APPLI',vRow-1,'LISTE_DATE_APPLI_MODIFIED');
CALL srLoad_M2R_DTM_ACKTRANSACTION_INCR( pSQLTableName, MyVar) ;
next
end sub
Can you help please ?
Regards
Check the content of the variables you use. Does LVDateModif have a value? Does pSQLWhereClause get a correct value?
yes LVDateModif ='20160810' and yes pSQLWhereClause get WHERE DATE_APPLI = To_Date(' & CHR(39) & Date(Date#($(LVDateModif),'YYYYMMDD'),'MM/DD/YYYY') & CHR(39) & ',' & CHR(39) & 'MM/DD/YYYY' & CHR(39) & ')
Well, if pSQLWhereClause resolves to pSQLWhereClause = 'WHERE DATE_APPLI = To_Date(' & CHR(39) & Date(Date#($(LVDateModif),'YYYYMMDD'),'MM/DD/YYYY') & CHR(39) & ',' & CHR(39) & 'MM/DD/YYYY' & CHR(39) & ') ' I'm not suprised your SQL database doesn't understand it. It should resolve to something like WHERE DATE_APPLI = To_Date('08/10/2016', 'MM/DD/YYY'),
that's what i get that means i get --> WHERE DATE_APPLI = ToDate('08/10/2016', 'MM/DD/YYY')
Then you have to correct where clause. If your database doesn't like it then you have to figure out what the correct syntax for a where clause is.