Re: Asterisk и ODBC
[root@asterisk tmp]# isql -v asterisk-connector
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> select sum(billsec) from cdr
+----------+
| sum |
+----------+
| 5620819 |
+----------+
SQLRowCount returns 1
1 rows fetched
SQL> quit
[root@asterisk tmp]# cat sql.log
[ODBC][8069][__handles.c][444]
Exit:[SQL_SUCCESS]
Environment = 0x9d89b58
[ODBC][8069][SQLAllocHandle.c][345]
Entry:
Handle Type = 2
Input Handle = 0x9d89b58
[ODBC][8069][SQLAllocHandle.c][463]
Exit:[SQL_SUCCESS]
Output Handle = 0x9d8a130
[ODBC][8069][SQLConnect.c][3549]
Entry:
Connection = 0x9d8a130
Server Name = [asterisk-connector][length = 18 (SQL_NTS)]
User Name = [NULL]
Authentication = [NULL]
UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE 'UCS-2LE'
[ODBC][8069][SQLConnect.c][4123]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLAllocHandle.c][510]
Entry:
Handle Type = 3
Input Handle = 0x9d8a130
[ODBC][8069][SQLAllocHandle.c][872]
Exit:[SQL_SUCCESS]
Output Handle = 0x9dabbf0
[ODBC][8069][SQLPrepare.c][189]
Entry:
Statement = 0x9dabbf0
SQL = [select sum(billsec) from cdr ][length = 29 (SQL_NTS)]
[ODBC][8069][SQLPrepare.c][364]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLExecute.c][183]
Entry:
Statement = 0x9dabbf0
[ODBC][8069][SQLExecute.c][344]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLNumResultCols.c][149]
Entry:
Statement = 0x9dabbf0
Column Count = 0xbfddf91a
[ODBC][8069][SQLNumResultCols.c][234]
Exit:[SQL_SUCCESS]
Count = 0xbfddf91a -> 1
[ODBC][8069][SQLNumResultCols.c][149]
Entry:
Statement = 0x9dabbf0
Column Count = 0xbfddf668
[ODBC][8069][SQLNumResultCols.c][234]
Exit:[SQL_SUCCESS]
Count = 0xbfddf668 -> 1
[ODBC][8069][SQLColAttribute.c][277]
Entry:
Statement = 0x9dabbf0
Column Number = 1
Field Identifier = SQL_DESC_DISPLAY_SIZE
Character Attr = (nil)
Buffer Length = 0
String Length = (nil)
Numeric Attribute = 0xbfddf4e4
[ODBC][8069][SQLColAttribute.c][648]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLColAttribute.c][277]
Entry:
Statement = 0x9dabbf0
Column Number = 1
Field Identifier = SQL_DESC_LABEL
Character Attr = 0xbfddf4eb
Buffer Length = 301
String Length = (nil)
Numeric Attribute = (nil)
[ODBC][8069][SQLColAttribute.c][648]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLColAttribute.c][277]
Entry:
Statement = 0x9dabbf0
Column Number = 1
Field Identifier = SQL_DESC_LABEL
Character Attr = 0xbfddf7ab
Buffer Length = 301
String Length = (nil)
Numeric Attribute = (nil)
[ODBC][8069][SQLColAttribute.c][648]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLNumResultCols.c][149]
Entry:
Statement = 0x9dabbf0
Column Count = 0xbfddf668
[ODBC][8069][SQLNumResultCols.c][234]
Exit:[SQL_SUCCESS]
Count = 0xbfddf668 -> 1
[ODBC][8069][SQLFetch.c][158]
Entry:
Statement = 0x9dabbf0
[ODBC][8069][SQLFetch.c][340]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLColAttribute.c][277]
Entry:
Statement = 0x9dabbf0
Column Number = 1
Field Identifier = SQL_DESC_DISPLAY_SIZE
Character Attr = (nil)
Buffer Length = 0
String Length = (nil)
Numeric Attribute = 0xbfddf4e4
[ODBC][8069][SQLColAttribute.c][648]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLColAttribute.c][277]
Entry:
Statement = 0x9dabbf0
Column Number = 1
Field Identifier = SQL_DESC_LABEL
Character Attr = 0xbfddf4eb
Buffer Length = 301
String Length = (nil)
Numeric Attribute = (nil)
[ODBC][8069][SQLColAttribute.c][648]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLGetData.c][224]
Entry:
Statement = 0x9dabbf0
Column Number = 1
Target Type = 1 SQL_CHAR
Buffer Length = 301
Target Value = 0xbfddf7ab
StrLen Or Ind = 0xbfddf664
[ODBC][8069][SQLGetData.c][470]
Exit:[SQL_SUCCESS]
Buffer = [5620819]
Strlen Or Ind = 0xbfddf664 -> 7
[ODBC][8069][SQLFetch.c][158]
Entry:
Statement = 0x9dabbf0
[ODBC][8069][SQLFetch.c][340]
Exit:[SQL_NO_DATA]
[ODBC][8069][SQLRowCount.c][166]
Entry:
Statement = 0x9dabbf0
Row Count = 0xbfddf8e0
[ODBC][8069][SQLRowCount.c][237]
Exit:[SQL_SUCCESS]
Row Count = 0xbfddf8e0 -> 1
[ODBC][8069][SQLMoreResults.c][155]
Entry:
Statement = 0x9dabbf0
[ODBC][8069][SQLMoreResults.c][311]
Exit:[SQL_NO_DATA]
[ODBC][8069][SQLFreeStmt.c][140]
Entry:
Statement = 0x9dabbf0
Option = 1
[ODBC][8069][SQLFreeHandle.c][365]
Entry:
Handle Type = 3
Input Handle = 0x9dabbf0
[ODBC][8069][SQLFreeHandle.c][462]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLDisconnect.c][204]
Entry:
Connection = 0x9d8a130
[ODBC][8069][SQLDisconnect.c][341]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLFreeHandle.c][268]
Entry:
Handle Type = 2
Input Handle = 0x9d8a130
[ODBC][8069][SQLFreeHandle.c][317]
Exit:[SQL_SUCCESS]
[ODBC][8069][SQLFreeHandle.c][203]
Entry:
Handle Type = 1
Input Handle = 0x9d89b58
|