Skip to content

Commit 0f5972e

Browse files
authored
Update README.md
1 parent 097df83 commit 0f5972e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
[![Gitter](https://img.shields.io/badge/Available%20on-Intersystems%20Open%20Exchange-00b2a9.svg)](https://community.intersystems.com)
44

5-
### Overview
5+
## Overview
66

77
This is an ObjectScript function to convert any sql query into a dynamic object. This returned object will have a key/value pair based on the fieldname and value from the query's result set. The function also has helpful optional parameters to let you switch namespaces on a per-query basis, and change the mode and dialect.
88

9-
### Features
9+
## Features
1010

1111
This function aims to be a one-stop shop for your sql needs, and is especially useful if you need the output eventually converted into json, as shown in the examples section. There are four parameters to the Build function that should be understood before using this code:
1212

@@ -15,14 +15,14 @@ This function aims to be a one-stop shop for your sql needs, and is especially u
1515
* **Mode (Optional String)**: Default Value = "0" - Determines which mode the query will be run on
1616
* **Dialect (Optional String)**: Default Value = "IRIS" - Determines which dialect the query will use
1717

18-
## Mode
18+
### Mode
1919

2020
Mode values are as follows:
2121
* **0**: Logical
2222
* **1**: ODBC
2323
* **2**: Display
2424

25-
## Dialect
25+
### Dialect
2626

2727
For more information on these different dialect options, see [this article](https://irisdocs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_dynsql#GSQL_dynsql_dialect).
2828
* **Sybase**
@@ -31,15 +31,16 @@ For more information on these different dialect options, see [this article](http
3131
* **IRIS**
3232
* **CACHE** (If using older versions)
3333

34-
### Example
34+
## Example Usage
3535
```sh
3636
USER> write ##class(SQLtoObject.SQLtoObject).Build("SELECT AircraftCategory FROM Aviation.Aircraft","SAMPLES")
3737
27@%Library.DynamicArray
38+
3839
USER> write ##class(SQLtoObject.SQLtoObject).Build("SELECT AircraftCategory FROM Aviation.Aircraft","SAMPLES").%ToJSON()
3940
[{"AircraftCategory":"Airplane"},{"AircraftCategory":"Airplane"},{"AircraftCategory":"Airplane"}... etc.
4041
```
4142
4243
SQL errors will be written out immediately, and logic errors will be returned in the return object
4344
44-
### Version history
45+
## Version history
4546
2019-07-18 - v1.0 - Initial commit of function with features outlined in description

0 commit comments

Comments
 (0)