Accessing odbc views from 4GL program - BPM

Hi

Thanks for the speedy response, I think I need to explain a bit more.

We are using the product configurator, everything we manufacture is
bespoke, we have thousands of components that can be used to make an
end product. (over 90,000 Parts in the Parts table). Within the
configurator we need to filter these components down to a manageable
size, e.g. component size, colour, dimensions etc. I have 4GL code
that the configurator calls to pull a selection list. It would be
cumbersome to call the part table, then UD10, then UD11, it would be
far easier to create a view and use that.

I know the documentation goes on about use BAQ's instead of ODBC, but
you can't access a BAQ through the 4GL code either, (or can you?).

thanks

--- In vantage@yahoogroups.com, "dansirow" <dansirow@...> wrote:
>
> In BPM I would try something like the following 4GL code:
> FIND FIRST UD10 WHERE UD10.Key1 = Part.PartNum NO-LOCK.
>
> Depending on the method, you probably want to be using a temporary table
> like ttPart.PartNum
>
> I don't think you want to use ODBC in a BPM.
>
>
> --- In vantage@yahoogroups.com, "erwinjw" <erwinjw@> wrote:
> >
> > Hi
> >
> > When we create a Part we have to use two UD tables to hold all the
> > additional fields we require (UD10 and UD11).
> >
> > I would like to be able to create an SQL View so I can do a single
> > lookup for required info.
> >
> > I know how to create the view through the SQL (instruction in
> > ODBC_Kit_403).
> >
> > create view obdc.partud10 as
> > select part.partnum, part.partdescription, ud10.shortchar03
> > from part, ud10
> > where part.partnum = ud10.key1;
> > commit;
> >
> > grant select on obdc.partud10 to public;
> > commit;
> >
> > I can open this view in Access, but when I try to access it through
> > 4GL code, it doesn't understand the code.
> >
> > for example,
> >
> > find first odbc.partud10 where etc
> >
> > produces the following error message.
> >
> > Unknown database name odbc. (855)
> > Unknown or ambiguous table partud10. (725)
> >
> > anyone have any ideas?
> > any help would be appreciated.
> >
>
Hi

When we create a Part we have to use two UD tables to hold all the
additional fields we require (UD10 and UD11).

I would like to be able to create an SQL View so I can do a single
lookup for required info.

I know how to create the view through the SQL (instruction in
ODBC_Kit_403).

create view obdc.partud10 as
select part.partnum, part.partdescription, ud10.shortchar03
from part, ud10
where part.partnum = ud10.key1;
commit;

grant select on obdc.partud10 to public;
commit;

I can open this view in Access, but when I try to access it through
4GL code, it doesn't understand the code.

for example,

find first odbc.partud10 where etc

produces the following error message.

Unknown database name odbc. (855)
Unknown or ambiguous table partud10. (725)

anyone have any ideas?
any help would be appreciated.
In BPM I would try something like the following 4GL code:
FIND FIRST UD10 WHERE UD10.Key1 = Part.PartNum NO-LOCK.

Depending on the method, you probably want to be using a temporary table
like ttPart.PartNum

I don't think you want to use ODBC in a BPM.


--- In vantage@yahoogroups.com, "erwinjw" <erwinjw@...> wrote:
>
> Hi
>
> When we create a Part we have to use two UD tables to hold all the
> additional fields we require (UD10 and UD11).
>
> I would like to be able to create an SQL View so I can do a single
> lookup for required info.
>
> I know how to create the view through the SQL (instruction in
> ODBC_Kit_403).
>
> create view obdc.partud10 as
> select part.partnum, part.partdescription, ud10.shortchar03
> from part, ud10
> where part.partnum = ud10.key1;
> commit;
>
> grant select on obdc.partud10 to public;
> commit;
>
> I can open this view in Access, but when I try to access it through
> 4GL code, it doesn't understand the code.
>
> for example,
>
> find first odbc.partud10 where etc
>
> produces the following error message.
>
> Unknown database name odbc. (855)
> Unknown or ambiguous table partud10. (725)
>
> anyone have any ideas?
> any help would be appreciated.
>