Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Другие СУБД > Вызов справки SQL Error Code


Автор: Greg 13.9.2009, 17:43
Доброго времени суток.
Недавно я узнал что DB2 CLP позволяет получить описание SQLSTATE или его класса, например:
Цитата

C:\>db2 ? 08003

SQLSTATE 08003: The connection does not exist.

Цитата

C:\>db2 ? 08

 08: Connection Exception

Можно ли подобное получить для SQLERRORCODE ?
Спасибо.

Автор: Greg 17.9.2009, 13:11
Ответы:
Цитата

C:\>db2 ? sql418


SQL0418N  A statement contains a use of a parameter marker that is not
      valid.

Explanation:

Untyped parameter markers cannot be used:
*  in a SELECT list
*  as the sole argument of a datetime arithmetic operation
*  in some cases as the sole argument of a scalar function
*  as a sort key in an ORDER BY clause
*  as an argument of an XMLQUERY, XMLEXISTS or XMLTABLE expression.
*  as an argument of UNNEST, CARDINALITY, MAX_CARDINALITY or TRIM_ARRAY,
   or used in array element specification.
*  on the left hand side of an assignment statement when the data type
   of the right hand side cannot be determined

Parameter markers can never be used:
*  in a statement that is not a prepared statement
*  in the fullselect of a CREATE VIEW statement
*  in the triggered action of a CREATE TRIGGER statement

References to the PARAMETER function in the first argument of the XQuery
function db2-fn:sqlquery are also considered to be parameter markers.

The statement cannot be processed.

User response:

Correct the syntax of the statement. If untyped parameter markers are
not allowed, use the CAST specification to give the parameter marker a
data type.

 sqlcode: -418

 sqlstate: 42610

Или
Цитата

C:\>db2 ? sqln418


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)