帮助TCL功能 [英] help with TCL function
问题描述
大家好,
之前有人用这个TCL触发功能帮助了我:
创建或替换函数tlow()返回触发器为''
设置NEW($ 1)[string tolower $ NEW($ 1)]
返回[array get NEW]''
language' 'pltcl'';
我用它来强制插入db中的小写值。但是有一个
问题,如果参数不存在,该函数将给出一个
错误消息。我希望在tolower之前检查是否为null
是否适用。在semicode:
if($ 1<> NULL){
设置NEW($ 1)[string tolower $ NEW($ 1)]
}
返回[array get NEW]''
但我不知道如何在TCL中执行此操作。有人可以告诉我吗?
非常感谢!
-------------------- -------(播出结束)---------------------------
提示3:如果通过Usenet发布/阅读,请发送适当的
subscribe-nomail命令到 ma **** ***@postgresql.org ,以便您的
消息可以干净地通过邮件列表
Hello everybody,
Someone helped me earlier with this TCL trigger function:
create or replace function tlow() returns trigger as ''
set NEW($1) [string tolower $NEW($1)]
return [array get NEW]''
language ''pltcl'';
I use it to force lowercase of values inserted in the db. There is one
problem though, if the parameter is absent, the function will give an
error message. I would like it to rather check for null before tolower
is applicated. In semicode:
if ($1 <> NULL) {
set NEW($1) [string tolower $NEW($1)]
}
return [array get NEW]''
but I have no idea how to do this in TCL. Can somebody please tell me?
Thanks a lot!
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly
推荐答案
1)[string tolower
1) [string tolower
NEW(
1)]
return [array get新]''
语言''pltcl'';
我用它来强制插入数据库中的小写值。但是有一个
问题,如果参数不存在,该函数将给出一个
错误消息。我希望在tolower之前检查是否为null
是否适用。在semicode:
if(
1)]
return [array get NEW]''
language ''pltcl'';
I use it to force lowercase of values inserted in the db. There is one
problem though, if the parameter is absent, the function will give an
error message. I would like it to rather check for null before tolower
is applicated. In semicode:
if (
这篇关于帮助TCL功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!