Page tree

Should you require any more information or have encountered a problem, please call the support helpdesk on (07) 5456 6000.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

GELLO can query a database. This example will show some some code that queries a database for a postcode based on a given locality. This page will then show it in use in an archetype.

Here is some code for this:

imports DB_Postcodes
Let retrievedSuburbName: String = 'Bray Park' -- this will be the entered Suburb or locality
Let retrievedStateName: String = 'NSW' -- this will be the entered State
Let postcodeTable: Sequence(TBL_csv)= csv
Let selectedRowOrRows: Sequence(TBL_csv) = postcodeTable->select((Suburb_locality = retrievedSuburbName)
and (State = retrievedStateName))
Let postcodeAsInteger: Integer = selectedRowOrRows.Postcode ->flatten()->last()
Let result: Real = postcodeAsInteger.oclAsType(Real)

DB_Postocdes in this case is a csv file. The MO Gello Authoring tool will also load SQL Lite file and Firebird files.

  • No labels