Bob: Thanks for the quick response.

I had done this, as well. The DocExt field is populated with the concatenated result:

#11
#8
#10
etc.

I'm thinking that the construct has to be interpreted as a column alias, where as all efforts so far produce a literal string.

Guessing that the solution lies within use of an ampersand variable, but, so far, I've been unsuccessful in crafting one.

Thanks very much, Bob. Stay healthy and well-entertained!

Bruce


------ Original Message ------
From: [email protected]
To: [email protected]
Sent: 5/15/2020 5:23:24 PM
Subject: Re: [RBASE-L] - Using #c within an UPDATE ... SELECT

How about

UPDATE PARSEDFILENAMES SET DOCEXT = ('#'+(CTXT(FIELDCOUNT))) WHERE DOCEXT IS 
NULL

Bob S.


On 2020-05-15 17:10, Bruce Chitiea wrote:
All:

Courier New font

BACKGROUND

For a file naming and re-naming project, several thousands of
custom-delimited document filenames are to be parsed into fields
within table PARSEDFILENAMES. The field count for each record varies
by class and filetype, so that the filename extension scatters over a
range of fields.

The goal is to copy the filename extension from whichever field it
falls within, to common column DOCEXT, ideally as the table is being
populated.

To this end, during parsing, SLOCI generates a field count to be
stored in a FIELDCOUNT column for each record. Since the filename
extension is the last field in a parsed filename, the extension is
found within Column# = FIELDCOUNT.

ISSUE

By itself ...

SELECT ('#'+(CTXT(FIELDCOUNT))) FROM PARSEDFILENAMES

... produces:

#13
#11
.
#10

... as intended. So, I'd thought this would do the trick:

UPDATE PARSEDFILENAMES +
   SET DOCEXT = +
SELECT ('#'+(CTXT(FIELDCOUNT))) +
  FROM PARSEDFILENAMES +
 WHERE DOCEXT IS NULL

... which produces the error:

"ILLEGAL TABLE NAME - ('#'+(CTXT(FIELDCOUNT))) (2037)"

Several attempts to turn the offending string into a variable, for use
as an AMPERSAND VARIABLE, have also failed. Still working at it, but
clearly not getting it.

How might the column number be specified within the SELECT statement,
to avoid resort to a WHERE loop or CURSOR?

Many thanks, Bruce

Bruce A. Chitiea
SafeSectors, Inc.
112 Harvard Ave #272
Claremont CA 91711-4716
[email protected]_
+011 (909) 238-9012 c

 --
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google
Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/emdaf59928-37f7-4860-a39e-91a4b7d4e199%40pathfinder
[1].


Links:
------
[1]
https://groups.google.com/d/msgid/rbase-l/emdaf59928-37f7-4860-a39e-91a4b7d4e199%40pathfinder?utm_medium=email&utm_source=footer

-- For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/77b9ad6cadeb26e30e656f5b5f5bc94a%40rasimms.com.

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/em6b467160-0ef0-4db2-a5fd-9ff8942688e7%40pathfinder.

Reply via email to