Attachment values according variable names
Hello,
In iteration I want to get values from variables according their names, i.e.:
DECLARE
val1 VARCHAR2(10) :='value1';
val2 VARCHAR2(10) :='value2';
val3 VARCHAR2(10) :='value3';
val VARCHAR2(10);
BEGIN
FOR i IN 1..3 LOOP
val:=val||i;
dbms_output.put_line(val);
END LOOP;
END;
In each iteration I want to get one value at time: value1 then value2 and so on. I think, it can be done with NDS, but I really don't know the right solution.
Can you help me please?
Hi,
If you want to be able to loop through those variables as if they were a collection, then actually make them a collection. For example:
DECLARE
TYPE my_string IS TABLE OF VARCHAR2 (10);
vals my_string := my_string ( 'value1'
, 'value2'
, 'value3'
BEGIN
FOR i IN 1 .. 3
LOOP
dbms_output.put_line (vals (i));
END LOOP;
END;
/What's the advantage of having separate variables with names like val1? Is it that much harder to use vals (1)?
Similar Messages
-
Presentation Variable name being passed as value
I have a requirement where value needs to be checked against two separate fields for filtering (as OR statement). But there should be ability to filter on these fields separately as well.
Dashboard prompt:
Province [Multi search]
State [Multi search]
Combined search (Province OR State Fields) [Edit Box] --- used to pass presentation variable
Report filter:
Province is prompted
AND State is prompted
AND Province is @{presentation_variable} (no default)
OR State is @{presentation_variable} (no default)
But if the text field with presentation variable in not used to filter, then the report shows no result because the presentation variable name itself is taken as a value. Any solution how this can be done making sure that if province only is searched for then the presentation variable is not passed as value and the query returns no results?
Thanks everyone.Thanks Rachit, that helps. For the scenario mentioned initially, even this works:
Province is @{presentation_variable} (no default)
OR State is @{presentation_variable} (no default)
But the challenge is if I want to add another filter (like country) also as a filter. When users filter only on country, then the report shows no results because no value has been passed to the presentation variable and the query generated uses presentation variable name as the value! -
JSP : create variable dynamic variable name and get his value.
//HI forums.sun.com !
//What I want to do is above :
//out.println("<td style=\"width: "+col_width_+h+" \">")
//Variable Declaration
String col_width_1 = "100px";
String col_width_2 = "150px";
//etc String col_width_N = "XXXpx";
//loop
for (int h = 0; h < hrecset.getRowCount(); h++)
//some code
//create the variable name (exemple : col_width_0 ) with the "loop counter name" to get the value
out.println("<td style=\"width: "+col_width_+h+" \">")//Do you understand what i mean?
//some code
//Variable Declaration
String col_width_1 = "100px";
String col_width_2 = "150px";
//etc String col_width_N = "XXXpx";
//loop
for (int h = 0; h < hrecset.getRowCount(); h++)
//some code
//create the variable name with a concat with the loop counter variable name to get the value of the concatened variable
out.println("<td style=\"width: "+col_width_+h+" \">")//Do you understand what i mean?
//some codeI apologize
1) Sure i understand it but i click on the "code" button after i inserted the text above but it doesn't worked now it do.
2) Because the table element need to have the total width in the HTML table TAG equal to the addition of every HTML td TAG to be W3 conform
because i have a lot of cell where i want to adjust the width.
so here my solution
<%
//Variable für Breite
String col_width_unit = "px"; // px, cm,
Integer total_table_width = 0;
String[] col_width=new String[3];
col_width[0] = "350";
col_width[1] = "75";
col_width[2] = "50";
%>
<table style="page-break-inside:avoid;width:<%=gesamt_table_width+col_width_unit%>;">
<%
for (int h = 0; h < hrecset.getRowCount(); h++)
out.println(" <td id =\"cell"+h+"\" class=\"tdall\" style=\"width:"+col_width[h]+col_width_unit+"\" >");
%>
</table>thank you very much -
Text Variable(Customer Exit) displays variable name instead of its value.
Hi Gurus,
My requirement is to display the year(from variable) as the field name i.e Year end salary 2009.
I was using the fields name as hardcoded values like 2009 but as per my requirement i need to display it from the variable.
I tried using Text Variable using customer exit, but I'm getting variable name(zvariable) instead of value(2009).
Please help me out, many thanks in advance.
Regards,
AnkurHi,
Actually I tried to create a Text Variable with Replacement Path.
But here the problem is that we have a Characteristic Variable (Customer Exit) which is not listing in the selection box of Replacement Path.
Hence we tried to create another Text Variable (Customer Exit) and refering to the same Customer Exit code.
Regards,
Ankur -
All NSStrings has paragraph sign as value according to variable view
Suddenly the summary of all my NSStrings has only a paragraph sign (§) as value according to the Variable View in Xcode. Normally you see (part of) the string value. When I 'Print Description' of a NSString variable the correct string value is shown.
For example: In the Variable view I see this:
test NSString * 0x00263ed0 §
Print Description of variable 'test' shows me this:
Printing description of test: TESTYes, sure, thank you for asking.
I haven't made the actul TOC yet. So far this is only the layout of the beginning of the book.
(I'm making an epub out of this) -
Rh Variable displays variable name, not value
In master page, header, I have inserted the chapter name. When I generate the output, it displays the variable name, PD Chapter Name, not the value of the variable. The code is unaltered from the button selection 'Insert Chapter Name' . Is there another step I'm missing? Thank you!
<p><?rh-variable_start name="pd-chap-name"
value="&lt;&lt;PD Chapter Name&gt;&gt;" ?><<PD Chapter Name>><?rh-variable_end ?></p>Hi there
Can you share screen captures of the variables pod as well as a topic or something depicting this in the final result?
Thanks... Rick -
Variable names display problem
I have three transparent text captions that are set to display from slide 1 through to slide 32 (using the option "display for rest of project").
The variables I am displaying are:
In the header:
$$cpInfoProjectName$$ - displays the name of the lesson module.
$$cpInfoCurrentSlideLabel$$ - displays the name of the current slide.
And in the footer:
Page $$cpInfoCurrentSlide$$ of $$rdinfoSlideCount$$ - displays the current slide number and the total number of slides in the lesson.
The problem is that the variable names display long enough to look somewhat unslightly. It might be for about 1/3 of a second but it is long enough to screen capture (attached just in case I am not clear enough in my description) this appearance before they resolve into their values.
This is rather annoying, since a student will see this occur for every slide.
Is there anything that can be done to fix this? Perhaps using a text caption is not the best way to display these variables?
Hmm... I wonder if creating a small persistant flash insert would be better?I have seen that aswell Shawn. It seems like the variables are a bit slow to be populated with the correct value and then it will show the $$variable_name$$.
A Flash component would solve it and it won't take more than 5 minutes to make them all.
/Michael
Visit my Captivate blog with tips & tricks, tutorials and Widgets. -
Hi, I'm really new to TestStand, so this is probably an easy question:
I'm using TestStand 4.5 and I'm trying to convert the name of a variable, Locals.MaxArrayIndex, which is a numeric variable, into a String, Locals.VarString.
I know that the Str() function can be used to convert a numeric into a String, but how can I store the actual words "Locals.MaxArrayIndex" in a string?
Thanks!Hmmm...it works great for Parameters that are arrays, but for me it won't work if the Parameter is a numeric variable. Maybe I'm making a mistake somewhere else that I'm not picking up; so I attached the sequence file if you want to take a look at it.
The issue arises in the 'Else' statement. I'm pretty sure the syntax in my function and popup are correct, but the String (ParamName) that is supposed to hold the value of the Parameter variable name (DataSelect) doesn't seem to ever be filled and outputted in the error message.
I would really appreciate it if any of you guys could have a look at the file (I'm sure I'm making some kind of really rookie mistake)
Thanks!
Attachments:
GenerateError.seq 9 KB -
SAP BEX Analyzer Set values for variables
Please help us out in sorting out this problem,
We are automating BEx Analyzer for a Testing Project with Quick Test Professional (QTP) a functional automation tool uses VB script.
Problem:
There are 5 steps in automation
Invoke BEx Application
Log in to BEx server
Run Query
Set values for Variables for Query
Display Report
We are able to do 1,2,3 steps using BEx API functions and running BEx macros but we struck up with 4th step,
1. Invoke BEx Application
Launch Excel
Dim app
Set app = createobject("Excel.Application")
Make it visible
app.Visible = true
Attach add-in to Excel file
app.Run ("'C:\Program Files\SAP\Business Explorer\BI\BExAnalyzer.xla'!SetStart")
2. Log in to BEx server
Login to Bex server
Function logonToBW(app)
Dim myConnection
Dim logonToBW2
On Error Resume Next
logonToBW2 = True
' Create logon to system with following user and system details
Set myConnection = app.Run ("'C:\Program Files\SAP\Business Explorer\BI\BExAnalyzer.xla'! SAPBEXgetConnection")
With myConnection
.client = "600"
.User = "USERNAME"
.Password = "Welcom123"
.Language = "en"
.systemnumber = "00"
.System = "BWDCLNT600"
.systemid = "BWD"
.ApplicationServer = "156.158.7.161"
.SAProuter = ""
.Logon 0, true
If .IsConnected = 0 Then
.Logon 0, False
If .IsConnected <> 1 Then
MsgBox "Automatic logon failed. Please enter your username and password in the next screen ..."
Exit Function
End If
End If
End With
' Run connection query to see if connected
app.Run ("'C:\Program Files\SAP\Business Explorer\BI\BExAnalyzer.xla'!SAPBEXinitConnection")
logonToBW2 = True
End Function
3. Run a Query
app.Run "'C:\Program Files\SAP\Business Explorer\BI\BExAnalyzer.xla'! runQuery", "ZZCCA3_M01_Q0003"
Till here the script is running fine then the Select values for Variables window is displayed.
This is where exactly we struck up; in this window we need to select values.
Name of the Fields
Field Name Technical name of characteristic Variable Name Value
1 Company Code 0COMP_CODE ZM_COMPCODE 1000
2 Cost Center Hierarchy 0COSTCENTER ZS_CCTRN 1000MDON
3 Cost Center Node 0COSTCENTER ZS_CCTRN 1000COP
4 Cost Element 0COSTELEMENT ZS_COELN 1000GDON_6999
5 Fiscal Year 0FISCYEAR 0P_FYEAR 2007
To select values for variables, we are trying below code but its giving an error,
app.Run "'C:\Program Files\SAP\Business Explorer\BI\BExAnalyzer.xla'!SAPBEXSetFilterValue", 1000, "0COMP_CODE"
app.Run "'C:\Program Files\SAP\Business Explorer\BI\BExAnalyzer.xla'!SAPBEXSetFilterValue", 1000MDON, " 0COSTCENTER "
app.Run "'C:\Program Files\SAP\Business Explorer\BI\BExAnalyzer.xla'!SAPBEXSetFilterValue", 1000COP, "0COSTCENTER"
app.Run "'C:\Program Files\SAP\Business Explorer\BI\BExAnalyzer.xla'!SAPBEXSetFilterValue", 1000GDON_6999, "0COSTELEMENT "
app.Run "'C:\Program Files\SAP\Business Explorer\BI\BExAnalyzer.xla'!SAPBEXSetFilterValue", 2007, " 0FISCYEAR"
Any help highly appreciated, thanks in advance.Hi Reinhard,
Pleas look at this:
Passing a range to SAPBEX.XLA!SAPBEXSetFilterValue
Best regards,
Eugene -
Same variable name causes major issues.....
I would like to get some input and possible direction on the issue below... I am new to PL/SQL. Thanks in advance.....
..... The system is in the middle of processing a “For” step, i.e. a given “For” step is incomplete.
..... The script instructs the system to process a second “For” step with the same “for-loop variable” as the incomplete “For” step.
When the above takes place, the system processes the second “For” step incorrectly. Instead of starting at the first value in the second “For” step’s list of values, the system begins in the middle of the value list.
I need to change the current implementation so that if a "For" loop is encountered that has the same “loop variable” as a “For” loop already being executed, the “state” of the previous “For” step is discarded, and the state for the new “For” step is initialized to the first value in its list.
-- Used for "for" steps
TYPE for_list is table of varchar2(4000) index by binary_integer;
TYPE for_loop_state is record (
list for_list,
next_index integer
TYPE for_loops_list is table of for_loop_state index by steps.output_param%TYPE;
all_for_loops for_loops_list;
procedure for_step(list_string IN varchar2, ret_var_name IN varchar2, end_for_label IN varchar2) is
state for_loop_state;
end_idx number;
list_value varchar2(4000);
begin
pkg_util.log('ret_var_name value after begin: ' || ret_var_name, 'I');
-- get the current for list state, based on its output variable name
if all_for_loops.exists(ret_var_name) then
state := all_for_loops(ret_var_name);
else
state.next_index := 0;
list_value := parse_next_param(list_string, 1, end_idx);
-- end_idx is thrown away; for loops only have 1 input parameter (the list)
state.list := get_for_list(list_value);
all_for_loops(ret_var_name) := state;
end if;
if state.next_index < state.list.count then
pkg_session_values.put(ret_var_name, state.list(state.next_index));
all_for_loops(ret_var_name).next_index := state.next_index + 1;
else
all_for_loops.delete(ret_var_name);
jump(end_for_label);
end if;
end;There is so much of your code hidden from view it is impossible to tell you anything other than perhaps suggest a methodology.
Create a single variable with a known value and use dbms_output to view it as it steps through each piece of the puzzle. Determine when the value does something you don't want. -
How to disply the value of variable in the Web template
Imagine I have a query TOP-N customers. I want to diplay N value in the web template. I used web item for this purpose in NW2004. Which item should I use for the same purpose in NW2004s?
ThanksDoes anyone have another suggestion? The information field does not render pretty. I am trying to do this via an HTML path edit and a text box. The view source looks like this for a variable
<BICS_VIEW>
<VARIABLES>
<VARIABLE name="RDSHW_PCY_YOVERY" type="DOUBLE" text="% Goal Year over Year" value="10.0"/>
</VARIABLES>
I tried various versions of the path=... but cannot get it to work. Anyone got an idea ???
I tried
path="DATA_PROVIDER:DP_1?/BICS_VIEW/VARIABLES/VARIABLE/@value" /> -
Hello Experts,
I have created a report which containts variable 0P_FPER ( Period/Fiscal year,single entery required). Now, the requirement is to get completed fiscal year/month(current month-1) by default in the input box of variable entry whenever I execute the query.
Assigning default values option is not giving me the list of variables to assign for default value.
How can I achieve this?
Regards,
Nirav Shah
Edited by: Nirav Shah on Aug 6, 2008 8:19 AMHow to Create a u201CCustomer Exitu201D Date Variable.
Custom date variables greatly enhance BEx Reporting.
Letu2019s assume you have an InfoProvider with a characteristic 0CALDAY (Calendar Day) and you want to restrict results of your query to u201Ccurrent month to dateu201D.
Scenario:
1. Start by creating a variable for the 0CALDAY InfoObject.
2. Assign u201CProcessing byu201D type u201CCustomer Exitu201D, u201CVariable Representsu201D to u201CIntervalu201D and u201CVariable Entryu201D to u201CMandatoryu201D. Select u201CReady for Inputu201D checkbox if you want a request window for your variable to be presented at runtime (interval values will be filled from your Customer-Exit but a user can still change them).
3. Go to transaction CMOD to create a project for your enhancement (see ref.2). Give a name to the project (1), create (2) and save the project. Then assign an enhancement RSR00001 to your project and
save. (In this step an error message u201CSAP enhancement RSR00001 already belongs to project NAMEu201D may appear. That means an active project with the enhancement RSR00001 already exists. If this is the case, you do not need to create your own project and may terminate this step and go to the step 4). Activate the project.
4. Go to a transaction SE80, display a Function Group XRSR (1,2), open Function Modules (3) and double click on an EXIT_SAPLRRS0_001 (4). A source code for the EXIT_SAPLRRS0_001 function module opens. Double click on a word ZXRSRU01. You arrive to a source code for the Include ZXRSRU01.
5. In the source code for Include ZXRSRU01 insert your code (see sample code below). If some code like DATA: L_S_RANGE TYPE RSR_S_RANGESID. u2026 u2026 u2026 u2026 u2026 u2026 ENDCASE. Already exists in the Include just insert the part of the sample code from the first comment to the last at the end of the existing code but above the ENDCASE statement. Check and Activate.
Code Example:
DATA: L_S_RANGE TYPE RSR_S_RANGESID.
Current month to date variable ZCMTD example.
WHEN 'ZCMTD'.
you variable name
data: ZCMTD_LOW like sy-datum.
*defining variable for using as a starting date of the interval
ZCMTD_LOW = sy-datum.
*initializing it with the current date
ZCMTD_LOW+6(2) = '01'.
*replacing last two symbols (day) in the current date with '01'(see ref.1)
CLEAR L_S_RANGE.
L_S_RANGE-LOW = ZCMTD_LOW.
*initializing low interval limit
L_S_RANGE-HIGH = SY-DATUM.
*initializing high interval limit
L_S_RANGE-SIGN = 'I'.
*defining interval as inclusive
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
Current month to date variable ZCMTD example end.
ENDCASE.
The result of this will be an interval from the first day of the current month till the current system date.
Acknowledgements and more info:
Thanks go to Dirk Herzog and Roberto Negro for their valuable posts on forum regarding Customer-Exit variables.
References:
ref.1 Processing Sections of Strings
ref.2 Customer Exits
ref.3 Date for Several Months topic on BW Forum -
Pass a Value to Variable from the unix environment in ODI (ELT)
Hi
i am very new to ODI environment.
i want know how to pass a value to variables in oracle data integrator from unix environment.
Example:
Variable name : Sales
for variable name sales i want to pass the value from unix environment.
Regards,
Raj
Edited by: user11137587 on Aug 19, 2009 6:26 AMWork Around !
You can execute OS commands using Jython script. Probably you need to flush your enviornment variables value into a file using jython script and then read those value into ODI variable from the file.
BUt may I know why you want to read environment variable vaules in ODI, Dont you think this will make your application less portable
Regards,
Amit -
What is the datatype to store the value of variable of UTL_HTTP.resp
Hello,
I am using Oracle 11g R2 SOE.
I have table Called SMS consists of two columns (TEXT , RESPONSE) to store the value of variable of type UTL_HTTP.resp
the datatype of TEXT column is varchar2.
What should be the datatype of the column RESPONSE that is supposed to store the value of a variable of type UTL_HTTP.resp ????
Please see the following example if it was not clear;
Declare
l_url2 SMS.RESPONSE%TYPE;
l_http_request2 UTL_HTTP.req;
l_http_response2 UTL_HTTP.resp;
begin
l_http_request2 := UTL_HTTP.begin_request(l_url2);
l_http_response2 := UTL_HTTP.get_response(l_http_request2);
insert into SMS (text,response) values (l_url2,l_http_response2);
UTL_HTTP.end_response(l_http_response2);
end;Regards,
FatehFateh wrote:
Hello,
I am using Oracle 11g R2 SOE.
I have table Called SMS consists of two columns (TEXT , RESPONSE) to store the value of variable of type UTL_HTTP.resp
the datatype of TEXT column is varchar2.
What should be the datatype of the column RESPONSE that is supposed to store the value of a variable of type UTL_HTTP.resp ????
Please see the following example if it was not clear;
Declare
l_url2 SMS.RESPONSE%TYPE;
l_http_request2 UTL_HTTP.req;
l_http_response2 UTL_HTTP.resp;
begin
l_http_request2 := UTL_HTTP.begin_request(l_url2);
l_http_response2 := UTL_HTTP.get_response(l_http_request2);
insert into SMS (text,response) values (l_url2,l_http_response2);
UTL_HTTP.end_response(l_http_response2);
end;Regards,
Fatehutl_http.resp is a record type Its defined like this
TYPE resp IS RECORD (
status_code PLS_INTEGER,
reason_phrase VARCHAR2(256),
http_version VARCHAR2(64));http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/u_http.htm#i1012713
I would suggest in your table you split the RESPONSE column into 3 different column and store the fields STATUS_CODE, REASON_PHARSE and HTTP_VERSION accordingly. -
Is it possible to add a property using variable in variable name?
I want to query for a list of virtual machines within a folder, then create a menu of the host names using forms. Since the list of machines is subject to change, I want to build the list each time the script is run, rather than build off a static
list.
For each virtual machine I need to create the list of variables below:
$hostnameX = New-Object System.Windows.Forms.checkbox
$hostnameX.Location = New-Object System.Drawing.Size(10,20)
$hostnameX.Size = New-Object System.Drawing.Size(100,20)
$hostnameX.Checked = $true
$hostnameX.Text = "Type"
$hostnameX.Controls.Add($hostnameX)
The location and size values need to be incremented but I think I can figure that part out.
I can use New-Variable to generate the initial variable. But I receive errors using the same method to try to create a new property for the variable.
$VMS = Get-Cluster MyCLUS | Get-vApp "My vApp" | Get-VM | Select Name,PowerState | Sort Name
For ($i=0; $i -lt ($VMS.count); $i++)
$VMS[$i].Name
$VMGUEST = "$($VMS[$i].Name)" -replace("-","")
New-Variable "CB$VMGUEST" "New-Object System.Windows.Forms.checkbox"
New-Variable "CB$VMGUEST.Location" "New-Object System.Drawing.Size(10,20)"
In the above, $CBVMGUEST1 = New-Object System.Windows.Forms.checkbox which is what I want, but $CBVMGUEST1.Location is not set.
Is there way to add a property using a variable in the variable name? Or any other suggestions on how to tackle this issue?Hi,
maybe another approach is a bit easier.
Use a hash-array like
$CB = @{}
$CB[$VMGUEST] = New-Object System.Windows.Forms....
$CB[$VMGUEST].Location = New-Object System.Drawing....
Mit freundlichen Grüßen Jens Kalski
That's the correct answer. Anytime you find yourself wanting to create variables named "Widget1", "Widget2", "Widget3", etc... it's a pretty clear indication that what you really need is a collection object of some sort. That might be an array,
a hashtable, or any other data structure for holding other objects, depending on your specific needs.
Maybe you are looking for
-
Will Photoshop Lightroom work on Microsoft SURFACE tablet? It operates on WIN 8.
also since sold as package, will Photoshop CC will work on MS SURFACE? Does anyone know?
-
Lightroom crashes at start up with the error message "Lightroom encountered an error when reading from its preview cache and needs to quit". Please advise on how to fix this error. Thanks
-
I setting up an Access 2010 database. Some of the fields are hyperlinks to document and folders To save some time I thought I'd use the Default Value field in the Hyperlink fields and set a URL e.g. \\serverx\directory\folder Once saved when I create
-
IPhone display lights up for half a second...
My new iPhone 4 does the same my old iPhone 3GS did. Sometimes when I push the slepp/wake button to wake it up, the display lights up for half a second and goes dark again. This always happens twice. Only when I push it the third time, the display st
-
May"NoLogging" Option for Enterprise and Express Edition Behave Diffrently?
Below you will find my scripts to test the redo generation for a simple create table as select statement. force_logging option in XE database is not enabled, but there is less difference redo generation. How can I go into details, can I use an event