gpt4 book ai didi

testing - Fitnesse 和 dbFit : how to escape colons in SQL queries

转载 作者:行者123 更新时间:2023-11-28 19:57:22 25 4
gpt4 key购买 nike

当我将 dbFit 与 Fitnesse 一起使用时,我在 SQL 查询中转义冒号和破折号时遇到问题。

这样的声明是行不通的:

!|Query|select to_char(my_birthday,'YYYY-MM-DD HH24:MI:SI') from family|

我需要用其他可接受的字符替换冒号和破折号,例如。

!|Query|select to_char(my_birthday,'YYYY_MM_DD HH24_MI_SI') from family|

你知道如何在不使用第二种方法的情况下正确解决它吗?

干杯,福克斯拉菲

最佳答案

我认为这就是您所需要的。来自 http://dbfit.github.io/dbfit/docs/reference.html

Avoiding parameter mapping

If you want to prevent DbFit from mapping parameters to bind variables (eg to execute a stored procedure definition that contains the @ symbol in Sql Server), disable bind symbols option before running the query.

|set option|bind symbols|false|

|execute| insert into users (name, username) values ('@hey','uuu')|

|query|select * from users| |name|username| |@hey|uuu|

Remember to re-enable the option after the query is executed. You can use the same trick with the Execute command.

关于testing - Fitnesse 和 dbFit : how to escape colons in SQL queries,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19518366/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com