Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

get data from remote server on Linux

14 posts in General Discussion Last posting was on 2008-08-22 10:47:38.0Z
Ilya Rilichev Posted on 2008-08-14 13:31:50.0Z
Sender: 6ea7.48a414c9.1804289383@sybase.com
From: Ilya Rilichev
Newsgroups: ianywhere.public.general
Subject: get data from remote server on Linux
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48a433c6.71eb.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Aug 2008 06:31:50 -0700
X-Trace: forums-1-dub 1218720710 10.22.241.41 (14 Aug 2008 06:31:50 -0700)
X-Original-Trace: 14 Aug 2008 06:31:50 -0700, 10.22.241.41
Lines: 14
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7030
Article PK: 5254

OS Linux 2.6.18-92.el5.asp121 #1 SMP Tue May 27 18:22:11
EEST 2008 x + ASA 9.0.2.3612 + unixodbc 2.2.11 + freeTDS
0.82.
Has created a remote server which works on Windows platform
(MS SQL). From ISQLc(ASA) connect to ASA and execute
statment:
forward to ttt {select id,varchar_data from testtable};
I receive some records until there is a field "varchar_data"
value NULL. At reception of such record the ISQL deduces a
dialogue window with the text: "Run time SQL error --
FetchPiece() was called with an unexpected datatype of 9".
That it meant and how it to overcome?
In ISQL(unixodbc) and TSQL(freeTDS) it's query work
correctly. Varchar_data has data type varchar(20).


"Nick Elson" < Posted on 2008-08-14 15:46:21.0Z
From: "Nick Elson" <@@@nick@@@.@@@elson@sybase@@@.@@@com@@@>
Newsgroups: ianywhere.public.general
References: <48a433c6.71eb.1681692777@sybase.com>
Subject: Re: get data from remote server on Linux
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48a4534d$1@forums-1-dub>
Date: 14 Aug 2008 08:46:21 -0700
X-Trace: forums-1-dub 1218728781 10.22.241.152 (14 Aug 2008 08:46:21 -0700)
X-Original-Trace: 14 Aug 2008 08:46:21 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7031
Article PK: 5255

Since we probably don't test that combination it may be hard
to guess at the source of this error.

I would recommend turning up as much verbosity on the
tracing of this as is possible. Get and ODBCTrace
from the unixodbc layer and get the database server
to show what CIS is also doing (set option CIS_OPTION=6).

Comparing those will tell you where the error is being reported.
My guess is it is coming from the ODBC driver especially since
it works on the Windows platform. Also comparing what
happens (traced) on Windows to the what happens on
Linux may prove informative as well.

<Ilya Rilichev> wrote in message news:48a433c6.71eb.1681692777@sybase.com...
> OS Linux 2.6.18-92.el5.asp121 #1 SMP Tue May 27 18:22:11
> EEST 2008 x + ASA 9.0.2.3612 + unixodbc 2.2.11 + freeTDS
> 0.82.
> Has created a remote server which works on Windows platform
> (MS SQL). From ISQLc(ASA) connect to ASA and execute
> statment:
> forward to ttt {select id,varchar_data from testtable};
> I receive some records until there is a field "varchar_data"
> value NULL. At reception of such record the ISQL deduces a
> dialogue window with the text: "Run time SQL error --
> FetchPiece() was called with an unexpected datatype of 9".
> That it meant and how it to overcome?
> In ISQL(unixodbc) and TSQL(freeTDS) it's query work
> correctly. Varchar_data has data type varchar(20).


Ilya Rilichev Posted on 2008-08-14 19:46:55.0Z
Sender: 7aff.48a47546.1804289383@sybase.com
From: Ilya Rilichev
Newsgroups: ianywhere.public.general
Subject: Re: get data from remote server on Linux
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48a48baf.7f0f.1681692777@sybase.com>
References: <48a4534d$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Aug 2008 12:46:55 -0700
X-Trace: forums-1-dub 1218743215 10.22.241.41 (14 Aug 2008 12:46:55 -0700)
X-Original-Trace: 14 Aug 2008 12:46:55 -0700, 10.22.241.41
Lines: 124
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7032
Article PK: 5256


> Since we probably don't test that combination it may be
> hard to guess at the source of this error.
>
> I would recommend turning up as much verbosity on the
> tracing of this as is possible. Get and ODBCTrace
> from the unixodbc layer and get the database server
> to show what CIS is also doing (set option CIS_OPTION=6).
>
> Comparing those will tell you where the error is being
> reported. My guess is it is coming from the ODBC driver
> especially since it works on the Windows platform. Also
> comparing what happens (traced) on Windows to the what
> happens on Linux may prove informative as well.

Here, more simple version of query: select cast(NULL as
varchar).
I receive following results.

Server messages:

