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.

Stored procedure returns null value for certain fields in VB

2 posts in General Discussion Last posting was on 2011-07-01 14:57:28.0Z
Arun Lekshman Posted on 2011-07-01 11:07:25.0Z
Sender: 48a2.4e0da9e7.1804289383@sybase.com
From: Arun Lekshman
Newsgroups: sybase.public.ase.general
Subject: Stored procedure returns null value for certain fields in VB
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4e0daa6d.48c1.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 1 Jul 2011 04:07:25 -0700
X-Trace: forums-1-dub 1309518445 10.22.241.41 (1 Jul 2011 04:07:25 -0700)
X-Original-Trace: 1 Jul 2011 04:07:25 -0700, 10.22.241.41
Lines: 27
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30299
Article PK: 72478

Hello,

I am executing a stored procedure in VB Script to export the
data from the SP to an excel file. While executing the SP in
ASE ISQL gives me exact result but while executing the SP in
VBScript returns 0 value for certain columns in the excel
file and in the script itself.

When I checked the SP, it contains many more sub SPs and it
seems the fields which are shown as 0 in the excel file are
stored in a temporary table.

My connection string is as follows

sCon = "driver={SYBASE ASE ODBC Driver};" & _
"srvr=MyServer;" & _ "uid=uName;pwd=uPwd; database=" &
DBName & "; InterfacesFile=k:sybaseinisql.ini"

Set Conn = CreateObject("ADODB.Connection") Conn.Provider =
"MSDASQL.1" Conn.ConnectionString = sCon Conn.CommandTimeout
= 300 Conn.Open Set myCommand =
CreateObject("ADODB.Command") Set myRS =
CreateObject("ADODB.Recordset")

I appreciate if someone can help me in this.

Thanks & Regards, Arun


J Posted on 2011-07-01 14:57:28.0Z
From: jtotally_bogus@sbcglobal.net (J)
Newsgroups: sybase.public.ase.general
Subject: Re: Stored procedure returns null value for certain fields in VB
Reply-To: J@bogusemailAddress.com
Message-ID: <4e0dddd0.2156985859@forums.sybase.com>
References: <4e0daa6d.48c1.1681692777@sybase.com>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 1 Jul 2011 07:57:28 -0700
X-Trace: forums-1-dub 1309532248 10.22.241.152 (1 Jul 2011 07:57:28 -0700)
X-Original-Trace: 1 Jul 2011 07:57:28 -0700, vip152.sybase.com
Lines: 52
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30300
Article PK: 72481

On 1 Jul 2011 04:07:25 -0700, Arun Lekshman wrote:

Without seeing a bit more detail of the stored procedures it is very
difficult for me to understand what could be going on. I would
suggest that the difference might be caused because the two
connections could be causing ASE to do null comparisions differently.

I suspect ODBC uses ANSI checking for nulls but isql normally used the
tsql checking for nulls.

With you isql session try this:

1> try your stored procedure

1> set ansinull on
2> go

1> try your stored procedure

Do you get the same results in both cases? Otherwise, you should
probably reduce you stored procedure processing to a very simple
reproduction and post it or contact Sybase support.

Jay

>Hello,
>
>I am executing a stored procedure in VB Script to export the
>data from the SP to an excel file. While executing the SP in
>ASE ISQL gives me exact result but while executing the SP in
>VBScript returns 0 value for certain columns in the excel
>file and in the script itself.
>
>When I checked the SP, it contains many more sub SPs and it
>seems the fields which are shown as 0 in the excel file are
>stored in a temporary table.
>
>My connection string is as follows
>
>sCon = "driver={SYBASE ASE ODBC Driver};" & _
>"srvr=MyServer;" & _ "uid=uName;pwd=uPwd; database=" &
>DBName & "; InterfacesFile=k:sybaseinisql.ini"
>
>Set Conn = CreateObject("ADODB.Connection") Conn.Provider =
>"MSDASQL.1" Conn.ConnectionString = sCon Conn.CommandTimeout
>= 300 Conn.Open Set myCommand =
>CreateObject("ADODB.Command") Set myRS =
>CreateObject("ADODB.Recordset")
>
>I appreciate if someone can help me in this.
>
>Thanks & Regards, Arun