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.

how to pass null value to DW retrieve method

13 posts in DataWindow .NET Last posting was on 2004-10-25 14:38:17.0Z
Manikandan Posted on 2004-10-21 06:18:22.0Z
Reply-To: "Manikandan" <maaniks@hotmail.com>
From: "Manikandan" <maaniks@hotmail.com>
Newsgroups: sybase.public.datawindow.net
Subject: how to pass null value to DW retrieve method
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: 61.11.89.126
Message-ID: <417754ab@forums-2-dub>
X-Original-Trace: 20 Oct 2004 23:18:19 -0700, 61.11.89.126
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 20 Oct 2004 23:18:20 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 20 Oct 2004 23:18:22 -0700
X-Trace: forums-1-dub 1098339502 10.22.108.75 (20 Oct 2004 23:18:22 -0700)
X-Original-Trace: 20 Oct 2004 23:18:22 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:574
Article PK: 125001

hi,

I developed a small application in VB.Net using DW.Net. I used Department
and employee tables from sample ASA DB. I used Dw_1.retrieve(dept_id) to
retrieve the employees of particular department. But i want to retrieve all
the employees using the same datawindow object. When i spoke to one PB
developer he ask me to set null value to dept_id then you will get all the
detail.

In Vb.Net we use Nothing for null value. When i set that Nothing to dept_id.
The Datawindow throw an error.
To solve this problem i had created another DW object without argument. I
think this not a correct method.

Pls. help me. How can i send the null value?

Manikandan


SmallDot Posted on 2004-10-21 09:02:45.0Z
Sender: 1de.4177770a.1804289383@sybase.com
From: SmallDot
Newsgroups: sybase.public.datawindow.net
Subject: Re: how to pass null value to DW retrieve method
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41777b31.22c.1681692777@sybase.com>
References: <417754ab@forums-2-dub>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 21 Oct 2004 02:02:41 -0700, 10.22.241.42
Lines: 30
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 21 Oct 2004 02:02:42 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 21 Oct 2004 02:02:45 -0700
X-Trace: forums-1-dub 1098349365 10.22.108.75 (21 Oct 2004 02:02:45 -0700)
X-Original-Trace: 21 Oct 2004 02:02:45 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:576
Article PK: 125003

Here is idea

modify the SQL where clasue like this
select * from xxx where (dept_id = :argument) or (:argument
= -1)

so if you pass -1 as retrieve argument you will hava all the
rows
I haven't tried it but it should work

> hi,
>
> I developed a small application in VB.Net using DW.Net. I
> used Department and employee tables from sample ASA DB. I
> used Dw_1.retrieve(dept_id) to retrieve the employees of
> particular department. But i want to retrieve all the
> employees using the same datawindow object. When i spoke
> to one PB developer he ask me to set null value to dept_id
> then you will get all the detail.
>
> In Vb.Net we use Nothing for null value. When i set that
> Nothing to dept_id. The Datawindow throw an error.
> To solve this problem i had created another DW object
> without argument. I think this not a correct method.
>
> Pls. help me. How can i send the null value?
>
> Manikandan
>
>


Jack Addington Posted on 2004-10-21 16:13:02.0Z
From: "Jack Addington" <jaddington@shaw.ca>
Newsgroups: sybase.public.datawindow.net
References: <417754ab@forums-2-dub>
Subject: Re: how to pass null value to DW retrieve method
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
X-Original-NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
Message-ID: <4177e00e$1@forums-1-dub>
Date: 21 Oct 2004 09:13:02 -0700
X-Trace: forums-1-dub 1098375182 68.147.193.82 (21 Oct 2004 09:13:02 -0700)
X-Original-Trace: 21 Oct 2004 09:13:02 -0700, s010600e018e32f17.cg.shawcable.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:585
Article PK: 125013

Create a string/int that has a null value (whatever the datawindow retrieval
argument type), pass the null valued string/ind to the datawindow retrieve.
As long as the retrieve knows how to handle the null it should be fine.

