# IRPCObjectTypesAdmin.ParseSQLSelectStatement

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Object type administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ParseSQLSelectStatement/

Badges: `Administration API / specialized` `admin` `session` `idempotent`

Connects to an external database and returns the source table and columns of a SELECT
statement, to set up the column mappings of an external object type.

- **Service:** [Object type administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/index.md) `MFiles.IRPCObjectTypesAdmin`
- **gRPC method:** `/MFiles.IRPCObjectTypesAdmin/ParseSQLSelectStatement`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/parse-sqlselect-statement`
- **Request:** [`ParseSQLSelectStatementRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ParseSQLSelectStatement/index.md#request)
- **Response:** [`ParseSQLSelectStatementResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ParseSQLSelectStatement/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Requires `change_metadata_structure` and `license_allows_modifications`. The server opens the
  connection itself, so the call also requires the server right `run_code` (system
  administrator), unless the connection string matches the providers and settings that the
  server allows for vault administrators.
- An empty `connection_string` (the vault's own database) is always refused with
  "Access denied.".
- Read-only: nothing is saved. Apply the result with
  [ModifyObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ModifyObjectType/index.md).

<a id="request"></a>

## Request: ParseSQLSelectStatementRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `connection_string` | `string` | OLE DB connection string of the external database. |
| `select_statement` | `string` | The SELECT statement to parse. |

<a id="response"></a>

## Response: ParseSQLSelectStatementResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `source_table` | `string` | The name of the source table. |
| `putf8szcolmappings[]` | repeated [`ObjectTypeColumnMapping`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeColumnMapping/index.md) | One mapping per column in the SELECT list, with only the source column details set; fill in the target property definitions yourself. |
| `putf8szcolmappings[].object_type` | `int32` | Object type ID. |
| `putf8szcolmappings[].ordinal` | `int32` | One-based source field ordinal. |
| `putf8szcolmappings[].source_field` | `string` | Source field name. |
| `putf8szcolmappings[].data_type` | `uint32` | Source field's data type. |
| `putf8szcolmappings[].target_property_def` | `int32` | Target property definition. |
| `putf8szcolmappings[].can_insert` | `bool` | Is the source field part of insertion operations? |
| `putf8szcolmappings[].can_update` | `bool` | Is the source field part of update operations? |

<a id="related"></a>

## Related methods

- [ModifyObjectType](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectTypesAdmin/ModifyObjectType/index.md): Saves a changed definition of an object type or value list.