<---------BEGIN----------->
Connect to 'ttt' class 'odbc' using
'driver=/usr/lib64/libodbc.so;dsn=XXXX'
Connected to 'libtdsodbc.so' version '0.82' odbc version
'03.00'
Server name = 'XXXX\XXXX'
DBMS name = 'Microsoft SQL Server'
DBMS version = '08.00.0760'
ODBC conformance = level 2
ODBC SQL conformance = Core grammar
SQL identifier case = Case insensitive
Maximum connections = 0
Maximum statements = 1
SQLGetData extensions = any row,
Search pattern escape = '\'
Concatenation null behavior = SQL_CB_NULL
Cursor commit behavior = SQL_CC_CLOSE
Cursor rollback behavior = SQL_CR_CLOSE
Cursor types = value concurrency, rowver concurrency,
locking concurrency, read only
Read only datasource = 'N'
Correlation names are supported
Transactions are supported
Default isolation = read committed
Multiple result sets = 'Y'
Multiple transactions = 'Y'
Isolation options = read committed,
Outer join capabilities = inner, not ordered, all comparison
ops, nested, full, right, left
Maximum owner name length = 128
Maximum qualifier name length = 128
Maximum table name length = 128
ODBC datatype -150, datatype name = sql_variant, precision =
8000, prefix = , suffix = , create params =
ODBC datatype -11, datatype name = uniqueidentifier,
precision = 36, prefix = ', suffix = ', create params =
ODBC datatype -10, datatype name = ntext, precision =
1073741823, prefix = N', suffix = ', create params =
ODBC datatype -9, datatype name = nvarchar, precision =
4000, prefix = N', suffix = ', create params = max length
ODBC datatype -8, datatype name = nchar, precision = 4000,
prefix = N', suffix = ', create params = length
ODBC datatype -7, datatype name = bit, precision = 1, prefix
= , suffix = , create params =
ODBC datatype -6, datatype name = tinyint, precision = 3,
prefix = , suffix = , create params =
ODBC datatype -5, datatype name = bigint, precision = 19,
prefix = , suffix = , create params =
ODBC datatype -4, datatype name = image, precision =
2147483647, prefix = 0x, suffix = , create params =
ODBC datatype -3, datatype name = varbinary, precision =
8000, prefix = 0x, suffix = , create params = max length
ODBC datatype -2, datatype name = binary, precision = 8000,
prefix = 0x, suffix = , create params = length
ODBC datatype -1, datatype name = text, precision =
2147483647, prefix = ', suffix = ', create params =
ODBC datatype 1, datatype name = char, precision = 8000,
prefix = ', suffix = ', create params = length
ODBC datatype 2, datatype name = numeric, precision = 38,
prefix = , suffix = , create params = precision,scale
ODBC datatype 3, datatype name = decimal, precision = 38,
prefix = , suffix = , create params = precision,scale
ODBC datatype 4, datatype name = int, precision = 10, prefix
= , suffix = , create params =
ODBC datatype 5, datatype name = smallint, precision = 5,
prefix = , suffix = , create params =
ODBC datatype 6, datatype name = float, precision = 53,
prefix = , suffix = , create params =
ODBC datatype 7, datatype name = real, precision = 24,
prefix = , suffix = , create params =
ODBC datatype 12, datatype name = varchar, precision = 8000,
prefix = ', suffix = ', create params = max length
ODBC datatype 93, datatype name = datetime, precision = 23,
prefix = ', suffix = ', create params =
Forward to (ttt): select cast(NULL as varchar)
<---------END----------->

unix ODBC trace log (here run ASA):
<---------BEGIN----------->
[ODBC][6500][SQLDescribeCol.c][474]
Exit:[SQL_SUCCESS]
Column Name = []
Data Type = 0x446024e6 -> 12
Column Size = 0x446024e8 -> 30
Decimal Digits = 0x446024f4 -> 0
Nullable = 0x446024f6 -> 1
[ODBC][6500][SQLGetData.c][224]
Entry:
Statement = 0x2aac3000dfc0
Column Number = 1
Target Type = 1 SQL_CHAR
Buffer Length = 256
Target Value = 0x2aac300111b0
StrLen Or Ind = 0x4520e7e8
[ODBC][6500][SQLGetData.c][470]
Exit:[SQL_SUCCESS]
Buffer = SQL_NULL_DATA
Strlen Or Ind = 0x4520e7e8 -> -1
<---------END----------->

Here is all ok.
If execute "select cast(NULL as char)", then server send
random data or, some where, error specified above.
One more ideas.


Ilya Rilichev Posted on 2008-08-14 20:56:42.0Z
Sender: 7aff.48a47546.1804289383@sybase.com
From: Ilya Rilichev
Newsgroups: ianywhere.public.general
Subject: Re: get data from remote server on Linux
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48a49c0a.325.1681692777@sybase.com>
References: <48a4534d$1@forums-1-dub>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Aug 2008 13:56:42 -0700
X-Trace: forums-1-dub 1218747402 10.22.241.41 (14 Aug 2008 13:56:42 -0700)
X-Original-Trace: 14 Aug 2008 13:56:42 -0700, 10.22.241.41
Lines: 140
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7033
Article PK: 5257

I try execute first query (select id,varchar_data from
testtable) in PowerBuilder. This client ODBC tracing:
<--------BEGIN--------->
pb60 658-c8 ENTER SQLExecDirect
HSTMT 01D11718
UCHAR * 0x023705A0 [ -3] "select
id,varchar_data from testtable\ 0"
SDWORD -3

pb60 658-c8 EXIT SQLExecDirect with return code
0 (SQL_SUCCESS)
HSTMT 01D11718
UCHAR * 0x023705A0 [ -3] "select
id,varchar_data from testtable\ 0"
SDWORD -3

