Push: Difference between revisions

From Data Islands
No edit summary
m (removed incorrect documentation)
 
(2 intermediate revisions by the same user not shown)
Line 9: Line 9:


With update option, we need to provide column list with comma separate with double quotes in the place of description.
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,
<nowiki>''</nowiki> as acstatus, getdate() as acdatadatetime, DB_NAME() AS acdbname,
<nowiki>'' as islandid, '' as acpassword, ''</nowiki> 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")

Latest revision as of 10:54, 14 February 2024

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")