All:
This:
SET VAR vColumn_Alias TEXT = NULL
SET VAR vColumn_Alias = (CTXT(.vColumnCNT_Stp))
... correctly resolves to this: " 1 " , being the " #c " column number,
in text datatype, accepted by the SELECT command.
But, when used in a SELECT statement to retrieve the value contained
within Field 1:
SELECT &vColumn_Alias +
INTO vColumn_Text INDIC vInd +
FROM Parsed_Filenames +
WHERE WalkListID = .vWalkList_Stp
... the value retrieved is the literal value of the text variable: " 1
", instead of the field value.
What needs to be changed in the definition of the variable, or in its
use within the SELECT statement, to retrieve the value of column number
" 1 "?
Sooo close. Stumped.
Thanks much, Bruce
Bruce A. Chitiea
SafeSectors, Inc.
112 Harvard Ave #272
Claremont CA 91711-4716
[email protected]
+011 (909) 238-9012 c
------ Original Message ------
From: "Bruce Chitiea" <[email protected]>
To: "[email protected]" <[email protected]>
Sent: 5/15/2020 5:10:50 PM
Subject: [RBASE-L] - Using #c within an UPDATE ... SELECT
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
<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/emd608335b-5794-4374-a6c6-86bc95fc2f86%40pathfinder.