pb60 658-c8 ENTER SQLSetStmtOption
HSTMT 01D11718
UWORD 9 <SQL_ROWSET_SIZE>
SQLPOINTER 0x000003E8

pb60 658-c8 EXIT SQLSetStmtOption with return
code 0 (SQL_SUCCESS)
HSTMT 01D11718
UWORD 9 <SQL_ROWSET_SIZE>
SQLPOINTER 0x000003E8 (BADMEM)

pb60 658-c8 ENTER SQLBindCol
HSTMT 01D11718
UWORD 1
SWORD 4 <SQL_C_LONG>
PTR 0x02350020
SQLLEN 44
SQLLEN * 0x02380020

pb60 658-c8 EXIT SQLBindCol with return code 0
(SQL_SUCCESS)
HSTMT 01D11718
UWORD 1
SWORD 4 <SQL_C_LONG>
PTR 0x02350020
SQLLEN 44
SQLLEN * 0x02380020 (0)

pb60 658-c8 ENTER SQLBindCol
HSTMT 01D11718
UWORD 2
SWORD 1 <SQL_C_CHAR>
PTR 0x023A0020
SQLLEN 22
SQLLEN * 0x024D0020

pb60 658-c8 EXIT SQLBindCol with return code 0
(SQL_SUCCESS)
HSTMT 01D11718
UWORD 2
SWORD 1 <SQL_C_CHAR>
PTR 0x023A0020
SQLLEN 22
SQLLEN * 0x024D0020 (0)

pb60 658-c8 ENTER SQLExtendedFetch
HSTMT 01D11718
UWORD 1 <SQL_FETCH_NEXT>
SQLLEN 1
SQLULEN * 0x0013EA04
UWORD * 0x012C0020

pb60 658-c8 EXIT SQLExtendedFetch with return
code -1 (SQL_ERROR)
HSTMT 01D11718
UWORD 1 <SQL_FETCH_NEXT>
SQLLEN 1
SQLULEN * 0x0013EA04
UWORD * 0x012C0020

DIAG [S1000] [Sybase][ODBC Driver][Adaptive Server
Anywhere]Server 'ttt': [unixODBC][Driver Manager]Function
sequence error (-660)

DIAG [S1000] [Sybase][ODBC Driver][Adaptive Server
Anywhere]Run time SQL error -- FetchPiece() was called with
an unexpected datatype of 9 (-300)

pb60 658-c8 ENTER SQLErrorW
HENV 01D11540
HDBC 01D115E8
HSTMT 01D11718
WCHAR * 0x0013E990 (NYI)
SDWORD * 0x0013E9DC
WCHAR * 0x0013E590
SWORD 512
SWORD * 0x0013E9E4

pb60 658-c8 EXIT SQLErrorW with return code 0
(SQL_SUCCESS)
HENV 01D11540
HDBC 01D115E8
HSTMT 01D11718
WCHAR * 0x0013E990 (NYI)
SDWORD * 0x0013E9DC (-660)
WCHAR * 0x0013E590 [ 110] "[Sybase][ODBC
Driver][Adaptive Server Anywhere]Server 'ttt':
[unixODBC][Driver Manager]Function sequence error"
SWORD 512
SWORD * 0x0013E9E4 (110)

pb60 658-c8 ENTER SQLCancel
HSTMT 01D11718

pb60 658-c8 EXIT SQLCancel with return code 1
(SQL_SUCCESS_WITH_INFO)
HSTMT 01D11718

DIAG [01000] [Sybase][ODBC Driver]Îáùåå
ïðåäóïðåæäåíèå (0)

pb60 658-c8 ENTER SQLFreeStmt
HSTMT 01D11718
UWORD 1 <SQL_DROP>

pb60 658-c8 EXIT SQLFreeStmt with return code 0
(SQL_SUCCESS)
HSTMT 01D11718
UWORD 1 <SQL_DROP>
<--------END--------->
PB use binding columns, isql not use it's. But error very
similar.

I come to a conclusion, what ASA incorrect work with
unixodbc driver manager. ODBC versions 2.0 and 3.0 work
differently, ASA&unixODBC probably not correctly understand
each other.

How I can get|set connection envirmoment
attributes(SQL_ATTR_ODBC_VERSION,SQL_ATTR_OUTPUT_NTS) for
remote server?


P.S.: I am sorry for my bad English...


"Nick Elson" < Posted on 2008-08-14 21:01:02.0Z
From: "Nick Elson" <@@@nick@@@.@@@elson@sybase@@@.@@@com@@@>
Newsgroups: ianywhere.public.general
References: <48a4534d$1@forums-1-dub> <48a49c0a.325.1681692777@sybase.com>
Subject: Re: get data from remote server on Linux
Lines: 159
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48a49d0e$1@forums-1-dub>
Date: 14 Aug 2008 14:01:02 -0700
X-Trace: forums-1-dub 1218747662 10.22.241.152 (14 Aug 2008 14:01:02 -0700)
X-Original-Trace: 14 Aug 2008 14:01:02 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7034
Article PK: 5258

Wrong ODBC trace. You want one from the Linux box.

You can see the root error is actually

