Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread LIST
Wed, Sep 10 2008 11:13 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

I've just used LIST for the first time. There are two improvements I'd like (one I think is an impossibility but I thought I'd ask anyway).

I discovered you don't need to put the size of the VARCHAR eg LIST(CAST(_fkContacts AS VARCHAR)) which is really good but since the output is always to a CLOB can we have an automatic CAST?

The impossible one: is there a way to supply a TStringList and get your LIST to populate it?

Roy Lambert
Wed, Sep 10 2008 4:17 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I discovered you don't need to put the size of the VARCHAR eg
LIST(CAST(_fkContacts AS VARCHAR)) which is really good but since the output
is always to a CLOB can we have an automatic CAST? >>

If you want to force the result of the LIST to a VARCHAR, then you need to
put the CAST around the LIST instead:

SELECT CAST(LIST(Company) AS VARCHAR(100)) FROM customer

<< The impossible one: is there a way to supply a TStringList and get your
LIST to populate it? >>

Just leave the result of the LIST as a CLOB type, and then use this code
after the query is executed:

MyStringList.CommaText:=FieldByName('MyListField').AsString;

or use something like this:

SELECT LIST(Company,#13+#10) FROM customer

MyStrings.Assign(TMemoField(FieldByName('MyListField')));

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Sep 15 2008 2:21 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


Been away for a few days


><< I discovered you don't need to put the size of the VARCHAR eg
>LIST(CAST(_fkContacts AS VARCHAR)) which is really good but since the output
>is always to a CLOB can we have an automatic CAST? >>
>
>If you want to force the result of the LIST to a VARCHAR, then you need to
>put the CAST around the LIST instead:
>
>SELECT CAST(LIST(Company) AS VARCHAR(100)) FROM customer

You need to read it again SmileyThe column I'm using is an integer hence the conversion inside LIST and my question was can ElevateDB do that conversion automatically.

><< The impossible one: is there a way to supply a TStringList and get your
>LIST to populate it? >>
>
>Just leave the result of the LIST as a CLOB type, and then use this code
>after the query is executed:
>
>MyStringList.CommaText:=FieldByName('MyListField').AsString;
>
>or use something like this:
>
>SELECT LIST(Company,#13+#10) FROM customer
>
>MyStrings.Assign(TMemoField(FieldByName('MyListField')));

That's what I'm currently doing I just wanted ElevateDB to do it for me <vbg>

Roy Lambert
Mon, Sep 15 2008 10:00 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< You need to read it again SmileyThe column I'm using is an integer hence
the conversion inside LIST and my question was can ElevateDB do that
conversion automatically. >>

No, EDB is strongly-typed, so you need to make sure to do any CASTs
yourself.

<< That's what I'm currently doing I just wanted ElevateDB to do it for me
<vbg> >>

I could say something about wiping one's own posterior here, but I won't
(even though I did). Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Sep 15 2008 10:31 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>I could say something about wiping one's own posterior here, but I won't
>(even though I did). Smiley

I did say it was asking for the impossible <hurt expression>

Roy Lambert
Tue, Sep 16 2008 5:53 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I did say it was asking for the impossible <hurt expression> >>

I hope that you're kidding, because I was completely kidding.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Sep 16 2008 6:10 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


Yes I did see the Smileyso I know, and yes I was

Roy Lambert
Tue, Sep 16 2008 6:33 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Yes I did see the Smileyso I know, and yes I was >>

Okay, good.  I was just making sure because of the <hurt expression>. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Sep 16 2008 7:44 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


I must say I'm surprised that you hadn't noticed that when I feel agreeved I don't hide it - both barrels, kick and scream is my motto <vbg>

Roy Lambert
Image