eoneon123 Posted February 19, 2013 Posted February 19, 2013 How do I declare a variable which is the result of a Let function? The following is inside an Execute SQL step but I don't think that matters: Let([ ~sql1 = $SQL_SELECTid & $WHERE_Parentid ]; ExecuteSQL ( ~sql1; "" ; ¶; $Currnt_PREMid)) What I want to do is to define multiple ~sql statements inside the first part of the Let statement and then have their results convert into variables which I can use for other calculations either inside this step or in other steps. I tried the following but it returns a "?". The overall goal here is to make my calculations more compact and readable. Let([ ~sql1 = $SQL_PARENTid & $WHERE_PREMid //I want to have multiple sql var steps here ]; Let ($result1 = ExecuteSQL ( ~sql1; "" ; ¶; $Currnt_PREMid); "")) //I want to have multiple result var's declared here.
eoneon123 Posted February 19, 2013 Author Posted February 19, 2013 Whoops, I think I've got this working as I had some mismatching variable names causing the calcs to fail. So far I got this working by setting the following inside a Execute SQL step: Let( $Result1 = ExecuteSQL ( $SQL_SELECTfield1_FROM_Table & $$WHERE_FieldEQLs ; ""; ¶; $Value1 ); "") & Let( $Result2 = ExecuteSQL ( SQL_SELECTfield2_FROM_Table & $$WHERE_FieldEQLs ; ""; ¶; $Value1); "")
bruceR Posted February 19, 2013 Posted February 19, 2013 Let( $Result1 = ExecuteSQL ( $SQL_SELECTfield1_FROM_Table & $$WHERE_FieldEQLs ; ""; ¶; $Value1 ) ; $Result2 = ExecuteSQL ( SQL_SELECTfield2_FROM_Table & $$WHERE_FieldEQLs ; ""; ¶; $Value1); "")
jbante Posted February 20, 2013 Posted February 20, 2013 Let ( [ $Result1 = ExecuteSQL ( $SQL_SELECTfield1_FROM_Table & $$WHERE_FieldEQLs ; "" ; "" ; $Value1 ) ; $Result2 = ExecuteSQL ( $SQL_SELECTfield2_FROM_Table & $$WHERE_FieldEQLs ; "" ; "" ; $Value1 ) ] ; "" )
Recommended Posts
This topic is 4351 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now