[unixODBC][Driver Manager]Function sequence error (-660)

but you don't see the functions being called by the
database server.

Check that out next.






<Ilya Rilichev> wrote in message news:48a49c0a.325.1681692777@sybase.com...
I try execute first query (select id,varchar_data from
testtable) in PowerBuilder. This client ODBC tracing:
<--------BEGIN--------->
pb60 658-c8 ENTER SQLExecDirect
HSTMT 01D11718
UCHAR * 0x023705A0 [ -3] "select
id,varchar_data from testtable\ 0"
SDWORD -3

pb60 658-c8 EXIT SQLExecDirect with return code
0 (SQL_SUCCESS)
HSTMT 01D11718
UCHAR * 0x023705A0 [ -3] "select
id,varchar_data from testtable\ 0"
SDWORD -3

pb60 658-c8 ENTER SQLSetStmtOption
HSTMT 01D11718
UWORD 9 <SQL_ROWSET_SIZE>
SQLPOINTER 0x000003E8

pb60 658-c8 EXIT SQLSetStmtOption with return
code 0 (SQL_SUCCESS)
HSTMT 01D11718
UWORD 9 <SQL_ROWSET_SIZE>
SQLPOINTER 0x000003E8 (BADMEM)

pb60 658-c8 ENTER SQLBindCol
HSTMT 01D11718
UWORD 1
SWORD 4 <SQL_C_LONG>
PTR 0x02350020
SQLLEN 44
SQLLEN * 0x02380020

pb60 658-c8 EXIT SQLBindCol with return code 0
(SQL_SUCCESS)
HSTMT 01D11718
UWORD 1
SWORD 4 <SQL_C_LONG>
PTR 0x02350020
SQLLEN 44
SQLLEN * 0x02380020 (0)

pb60 658-c8 ENTER SQLBindCol
HSTMT 01D11718
UWORD 2
SWORD 1 <SQL_C_CHAR>
PTR 0x023A0020
SQLLEN 22
SQLLEN * 0x024D0020

pb60 658-c8 EXIT SQLBindCol with return code 0
(SQL_SUCCESS)
HSTMT 01D11718
UWORD 2
SWORD 1 <SQL_C_CHAR>
PTR 0x023A0020
SQLLEN 22
SQLLEN * 0x024D0020 (0)

pb60 658-c8 ENTER SQLExtendedFetch
HSTMT 01D11718
UWORD 1 <SQL_FETCH_NEXT>
SQLLEN 1
SQLULEN * 0x0013EA04
UWORD * 0x012C0020

pb60 658-c8 EXIT SQLExtendedFetch with return
code -1 (SQL_ERROR)
HSTMT 01D11718
UWORD 1 <SQL_FETCH_NEXT>
SQLLEN 1
SQLULEN * 0x0013EA04
UWORD * 0x012C0020

DIAG [S1000] [Sybase][ODBC Driver][Adaptive Server
Anywhere]Server 'ttt': [unixODBC][Driver Manager]Function
sequence error (-660)

DIAG [S1000] [Sybase][ODBC Driver][Adaptive Server
Anywhere]Run time SQL error -- FetchPiece() was called with
an unexpected datatype of 9 (-300)

pb60 658-c8 ENTER SQLErrorW
HENV 01D11540
HDBC 01D115E8
HSTMT 01D11718
WCHAR * 0x0013E990 (NYI)
SDWORD * 0x0013E9DC
WCHAR * 0x0013E590
SWORD 512
SWORD * 0x0013E9E4

pb60 658-c8 EXIT SQLErrorW with return code 0
(SQL_SUCCESS)
HENV 01D11540
HDBC 01D115E8
HSTMT 01D11718
WCHAR * 0x0013E990 (NYI)
SDWORD * 0x0013E9DC (-660)
WCHAR * 0x0013E590 [ 110] "[Sybase][ODBC
Driver][Adaptive Server Anywhere]Server 'ttt':
[unixODBC][Driver Manager]Function sequence error"
SWORD 512
SWORD * 0x0013E9E4 (110)

pb60 658-c8 ENTER SQLCancel
HSTMT 01D11718

pb60 658-c8 EXIT SQLCancel with return code 1
(SQL_SUCCESS_WITH_INFO)
HSTMT 01D11718

DIAG [01000] [Sybase][ODBC Driver]Îáùåå
ïðåäóïðåæäåíèå (0)

pb60 658-c8 ENTER SQLFreeStmt
HSTMT 01D11718
UWORD 1 <SQL_DROP>

pb60 658-c8 EXIT SQLFreeStmt with return code 0
(SQL_SUCCESS)
HSTMT 01D11718
UWORD 1 <SQL_DROP>
<--------END--------->
PB use binding columns, isql not use it's. But error very
similar.

I come to a conclusion, what ASA incorrect work with
unixodbc driver manager. ODBC versions 2.0 and 3.0 work
differently, ASA&unixODBC probably not correctly understand
each other.

How I can get|set connection envirmoment
attributes(SQL_ATTR_ODBC_VERSION,SQL_ATTR_OUTPUT_NTS) for
remote server?


P.S.: I am sorry for my bad English...