"Manikandan" <maaniks@hotmail.com> wrote in message
news:417754ab@forums-2-dub...
> hi,
>
> I developed a small application in VB.Net using DW.Net. I used Department
> and employee tables from sample ASA DB. I used Dw_1.retrieve(dept_id) to
> retrieve the employees of particular department. But i want to retrieve
> all
> the employees using the same datawindow object. When i spoke to one PB
> developer he ask me to set null value to dept_id then you will get all the
> detail.
>
> In Vb.Net we use Nothing for null value. When i set that Nothing to
> dept_id.
> The Datawindow throw an error.
> To solve this problem i had created another DW object without argument. I
> think this not a correct method.
>
> Pls. help me. How can i send the null value?
>
> Manikandan
>
>


dfish Posted on 2004-10-21 16:31:17.0Z
From: dfish@_no_spam_sybase.com (Dave Fish [Team Sybase])
Newsgroups: sybase.public.datawindow.net
Subject: Re: how to pass null value to DW retrieve method
Organization: Sybase Professional Services
Reply-To: nospam_dfish@sybase.com_nospam
Message-ID: <4177c21b.517019925@forums.sybase.com>
References: <417754ab@forums-2-dub>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vpn-dub-064.sybase.com
X-Original-NNTP-Posting-Host: vpn-dub-064.sybase.com
Date: 21 Oct 2004 09:31:17 -0700
X-Trace: forums-1-dub 1098376277 10.22.120.64 (21 Oct 2004 09:31:17 -0700)
X-Original-Trace: 21 Oct 2004 09:31:17 -0700, vpn-dub-064.sybase.com
Lines: 77
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:589
Article PK: 125016

I don't believe passing a null value will return all rows. You
shouldn't receive any rows since there won't be any rows in the table
to match your select statement.

A better approach is to define the DataWindow with NO retrieval
arguments. If you want to limit the result set with a where clause you
can modify the table.select property programmatically. Here is an
example written in Visual Basic .NET:

Dim sqlStatement As String 'Original table.select property
Dim sqlWhere As String 'Holds new Where clause
Dim orderPos As Integer 'Location of the ORDER BY Statement
Dim newSQLStatement As String 'New SQL Statement

'Capture the existing select statement
sqlStatement = DWC1.Describe("DataWindow.Table.Select")

'Find the position of the ORDER BY Statement
orderPos = sqlStatement.IndexOf("ORDER BY")

'Create WHERE Clause
sqlWhere = "WHERE dept_id = 200"

'Concatenate the select, where and order by statements
newSQLStatement = "DataWindow.Table.Select='" + _
sqlStatement.Substring(1, (orderPos - 1)) _
+ " " + sqlWhere + " " + sqlStatement.Substring(orderPos)+"'"

Try
'Modify the Table.Select property
DWC1.Modify(newSQLStatement)

Catch ex As Sybase.DataWindow.MethodFailureException
MsgBox(ex.Message)
End Try
Try
DWC1.Retrieve()
Catch ex As Sybase.DataWindow.MethodFailureException
MsgBox(ex.Message)
End Try

Note that you would need to change this if you don't have an Order By
statement or if you had table joins but this should give you the
general idea of what you need to do.

Regards,
Dave Fish
Sybase

TeamSybase blogs: http://www.teamsybase.net/blogs

DataWindow.NET code examples available on CodeXchange:
http://datawindownet.codexchange.sybase.com

On 20 Oct 2004 23:18:22 -0700, "Manikandan" <maaniks@hotmail.com>

wrote:

>hi,
>
>I developed a small application in VB.Net using DW.Net. I used Department
>and employee tables from sample ASA DB. I used Dw_1.retrieve(dept_id) to
>retrieve the employees of particular department. But i want to retrieve all
>the employees using the same datawindow object. When i spoke to one PB
>developer he ask me to set null value to dept_id then you will get all the
>detail.
>
>In Vb.Net we use Nothing for null value. When i set that Nothing to dept_id.
>The Datawindow throw an error.
>To solve this problem i had created another DW object without argument. I
>think this not a correct method.
>
>Pls. help me. How can i send the null value?
>
>Manikandan
>
>


