SET DESCRIPTOR

|           SET DESCRIPTOR           |                            |                            |                  |                           |
|:----------------------------------:|----------------------------|----------------------------|------------------|---------------------------|
|[Prev](ecpg-sql-set-connection.html)|[Up](ecpg-sql-commands.html)|36.14. Embedded SQL Commands|[Home](index.html)| [Next](ecpg-sql-type.html)|

---

## SET DESCRIPTOR

SET DESCRIPTOR — set information in an SQL descriptor area

## Synopsis

```
SET DESCRIPTOR descriptor_name descriptor_header_item = value [, ... ]
SET DESCRIPTOR descriptor_name VALUE number descriptor_item = value [, ...]

```

## Description

`SET DESCRIPTOR` populates an SQL descriptor area with values. The descriptor area is then typically used to bind parameters in a prepared query execution.

 This command has two forms: The first form applies to the descriptor “header”, which is independent of a particular datum. The second form assigns values to particular datums, identified by number.

## Parameters

*`descriptor_name`*

 A descriptor name.

*`descriptor_header_item`*

 A token identifying which header information item to set. Only `COUNT`, to set the number of descriptor items, is currently supported.

*`number`*

 The number of the descriptor item to set. The count starts at 1.

*`descriptor_item`*

 A token identifying which item of information to set in the descriptor. See [Section 36.7.1](ecpg-descriptors.html#ECPG-NAMED-DESCRIPTORS) for a list of supported items.

*`value`*

 A value to store into the descriptor item. This can be an SQL constant or a host variable.

## Examples

```
EXEC SQL SET DESCRIPTOR indesc COUNT = 1;
EXEC SQL SET DESCRIPTOR indesc VALUE 1 DATA = 2;
EXEC SQL SET DESCRIPTOR indesc VALUE 1 DATA = :val1;
EXEC SQL SET DESCRIPTOR indesc VALUE 2 INDICATOR = :val1, DATA = 'some string';
EXEC SQL SET DESCRIPTOR indesc VALUE 2 INDICATOR = :val2null, DATA = :val2;

```

## Compatibility

`SET DESCRIPTOR` is specified in the SQL standard.

## See Also

[ALLOCATE DESCRIPTOR](ecpg-sql-allocate-descriptor.html), [GET DESCRIPTOR](ecpg-sql-get-descriptor.html)

---

|[Prev](ecpg-sql-set-connection.html)|[Up](ecpg-sql-commands.html)| [Next](ecpg-sql-type.html)|
|:-----------------------------------|:--------------------------:|--------------------------:|
|           SET CONNECTION           |     [Home](index.html)     |            TYPE           |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>