Registersql: Difference between revisions

From Data Islands
No edit summary
No edit summary
Line 40: Line 40:


SQL Statement: select "IDCUST","IDBILLCYCL" from testarcus where "IDBILLCYCL" like '%BILLMT%' OR "IDBILLCYCL"='"abc"'
SQL Statement: select "IDCUST","IDBILLCYCL" from testarcus where "IDBILLCYCL" like '%BILLMT%' OR "IDBILLCYCL"='"abc"'
---
'''Delete a SQL statement'''
removesql "NAME"

Revision as of 17:58, 25 November 2024

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


---

Here is how we can register a sql statement with double quote vaules:

>registersql "sqltest38" "get 38 2" "select "IDCUST","IDBILLCYCL" from testarcus where "IDBILLCYCL" like '%{0}%' OR "IDBILLCYCL"='"abc"'"

And we can see the result as:

>test_registersql "sqltest38" "BILLMT"

Fetched data with rows#20

SQL Statement: select "IDCUST","IDBILLCYCL" from testarcus where "IDBILLCYCL" like '%BILLMT%' OR "IDBILLCYCL"='"abc"'

---

Delete a SQL statement

removesql "NAME"