Manikandan Posted on 2004-10-25 06:13:15.0Z
Reply-To: "Manikandan" <maaniks@hotmail.com>
From: "Manikandan" <maaniks@hotmail.com>
Newsgroups: sybase.public.datawindow.net
References: <417754ab@forums-2-dub> <4177c21b.517019925@forums.sybase.com>
Subject: Re: how to pass null value to DW retrieve method
Lines: 95
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 61.11.89.126
X-Original-NNTP-Posting-Host: 61.11.89.126
Message-ID: <417c997b$1@forums-1-dub>
Date: 24 Oct 2004 23:13:15 -0700
X-Trace: forums-1-dub 1098684795 61.11.89.126 (24 Oct 2004 23:13:15 -0700)
X-Original-Trace: 24 Oct 2004 23:13:15 -0700, 61.11.89.126
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:617
Article PK: 125044

Dave,

If it is single argument we can modify the statement easily. But if the
statement is complex or we will use more number of arguments to filter the
records in reports , in those case how can we do this? This is the only way
. is there any other options available?.

Manikandna

"Dave Fish [Team Sybase]" <dfish@_no_spam_sybase.com> wrote in message
news:4177c21b.517019925@forums.sybase.com...
> I don't believe passing a null value will return all rows. You
> shouldn't receive any rows since there won't be any rows in the table
> to match your select statement.
>
> A better approach is to define the DataWindow with NO retrieval
> arguments. If you want to limit the result set with a where clause you
> can modify the table.select property programmatically. Here is an
> example written in Visual Basic .NET:
>
> Dim sqlStatement As String 'Original table.select property
> Dim sqlWhere As String 'Holds new Where clause
> Dim orderPos As Integer 'Location of the ORDER BY Statement
> Dim newSQLStatement As String 'New SQL Statement
>
> 'Capture the existing select statement
> sqlStatement = DWC1.Describe("DataWindow.Table.Select")
>
> 'Find the position of the ORDER BY Statement
> orderPos = sqlStatement.IndexOf("ORDER BY")
>
> 'Create WHERE Clause
> sqlWhere = "WHERE dept_id = 200"
>
> 'Concatenate the select, where and order by statements
> newSQLStatement = "DataWindow.Table.Select='" + _
> sqlStatement.Substring(1, (orderPos - 1)) _
> + " " + sqlWhere + " " + sqlStatement.Substring(orderPos)+"'"
>
> Try
> 'Modify the Table.Select property
> DWC1.Modify(newSQLStatement)
>
> Catch ex As Sybase.DataWindow.MethodFailureException
> MsgBox(ex.Message)
> End Try
> Try
> DWC1.Retrieve()
> Catch ex As Sybase.DataWindow.MethodFailureException
> MsgBox(ex.Message)
> End Try
>
> Note that you would need to change this if you don't have an Order By
> statement or if you had table joins but this should give you the
> general idea of what you need to do.
>
> Regards,
> Dave Fish
> Sybase
>
> TeamSybase blogs: http://www.teamsybase.net/blogs
>
> DataWindow.NET code examples available on CodeXchange:
> http://datawindownet.codexchange.sybase.com
>
> On 20 Oct 2004 23:18:22 -0700, "Manikandan" <maaniks@hotmail.com>
> wrote:
>
> >hi,
> >
> >I developed a small application in VB.Net using DW.Net. I used Department
> >and employee tables from sample ASA DB. I used Dw_1.retrieve(dept_id) to
> >retrieve the employees of particular department. But i want to retrieve
all
> >the employees using the same datawindow object. When i spoke to one PB
> >developer he ask me to set null value to dept_id then you will get all
the
> >detail.
> >
> >In Vb.Net we use Nothing for null value. When i set that Nothing to
dept_id.
> >The Datawindow throw an error.
> >To solve this problem i had created another DW object without argument.
I
> >think this not a correct method.
> >
> >Pls. help me. How can i send the null value?
> >
> >Manikandan
> >
> >
>