Ilya Rilichev Posted on 2008-08-14 21:10:36.0Z
Sender: 7aff.48a47546.1804289383@sybase.com
From: Ilya Rilichev
Newsgroups: ianywhere.public.general
Subject: Re: get data from remote server on Linux
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48a49f4c.3d2.1681692777@sybase.com>
References: <48a49d0e$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Aug 2008 14:10:36 -0700
X-Trace: forums-1-dub 1218748236 10.22.241.41 (14 Aug 2008 14:10:36 -0700)
X-Original-Trace: 14 Aug 2008 14:10:36 -0700, 10.22.241.41
Lines: 21
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7035
Article PK: 5259


> Wrong ODBC trace. You want one from the Linux box.
>
> You can see the root error is actually
>
> [unixODBC][Driver Manager]Function sequence error
> (-660)
>
> but you don't see the functions being called by the
> database server.
>
> Check that out next.

First ODBC trace from Linux server machine.
isqlc -> win-ODBC -> ASA Linux -> unixodbc * -> freeTDS ->
MS SQL.

Two ODBC trace from client machine connected to ASA on
linux.
PB -> win-ODBC * -> ASA Linux -> unixodbc -> freeTDS -> MS
SQL.
Asterisk there where became trace log.


"Nick Elson" < Posted on 2008-08-18 17:18:37.0Z
From: "Nick Elson" <@@@nick@@@.@@@elson@sybase@@@.@@@com@@@>
Newsgroups: ianywhere.public.general
References: <48a49d0e$1@forums-1-dub> <48a49f4c.3d2.1681692777@sybase.com>
Subject: Re: get data from remote server on Linux
Lines: 190
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48a9aeed@forums-1-dub>
Date: 18 Aug 2008 10:18:37 -0700
X-Trace: forums-1-dub 1219079917 10.22.241.152 (18 Aug 2008 10:18:37 -0700)
X-Original-Trace: 18 Aug 2008 10:18:37 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7043
Article PK: 5267

Iliya,

*Strlen_or_Ind Ptr: -1

is a correct response in that case. The -1 simply
means SQL_NULL_DATA; which would seem
to be the purpose of issuing such an otherwise
useless statement as

Text: select cast(null as char(30))
Statement Len: SQL_NTS=-3

We must have have other generic ODBC drivers
fail in returning nulls on varchar field before and
this query is probably part of a workaround to
that phenomena.

I don't believe that is actually causing any problems.


Engineering feels it is failing on the next statement.
They feel it is a problem with a know issue when
passing pointers via unixODBC from a 32bit ODBC
driver .... [passing variable character columns
tends to require passing pointers].


SQL Anywhere can apparently bypass the unixODBC
driver manager. Don't use DSN=. Switch to a
"driver=libtdsodbc.so; .... "
style connection string; namine the freeTDS driver
directly.

That suggestion should now work and prevent the
problem (unless freeTDS has other problems with it).

- - - - - - - - - - - below posting dropped as
requested - - - - - - - - - - -

> Wrong ODBC trace. You want one from the Linux box.
>
> You can see the root error is actually
>
> [unixODBC][Driver Manager]Function sequence error
> (-660)
>
> but you don't see the functions being called by the
> database server.
>
> Check that out next.
>
>

I have carried out the test query in the odbctest program on
linux server, where ASA install. On it it is visible that
the unixodbc manager and the freetds driver working
normally. But I do not know, what exactly is done by the ASA
between SQLGetData (with Strlen_or_Ind Ptr=-1) and SQLFetch
(with return SQL_NO_DATA). I admit that the unixodbc driver
or freetds driver does not clear the buffer but only exposes
the indicator at return of the data to "-1". And the
program, despite the indicator, all the same uses the buffer
with the data. This theory is confirmed with the fact of
reception of random data at such query: "select cast (null
as char)". I ask the help from sybase developers, after all
only they know, how the ASA work.

