我的表格是
SELECT REPLACE(text, 'a','b')
FROM DUAL;
如果字符串text = a','b','c
如何将字符串放在replacd函数中以使其正确运行?
答案 0 :(得分:2)
像这样使用替代引用运算符:volatile uint8_t receivedResponse;
// in the main
for(int i = 0; i < countRegister ; i++)
{
register[i].toCharArray(tempRegister, 80);
receivedResponse = 0;
ether.browserUrl(PTSR("/log.php"), tempRegister , browser_callback);
while (!receivedResponse)
ether.packetLoop(ether.packetReceive());
}
// the callback
static void browser_callback (byte status, word off, word len)
{
Serial.println("Data sent");
receivedResponse = 1;
}
或者:
test := q'[a','b','c]';
更多信息here。
这是在Sqlplus中证明它的另一种方法:
SELECT REPLACE(q'[a','b','c]', 'a','b')
FROM DUAL;
答案 1 :(得分:0)
Escape每个单引号带有第二个单引号:
SELECT REPLACE( 'a'',''b'',''c','a','b') FROM DUAL