dfish Posted on 2004-10-25 14:38:17.0Z
From: dfish@_no_spam_sybase.com (Dave Fish [Team Sybase])
Newsgroups: sybase.public.datawindow.net
Subject: Re: how to pass null value to DW retrieve method
Organization: Sybase Professional Services
Reply-To: nospam_dfish@sybase.com_nospam
Message-ID: <417d0e9c.52293373@forums.sybase.com>
References: <417754ab@forums-2-dub> <4177c21b.517019925@forums.sybase.com> <417c997b$1@forums-1-dub>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vpn-dub-070.sybase.com
X-Original-NNTP-Posting-Host: vpn-dub-070.sybase.com
Date: 25 Oct 2004 07:38:17 -0700
X-Trace: forums-1-dub 1098715097 10.22.120.70 (25 Oct 2004 07:38:17 -0700)
X-Original-Trace: 25 Oct 2004 07:38:17 -0700, vpn-dub-070.sybase.com
Lines: 120
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:618
Article PK: 125045

Actually it isn't that hard. Just build up your Where clause in code
using the AND or OR key words. In the end I think you will find this
approach easier to follow and maintain than trying to "game" the
retrieval arguments at runtime.

I will open an enhancement request to make the retrieval argument
property on the DataWindow editable by the developer at runtime. Right
now if you use the Modify method to change the table.select property
on a DataWindow with retrieval arguments defined you will get the
retrieval arguments dialog popping up if you call the retrieve method
without passing arguments.

Regards,
Dave Fish
Sybase

TeamSybase blogs: http://www.teamsybase.net/blogs

DataWindow.NET code examples available on CodeXchange:
http://datawindownet.codexchange.sybase.com

On 24 Oct 2004 23:13:15 -0700, "Manikandan" <maaniks@hotmail.com>

wrote:

>Dave,
>
>If it is single argument we can modify the statement easily. But if the
>statement is complex or we will use more number of arguments to filter the
>records in reports , in those case how can we do this? This is the only way
>. is there any other options available?.
>
>Manikandna
>
>
>"Dave Fish [Team Sybase]" <dfish@_no_spam_sybase.com> wrote in message
>news:4177c21b.517019925@forums.sybase.com...
>> I don't believe passing a null value will return all rows. You
>> shouldn't receive any rows since there won't be any rows in the table
>> to match your select statement.
>>
>> A better approach is to define the DataWindow with NO retrieval
>> arguments. If you want to limit the result set with a where clause you
>> can modify the table.select property programmatically. Here is an
>> example written in Visual Basic .NET:
>>
>> Dim sqlStatement As String 'Original table.select property
>> Dim sqlWhere As String 'Holds new Where clause
>> Dim orderPos As Integer 'Location of the ORDER BY Statement
>> Dim newSQLStatement As String 'New SQL Statement
>>
>> 'Capture the existing select statement
>> sqlStatement = DWC1.Describe("DataWindow.Table.Select")
>>
>> 'Find the position of the ORDER BY Statement
>> orderPos = sqlStatement.IndexOf("ORDER BY")
>>
>> 'Create WHERE Clause
>> sqlWhere = "WHERE dept_id = 200"
>>
>> 'Concatenate the select, where and order by statements
>> newSQLStatement = "DataWindow.Table.Select='" + _
>> sqlStatement.Substring(1, (orderPos - 1)) _
>> + " " + sqlWhere + " " + sqlStatement.Substring(orderPos)+"'"
>>
>> Try
>> 'Modify the Table.Select property
>> DWC1.Modify(newSQLStatement)
>>
>> Catch ex As Sybase.DataWindow.MethodFailureException
>> MsgBox(ex.Message)
>> End Try
>> Try
>> DWC1.Retrieve()
>> Catch ex As Sybase.DataWindow.MethodFailureException
>> MsgBox(ex.Message)
>> End Try
>>
>> Note that you would need to change this if you don't have an Order By
>> statement or if you had table joins but this should give you the
>> general idea of what you need to do.
>>
>> Regards,
>> Dave Fish
>> Sybase
>>
>> TeamSybase blogs: http://www.teamsybase.net/blogs
>>
>> DataWindow.NET code examples available on CodeXchange:
>> http://datawindownet.codexchange.sybase.com
>>
>> On 20 Oct 2004 23:18:22 -0700, "Manikandan" <maaniks@hotmail.com>
>> wrote:
>>
>> >hi,
>> >
>> >I developed a small application in VB.Net using DW.Net. I used Department
>> >and employee tables from sample ASA DB. I used Dw_1.retrieve(dept_id) to
>> >retrieve the employees of particular department. But i want to retrieve
>all
>> >the employees using the same datawindow object. When i spoke to one PB
>> >developer he ask me to set null value to dept_id then you will get all
>the
>> >detail.
>> >
>> >In Vb.Net we use Nothing for null value. When i set that Nothing to
>dept_id.
>> >The Datawindow throw an error.
>> >To solve this problem i had created another DW object without argument.
>I
>> >think this not a correct method.
>> >
>> >Pls. help me. How can i send the null value?
>> >
>> >Manikandan
>> >
>> >
>>
>
>


