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