March 15, 2007, 09:02 AM
GeorgeMengArray 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!
March 15, 2007, 09:28 AM
Danny-SRLHi 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,
March 15, 2007, 10:03 AM
GeorgeMengThank you very much! That is I need.
Have a nice day!