Jun Posted on 2004-10-22 15:21:55.0Z
Sender: 1464.41791ffb.1804289383@sybase.com
From: Jun
Newsgroups: sybase.public.datawindow.net
Subject: Re: how to pass null value to DW retrieve method
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4179258f.156f.1681692777@sybase.com>
References: <417754ab@forums-2-dub>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 22 Oct 2004 08:21:51 -0700, 10.22.241.42
Lines: 32
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 22 Oct 2004 08:21:52 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 22 Oct 2004 08:21:55 -0700
X-Trace: forums-1-dub 1098458515 10.22.108.75 (22 Oct 2004 08:21:55 -0700)
X-Original-Trace: 22 Oct 2004 08:21:55 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:596
Article PK: 125023

Try this.

dept_id = Convert.DBNull

Dw_1.retrieve(dept_id)

or

Dw_1.retrieve(Convert.DBNull)

> hi,
>
> I developed a small application in VB.Net using DW.Net. I
> used Department and employee tables from sample ASA DB. I
> used Dw_1.retrieve(dept_id) to retrieve the employees of
> particular department. But i want to retrieve all the
> employees using the same datawindow object. When i spoke
> to one PB developer he ask me to set null value to dept_id
> then you will get all the detail.
>
> In Vb.Net we use Nothing for null value. When i set that
> Nothing to dept_id. The Datawindow throw an error.
> To solve this problem i had created another DW object
> without argument. I think this not a correct method.
>
> Pls. help me. How can i send the null value?
>
> Manikandan
>
>


dfish Posted on 2004-10-22 16:48:42.0Z
From: dfish@_no_spam_sybase.com (Dave Fish [Team Sybase])
Newsgroups: sybase.public.datawindow.net
Subject: Re: how to pass null value to DW retrieve method
Organization: Sybase Professional Services
Reply-To: nospam_dfish@sybase.com_nospam
Message-ID: <41793992.613128942@forums.sybase.com>
References: <417754ab@forums-2-dub> <4179258f.156f.1681692777@sybase.com>
X-Newsreader: Forte Free Agent 1.21/32.243
X-Original-NNTP-Posting-Host: vpn-dub-064.sybase.com
X-Original-Trace: 22 Oct 2004 09:48:39 -0700, vpn-dub-064.sybase.com
Lines: 47
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 22 Oct 2004 09:48:40 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 22 Oct 2004 09:48:42 -0700
X-Trace: forums-1-dub 1098463722 10.22.108.75 (22 Oct 2004 09:48:42 -0700)
X-Original-Trace: 22 Oct 2004 09:48:42 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:597
Article PK: 125024