Test ODBC trace:
<------BEGIN------>
SQLAllocEnv():
In:
phenv: 0x7fff96bb5dc8
Return:
SQL_SUCCESS=0
*phenv: 0x154240e0
SQLSetEnvAttr():
In:
Environment Handle: 0x154240e0
Attribute: SQL_ATTR_ODBC_VERSION=200
Value: SQL_OV_ODBC3=3
String Length: SQL_IS_INTEGER=-6
Return:
SQL_SUCCESS=0
SQLAllocHandle():
In:
Handle Type: SQL_HANDLE_DBC=2
InputHandle: 0x154240e0
OutputHandle: 0x7fff96bb5dd0
Return:
SQL_SUCCESS=0
Out:
*OutputHandle: 0x15430760
SQLSetConnectAttr():
In:
Connection Handle: 0x15430760
Attribute: SQL_ATTR_ODBC_CURSORS=110
Value: SQL_CUR_USE_IF_NEEDED=0
String Length: SQL_IS_UINTEGER=-5
Return:
SQL_SUCCESS=0
SQLDriverConnect():
In:
Connection Handle: 0x15430760
Window Handle: NULL
InConnectionString: dsn=********;UID=********;PWD=********
StringLength1: SQL_NTS=-3
OutConnectionString: 0x154286d0
Buffer Length 300
StringLengthPtr: 0x7fff96bb5dce
Driver Complete: SQL_DRIVER_NOPROMPT=0 (1.0)
Return:
SQL_SUCCESS=0
OutConnectionString: dsn=********;UID=********;PWD=********
*StrLenPtr: <nnnnn>
SQLAllocHandle():
In:
Handle Type: SQL_HANDLE_STMT=3
InputHandle: 0x15430760
OutputHandle: 0x7fff96bb5dd0
Return:
SQL_SUCCESS=0
Out:
*OutputHandle: 0x1542c0c0
SQLPrepare():
In:
Statement Handle: 0x1542c0c0
Text: select cast(null as char(30))
Statement Len: SQL_NTS=-3
Return:
SQL_SUCCESS=0
SQLExecute():
In:
Statement Handle: 0x1542c0c0
Return:
SQL_SUCCESS=0
SQLNumResultCols():
In:
Statement Handle: 0x1542c0c0
ColumnCountPtr: 0x7fff96bb5dee
Return:
SQL_SUCCESS=0
Out:
*ColumnCountPtr: 1
SQLFetch():
In:
Statement Handle: 0x1542c0c0
Return:
SQL_SUCCESS=0
SQLDescribeCol():
In:
Statement Handle: 0x1542c0c0
Column Number: 1
Column Name Ptr: 0x154a20d0
Column Name Length: 300
Name Length Ptr: 0x7fff96bb5dce
Data Type Ptr: 0x7fff96bb5dcc
Column Size Ptr: 0x7fff96bb5dc4
Decimal Digits Ptr: 0x7fff96bb5dca
Nullable Ptr: 0x7fff96bb5dc8
Return:
SQL_SUCCESS=0
Out:
Column Name:
*Name Length Ptr: 0
*Data Type Ptr: SQL_CHAR (1)
*Column Size Ptr: 30
*Decimal Digits Ptr: 0
*Nullable Ptr: 1
SQLGetData():
In:
Statement Handle: 0x1542c0c0
Column Number: 1
Target Type: SQL_C_CHAR=1 (1.0)
Target Value Ptr: 0x154ac2a0
Buffer Length: 256
Strlen_or_Ind Ptr: 0x7fff96bb5d2c
Return:
SQL_SUCCESS=0
Out:
*Strlen_or_Ind Ptr: -1
<-----this ASA was stopped and return error to client----->
<-------but in odbctest I can call next SQLFetch------->
SQLFetch():
In:
Statement Handle: 0x1542c0c0
Return:
SQL_NO_DATA=100
<-------END------->


Ilya Rilichev Posted on 2008-08-19 13:39:59.0Z
Sender: daf.48aa7416.1804289383@sybase.com
From: Ilya Rilichev
Newsgroups: ianywhere.public.general
Subject: Re: get data from remote server on Linux
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48aacd2f.1bee.1681692777@sybase.com>
References: <48a9aeed@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 19 Aug 2008 06:39:59 -0700
X-Trace: forums-1-dub 1219153199 10.22.241.41 (19 Aug 2008 06:39:59 -0700)
X-Original-Trace: 19 Aug 2008 06:39:59 -0700, 10.22.241.41
Lines: 5
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7047
Article PK: 5269

I try iODBC driver manager with FreeTDS ODBC driver. I get
same result. But unixODBC|iODBC + ASA ODBC
driver(libdbodbc9.so) to another ASA work correctly with
"select cast(null as varchar(20))".
It's bug, but only where? How to workaround?


"Nick Elson" < Posted on 2008-08-20 14:57:15.0Z
From: "Nick Elson" <@@@nick@@@.@@@elson@sybase@@@.@@@com@@@>
Newsgroups: ianywhere.public.general
References: <48a9aeed@forums-1-dub> <48aacd2f.1bee.1681692777@sybase.com>
Subject: Re: get data from remote server on Linux
Lines: 41
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48ac30cb$1@forums-1-dub>
Date: 20 Aug 2008 07:57:15 -0700
X-Trace: forums-1-dub 1219244235 10.22.241.152 (20 Aug 2008 07:57:15 -0700)
X-Original-Trace: 20 Aug 2008 07:57:15 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7049
Article PK: 5272

Ilya,

Those are indeed interesting findings.

Three (3) things to consider:

1 - According to http://www.sybase.com/detail?id=1035824#distributions
your kernel level has not been tested with 9.0.2. The only
version tested with 64bit software running on a X86_64 Chipset
10.0.1 Build 3540 (and higher). We have only tested that level
with RHE 5, which distribution are you running?

1b - You may also want to try the 32bit installation of everything.
[I am assuming everything was installed as 64bit]

2 - You keep saying you get the ***same result***. The result I
I am expecting to hear is the ODBC Driver manager throwing
a Function Sequence error, but I have never seen an ODBC trace
capturing the function being called that causes that. [again a full
trace would be helpful ... no editing whatsoever] But if the
'same result' means it just fails then that lacks the precision
we will need to diagnose this.

3 - I have a confirmation that you can use the DRIVER= with
remote servers on Linux. We provide a hidden ODBC
Manager abstraction layer and OMNI/CIS uses it in the latest
9.0.2 product. Given that, how exactly did that fail for you?
Is it possible you have a simple connection string error that
can be corrected? What was the full remote server connection
string you used when you tried that?

