Focal Point
Array object?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4801082812

March 15, 2007, 09:02 AM
GeorgeMeng
Array object?
Hi,

I have a simple table in SQL database:

Table: Exchange

ID From_CUR To_CUR CUR_RATE
1 US CAN 10.00
2 US CAN 9.00
3 US CAN 8.00
4 US CAN 7.00
5 US CAN 6.00
6 US CAN 5.00

I have the code to show the content in the table.

ENGINE SQLMSS SET DEFAULT_CONNECTION CON01
SQL SQLMSS PREPARE SQLOUT FOR
SELECT
TOP 100
[id]
,[from_cur]
,[to_cur]
,[cur_rate]
FROM
[AdventureWorks].[dbo].[Exchange]
;
END
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS HOLD_FILE
END
TABLE FILE HOLD_FILE
PRINT *
END

My question is:
1) Is there a way to put CUR_RATE value into a variable for ID=3?
2) Is there an array object in WebFocus script language?

Thank you very much!


George

WebFocus Developer Studio 7.6.0/BW 3.5/Servlet mode
March 15, 2007, 09:28 AM
Danny-SRL
Hi George,
When you ask about a variable, am I correct in assuming you want to put 8.00 into an &variable?
If so, then you do:
TABLE FILE HOLD_FILE
WHERE ID EQ 3
PRINT CUR_RATE
ON TABLE SAVE
END
-RUN
-READ SAVE,&V

You will have 8.00 in &V.

As for an array object, you can have arrays of &variables. There are no arrays of fields.
Variable arrays are written &V.&I where &V is the variable name and &I is the index.

Hope it helps,


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

March 15, 2007, 10:03 AM
GeorgeMeng
Thank you very much! That is I need.

Have a nice day!


George

WebFocus Developer Studio 7.6.0/BW 3.5/Servlet mode