From: Geoff Schaller on
Bill,

> I put an InfoBox at the start of CaptionClick() to show the #FieldSym
> [Symbol2String(oEvent:column:FieldSym)] from the clicked column, but

I thought this was obvious. You cannot use FieldSym because there isn't
a field. But you shouldn't use FieldSym anyway - you should use the
hyperlabel - that is why you provided one. Here is how I do it in my
base column class:

ACCESS FieldSym AS SYMBOL PASCAL CLASS GCSbDataColumn

LOCAL symField AS SYMBOL
LOCAL oHyperLabel AS HyperLabel

IF IsSymbol(SELF:symField) .AND. !Empty(SELF:symField)
symField:= SELF:symField
ELSEIF SELF:oHyperLabel<>NULL_OBJECT
symField := SELF:oHyperLabel:NameSym
ELSEIF SELF:oFieldSpec<>NULL_OBJECT .AND.
SELF:oFieldSpec:HyperLabel<>NULL_OBJECT
symField := SELF:oFieldSpec:HyperLabel:NameSym
ELSEIF SELF:iField>0
oHyperLabel := SELF:oServer:FieldHyperLabel(SELF:iField)
IF !Empty(oHyperLabel)
symField:= oHyperLabel:NameSym
ENDIF
ELSEIF IsString(SELF:uCaption) .AND. !Empty(SELF:uCaption)
symField := String2Symbol(SELF:uCaption)
ELSE
symField:= NULL_SYMBOL
ENDIF

RETURN symField


You will see that I cover a range of possibilities. Often I assign a
fieldspec and wish to use that but if that fails, it resorts to the
hyperlabel.

> By the way, what does CTE stand for in your last post?

Common Table Expression.

Very powerful concept and it greatly reduces query complexity and
substantially improves performance. Basically you create a table on the
fly with names you wish to use (especially from joins etc) and then you
can use those names in your further query components. Look it up in BOL
or your favourite SQL book. It is another way of achieving sorting on a
column that has a pseudo name or derives from a joined table or
expression.

Cheers,
Geoff


From: BillT on
Geoff, you are a wizard again!
Of course, NameSym and not FieldSym! So taking the lead from your
ACCESS I took a simple solution for now and detect the
column:hyperlabel:namesym as CategoryName but OrderBy(#CategoryID) -
not alphabetic order but at least ordered. Many thanks.
------------------------

OK, I Googled for some info on CTE; will pursue it further. But
meantime, following up on Roger's suggestion above, I can't find
anything about how to JOIN two tables using VO SQLServers and then
attaching the result to a bBrowser? Maybe it can't be done?

I have done a number of joins and selects in ASP code using low-level
creation of Connections and Selects, but do the Joins or even simple
Selects of subsets from a single table in VO have to be also done at
that level? This is a bit off-topic; may be worth another thread?

Regards,
Bill
From: Geoff Schaller on
<g>

You don't "join two VO servers", you create a joined server.


Select ih.a, ih.b, ih.c, il.x, il.y, il.z from invoiceheader ih
Left join invoicelines il on ih.invno=il.invno


You create your joined table, add your orders and where clauses and bob
is your uncle. Using a CTE would let you create a runtime table with
columns of any name that made sense.

Geoff




"BillT" <wtillick(a)hotmail.com> wrote in message
news:333762ac-7b5a-4196-be70-11769df108f6(a)z8g2000yqz.googlegroups.com:

> Geoff, you are a wizard again!
> Of course, NameSym and not FieldSym! So taking the lead from your
> ACCESS I took a simple solution for now and detect the
> column:hyperlabel:namesym as CategoryName but OrderBy(#CategoryID) -
> not alphabetic order but at least ordered. Many thanks.
> ------------------------
>
> OK, I Googled for some info on CTE; will pursue it further. But
> meantime, following up on Roger's suggestion above, I can't find
> anything about how to JOIN two tables using VO SQLServers and then
> attaching the result to a bBrowser? Maybe it can't be done?
>
> I have done a number of joins and selects in ASP code using low-level
> creation of Connections and Selects, but do the Joins or even simple
> Selects of subsets from a single table in VO have to be also done at
> that level? This is a bit off-topic; may be worth another thread?
>
> Regards,
> Bill

From: BillT on
Geoff,
I am OK about the select and join, but can that be used to create a
new VO SQLServer or am I missing something here?

If, however, I have to work through the low-level SQLConnection/
SQLSatement path how do I then attach that result to bBrowser?

thanks,
Bill
From: Geoff Schaller on
Bill.

I use VO2Ado, not the VO SQL classes, however the concept is identical.

You open a server based on a select statement. At that point you have a
table comprising the columns you selected, be they from joins or
anything else. Hence under SQL, relations are implicit. They become raw
data from a join.

You can still class-wrap this stuff and strongly type the server, its
access and assigns, otherwise you use fieldget/put just like any other
server. The select that was used to create the data it totally
irrelevant. It can be anything. Literally.

Geoff


"BillT" <wtillick(a)hotmail.com> wrote in message
news:2fbe3e07-906a-4844-a757-d4677f4ca17b(a)w12g2000yqj.googlegroups.com:

> Geoff,
> I am OK about the select and join, but can that be used to create a
> new VO SQLServer or am I missing something here?
>
> If, however, I have to work through the low-level SQLConnection/
> SQLSatement path how do I then attach that result to bBrowser?
>
> thanks,
> Bill