Registersql

From Data Islands
Revision as of 17:56, 25 November 2024 by WikiSysopdi (talk | contribs)

We can register a sql with using registersql command.

(Syntax : registersql "sqlname" "description" "sql statement" <ENTER>)

Example

>registersql "getBerlinCustomers" "return only customers from Berlin" "select \"CustomerID\", \"CompanyName\", \"City\", \"Phone\" from customers where City='Berlin'"

Sage 100 Example

We register the SQL

>registersql "getEntityData" "Get island data" "select * from {0} where 150=150 and {1}={2}"

And from the console we can test this

>test_registersql "getEntityData" "arcustomers,idfield,'02_ALLENAP'"

and then this returns the SQL and whether it is valid or not

EG

Fetched data with rows#1

SQL Statement: select * from arcustomers where 150=150 and idfield='02_ALLENAP'

Then from here you can call thsis via a REST API