Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View - nodataonload
Message
From
06/10/1998 00:27:07
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
 
To
05/10/1998 21:50:07
Bob Lucas
The WordWare Agency
Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00144086
Message ID:
00144113
Views:
26
>I had an awful time with the following view until I realized some interesting behaviour with views.
>
>CREATE SQL VIEW "LV_OBJECTDECORATORLIST" ;
> AS SELECT Decorator.winobjkey, Decorator.decobjkey, Decorator.decoratorname, Decorator.price, ;
> Objdeco.objdecokey, objdeco.objcompkey, ;
> NVL(Objdeco.default, .F.) AS ldefault, Objdeco.default, IIF(ISNULL(Objdeco.objdecokey),.F.,.T.) AS checked FROM ;
> vwin!decorator LEFT OUTER JOIN vwin!objectdecorator Objdeco ;
> ON Decorator.decobjkey = Objdeco.decobjkey and objdeco.objcompkey = ?v_objcompkey ;
> WHERE Decorator.winobjkey = ?v_winobjkey
>
>You will notice their are two view parameters. The interesting thing is that whether the view is opened as USE LV_OBJECTDECORATORLIST NODATA or the nodataonload property is set for the cursor object, it ALWAYS requests a value for the v_objcompkey. It must be some requirement when the parameter is used in the outer join statement and not the where clause. I solved the problem by including the parameter with a dummy value in the opentables method of the class that defines the cursor object.
>
>At any rate, NODATA does not work with a view of this type.
The ON.. clause is for relating the two tables so I would think that this would be the proper behaviour. VFP cannot finish the relationship without it. You might try...
CREATE SQL VIEW "LV_OBJECTDECORATORLIST" ;
AS SELECT Decorator.winobjkey, Decorator.decobjkey,;
Decorator.decoratorname, Decorator.price, Objdeco.objdecokey,; objdeco.objcompkey, NVL(Objdeco.default, .F.) AS ldefault,;
Objdeco.default, IIF(ISNULL(Objdeco.objdecokey),.F.,.T.) AS checked FROM ;
vwin!decorator LEFT OUTER JOIN vwin!objectdecorator Objdeco ;
ON Decorator.decobjkey = Objdeco.decobjkey ;
WHERE Decorator.winobjkey = ?v_winobjkey and objdeco.objcompkey = ?v_objcompkey
L.A.Long
ProgRes
lalong1@charter.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform