ODBC Driver for Zoho Books

Build 22.0.8479

パラメータ化されたステートメント

次のコード例は、パラメータをバインドしてパラメータ化されたステートメントを作成する方法を示します。

シングルユース ステートメント

RODBCext のsqlExecute 関数は、クエリパラメータを値にバインドするための追加のデータフレームを受け入れます。

sqlExecute(
    cnx,
    query = "SELECT InvoiceId, InvoiceNumber FROM INVOICES WHERE CustomerName = ?",
    data = data.frame("NewTech Industries")
)

results <- sqlGetResults(cnx, max = 1000)
while (is.data.frame(results)) {
    for (row in 1:nrow(results)) {
        cat(paste("InvoiceId = ", results[row,]$InvoiceId, "\n"))
        cat(paste("InvoiceNumber = ", results[row,]$InvoiceNumber, "\n"))
    }
    results <- sqlGetResults(cnx, max = 1000)
}

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8479