datastore

With datastore you can store any data in the memory or can save it in the database.        

datastores are very simple to use

 

declare datastore with the name lds

instance datastore lds

 

read data from database

lds=select ....

 

destroy (very important)

destroy=lds

 

 

You can access the values with Place holders <objectname.spaltenname> and / or within the multi mode with <datastorename.spaltenname> (inside the Multimode you need to provide the objectname.

 

Set a field with a value:

objectname.columnname.value=<value>

 

Get a field value:

messagebox=<objectname.columnname.value>

 

The attribute "value"  is not compelling on this occasion

 

Example:

instance datastore lds
// we don't use "select *"
// faster is command "select (fieldfrom="tablename") ..."
lds=select (fieldfrom="OITM") from "OITM"
// go to first row
lds.setrow=1
if <lds.itemcode.value> = "myitem" then
   lds.u_beas_match.value=yes
end if
destroy=lds

 

Videos:

youtube Display content of a datastore

youtube Extended Datastore Import

youtube bsl and datastore

 

Commands:

 

Method

Description

multimode=<0/1>

select=<sqlstatement>

hmtoggle_plus1 Generate datastore with this sql-Statement

bsl=<odata get command>

execute <procedure>

hmtoggle_plus1  Generate datastore with the result from the sql-procedure

add=<sql>

add=<psr-file>
multimode:
add=mytds=<sql>

setrow=<row>

Set the actual row.

setrow=-x,+x,top,buttom
  setrow=top

  setrow=<loop>

  setrow=+5  

  setrow=tomtom=10

hmtoggle_plus1  Set the current row.

destroy

Destroy all Datastores.



dir=<director>

sort=<sortarguments>

Sort the Datastore

lds=sort=itemcode d

filter=<arguments>

Filter the Datastore

lds=filter=substring(itemcode,1,1)='1'

find=<argument>

insertrow

Insert a row the then end end set the Cursor on that row
lds=insertrow

deleterow

Delete the current row and set the cursor to the next row.

lds=deleterow

setitem=<colname>=<value>

Set Item.

lds=setitem=itemname=hello

rowscopy=<datasdlatore>

rowscopytodwx=<dw_x>

copy datastore in datawindow dw_x

lds=rowscopytodwx=dw_1

updatetable=<table>

updatetable=<table[,primary[,primary]]>

 

 

update

Updates the DataStore

 

 

Method

Description

addfield=fieldname=length=typ

Add a field to the Datastore
typ=n,i or d=numeric, d=datetime, otherwise Chars

fieldreset

reset all fields which has been declared with "addfield"

getparent=<datastorename>

 

get reference datastorevalue from the parent window

instance datastore mydts

mydts=getparent=mydtsfromparentwindow

 

getparentcopy=<datastorevalue>

get copy from the parent datastorevalue

declare=mydts=ue_datastorevalues

mydts=getparentcopy=mydtsfromparentwindow

blobread=<id>

blobwrite=<id>=<filename>

 

Export / Import

Methode

Description

saveas=<typ>=<filename>

Export the DataStore into value or file in different formats

importfromfile=<filename>

importfromdbfile

importfromexcel

importfromxml=<filename>[<tab>Properties]

importfromfile=<filename>[<tab>Properties]

importfromxmlstring=<string>

Import from string. Format see importfromxml

importdbstring=<dbstring>

Import from string in Datastore from Format "dbstring"

return errormessage in "value". If empty, all is ok

example:

lds1.saveas=dbstring

lds2.importdbstring=<value>