Claudine,
In addition to Buddy's observation, you may
pre-define the vValue as NOTE or VARCHAR data type.
Very Best R:egards,
Razzak
At 08:02 PM 8/7/2017, Claudine Robbins wrote:
Trying to figure this out on my own. I tried
one field at a time and all load fine until I
reach vlading. All text fields total 667
characters. Am I running up against a size limit of some kind?
From: [email protected]
[mailto:[email protected]] On Behalf Of Claudine Robbins
Sent: Monday, August 07, 2017 6:17 PM
To: [email protected]
Subject: RE: [RBASE-L] - Version 10 - dotted vs. ampersand variables
Oh, it helps a lot. And what a beautiful thing
it is when code works as expected!
One problem remains however, on the last field
loaded I get an error 122 that LOADLADING needs
to be TEXT. Except for vamt which is currency,
the variables and the temp table column are text
so I’m stumped. This is my code:
SET VAR vValue TEXT
SET VAR vValue = ('.VDTG'+(CTXT(.VCOUNT)))
SET VAR vValue = (.vValue + ',' + ('.Vcar'+(CTXT(.VCOUNT))) )
SET VAR vValue = (.vValue + ',' + ('.Vwb'+(CTXT(.VCOUNT))) )
SET VAR vValue = (.vValue + ',' + ('.Vamt'+(CTXT(.VCOUNT))) )
SET VAR vValue = (.vValue + ',' + ('.Vorigin'+(CTXT(.VCOUNT))) )
SET VAR vValue = (.vValue + ',' + ('.Vdestin'+(CTXT(.VCOUNT))) )
SET VAR vValue = (.vValue + ',' + ('.Vlading' +(CTXT(.VCOUNT))) )
INSERT INTO comparecontrast
(LOADDTGSPLIT,LOADCARNAME,LOADWB,CARAMT,LOADORIGIN,LOADDESTIN,LOADLADING)
VALUES &vValue
vValue = .VDTG1,.Vcar1,.Vwb1,.Vamt1,.Vo TEXT
rigin1,.Vdestin1,.Vlading1
Vlad1 = LOAD FROM SEABOARD-CORPUS: TEXT
[1] 5-1/8" X 15 MANUAL VALVE,
BOLTS, RING GASKETS ***
-----Original Message-----
From:
<mailto:[email protected]>[email protected]
[mailto:[email protected]] On Behalf Of Claudine Robbins
Sent: Sunday, August 06, 2017 10:39 PM
To: <mailto:[email protected]>[email protected]
Subject: Re: [RBASE-L] - Version 10 - dotted vs. ampersand variables
Razzak,
Well I can't wait to try it tomorrow! I
actually also have several values to load into my temp table...
Thank you very much.
Claudine
Sent from my iPhone
On Aug 6, 2017, at 8:23 PM, A. Razzak Memon
<<mailto:[email protected]>[email protected]> wrote:
Claudine,
The timing of your post couldn't have been better.
Yes, you can!
In your specific case ...
You will have to create an additional variable
to build the string which is the "values" part of the insert.
When you finally go to use that variable, use
the "&" prefix instead of the "." prefix.
Here is the key part of an example from one of my application ...
-- Predefined variables and logic is defined here ...
SET VAR vValue TEXT
WHILE vWorkingOn <> vLFNFileCount THEN
SET VAR vWorkingOn = (.vWorkingOn + 1)
SELECT (MAX(External_File_ID)+1) INTO
vExternal_File_ID INDIC iv1 FROM External_Files
-- Build the string with needed file names
set var vValue = ('(' + '.vExternal_File_ID')
set var vValue = (.vValue + ',' + '.vLFNFileNameS' + CTXT(.vWorkingOn))
set var vValue = (.vValue + ',' + '.vLFNFileExt'+(CTXT(.vWorkingOn)))
set var vValue = (.vValue + ',' + '.vLFNFileDateTime'+(CTXT(.vWorkingOn)))
set var vValue = (.vValue + ',' + '.vLFNFileSize'+(CTXT(.vWorkingOn)))
set var vValue = (.vValue + ',' +
'.vLFNFilePath'+(CTXT(.vWorkingOn)) + ')')
-- Now use this string for the value part of the insert
INSERT INTO External_Files +
(External_File_ID, +
External_File_Name, +
External_File_Extension, +
External_File_DateTime, +
External_File_Size, +
External_File_Original_Path) +
VALUES +
&vValue
ENDWHILE
RETURN
Hope that helps!
Very Best R:egards,
Razzak
At 09:05 PM 8/6/2017, Claudine Robbins wrote:
> SET VAR VCOUNT = 1
> SET VAR yylading TEXT = ('Vlad'+(CTXT(.VCOUNT)))----vlad1 SET VAR
> &yylading TEXT = NULL-----same as vlad1 = NULL SELECT LADING INTO
> &yylading INDICATOR ivlad FROM orders WHERE (dtg+split) = .ventry
> R>sho v vlad1
> LOAD FROM SEABOARD-CORPUS:
> [1] 5-1/8" X 15 MANUAL VALVE,
> BOLTS, RING GASKETS ***
> LOAD FROM BASIC
> ENERGY-CORPUS: [1] 5-1/8" X
> 15 MANUAL VALVE, BOLTS, RING
> GASKETS
>
> I’m trying to do something which is NOT in
the whitepaper dotted vs. ampersand variables.
>
> I’m in a 4 count while loop, so as vcount
is incremented field vlad becomes vlad1, vlad2, vlad3, and vlad4.
>
> My select correctly acquires the lading
value. Before I increment vcount = (.vcount
+1), I want to load vlad1 in a temporary table.
>
> INSERT INTO tempTBL VALUES (????). I’ve
tried (&yylading), &yylading (error),
'&yylading',and '.yylading' . All I manage to
get is &yylading, .yylading or vlad1 but not
the actual value contained in vlad1.
>
> I don’t have any great hopes that this can be done but what the heck,
> I thought I’d ask anyway…
--
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
<mailto:[email protected]>[email protected].
For more options, visit
<https://groups.google.com/d/optout>https://groups.google.com/d/optout.
--
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
<mailto:[email protected]>[email protected].
For more options, visit
<https://groups.google.com/d/optout>https://groups.google.com/d/optout.
--
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
<mailto:[email protected]>[email protected].
For more options, visit
<https://groups.google.com/d/optout>https://groups.google.com/d/optout.
--
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
<mailto:[email protected]>[email protected].
For more options, visit
<https://groups.google.com/d/optout>https://groups.google.com/d/optout.
--
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].
For more options, visit https://groups.google.com/d/optout.