Focal Point
[CLOSED] DATA MIGRATOR - Assign Synonym value to Variable

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/5497067786

September 15, 2017, 03:38 PM
DipJen
[CLOSED] DATA MIGRATOR - Assign Synonym value to Variable
Hi,
I want to read a source synonym field value into a variable. sourceSynonym would have multiple rows and want to assign only one of the value (conditional) to variable. How would I do this in data migrator?

Thanks
Dipjen

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
September 18, 2017, 12:16 PM
dhagen
 SQL
SELECT COUNTRY
FROM CAR
WHERE CAR = 'JAGUAR'
;
TABLE 
ON TABLE HOLD AS OUTLINE
END
-RUN
-READFILE OUTLINE
-? &C 



"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
September 20, 2017, 10:50 AM
DipJen
Hi,
thank you for replying. I got it working and now need bit more info.

I am storing returning query value in amper variable &lastreaddatetime. Its Apha value. I am trying to use this value in the data migrator flow, as select order,orderline,qty from order where moddate > &lastreaddatetime.

when i do -Type &lastreaddatetime its showing 0000192017/09/01 00:01:15 instead of 2017/09/01 00:01:15. How do I convert it to proper date.?

Thanks


WebFOCUS 8
Windows, All Outputs
September 20, 2017, 12:57 PM
FP Mod Chuck
Dipjen

It must be a varchar field and the 000019 is the length of the field. You can do the following to get rid of the length part.

-SET &leastreaddatetime = EDIT(&leastreaddatetime,'$$$$$$9999999999999999999');



Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
September 20, 2017, 03:40 PM
DipJen
In my process flow, i have steps as following:
steps:
[start]
2nd --> [set parameter] I default &lastreaddatetime = somevalue
3rd --> [procedure] that gets the date value from sql table and set to &lastreaddatetime amper variable
4th --> [data flow] that gets this &lastreaddatetime

so, value that i set in [set parameter] gets passed to my dataflow. But that value I changed in procedure to read from synonym is not seem to get set in step 3 in above. How do I get to get the value that is set by procedure here to pass to dataflow ?

my procedure looks like this:
 

SQL
SELECT lastreaddatetime FROM tbcontroltable WHERE CTLNAME='lastread';
TABLE 
ON TABLE HOLD AS HOLD01 FORMAT ALPHA
END
-RUN
 
-READ HOLD01  &lastreaddatetime.A24.
-TYPE TEST: &lastreaddatetime
-SET &lastreaddatetime = EDIT(&lastreaddatetime,'$$$$$$9999999999999999999');
-TYPE test1: &lastreaddatetime
-EXIT

 



WebFOCUS 8
Windows, All Outputs
September 22, 2017, 12:52 PM
FP Mod Chuck
Dipjen

That looks correct to me. Is it working?


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats