Push

From Data Islands
Revision as of 10:54, 14 February 2024 by WikiSysopdi (talk | contribs) (removed incorrect documentation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Syntax : push <ISLANDNAME> [A/D/U] "<COLUMN LIST>" "<DESCRIPTION>" <ENTER>

Description : Creates a data island in the current region and adds the data based on the previous run query. 


For the FILES provider ONLY, please note that the files (which we get from querydb) will be uploaded to the server.

We also have one optional parameter 'a' append or 'd' delete or 'u' update, so if user try to store data into existing island then application will ask whether we are going to appened or we need to delete the existing island first. 

With update option, we need to provide column list with comma separate with double quotes in the place of description.


Example querydb with push that updates based on the idfield


querydb "SELECT  trim(IDCUST)+'_'+DB_NAME() as [idfield],

trim(IDCUST) as IDCUST,

trim(NAMECUST) as NAMECUST,AMTBALDUEH, AMTBALDUET,

DATELASTIV,

trim(AUDTORG) as AUDTORG,trim(TEXTSNAM) as TEXTSNAM,trim(TEXTSTRE1) as TEXTSTRE1,trim(TEXTSTRE2) as TEXTSTRE2,

trim(TEXTSTRE3) as TEXTSTRE3,trim(TEXTSTRE4) as TEXTSTRE4,

trim(NAMECITY) as NAMECITY,trim(CODESTTE) as CODESTTE,trim(CODEPSTL)as CODEPSTL,

trim(CODECTRY) as CODECTRY,trim(NAMECTAC) as NAMECTAC,

trim(TEXTPHON1) as TEXTPHON1,trim(TEXTPHON2) as TEXTPHON2,trim(CODETERR)as CODETERR,

trim(IDACCTSET) as IDACCTSET,AMTCRLIMT as AMTCRLIMT,trim(EMAIL1) as EMAIL1, trim(EMAIL2) as EMAIL2,

trim(PRICLIST) as PRICLIST,

'' as acstatus, getdate() as acdatadatetime, DB_NAME() AS acdbname,

'' as islandid, '' as acpassword, '' as acportalaccess

FROM   ARCUS  where DATELASTMN> convert(varchar, getdate()-1, 112)"


push arcustomers u "idfield"


You can see we filter

FROM   ARCUS  where DATELASTMN> convert(varchar, getdate()-1, 112)"

so we only get the latest data


JINT - Javascript integration

 di.push("islandname", dataTable)
 di.push("islandname", dataTable, "u/a/d")
 di.push("islandname", dataTable, "u/a/d", "column list")
 di.push("islandname", dataTable, "u/a/d", "column list", "description")