ホーム › System.Search › SQLPutData
SQLPutData
関数実行時パラメータや列のデータを部分的に送信する。
シグネチャ
// ODBC32.dll
#include <windows.h>
SHORT SQLPutData(
void* StatementHandle,
void* Data,
INT StrLen_or_Ind
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| StatementHandle | void* | inout |
| Data | void* | in |
| StrLen_or_Ind | INT | in |
戻り値の型: SHORT
各言語での呼び出し定義
// ODBC32.dll
#include <windows.h>
SHORT SQLPutData(
void* StatementHandle,
void* Data,
INT StrLen_or_Ind
);[DllImport("ODBC32.dll", ExactSpelling = true)]
static extern short SQLPutData(
IntPtr StatementHandle, // void* in/out
IntPtr Data, // void*
int StrLen_or_Ind // INT
);<DllImport("ODBC32.dll", ExactSpelling:=True)>
Public Shared Function SQLPutData(
StatementHandle As IntPtr, ' void* in/out
Data As IntPtr, ' void*
StrLen_or_Ind As Integer ' INT
) As Short
End Function' StatementHandle : void* in/out
' Data : void*
' StrLen_or_Ind : INT
Declare PtrSafe Function SQLPutData Lib "odbc32" ( _
ByVal StatementHandle As LongPtr, _
ByVal Data As LongPtr, _
ByVal StrLen_or_Ind As Long) As Integer
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SQLPutData = ctypes.windll.odbc32.SQLPutData
SQLPutData.restype = ctypes.c_short
SQLPutData.argtypes = [
ctypes.POINTER(None), # StatementHandle : void* in/out
ctypes.POINTER(None), # Data : void*
ctypes.c_int, # StrLen_or_Ind : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ODBC32.dll')
SQLPutData = Fiddle::Function.new(
lib['SQLPutData'],
[
Fiddle::TYPE_VOIDP, # StatementHandle : void* in/out
Fiddle::TYPE_VOIDP, # Data : void*
Fiddle::TYPE_INT, # StrLen_or_Ind : INT
],
Fiddle::TYPE_SHORT)#[link(name = "odbc32")]
extern "system" {
fn SQLPutData(
StatementHandle: *mut (), // void* in/out
Data: *mut (), // void*
StrLen_or_Ind: i32 // INT
) -> i16;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ODBC32.dll")]
public static extern short SQLPutData(IntPtr StatementHandle, IntPtr Data, int StrLen_or_Ind);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ODBC32_SQLPutData' -Namespace Win32 -PassThru
# $api::SQLPutData(StatementHandle, Data, StrLen_or_Ind)#uselib "ODBC32.dll"
#func global SQLPutData "SQLPutData" sptr, sptr, sptr
; SQLPutData StatementHandle, Data, StrLen_or_Ind ; 戻り値は stat
; StatementHandle : void* in/out -> "sptr"
; Data : void* -> "sptr"
; StrLen_or_Ind : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "ODBC32.dll"
#cfunc global SQLPutData "SQLPutData" sptr, sptr, int
; res = SQLPutData(StatementHandle, Data, StrLen_or_Ind)
; StatementHandle : void* in/out -> "sptr"
; Data : void* -> "sptr"
; StrLen_or_Ind : INT -> "int"; SHORT SQLPutData(void* StatementHandle, void* Data, INT StrLen_or_Ind)
#uselib "ODBC32.dll"
#cfunc global SQLPutData "SQLPutData" intptr, intptr, int
; res = SQLPutData(StatementHandle, Data, StrLen_or_Ind)
; StatementHandle : void* in/out -> "intptr"
; Data : void* -> "intptr"
; StrLen_or_Ind : INT -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
odbc32 = windows.NewLazySystemDLL("ODBC32.dll")
procSQLPutData = odbc32.NewProc("SQLPutData")
)
// StatementHandle (void* in/out), Data (void*), StrLen_or_Ind (INT)
r1, _, err := procSQLPutData.Call(
uintptr(StatementHandle),
uintptr(Data),
uintptr(StrLen_or_Ind),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // SHORTfunction SQLPutData(
StatementHandle: Pointer; // void* in/out
Data: Pointer; // void*
StrLen_or_Ind: Integer // INT
): Smallint; stdcall;
external 'ODBC32.dll' name 'SQLPutData';result := DllCall("ODBC32\SQLPutData"
, "Ptr", StatementHandle ; void* in/out
, "Ptr", Data ; void*
, "Int", StrLen_or_Ind ; INT
, "Short") ; return: SHORT●SQLPutData(StatementHandle, Data, StrLen_or_Ind) = DLL("ODBC32.dll", "int SQLPutData(void*, void*, int)")
# 呼び出し: SQLPutData(StatementHandle, Data, StrLen_or_Ind)
# StatementHandle : void* in/out -> "void*"
# Data : void* -> "void*"
# StrLen_or_Ind : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。