Dynamically nameing a CFfunction in a loop
I want to do this
loop through query results
<cffunction name= "#loop.ID#_test">
DO something with record of data from query
</cffunction>
now can I dynamically change the name of the cffunction ( and or Method)?
Can someone help me please
This might help get help
this is what I have and it works but whenever I add something new it gets ver cumbersum
<cfcomponent displayname="F_QU_004_harness" extends="mxunit.framework.TestCase">
<cfobject component="setup" name="setupUtil">
<!--- read xml file templatevariables.xml --->
<CFFile action="READ" variable="xml" file="#ExpandPath('.')#\Templatevariables.xml">
<cfset mydoc = XmlParse(xml)>
<cfset MyDocArray =XmlSearch(mydoc,'SavedQuery')>
<!--- set up --->
<cffunction name="setUp" returntype="void" access="public" output="false">
<cfset this.selenium=setupUtil.setup()/>
</cffunction>
<!--- Shut down selenium --->
<cffunction name="tearDown" returntype="void" access="public" output="false">
<cfset setupUtil.tearDown()/>
</cffunction>
<!---set variables based on the index of the function --->
<cffunction name="variablesetup" access="Private">
<cfargument name="indexVar">
<cfscript>
this.queryId = #myDoc.xmlRoot.xmlChildren[indexVar]["queryId"].xmlText#;
this.queryName=#myDoc.xmlRoot.xmlChildren[indexVar]["queryName"].xmlText#;
this.UnqSQL =#myDoc.xmlRoot.xmlChildren[indexVar]["UniqueSQL"].xmlText#;
this.AllSql=#myDoc.xmlRoot.xmlChildren[indexVar]["AllSQL"].xmlText#;
</cfscript>
</cffunction>
<!--- the following are calls to the individual templates --->
<cffunction name="All_Bio_Samples" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<!--- the number in the variablesetup call corresponds to the index in the xml file to the template--->
<cfset variablesetup(1)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="Asthma_All" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(2)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="COPD_All" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(3)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="Asthma_Adults" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(4)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="Asthma_Kids" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(5)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="COPD_Under_50" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(6)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="ILD_All" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(7)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="Sleep_Apnea" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(8)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="Rhinitis_All" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(9)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="Rhinitis_Adults" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(10)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="Rhinitis_Kids" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(11)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="Sinusitis_All" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(12)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="Sinusitis_Adults" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(13)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="Alpha_1_antitrypsin_Deficiency" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(14)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
<cffunction name="Sleep_Apnea_Kids" returntype="void" access="public" output="false">
<cfset selenium=this.selenium/>
<cfset variablesetup(15)>
<cfinclude template="F_QI_004.cfm">
</cffunction>
</cfcomponent>
I want to do this more dynamically like read the XML and let the data drive instead of ME doing all that typing of the same thing OVER AND OVER
Similar Messages
-
Dynamically Named Restore Points?
Does anyone know how to create dynamically named restore points? I have an RMAN script that is currently setup like this:
sql 'drop restore point lv_restore';
sql 'create restore point lv_restore';
backup database plus archivelog;
delete noprompt obsolete;
exit;
The first line is where I drop the restore point and the second line is where I create it again. This way the restore point is set just before the backup begins.
Okay - it's setup like this because when I don't drop the restore point ahead of time I get the following error:
sql statement: create restore point lv_restore
RMAN-00571: =================================================
RMAN-00569: ======== ERROR MESSAGE STACK FOLLOWS ===========
RMAN-00571: =================================================
RMAN-03009: failure of sql command on default channel at 04/29/2008 15:22:44
RMAN-11003: failure during parse/execution of SQL statement: create restore point lv_restore
ORA-38778: Restore point 'LV_RESTORE' already exists.
This makes sense to me, actually. What I would love to do is to dynamically append the current date to the end of the restore point name. The idea is to have the restore points named something like this:
lv_restore_2008-04-25
lv_restore_2008-04-26
lv_restore_2008-04-27
lv_restore_2008-04-28
lv_restore_2008-04-29
etc...
Is there any way I can dynamically name restore points?Can anyone explain to me how to use the syntax provided by damorgan to actually append a value to the restore point name in the script I provided?
Any help is greatly appreciated. -
File dynamically named & want to ignor some characters
Hi,
My ODI sources are files dynamically named with structure SR_10-04-2011-22-54.tx.gz --> SR_dd-mm-yyyy-hh24-mi.txt.gz , i'm trying to extract thoes files with ODIunzip so i created a package and passed a variable with that structure to the ODIunzip component, but as my files are generated by a platforme in a time, and the extraction begin later , the sysdate browth form Oracle by : select to_char(sysdate,'dd-mm-yyyy-hh24-mi') from dual ; to the variable is not conform with the file structure (minuts & seconds) so i'll bring just the dd-mm-yyyy form the sysdate, and what i need is to extract the file with that date , and ignor the seconds & minuts in the name of the file.
so Plz how can i do that?
or is there other way to extract this file?
thx a lot :)Jython tutorials..
http://www.jython.org/docs/tutorial/indexprogress.html
I would also look at the blogs on http://odiexperts.com/, and Oracles own tutorials around ODI -
Trying to reference a dynamically named object
Hi. I'm trying to make an interactive deck of cards and am
mostly done (
http://cards.positivedesign.co.uk
) but i'm having a slight problem. If you click on the link above
you'll see a pile on the right, click on the pile and the top card
lifts and flips into the center. Click on the right pile again and
the center card moves down to a pile on the left, and the next card
flips up to the center, and so on. The problem occurs when you
click on the right pile the 3rd time, the center card moves down to
the left, but goes BELOW the pile rather than on top of it.
I know WHY its doing this - i'm using the child index of the
cards to select which cards to flip, so if you click on a card on
the right and it has an index of 5, it moves the card with index 6
from the center to the left, etc. - I'm just not sure of another
way to do it. I tried naming the cards by numbers, so the top card
has a name of '1', and then I used a currentCard variable to keep
track of which cards I should be moving. However this wouldn't work
when I tried to select which object to tween, because I was
referencing 'cardLayer.currentCard' rather than say,
'cardLayer.card1'...
Hope that all makes sense. I'd appreciate any suggestions on
where I'm going wrong, or a better way of doing it?a clean solution, nice
Craig
"fatbuoy1" <[email protected]> wrote in
message
news:gkipvm$1gj$[email protected]..
> Yeah but by changing the order of the objects on stage,
like say bringing
> a
> card to the top, I then couldn't use the child index to
work out what
> cards to
> use.
>
> I found another way of referencing the right objects
though.. when I'm
> creating the cards in a for loop, I put the objects
themselves into an
> array,
> and then reference them through their index in the array
when I want to
> manipulate them.
>
> Thanks anyway!
> -
Dynamic query in where clause while looping in an internal table.
Hi,
Had a small question : How can i make a dynamic query for the WHERE clause while looping at an internal table.
i want to implement a dynamic where clause query for the below example.
it_cfx_col is an internal table and wa_cfx_col is a work area for it_cfx_col
DATA :
i_cfx_col TYPE TABLE OF cfx_col,
wa_cfx_col LIKE LINE OF i_cfx_col.
DATA : count TYPE i VALUE 0.
DATA : l_where_clause TYPE string,
l_where_clause2 TYPE string,
l_name type string.
l_name = 'NANDANOM'.
l_scenario = 'collaboration'.
LOOP AT it_cfx_col INTO wa_cfx_col
WHERE CREATED_BY = l_name
AND SCENARIO = l_scenario.
count = count + 1.
some business logic implemented using the work area wa_cfx_col
endloop.
Now i want to write a dynamic query for the where clause.
DATA : count TYPE i VALUE 0.
DATA : l_where_clause TYPE string,
l_where_clause2 TYPE string,
l_name type string.
l_name = 'NANDANOM'.
l_scenario = 'collaboration'.
l_where_clause = 'CREATED_BY = l_name'.
l_where_clause2 = 'AND SCENARIO = l_scenario'.
if l_scenario is not initial.
CONCATENATE l_where_clause l_where_clause2
INTO l_where_clause SEPARATED BY space.
endif.
LOOP AT i_cfx_col INTO wa_cfx_col
WHERE (l_where_clause).
count = count + 1.
some business logic implemented using the work area wa_cfx_col
endloop.
when i compile this i get an error message as { Statement concluding with "...(l_where_clause)" ended unexpectedly}
Even i changed the initilization of the variable l_where_clause2 to [ l_where_clause2 = 'AND SCENARIO = l_scenario.'. ]
added the end of line demarkation ".", but still i got the same error message.
Is it a limtation in ABAP that i cannot write a dynamic query for the where clause while looping at an internal table?
Regards,
omHi savita,
there in no such 1 limitaion in abap for dynamic query .. i think the error meassge is only beacuse of your synatx delcartaion.
>> LOOP AT i_cfx_col INTO wa_cfx_col
WHERE (l_where_clause).
count = count + 1.
some business logic implemented using the work area wa_cfx_col
endloop.
afted delclarataion also , in the where statement you should specify both the field name and value bname
LOOP AT i_cfx_col INTO wa_cfx_col
WHERE l_where_clause = 'CREATED_BY = l_name' .
count = count + 1.
hope it helps.
regads
priya. -
Dynamic naming of receiver file adapter
Hello Friends,
How to handle the dynamic file naming in XI at receiver side as file naming convention sequence to be incremented for every 1 hour...
my Client expecting to handle at mapping...How to do this...
Could any one give me the program if we need to do it in java...
and pls also give another approach if any
Setup dynamically ,>>as file naming convention sequence to be incremented for every 1 hour.
Please elaborate this point. I'm again seeing same the question from your side.
From Variable Substitution you can access only ASMA and can refer the payload element. But in the requirement is something else the you should have to go for Dynamic Configuration in Mapping program.
Thanks
Farooq
Edited by: Farooq Farooqui on Aug 16, 2008 12:11 AM -
Dynamic component in WHERE-condition for LOOP AT ?
i want to make
loop at itab where (dynamic field) > 0
how i can make it...
Edited by: Thomas Zloch on Mar 2, 2010 2:47 PMI thought it's funny.
And the problem can maybe be solved by using a completely dynamic where-condition, not just a dynamic component.
http://help.sap.com/abapdocu_70/en/ABAPLOOP_AT_ITAB_COND.htm#!ABAP_ADDITION_4@4@
Thomas
P.S. meaningless subject enhanced, and please take the time to say hi and please when asking for help. Thanks. -
When assigning a name to an object is it possible to do it dynamically? What I mean by this is can you name a list of objects with a name such as pic_# ( # is a number) within a for loop, instead having to write out every name,ie pic_1, pic_2, etc.
The reason why I ask this is that my application adds pictures defined by the user to a JPanel, but my code assigns the same temporary object name to each picture, which means i can't select pictures which have been added. I want to give each picture a handle from pic_1..pic_50, but typing out 50 names is way to time consuming. Is there an easier way?
I'll be grateful for any help. thanks :0)Try this:
public class Test1
public static void main (String[] args)
// Note that you have to declare array of size [51] instead of 50,
// since array stores data from index 0 and not 1
String[] imageNames = new String[51];
for (int i=1;i<51; i++)
imageNames = "pic_" +(i);
System.out.println("names of image " + i + " " + imageNames[i]); -
Dynamic naming for screen fields possible?
Hi.
I am trying to loop through some screen fields, and hence need to dynamically name the fields. I use the following codes, but it gave me an error:
IF MAND_CHECK = 'X' AND (TXT_FILE) IS INITIAL.
"TXT_FILE is a variable that contains the name of the screen field.
SET CURSOR FIELD TXT_FILE.
"TXT_FILE is a variable that contains the name of the screen field.
ENDIF.
Error: Fehlerhafter logischer Ausdruck "(TXT_FILE)": Nach "(".......Do the following:
field-symbols: <fs> type any.
assign txt_file to <fs>.
if mand_check eq 'X' and <fs> is initial.
Regards,
Michael -
I'm creating an instance in this way:
var newhouse:House = new House();
But I need to create fourty of these objects named:
"newhouse1","newhouse2",...,"newhouse40"
How can I name the var dynamicly, since the syntax won't
allow bracketsWell, at least to me, having all the instances located in an
array is
cleaner. I realize it's not _really_ cleaner, I just like
sticking stuff
into arrays. <g>
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
Dynamically naming a file using a send operation in B2B
Hello,
I am using a send operation in B2b adapter which drops a file in a particular location.
Right now its dropping a file as default naming standard by B2B.
I just wanted to know that is there any way where we can do this dynamically?
for eg- fetching a value from the file and concatenating it to the file name pattern that is set in B2B?
need a solution.
Thanks!
Regards,
Shreya.Shreya,
As indicated by Nitesh, use the "preserve filename" in File/FTP/SFTP channel and set the filename from the middleware using ACTION NAME B2B header. If you are passing message to B2B using AQ/JMS then use action name as -
ACTION_NAME=contentType:application/octet-stream;filename:abc.xml
If you are passing message to B2B using fabric (default) then set below headers -
b2b.contentType
b2b.fileName
Setting Content Type is optional.
You may refer -
http://docs.oracle.com/cd/E23943_01/user.1111/e10229/b2b_tps.htm#BABBCDHI
Regards,
Anuj -
Creating on the fly dynamic named bind variable names.
I have an application process which gets called by a Dynamic action and Javascript.
Everything is working great however I'm using it to drive dynamic charts.
I could use IF statements at the end of the application process to decide what BIND vairable to fill with the information the process has collected however I'd prefer just to create the BIND variable from the
name of the submitted information.
So I have an application level variable called WHICHCHART. this gets populated with text upon calling the application process...so let's say 'chart1' is what it gets filled with.
What I"d like to have at the end of the application process is just a bind variable waiting called :chart_1.
So no matter what the value of WHICHCHART it will create an on the fly a bind variable with the same name.Ok. I guess this question was more how do you do this..then OH NO there are not other ways to do this.
So I have a page with a chart region. this chart will have 3 Y Axes which prohibits the use of the default XML.
So..
I have the following Javscript:
function getdata(whichchart) {
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=VM_XML_GENERATION',0);
get.add('WHICHCHART',whichchart);
gReturn = get.get('XML');
get = null;
Which is called when the page loads by a dynamic action:
getdata('production');
When the javascript is called as you can see it fires off:
declare
chart_series_data VARCHAR(32767);
type array_cols is varray(7) of varchar2(100);
array array_cols := array_cols('VM_HOSTS_NUM','VM_NUMBER','VM_PHYS_MEM','VM_VIRT_MEM','VM_CPU_COUNT', 'VM_TOTAL_DISK','VM_PROVISIONED_DISK');
BEGIN
--IF :WHICHCHART IS NULL THEN
--RAISE_APPLICATION_ERROR(-20001,'Chart variable not set');
--END IF;
chart_series_data := null;
chart_series_data := ' <data>'||chr(10);
chart_series_data := chart_series_data|| ' <series name="Hosts Number" type="Line" color="0x1D8BD1" >'||chr(10);
for c1 in (SELECT VM_REPORT_DATE LABEL,VM_HOSTS_NUM from TABLE where VM_REPORT_DATE between add_months(SYSDATE,-24) and SYSDATE and lower(VM_DCNAME)=lower(:WHICHCHART) )
loop
chart_series_data := chart_series_data || '<point name="'||c1.LABEL||'" ';
chart_series_data := chart_series_data || 'y="'||c1.VM_HOSTS_NUM||'"></point> '||chr(10);
end loop;
chart_series_data := chart_series_data|| ' </series>'||chr(10)||'</data>';
:PROD_DATA := chart_series_data;
END;
The : production variable at the end of this I want to change the name of based on the value I'm sending of WHICHCHART from the javascript. I hope this is clearer now.
AGAIN this is not really a need. It is a want to be able to create dynamic bind variable names going forward.
Thanks -
Hi,
I need to be able to create vectors dynamically, for
example vectorName1, vectorName2 and so on. I've
managed to do this with JButtons using setName().
Is there a similar way to set the name of vectors
using a string?
Thanxwhy do you need dynamic names?
you could use a vector of vector or a hashtable of vectors to dynamically allocate vectors, but naming them?
a hashtable seems most appropriate since you could use your dynamic names as hash key.
thomas -
Need some assistance with dynamic database updates done through a loop
In the part of my application that I'm currently working on
I'm trying to dynamically update a local database every time a
change is made to the dataProvider(ArrayCollection) when a dragDrop
action is done. After doing some more research I found that the
update "function"(my trace placeholder) is fine where it is, the
problem is that it is firing the insert function for each and every
row every time something is dragged onto the datagrid essentially
cloning all the entries in the database while updating the original
items. So I've narrowed down my problem to figuring out how to get
the insert function to fire only once for new items and skipped
when updating items. The database is a local as this is an AIR app,
I'm posting this here since I feel this is more of a flex issue
than an AIR issue. I've already tried adding an else clause to the
if statement but that doesn't work along with else if. Thanks in
advance.
Here's my code so far:Ok, one thing I'm going to try today is this; essentially I'm
going to
say, "forget that for-loop, just let it update the
dataProvider". What
I'm going to do is write another function that runs each row
of the dp
through a filterFunction and checks to see if it is there or
not, if
it is there, then update the editable values, if not, then
insert a
new row. Since this would be invoked after the dataProvider
update, I
may just save it until the user closes the window in any way
and then
run this as a save and quit function. It would also help to
be able to
have it available in a button.
If anyone has a better idea on how to do this, don't hesitate
to tell me. -
Convert "1D array of dynamic data" to "Dynamic data" after auto-indexing with loop
Hi -
I have a question about how exaclty auto-indexing works with the Dynamic Data type when exiting a while loop. I'd like to use the DAQ assistant to record data through an analog input (on the MyDAQ) and then replay that data through an analog output. This works fine if I use the DAQ Assistant to record data for a set amount of time:
However, I run into trouble when I try to use a While loop with a stop button to record data for an arbitrary amount of time. I set the dynamic data tunnel out of the While loop to "Indexing", but then when it exits the loop, it becomes "1-D Array of Dynamic Data" instead of just "Dynamic Data", and get a broken wire when I try to connect it to the input of the DAQ Assistant. I've also tried converting the dynamic data to Array and Waveform data types inside the loop, but have the same issue (they become 2D Array and 2D Array of Waveform respectively when leaving the loop). Try as I might using blocks like Convert to/from Dynamic Data Type, or Array Subset, I'm unable to get them back down to just Dynamic Data or Waveform, which will be accepted by the DAQ Assistant:
One other small note - I'm not sure if using the "Build Array" function with a shift register accomplishes exactly the same thing as just auto-indexing an array out of the loop - so I've tried both, but still have the broken wire issue.
I'm assuming this is just a simple issue of using the right block to convert "1D Array of [Something]" to just plain [Something]. Any help appreciated.
Attachments:
PWM_FlatSequence.vi 101 KB
PWM_FlatSequence_While.vi 129 KBI have been facing problem for all temperature values placing the Write to Measurement File outside the Loop.
In Error message it says" Source: 1D array of dynamic data and Sink: Dynamic data".
Is there any means of convering 1D array of dynamic data to dynamic data?
I would highly appreciate any help.
Attachments:
Temperature Logger.vi 110 KB
Maybe you are looking for
-
Error while Executing Unix Shell Commands Using Runtime clas
I am trying to run the following code in java on unix machine to execute cat command. Runtime runtime = Runtime.getRuntime(); try { System.out.println("before catexecute"); Process process = runtime.exec("cat /
-
How to connect database using type4 driver(dsn or dsnless connection)
please send any one reply answer
-
I have just bought my first Mac(!) (Macbook Pro) after haveing owned iPod´s and an iPhone for some years now, and I´ve just started learning the basics. I was makeing my first purchase in Appstore, and when the download started, a strange pop-up appe
-
Dear all, i have written a select query for Update oracle database through Native SQL. Query is W_FLG = 'Y' UPDATE LPR_LEAVEPLAN_TRN SET FLOWLEVEL = W_FLG WHERE EMP_ID = '11200010'. LPR_LEAVEPLAN_TRN is my oracle table i want to change the field of
-
Watched folder issue with Distiller 9.0 and the Network
We found that the Distiller watched folders "In" and "Out" creates automatically to some other folders on the network. This is happened only when missing folders occurs in Distiller when network disconnects. We just wanted to know how to avoid of cre