# mssqlCall

## Description

Directly access or call a mssql Web Service.

## Input / Parameters

| No | Name      | Description                                                               | Data Type | Required |
| -- | --------- | ------------------------------------------------------------------------- | --------- | -------- |
| 1  | connector | Name of connector and created in the Services and Global Components page. | String    | Yes      |
| 2  | ent       | The Web Service name to be called.                                        | String    | Yes      |
| 3  | function  | The function from the Web Service to be executed.                         | String    | Yes      |
| 4  | data      | This contains the main parameter in the function being called.            | Object    | Yes      |
| 5  | filter    | Filter details to be used in retrieving the data.                         | Object    | No       |
| 6  | orFilter  | Filter details to be used in retrieving the data.                         | Object    | No       |

## Output

Coming soon.

## Callback

Coming soon.

## Video

Coming soon.

## Example

The user wants to call the mssql Web Service.

### Step

1. Create MSSQL Connector in Services and define the name, url, port, database, user, password and timeOut.\
   Name: mssql\
   url: mkals4utt4.database.windows.net port: 1433\
   database: emobiq\_demo\_1\
   user: sqladmin\
   password: \*\*\*\*\*\*\*\*\
   timeOut: 5000

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-8d8295c71afd9445e4693d0b9a5953c3a5046676%2FmssqlCall-step-1.png?alt=media)
2. Create MSSQL Table in Services and define the Name, connector, listKey and serviceName timeOut.\
   Name: tbl\_1\
   mssql: mssql\
   listKey: data\
   serviceName: user\_package<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-12dd02399e97ec0969f693d989e113d9ff39877c%2FmssqlCall-step-2.png?alt=media)
3. Fill in the field caption for MssqlDataset Fields and generate datalist.\
   Field Caption: 1,2,3,4,5,6<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-e9ede452d6d67a5c8aca2cd62d7c535149a2fa98%2FmssqlCall-step-3.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-f4d3f355a9fa3ad390b3af8a46b2fc645bec9af1%2FmssqlCall-step-4.png?alt=media)<br>
4. Call the function "mssqlCall"and define the connector, ent, function and set the function"toObject"to data.\
   connector: mssql\
   ent: user\_package\
   function: insert\
   data: toObject<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-e057a818e4af2820ede91c1e08cd7257b06e1a05%2FmssqlCall-step-5.png?alt=media)
5. Define the column and value for object. ( Please refer to the images below, we have our own database:emobiq\_demo\_1 and inside this database we have 6 column which are id(not need to create due to the id no will auto increment), icnum, name, handphone, address, package.)\
   icnum: 9\
   name: 9\
   handphone: 9\
   address: 9\
   package: 9 (auto display 1)<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-a78ee56ce7f7683c2c141d1cf7a5cce2ee63ec54%2FmssqlCall-step-6.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-6821a40a5d87057179f55f4d9924cbbeef9bc4f7%2FmssqlCall-step-7.png?alt=media)
6. Add a console for display the response from console.<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-4fb0c9a5598ad6ab752616a452d86605c682495c%2FmssqlCall-step-8.png?alt=media)

### Result

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-91ff68b438ab67e76c81fdd2c8b2a9fc186daa57%2FmssqlCall-result-1.png?alt=media)

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-17f73b39293c1cc67634e5b58304aeb9e7aed6c9%2FmssqlCall-result-2.png?alt=media)

## Links

Coming soon.