<Ilya Rilichev> wrote in message news:48aacd2f.1bee.1681692777@sybase.com...
>I try iODBC driver manager with FreeTDS ODBC driver. I get
> same result. But unixODBC|iODBC + ASA ODBC
> driver(libdbodbc9.so) to another ASA work correctly with
> "select cast(null as varchar(20))".
> It's bug, but only where? How to workaround?


Ilya Rilichev Posted on 2008-08-21 13:43:25.0Z
Sender: 2315.48aaf22a.1804289383@sybase.com
From: Ilya Rilichev
Newsgroups: ianywhere.public.general
Subject: Re: get data from remote server on Linux
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48ad70fd.7bf.1681692777@sybase.com>
References: <48ac30cb$1@forums-1-dub>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="-=_forums-1-dub48ad70fd"
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 21 Aug 2008 06:43:25 -0700
X-Trace: forums-1-dub 1219326205 10.22.241.41 (21 Aug 2008 06:43:25 -0700)
X-Original-Trace: 21 Aug 2008 06:43:25 -0700, 10.22.241.41
Lines: 2521
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7050
Article PK: 5274


> Ilya,
>
> Those are indeed interesting findings.
>
> Three (3) things to consider:
>
> 1 - According to
> http://www.sybase.com/detail?id=1035824#distributions
> your kernel level has not been tested with 9.0.2.
> The only
> version tested with 64bit software running on a
> X86_64 Chipset
> 10.0.1 Build 3540 (and higher). We have only tested
> that level
> with RHE 5, which distribution are you running?
>
> 1b - You may also want to try the 32bit installation of
> everything.
> [I am assuming everything was installed as 64bit]
>
> 2 - You keep saying you get the ***same result***. The
> result I
> I am expecting to hear is the ODBC Driver manager
> throwing
> a Function Sequence error, but I have never seen an
> ODBC trace
> capturing the function being called that causes that.
> [again a full
> trace would be helpful ... no editing whatsoever]
> But if the
> 'same result' means it just fails then that lacks the
> precision
> we will need to diagnose this.
>
> 3 - I have a confirmation that you can use the DRIVER=
> with
> remote servers on Linux. We provide a hidden ODBC
> Manager abstraction layer and OMNI/CIS uses it in the
> latest
> 9.0.2 product. Given that, how exactly did that fail
> for you?
> Is it possible you have a simple connection string
> error that
> can be corrected? What was the full remote server
> connection
> string you used when you tried that?
>

1) Yes, my kernel is not been tested with 9.0.2. I use "ASP
Server V", which is created on RHE 5.
(http://www.asplinux.ru/corporate/products/asplinux-server/v/)
1b) No, 32-bit ASA server is not interested. Is better I
will try to pass to 10 version ASA.

2) "Function Sequence error" - error, which I get only in
PB. But in ODBC trace we see, what primary error on ASA
server-side in call SQLGetData on null data value. ***Same
result***, is a recieve error message in client ISQLC.EXE
(FetchPiece() was called with an unexpected datatype of 9).
ISQL.exe show error which get by ASA on working with remote
server. I have carried out now the simple test. In this test
I use unixODBC (DriverManager) and FreeTDS (ODBC Driver).
Full ODBC trace (unixODBC trace on Linux machine with ASA
server) this test attached.

3)When I try connect to remote MS SQL using only FreeTDS
driver and not using DM unixODBC, I recieve "Data source
name not found, and no default driver specified". ASA
connection string
"driver=/usr/local/lib/libtdsodbc.so;SERVERNAME=MCB".
FreeTDS driver configured by freetds.conf, in this file
there is section [MCB] in which connection parametres are
specified.


"Nick Elson" < Posted on 2008-08-21 15:34:42.0Z
From: "Nick Elson" <@@@nick@@@.@@@elson@sybase@@@.@@@com@@@>
Newsgroups: ianywhere.public.general
References: <48ac30cb$1@forums-1-dub> <48ad70fd.7bf.1681692777@sybase.com>
Subject: Re: get data from remote server on Linux
Lines: 89
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48ad8b12$1@forums-1-dub>
Date: 21 Aug 2008 08:34:42 -0700
X-Trace: forums-1-dub 1219332882 10.22.241.152 (21 Aug 2008 08:34:42 -0700)
X-Original-Trace: 21 Aug 2008 08:34:42 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7051
Article PK: 5273

Ilya,

Thanks for the update. I'm still having problems
reconciling what your ODBC trace with freeTDS
shows against your ODBC trace with pb60 is
showing. The seem to be occurring a 2 completely
different points (much much later in the case of PB60).

Do let us know if SQL Anywhere 10.0.1 changes
this at all.