Sending a null value will not retrieve all the rows. In fact the
DataWindow will throw an exception (-1 return code).

Regards,
Dave Fish
Sybase

TeamSybase blogs: http://www.teamsybase.net/blogs

DataWindow.NET code examples available on CodeXchange:
http://datawindownet.codexchange.sybase.com

On 22 Oct 2004 08:21:55 -0700, Jun wrote:

>Try this.
>
>dept_id = Convert.DBNull
>
>Dw_1.retrieve(dept_id)
>
>or
>
>Dw_1.retrieve(Convert.DBNull)
>
>
>
>> hi,
>>
>> I developed a small application in VB.Net using DW.Net. I
>> used Department and employee tables from sample ASA DB. I
>> used Dw_1.retrieve(dept_id) to retrieve the employees of
>> particular department. But i want to retrieve all the
>> employees using the same datawindow object. When i spoke
>> to one PB developer he ask me to set null value to dept_id
>> then you will get all the detail.
>>
>> In Vb.Net we use Nothing for null value. When i set that
>> Nothing to dept_id. The Datawindow throw an error.
>> To solve this problem i had created another DW object
>> without argument. I think this not a correct method.
>>
>> Pls. help me. How can i send the null value?
>>
>> Manikandan
>>
>>


Jun Posted on 2004-10-22 18:25:25.0Z
Sender: 1685.41794f6e.1804289383@sybase.com
From: Jun
Newsgroups: sybase.public.datawindow.net
Subject: Re: how to pass null value to DW retrieve method
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41795095.169e.1681692777@sybase.com>
References: <41793992.613128942@forums.sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 22 Oct 2004 11:25:25 -0700
X-Trace: forums-1-dub 1098469525 10.22.241.41 (22 Oct 2004 11:25:25 -0700)
X-Original-Trace: 22 Oct 2004 11:25:25 -0700, 10.22.241.41
Lines: 68
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:600
Article PK: 125028

No, Not necessarily.

What if the select statement behind the DW is like this.

select *
from vendor
where vendor_contact_number is :Argument;

And this 'vendor' table has 'vendor_contact_number' field
which is nullable.

In this case, we want to retrieve all vendor whose
vendor_contact_number is null.

Other case is where DW is getting the data from Stored
Procedure where we can pass null value as argument to
retrieve some data from SP.

> Sending a null value will not retrieve all the rows. In
> fact the DataWindow will throw an exception (-1 return
> code).
>
> Regards,
> Dave Fish
> Sybase
>
> TeamSybase blogs: http://www.teamsybase.net/blogs
>
> DataWindow.NET code examples available on CodeXchange:
> http://datawindownet.codexchange.sybase.com
>
> On 22 Oct 2004 08:21:55 -0700, Jun wrote:
>
> >Try this.
> >
> >dept_id = Convert.DBNull
> >
> >Dw_1.retrieve(dept_id)
> >
> >or
> >
> >Dw_1.retrieve(Convert.DBNull)
> >
> >
> >
> >> hi,
> >>
> >> I developed a small application in VB.Net using DW.Net.
> I >> used Department and employee tables from sample ASA
> DB. I >> used Dw_1.retrieve(dept_id) to retrieve the
> employees of >> particular department. But i want to
> retrieve all the >> employees using the same datawindow
> object. When i spoke >> to one PB developer he ask me to
> set null value to dept_id >> then you will get all the
> detail. >>
> >> In Vb.Net we use Nothing for null value. When i set
> that >> Nothing to dept_id. The Datawindow throw an error.
> >> To solve this problem i had created another DW object
> >> without argument. I think this not a correct method.
> >>
> >> Pls. help me. How can i send the null value?
> >>
> >> Manikandan
> >>
> >>
>


