Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I retrieve a dddw with an argument .

2,503 views
Skip to first unread message

Stephane Viau

unread,
Sep 22, 1999, 3:00:00 AM9/22/99
to

How can I retrieve a dddw with an argument .I have the following code but it
prompts for argument! The argument type is date.
idw_header.retrieve(ll_requestid) - parent dw
DatawindowChild dwc
idw_header.GetChild("owner", dwc)
dwc.SetTransObject(SQLCA)
dwc.Retrieve(idw_header.object.opendate[1])--

Thanks,

Stephane Viau
Ottawa, Canada

Boris Gasin [TeamSybase]

unread,
Sep 22, 1999, 3:00:00 AM9/22/99
to

On Wed, 22 Sep 1999 13:38:19 -0400, in
powersoft.public.powerbuilder.datawindow "Stephane Viau"
<via...@rmoc.on.ca> wrote:

>How can I retrieve a dddw with an argument .I have the following code but it
>prompts for argument! The argument type is date.
> idw_header.retrieve(ll_requestid) - parent dw
> DatawindowChild dwc
> idw_header.GetChild("owner", dwc)
> dwc.SetTransObject(SQLCA)
> dwc.Retrieve(idw_header.object.opendate[1])--

Stephane,

If the child DW is empty it is automatically retrieved when you
retrieve the parent DW.

You need to insert a blank row into the child DW prior to retrieving
the parent or save a blank row with the child DW data object.


Boris Gasin [TeamSybase]
mailto:bga...@dynamictechgroup.com
___
____ _
_____ _
____ _
___

Dynamic Technology Group, Inc.
http://www.dynamictechgroup.com/

Rodney J. Woodruff

unread,
Sep 23, 1999, 3:00:00 AM9/23/99
to

Stephane,

Your ability to retrieve a dddw with an argument depends on the way that you
defined the parent datawindow. Based on your example below, you defined the
parent datawindow with a retrieval argument of type "Long". Since the
datawindow child is a child of the idw_header it will also expect a long
variable with values like that of "ll_requestid". Therefore, you can not use a
date value as a retrieval criteria for the datawindow because the orignal
retrieval argument is defined to be a long value.

There might be a programmatic way to redefine the retrieval argument for the
parent datawindow but I don't know how to do that.

What you can do is create a datawindow exactly like the idw_header but define
its retrieval argument to be a date value. The new datawindow does not have to
contain all the same columns as the original idw_header. You only need the
column that you will be using to select values for the "owner" column from.
Also, in the datawindow painter, make sure to define your select statement to
include the defined retrieval argument in the where clause of the SQL
statement. After you have done this then you can do what you stated below. You
would then do the following:

1) In the datawindow painter, for the drop down data window for column "owner"
of idw_header would be the newly defined drop down datawindow described above.

NOTE: Open properties for owner column of idw_header and set the values of the
edit tab and do the following:

a) Name: Leave Blank
b) Style: DropDownDW
c) DataWindow: dddw_header2 (the new datawindow described above)
d) Display Column: The column you want to appear in the "owner" on the window
e) Data Column: The same as letter d above

2) Your code would still look like this:

idw_header.retrieve(ll_requestid) - parent dw
DatawindowChild dwc
idw_header.GetChild("owner", dwc)
dwc.SetTransObject(SQLCA)
dwc.Retrieve(idw_header.object.opendate[1])

This should yield you the values that you are looking for. I am successfully
using the exact same technique in project that I am finishing right now and have
not had any problems as of yet. Let me know if you need more info or if I can
make things clearer.

-- Rodney

P.S. I have never seen the opendate call before. I am using PB 6.0. What about
you?

Stephane Viau wrote:

> How can I retrieve a dddw with an argument .I have the following code but it
> prompts for argument! The argument type is date.
> idw_header.retrieve(ll_requestid) - parent dw
> DatawindowChild dwc
> idw_header.GetChild("owner", dwc)
> dwc.SetTransObject(SQLCA)
> dwc.Retrieve(idw_header.object.opendate[1])--
>

Adrian Gomez

unread,
Sep 29, 1999, 3:00:00 AM9/29/99
to

If your DDDW expects an argument, what you should do to avoid it is the
following:

1) Get the Handle of the DDDW using Getchild() function.
2) Use embedded SQL to retrieve a value in the child table
3) Use DDDW.Retrieve(<<value>>), no matter it´s not the value you need.
4) Calle DW.Retrieve()

Example:
DataWindowChild ldwc_1

select id
into :ll_id
from table;

dw_1.GetChild("id", ldwc_1)
ldwc_1.SetTransObject(sqlca)
ldwc_1.Retrieve(ll_id)
dw_1.Retrieve()

Stephane Viau <via...@rmoc.on.ca> escribió en el mensaje de noticias
ATx5rCSB$GA....@forums.sybase.com...

0 new messages