<Ilya Rilichev> wrote in message news:48ad70fd.7bf.1681692777@sybase.com...
>> Ilya,
>>
>> Those are indeed interesting findings.
>>
>> Three (3) things to consider:
>>
>> 1 - According to
>> http://www.sybase.com/detail?id=1035824#distributions
>> your kernel level has not been tested with 9.0.2.
>> The only
>> version tested with 64bit software running on a
>> X86_64 Chipset
>> 10.0.1 Build 3540 (and higher). We have only tested
>> that level
>> with RHE 5, which distribution are you running?
>>
>> 1b - You may also want to try the 32bit installation of
>> everything.
>> [I am assuming everything was installed as 64bit]
>>
>> 2 - You keep saying you get the ***same result***. The
>> result I
>> I am expecting to hear is the ODBC Driver manager
>> throwing
>> a Function Sequence error, but I have never seen an
>> ODBC trace
>> capturing the function being called that causes that.
>> [again a full
>> trace would be helpful ... no editing whatsoever]
>> But if the
>> 'same result' means it just fails then that lacks the
>> precision
>> we will need to diagnose this.
>>
>> 3 - I have a confirmation that you can use the DRIVER=
>> with
>> remote servers on Linux. We provide a hidden ODBC
>> Manager abstraction layer and OMNI/CIS uses it in the
>> latest
>> 9.0.2 product. Given that, how exactly did that fail
>> for you?
>> Is it possible you have a simple connection string
>> error that
>> can be corrected? What was the full remote server
>> connection
>> string you used when you tried that?
>>
>
> 1) Yes, my kernel is not been tested with 9.0.2. I use "ASP
> Server V", which is created on RHE 5.
> (http://www.asplinux.ru/corporate/products/asplinux-server/v/)
> 1b) No, 32-bit ASA server is not interested. Is better I
> will try to pass to 10 version ASA.
>
> 2) "Function Sequence error" - error, which I get only in
> PB. But in ODBC trace we see, what primary error on ASA
> server-side in call SQLGetData on null data value. ***Same
> result***, is a recieve error message in client ISQLC.EXE
> (FetchPiece() was called with an unexpected datatype of 9).
> ISQL.exe show error which get by ASA on working with remote
> server. I have carried out now the simple test. In this test
> I use unixODBC (DriverManager) and FreeTDS (ODBC Driver).
> Full ODBC trace (unixODBC trace on Linux machine with ASA
> server) this test attached.
>
> 3)When I try connect to remote MS SQL using only FreeTDS
> driver and not using DM unixODBC, I recieve "Data source
> name not found, and no default driver specified". ASA
> connection string
> "driver=/usr/local/lib/libtdsodbc.so;SERVERNAME=MCB".
> FreeTDS driver configured by freetds.conf, in this file
> there is section [MCB] in which connection parametres are
> specified.
>


Ilya Rilichev Posted on 2008-08-22 10:47:38.0Z
Sender: 2315.48aaf22a.1804289383@sybase.com
From: Ilya Rilichev
Newsgroups: ianywhere.public.general
Subject: Re: get data from remote server on Linux
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48ae994a.2853.1681692777@sybase.com>
References: <48ad8b12$1@forums-1-dub>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="-=_forums-1-dub48ae994a"
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 22 Aug 2008 03:47:38 -0700
X-Trace: forums-1-dub 1219402058 10.22.241.41 (22 Aug 2008 03:47:38 -0700)
X-Original-Trace: 22 Aug 2008 03:47:38 -0700, 10.22.241.41
Lines: 9008
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7052
Article PK: 5290


> Ilya,
>
> Thanks for the update. I'm still having problems
> reconciling what your ODBC trace with freeTDS
> shows against your ODBC trace with pb60 is
> showing. The seem to be occurring a 2 completely
> different points (much much later in the case of PB60).
>
> Do let us know if SQL Anywhere 10.0.1 changes
> this at all.
>
>

I have not up to the end understood that I should make.
Therefore I will spend a test from the very beginning for
PB60 and I will give the full traces. So, we have:
a)Machine1. WinXP+PB60+ODBC(trace_1)+driver dbodbc9.dll
9.0.2.3534.
b)Machine2. Linux ASP Server V 64-bit+ASA 9.0.2 3612
64-bit+unixODBC 2.2.11(trace_2)+FreeTDS 0.82(trace_3)
c)Machine3. Win2000 SP4 + MS SQL 2000 Desktop Edition

In PB60, I use "select id, int_col, varchar_col from
test_table" (with only one record) because "forward to" ASA
statement not working properly in PB Database Administrator.
Note, what PB60 use SQLFetchScroll, but in my previous tests
isqlc.exe use SQLGetData and not using cursor on "forward to
ttt {select cast(null as varchar)}".

P.S. Tracing stopped after disconnect PB60 from ASA server,
not immediately after I get error message in PB.


Ilya Rilichev Posted on 2008-08-19 09:51:18.0Z
Sender: daf.48aa7416.1804289383@sybase.com
From: Ilya Rilichev
Newsgroups: ianywhere.public.general
Subject: Re: get data from remote server on Linux
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48aa9796.1251.1681692777@sybase.com>
References: <48a9aeed@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 19 Aug 2008 02:51:18 -0700
X-Trace: forums-1-dub 1219139478 10.22.241.41 (19 Aug 2008 02:51:18 -0700)
X-Original-Trace: 19 Aug 2008 02:51:18 -0700, 10.22.241.41
Lines: 7
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7045
Article PK: 5270

O-o, I get results interest!
I download trial ODBC driver easysoft for SQL server. For
it's also need driver manager and I use unixODBC. I get from
ASA same error. It turns out that the FreeTDS driver not
and.

I will try to change the driver manager unixODBC to iODBC.