dfish Posted on 2004-10-22 18:44:05.0Z
From: dfish@_no_spam_sybase.com (Dave Fish [Team Sybase])
Newsgroups: sybase.public.datawindow.net
Subject: Re: how to pass null value to DW retrieve method
Organization: Sybase Professional Services
Reply-To: nospam_dfish@sybase.com_nospam
Message-ID: <4179546d.620003287@forums.sybase.com>
References: <41793992.613128942@forums.sybase.com> <41795095.169e.1681692777@sybase.com>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vpn-dub-064.sybase.com
X-Original-NNTP-Posting-Host: vpn-dub-064.sybase.com
Date: 22 Oct 2004 11:44:05 -0700
X-Trace: forums-1-dub 1098470645 10.22.120.64 (22 Oct 2004 11:44:05 -0700)
X-Original-Trace: 22 Oct 2004 11:44:05 -0700, vpn-dub-064.sybase.com
Lines: 84
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:603
Article PK: 125031

Perhaps but it won't work the way Manikandan is trying to use it which
was to either retrieve the employee's from one department or all of
the employees in the table.

Regards,
Dave Fish
Sybase

TeamSybase blogs: http://www.teamsybase.net/blogs

DataWindow.NET code examples available on CodeXchange:
http://datawindownet.codexchange.sybase.com

On 22 Oct 2004 11:25:25 -0700, Jun wrote:

>No, Not necessarily.
>
>What if the select statement behind the DW is like this.
>
>select *
>from vendor
>where vendor_contact_number is :Argument;
>
>And this 'vendor' table has 'vendor_contact_number' field
>which is nullable.
>
>In this case, we want to retrieve all vendor whose
>vendor_contact_number is null.
>
>Other case is where DW is getting the data from Stored
>Procedure where we can pass null value as argument to
>retrieve some data from SP.
>
>
>
>> Sending a null value will not retrieve all the rows. In
>> fact the DataWindow will throw an exception (-1 return
>> code).
>>
>> Regards,
>> Dave Fish
>> Sybase
>>
>> TeamSybase blogs: http://www.teamsybase.net/blogs
>>
>> DataWindow.NET code examples available on CodeXchange:
>> http://datawindownet.codexchange.sybase.com
>>
>> On 22 Oct 2004 08:21:55 -0700, Jun wrote:
>>
>> >Try this.
>> >
>> >dept_id = Convert.DBNull
>> >
>> >Dw_1.retrieve(dept_id)
>> >
>> >or
>> >
>> >Dw_1.retrieve(Convert.DBNull)
>> >
>> >
>> >
>> >> hi,
>> >>
>> >> I developed a small application in VB.Net using DW.Net.
>> I >> used Department and employee tables from sample ASA
>> DB. I >> used Dw_1.retrieve(dept_id) to retrieve the
>> employees of >> particular department. But i want to
>> retrieve all the >> employees using the same datawindow
>> object. When i spoke >> to one PB developer he ask me to
>> set null value to dept_id >> then you will get all the
>> detail. >>
>> >> In Vb.Net we use Nothing for null value. When i set
>> that >> Nothing to dept_id. The Datawindow throw an error.
>> >> To solve this problem i had created another DW object
>> >> without argument. I think this not a correct method.
>> >>
>> >> Pls. help me. How can i send the null value?
>> >>
>> >> Manikandan
>> >>
>> >>
>>


Jun Posted on 2004-10-22 18:37:50.0Z
Sender: 1685.41794f6e.1804289383@sybase.com
From: Jun
Newsgroups: sybase.public.datawindow.net
Subject: Re: how to pass null value to DW retrieve method
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4179537e.16f0.1681692777@sybase.com>
References: <41795095.169e.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 22 Oct 2004 11:37:50 -0700
X-Trace: forums-1-dub 1098470270 10.22.241.41 (22 Oct 2004 11:37:50 -0700)
X-Original-Trace: 22 Oct 2004 11:37:50 -0700, 10.22.241.41
Lines: 76
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:602
Article PK: 125033

Dave. Let me if I understood right.

So Datawindow does NOT allow Retrieval Argument to be Null
value at all?

