getEdition method
Get the Oracle Database edition name.
Returns the edition that this connection is using. Editions enable online application upgrades by allowing multiple versions of database objects to coexist.
Returns: The edition name, or empty string if using the default edition.
Example:
final edition = await connection.getEdition();
if (edition.isNotEmpty) {
print('Using edition: $edition');
} else {
print('Using default edition');
}
See also:
- Oracle Database documentation on Edition-Based Redefinition
Implementation
Future<String> getEdition() async {
_ensureConnected();
final editionPtr = _memoryManager.allocate<Pointer<Char>>(sizeOf<Pointer<Char>>());
final editionLength = _memoryManager.allocate<Uint32>(sizeOf<Uint32>());
final result = _dpiOracle.dpiConn_getEdition(
_connectionPtr.value,
editionPtr,
editionLength,
);
if (result == DPI_FAILURE) {
return '';
}
if (editionLength.value == 0) {
return '';
}
return StringUtils.fromNativeUtf8(editionPtr.value);
}