I have a checkbox on my page and I need to load multiple values from the array into the checkbox. How can I do that?
FOR i IN 1 .. v_arr.COUNT
LOOP
:P2_CHK1 = v_arr (i)
END LOOP;
you need to pass a string delimited by colon. I don't know if there is a utility function to do this, but you can concatenated every value in a varchar2 variable and then pass to :P2_CHK1. Example of a valid value: '1:2:4:5'
Related
I have a macro variable called max_attempts I created from a a PROC SQL that equals 4 for my current datafile. Then, I used a macro function to create datasets up to max_attempts so now I have attempt1_table, attempt2_table, attempt3_table, and attempt4_table. Now I'm having trouble merging the 4 datasets.
data final_table;
set attempt1_table - attempt&max_attempts._table;
run;
The inputted datafile will have a different max_n each time, so I'm using macros to account for that.
The - shortcut only works if the number is at the end of the dataset name. Rename your datasets to be round_table1, round_table2, etc.:
data final_table;
set round_table1 - round_table&max_n.;
run;
Use the trimmed option of the into :macrovar clause in order to remove the leading spaces that cause set attempt1_table - attempt&max_attempts._table; to resolve into erroneous syntax.
Example:
proc sql noprint;
select <computation-for-max-attempts>
into :max_attempts trimmed /* removes leading spaces when column is numeric */
from ...
;
quit;
Thank you everyone for your help! It was two issues, the number has to be at the end of the dataset name when using the - shortcut and using trimmed to remove leading spaces.
proc sql feedback;
select max(max_attempts)
into: max_attempts trimmed
from analysis_data;
quit;
data analysis_table;
set unknown_table attempt_table1 - attempt_table&max_attempts;
run;
I want to pass a constant string value i.e. Not Applicable for one of the column values that will be used in SUMMARIZECOLUMNS function. But I am not find any format in how to do the same.
SUMMARIZECOLUMNS( table_name[column_name], "Custom_Column_Name", "Not Applicable")
I would like to retrieve large SQL dump between date ranges. For the same, I constructed a loop over a date list, which intends to extract adjacent fields. Unfortunately, in my case, it doesnt work as planned.
Following is my flow:
Replace Text: Takes flowfile content date list as all_first_dates
Initialize Count:
While Loop:
Get first and adjacent dates:
However, on seeing the queue, I get the first and second as this:
Whereas, I desired as 2016-01-01 and 2016-01-02 for first and second respectively on my first iteration and so on.
check the description of the getDelimitedField function and it's parameters:
Description: Parses the Subject as a delimited line of text and returns just a single field from that delimited text.
Arguments:
index: The index of the field to return. A value of 1 will return the first field, a value of 2 will return the second field, and so on.
delimiter: Optional argument that provides the character to use as a field separator. If not specified, a comma will be used. This value must be exactly 1 character.
...
you are not passing the second parameter, so the coma used to split the subject, and you got the whole subject as one element in result.
I have a grid on a form that displays some columns from a dbf table and a textbox.
I want to search the value displayed in the textbox over all columns from a dbf table. Some fields are numeric and other are character
If I want to find a number, should search all record that contain that number in all columns, no matter the column type.
If I want to search a substring should give me all record that contain that substring.
SET FILTER TO ALLTRIM(ThisForm.Text1.Value) $Content or ALLTRIM(val(ThisForm.Text1.Value)) $registrationNumber or ALLTRIM(ThisForm.Text1.Value) $holderNo
Your approach with the "$" wildcard "contains" approach appears to be ok. However, your attempt via allt( val( )) would fail as you cant trim a numeric value, it would have to be pre-converted to a string.
Now, that said, you could shorten your query by just doing a $ against a concatenation of ALL columns something like (assuming your registration number is a numeric field)...
set filter to ALLTRIM(ThisForm.Text1.Value) ;
$ ( Content +"," +str(registrationNumber) +," + holderNo )
if you have dates or date/time fields you could do DTOC( dateField ) or TTOC( dateTimeField). So, by building a single string of all values, you dont have to explicitly repeat the OR condition repeatedly.
You could do something like:
select curGrid
scan
lcRow = transform(field1) + transform(field2) ... + transform(lastfield)
if lcSearchValue $ lcRow
DoWhatever()
endif
endscan
This leverages the fact that transform() will give a string representation of any data type.
I have an SSIS package which loops over an array of dates. On each iteration I would like to append the current date to a string to get a full string of all the dates iterated.
What I did was to make an expression where: dateconcatvariable + ", " +currentdatevariable
However, dateconcatvariable is resetting on every iteration of the for loop and so in the end I end up with the last date iterated over instead of all the dates.
the variable is a package level variable.
Any ideas on how to get a concatenation to happen on SSIS?
Thanks!
1. Create a string variable #User::var
2. Use an Expression component and set the expression to #User::var = #User::var + (WSTR, 15)#User::yourdatevar
This should give you the general idea.