mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-30 14:28:50 +01:00
outline nvl
This commit is contained in:
parent
98191f1b2b
commit
5eb03ba814
@ -179,25 +179,13 @@ public:
|
|||||||
DynamicAny value(const std::string& name, std::size_t row) const;
|
DynamicAny value(const std::string& name, std::size_t row) const;
|
||||||
/// Returns the data value at named column, row location.
|
/// Returns the data value at named column, row location.
|
||||||
|
|
||||||
DynamicAny nvl(const std::string& name, const DynamicAny& deflt) const
|
DynamicAny nvl(const std::string& name, const DynamicAny& deflt) const;
|
||||||
/// Returns the value in the named column of the current row
|
/// Returns the value in the named column of the current row
|
||||||
/// if the value is not NULL, or deflt otherwise.
|
/// if the value is not NULL, or deflt otherwise.
|
||||||
{
|
|
||||||
if (isNull(name))
|
|
||||||
return deflt;
|
|
||||||
else
|
|
||||||
return value(name, _currentRow);
|
|
||||||
}
|
|
||||||
|
|
||||||
DynamicAny nvl(std::size_t index, const DynamicAny& deflt) const
|
DynamicAny nvl(std::size_t index, const DynamicAny& deflt) const;
|
||||||
/// Returns the value in the given column of the current row
|
/// Returns the value in the given column of the current row
|
||||||
/// if the value is not NULL, or deflt otherwise.
|
/// if the value is not NULL, or deflt otherwise.
|
||||||
{
|
|
||||||
if (isNull(index, _currentRow))
|
|
||||||
return deflt;
|
|
||||||
else
|
|
||||||
return value(index, _currentRow);
|
|
||||||
}
|
|
||||||
|
|
||||||
const RowIterator& begin();
|
const RowIterator& begin();
|
||||||
/// Moves the row cursor to the first row and returns the pointer to row.
|
/// Moves the row cursor to the first row and returns the pointer to row.
|
||||||
|
@ -203,4 +203,22 @@ bool RecordSet::moveLast()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DynamicAny RecordSet::nvl(const std::string& name, const DynamicAny& deflt) const
|
||||||
|
{
|
||||||
|
if (isNull(name))
|
||||||
|
return deflt;
|
||||||
|
else
|
||||||
|
return value(name, _currentRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DynamicAny RecordSet::nvl(std::size_t index, const DynamicAny& deflt) const
|
||||||
|
{
|
||||||
|
if (isNull(index, _currentRow))
|
||||||
|
return deflt;
|
||||||
|
else
|
||||||
|
return value(index, _currentRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Data
|
} } // namespace Poco::Data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user