【发布时间】:2018-07-17 19:55:31
【问题描述】:
假设您有一个接受单个参数的现有存储过程,该参数恰好是the BOOLEAN Informix data type:
test_bool_param(BOOLEAN)
对于这样的存储过程,EXECUTE PROCEDURE 语句会是什么样子?
这是我尝试过但失败的方法:
EXECUTE PROCEDURE test_bool_param('true'); -- [Error Code: -1260, SQL State: IX000] It is not possible to convert between the specified types.
EXECUTE PROCEDURE test_bool_param('false');-- [Error Code: -1260, SQL State: IX000] It is not possible to convert between the specified types.
EXECUTE PROCEDURE test_bool_param('TRUE'); -- [Error Code: -1260, SQL State: IX000] It is not possible to convert between the specified types.
EXECUTE PROCEDURE test_bool_param('FALSE');-- [Error Code: -1260, SQL State: IX000] It is not possible to convert between the specified types.
EXECUTE PROCEDURE test_bool_param(true); -- [Error Code: -201, SQL State: 42000] A syntax error has occurred.
EXECUTE PROCEDURE test_bool_param(false); -- [Error Code: -201, SQL State: 42000] A syntax error has occurred.
EXECUTE PROCEDURE test_bool_param(TRUE); -- [Error Code: -201, SQL State: 42000] A syntax error has occurred.
EXECUTE PROCEDURE test_bool_param(FALSE); -- [Error Code: -201, SQL State: 42000] A syntax error has occurred.
EXECUTE PROCEDURE test_bool_param(1); -- [Error Code: -674, SQL State: IX000] Routine (test_bool_param) can not be resolved.
EXECUTE PROCEDURE test_bool_param(0); -- [Error Code: -674, SQL State: IX000] Routine (test_bool_param) can not be resolved.
EXECUTE PROCEDURE test_bool_param('\1'); -- [Error Code: -1260, SQL State: IX000] It is not possible to convert between the specified types.
EXECUTE PROCEDURE test_bool_param('\0'); -- [Error Code: -1260, SQL State: IX000] It is not possible to convert between the specified types.
EXECUTE PROCEDURE test_bool_param('t'); -- [Error Code: -1260, SQL State: IX000] It is not possible to convert between the specified types.
EXECUTE PROCEDURE test_bool_param('f'); -- [Error Code: -1260, SQL State: IX000] It is not possible to convert between the specified types.
EXECUTE PROCEDURE test_bool_param('T'); -- [Error Code: -1260, SQL State: IX000] It is not possible to convert between the specified types.
EXECUTE PROCEDURE test_bool_param('F'); -- [Error Code: -1260, SQL State: IX000] It is not possible to convert between the specified types.
EXECUTE PROCEDURE test_bool_param(t); -- [Error Code: -201, SQL State: 42000] A syntax error has occurred.
EXECUTE PROCEDURE test_bool_param(f); -- [Error Code: -201, SQL State: 42000] A syntax error has occurred.
EXECUTE PROCEDURE test_bool_param(T); -- [Error Code: -201, SQL State: 42000] A syntax error has occurred.
EXECUTE PROCEDURE test_bool_param(F); -- [Error Code: -201, SQL State: 42000] A syntax error has occurred.
EXECUTE PROCEDURE test_bool_param(\1); -- [Error Code: -202, SQL State: IX000] An illegal character has been found in the statement.
EXECUTE PROCEDURE test_bool_param(\0); -- [Error Code: -202, SQL State: IX000] An illegal character has been found in the statement.
【问题讨论】:
标签: stored-procedures boolean informix