If so, that odd. Is there any reason for this?

> No, Not necessarily.
>
> What if the select statement behind the DW is like this.
>
> select *
> from vendor
> where vendor_contact_number is :Argument;
>
> And this 'vendor' table has 'vendor_contact_number' field
> which is nullable.
>
> In this case, we want to retrieve all vendor whose
> vendor_contact_number is null.
>
> Other case is where DW is getting the data from Stored
> Procedure where we can pass null value as argument to
> retrieve some data from SP.
>
>
>
> > Sending a null value will not retrieve all the rows. In
> > fact the DataWindow will throw an exception (-1 return
> > code).
> >
> > Regards,
> > Dave Fish
> > Sybase
> >
> > TeamSybase blogs: http://www.teamsybase.net/blogs
> >
> > DataWindow.NET code examples available on CodeXchange:
> > http://datawindownet.codexchange.sybase.com
> >
> > On 22 Oct 2004 08:21:55 -0700, Jun wrote:
> >
> > >Try this.
> > >
> > >dept_id = Convert.DBNull
> > >
> > >Dw_1.retrieve(dept_id)
> > >
> > >or
> > >
> > >Dw_1.retrieve(Convert.DBNull)
> > >
> > >
> > >
> > >> hi,
> > >>
> > >> I developed a small application in VB.Net using
> > DW.Net. I >> used Department and employee tables from
> > sample ASA DB. I >> used Dw_1.retrieve(dept_id) to
> > retrieve the employees of >> particular department. But
> > i want to retrieve all the >> employees using the same
> > datawindow object. When i spoke >> to one PB developer
> > he ask me to set null value to dept_id >> then you will
> > get all the detail. >>
> > >> In Vb.Net we use Nothing for null value. When i set
> > that >> Nothing to dept_id. The Datawindow throw an
> > error. >> To solve this problem i had created another
> > DW object >> without argument. I think this not a
> > correct method. >>
> > >> Pls. help me. How can i send the null value?
> > >>
> > >> Manikandan
> > >>
> > >>
> >


Manikandan Posted on 2004-10-25 05:59:50.0Z
Reply-To: "Manikandan" <maaniks@hotmail.com>
From: "Manikandan" <maaniks@hotmail.com>
Newsgroups: sybase.public.datawindow.net
References: <417754ab@forums-2-dub> <4179258f.156f.1681692777@sybase.com>
Subject: Re: how to pass null value to DW retrieve method
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 61.11.89.126
X-Original-NNTP-Posting-Host: 61.11.89.126
Message-ID: <417c9656$1@forums-1-dub>
Date: 24 Oct 2004 22:59:50 -0700
X-Trace: forums-1-dub 1098683990 61.11.89.126 (24 Oct 2004 22:59:50 -0700)
X-Original-Trace: 24 Oct 2004 22:59:50 -0700, 61.11.89.126
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:616
Article PK: 125043

hi,

What Dave said is correct. When i pass the Convert.DBNull as retrieval
argument. I got the error with return code -1.

Manikandan

<Jun> wrote in message news:4179258f.156f.1681692777@sybase.com...
> Try this.
>
> dept_id = Convert.DBNull
>
> Dw_1.retrieve(dept_id)
>
> or
>
> Dw_1.retrieve(Convert.DBNull)
>
>
>
> > hi,
> >
> > I developed a small application in VB.Net using DW.Net. I
> > used Department and employee tables from sample ASA DB. I
> > used Dw_1.retrieve(dept_id) to retrieve the employees of
> > particular department. But i want to retrieve all the
> > employees using the same datawindow object. When i spoke
> > to one PB developer he ask me to set null value to dept_id
> > then you will get all the detail.
> >
> > In Vb.Net we use Nothing for null value. When i set that
> > Nothing to dept_id. The Datawindow throw an error.
> > To solve this problem i had created another DW object
> > without argument. I think this not a correct method.
> >
> > Pls. help me. How can i send the null value?
> >
> > Manikandan
> >
> >