How to Print the Value of a variable inside a PL/SQL package
Hi Friends,
Here is my Scenario
I have a PL/SQL Package. Let us call it Baseline Package.
This Package includes a dynamically built merge Statement.
Execute Immediate v_merge_query.
I have a procedure which replaces which few Keywords from the Package Text and Creates a new one depending on Inputs I provide. (This is something like a Code generator)
Now while Creating the new package, I need to print the Value of v_merge_query.... I Need s Static Query to be Printed inside the new package and not a dynamic query.
My Question is "Is there a way to print the value of the variable inside a different PL/SQL package?
Thanks in Advance,
Mohit
Print where?
That PL/SQL code is server-side code. It runs in an Oracle server process.
That server process does not have a keyboard. Or a screen/monitor. Or display canvas. Or an attached printer.
That server process is incapable of "printing" as that is not its job or responsibility and not part of its environment.
What is can do is record data for the client to look at afterwards. This can be done using static PL/SQL session variables. Or a SQL table.
The former is done by DBMS_OUTPUT - a very primitive interface for writing text into a static PL/SQL string array. That btw resides in expensive private process server memory. The client can query the array after a database call and render the contents.
PS. Also keep in mind that bind variables are critical for performance and server robustness - especially when (ab)using dynamic SQL.
Similar Messages
-
How to print the value of a field of type FLTP
hi experts,
pls tell me how to print the value of a field of type FLTP. i.e in decimal format not in exponential format.
thankyou.
krishnaHi ,
I dont think in Floating point u can able to go for the decimal point display as it is for the minimum precission display..
Define the variable as the 'packed' type and then u can able to define the decimal point...
Cheers,
SImha. -
How to find the value of a variable in other program
How to find the value of a variable in other program say I am in a FM and this FM is being called in from other program and I want to know some of the variable details of the program from the FM itself. Imagine if this is a txn. and I need to know the details from some of the programs while executing the same transaction
Regards
VinHi Vinayak,
you will be having your first program values in internal table or some variables,
when you are calling the second program you wii use like this,
SUBMIT <Second Program Name> USING SELECTION-SCREEN '1000'
WITH s_emp(second program select-options) IN t_emp(first program variables)
WITH p_chk EQ t_chk
WITH p_r1 EQ t_r1
WITH p_month EQ t_month
WITH s_cust1 IN t_cust1
WITH p_r2 EQ t_r2
WITH s_cust2 IN t_cust2
WITH s_week IN t_week
AND RETURN.
you have pas like this to get your first program details. -
How to get the value of a variable defined in javascript in JSP
how to get the value of a variable defined in javascript in/through JSP????
In Javascript you can use the DOM to access the input element and set it's value before submitting the form. Then it's value will just be passed.
-
How to get the value of a variable in FOX?
Hi,
In the FOX program how to get the value of a variable defined in planning area?
can anyone give me some sample code?
thanksAdding to the last reply,
you can use VARI(variable) to get the count of the values.
In the latest version of BPS, you may also use the following new foreach construct:
FOREACH var IN VARIABLE variable_id.
Regards - Ravi -
How to change the value of a variable in new ABAP debugger.
Hi Guys,
I can't change the value of a variable in the new ABAP debugger.. when I change its revert back to old value. but this is not the case with the old version. How to do this..
Cheers
SenthilHi,
1. Dobule click in the variable in the variable tab.
2. Click the Change icon in Detail.Dis.
3. enter the new value and press enter
Refer
[http://www.sapdb.info/new-abap-debugger/|http://www.sapdb.info/new-abap-debugger/]
[http://help.sap.com/saphelp_nw70/helpdata/en/84/1f624f4505144199e3d570cf7a9225/content.htm|http://help.sap.com/saphelp_nw70/helpdata/en/84/1f624f4505144199e3d570cf7a9225/content.htm]
<removed_by_moderator_together_with_points>
Regards,
SB
Edited by: Julius Bussche on Jun 24, 2008 8:21 AM -
How to set the value of process variables/payload using a managed bean?
Hello,
Someone can give me an example about how to set the values of a process payload in a managed bean?
thank you!Try this:
jsf page:
<af:selectOneChoice label="Select Suburb"
requiredMessageDetail="Select a suburb"
valueChangeListener="#{selectOneChoiceBean.onValueChanged}"
validator="#{selectOneChoiceBean.validate}"
unselectedLabel="None" autoSubmit="true"
binding="#{selectOneChoiceBean.selectOneChoice}"
value="#{selectOneChoiceBean.value}">
<f:selectItems value="#{selectOneChoiceBean.selectionList}"/>
</af:selectOneChoice>
backing bean:
public class SelectChoiceBean {
private List<SelectItem> selectionList;
private String value = "B";
private RichSelectOneChoice selectOneChoice;
public SelectChoiceBean() {
initSelectionList();
public void setSelectionList(List<SelectItem> selectionList) {
this.selectionList = selectionList;
public List<SelectItem> getSelectionList() {
return selectionList;
public void onValueChanged(ValueChangeEvent valueChangeEvent) {
System.out.println(valueChangeEvent.getNewValue());
// Add event code here...
public void validate(FacesContext facesContext, UIComponent uIComponent,
Object object) {
// Add event code here...
private void initSelectionList() {
selectionList = new ArrayList<SelectItem>();
selectionList.add(new SelectItem("A", "A label"));
selectionList.add(new SelectItem("B", "B label"));
selectionList.add(new SelectItem("C", "C label"));
public void setValue(String value) {
this.value = value;
public String getValue() {
return value;
public void setSelectOneChoice(RichSelectOneChoice selectOneChoice) {
this.selectOneChoice = selectOneChoice;
public RichSelectOneChoice getSelectOneChoice() {
return selectOneChoice;
} -
How to print the values of type Object?
Hi All,
I am not able to print values of the following can anyone telme where i am wrong and what i can do in this regard.
Object one = request.getAttribute("values");
When i try to print these values as following
System.out.println("one ="+one);
am not getting the values in a different format something like [Ljava.lang.String;@1234f. I tried to convert the following Object to String still its not working. Can some one please suggest me what i can do in this regard.
Thanksferrari_sun wrote:
I am getting a Null pointer exception if i typecast it to a string array. Not sure what to do nowThe hell you are. You don't get Null pointers out of casting. However you might be accessing null elements of the array afterwards.
You really should throw away the code, go fetch some "How to learn basic Java with Wiggles The Bear" ebook and then start learning the basics instead of tripping on every single line of your code which is too complicated for you. -
How to print the value if a condition is satisfied
Hi,
Please suggest me how to print a text as 'Do not print' when a field in the selection screen is entered.
If in the selection screen (s_field1) we have entered a value as ZESM then the value filed of
wa_vbak-auart should check the the values in s_field1 then it should just print the text "'DO NOT PRINT''.
we have written the folowing code, but the condition is not working.
DATA: V_FIELD1 type z_field1. "(zdata element).
ranges: r_fIELD1 for v_field1.
SELECT-OPTIONS: S_field1 FOR v_field1 default 'ZESM'.
loop at s_field1.
r_field1-sign = 'I'.
r_field1-option = 'EQ'.
r_field1-low = s_field1-low.
append r_field1.
clear r_field1.
endloop.
if wa_vbak-auart in r_field1.
wa_final-v_text = 'DO NOT PRINT'
else.
wa_final-v_text = ' '.
endif.
Please suugest what can be done.
Thanks in advanceHi,
if wa_vbak-auart in r_field1.
wa_final-v_text = 'DO NOT PRINT'
else.
wa_final-v_text = ' '.
endif.
Have you writtent he above code with in loop enloop on the internal table.If yes then simply add append statement after assignment.
if wa_vbak-auart in r_field1.
wa_final-v_text = 'DO NOT PRINT'
append wa_final into it_final.
clear wa_final.
else.
wa_final-v_text = ' '.
append wa_final into it_final.
clear wa_final.
endif.
Hope this will solve your problem.
Pooja -
How to get the value of a variable in group footer in the report footer also
I have a placed a formula as below at the group footer and the report footer. The data is grouped on the basis of duedays which is again formula and the value in that is appearing correctly.
Whilereadingrecords;
Global Numbervar CNTONE;
Numbervar P := P+1;
IF P = 1 AND {@DUEDAYS} = 0
THEN CNTONE := {spSUPPLIERSOA;1.INVOICEBAL}
ELSE IF P>1 AND {@DUEDAYS} = 0
THEN CNTONE := CNTONE + {spSUPPLIERSOA;1.INVOICEBAL}
At the group footer I get the value correctly for CNTONE but when I place the formula in Report footer I get the value for CNTONE as 0.
Please do let me know how I could get the same value in the report footer also.
Regards
Sreejith JHi Abhilash;
When I give the statement whileprintingrecords then my above formula sums up only the first record and the last record of the group and when I give whilereadingrecords it adds up all the data in the group correctly.
The formula that you mentioned for the report footer had worked out and it is showing my result correctly.
I did not put up the reset formula on the group footer because as the group changes I had used another variable in another formula for example for the second group I used
Whilereadingrecords;
Global Numbervar CNTTWO;
Numbervar Q := Q+1;
IF Q = 1 AND {@DUEDAYS} = 30
THEN CNTTWO := {spSUPPLIERSOA;1.INVOICEBAL}
ELSE IF Q>1 AND {@DUEDAYS} = 30
THEN CNTTWO := CNTTWO + {spSUPPLIERSOA;1.INVOICEBAL}
I have set up total 5 such formulas as the number of groups that will be formed is 5. I have put up these formulas on the group footer and suppressed it as I dont want to get it displayed.
The as you suggested the solution for Report Footer I did that and getting the result correctly.
I dont know I may be following a longer procedure
Take Care
Sreejith J -
How to set the value of a variable in a cluster in LabVIEW from C#?
Hi guys, I'm working on a small c# program, which using the interface provided by LabVIEW. And I know that, using lv.SetControlValue(name, value) can set a variable just on the front panel. But in my case, there're several clusters on the front panel. So it confused me how to set the variables in these clusters. For example there's a cluster named clusterA, and a variable in it named valueA, I've tried something like this:
lv.SetControlValue("clusterA.valueA",1);
but it totally not work. Anyone has some experience about this stuff? Thanks a lot!!
Solved!
Go to Solution.Hey guys, thanks a lot for all your reply. I just find a simply way to solve this porblem. For example, there a cluster named "ClusterA", and there are only two control values in it, which are: an int value named "IntA" (default value IntA = 10)and a string value named "StringA" (default value StringA = "abc"). In C# if you invoke the method:
var clusterA = (Array) vi.GetControlValue("ClusterA");
you will get an Array looks like: clusterA = {10, "abc"}; Then if you want to change IntA to 123, you just need to do:
clusterA.SetValue(123, 0); // 123 is the value, 0 is the index of IntA in the array clusterA, after this clusterA = {123, "abc"}
After this, you just need to give the array back to LabVIEW by using:
vi.SetControlValue("ClusterA", clusterA);
and now see the panel in you LabVIEW, the IntA is changed. -
In Scripts how to print the values in currence format
Dear abap guru's,
I am working on Purchase Order Script, copy from the standard script, after that wrote a one perform , in that added one new field to script, but value is printed like this formate : 1000.00, but i want to print 1,000.00 like this currence format. let me know the any solution
thanks to all
raj.Hi ,
When you are populating the value in perform instead of assigning the value (using = ) pass it using WRITE TO.
Like : WRITE lw_total TO output-value.
Declare lw_total as currency field.
Regards,
Rajitha. -
How to Get the value of a variable which is inside other variable
Hi All Experts,
I have some tricky kind of situation. Actually there is one deep structure <is_input>-create_posting_lock_req-request_body-reference and this path is stored in a variable v_field.
i mean to say the value of v_field is <is_input>-create_posting_lock_req-request_body-reference i.e. the path.
now i want to value stored in this path to go to some other varible v_field2.
Kindly help me with the situation.
I even tried to use
v_field2 = ( V_field ), but it dint help.
Thanks a lot expertsfield-symbols: <fs_field> TYPE any.
LOOP AT lo_strucdescr_ref->components INTO ls_components.
CLEAR ls_components1.
READ TABLE lo_strucdescr_ref1->components INTO ls_components1 WITH KEY name = ls_components-name.
IF sy-subrc EQ 0.
CLEAR lv_field.
CONCATENATE lc_struc ls_components-name INTO lv_field SEPARATED BY '-'.
lv_field = ls_components-name.
ls_extensionin-valuepart1 = ls_components-name.
unassign <fs_field>.
assign (lv_field) to <fs_field>.
*move <fs_field> to lv_var.
move <fs_field> to ls_extensionin-valuepart2.
APPEND ls_extensionin TO lt_extensionin.
clear ls_extensionin.
ENDIF.
clear ls_components.
ENDLOOP.
this is the code and it dumps if i declare the field symbol as character, for charater field i don have any problem -
How to use the value of a variable to set another variable
Hello Experts,
Is it possible to access the value of variable set by the user and set the default value of another variable using the user entered value for the first variable? Example:
Date variable
Week variable
Month variable
User enters one of those and the other two are automatically prefilled with the correct values?
Thanks
RadoHi Rado,
Gothrough following code
Which reads year from user input and converts it to factory calendar week , following which you should able to convert user inputs to required parameters.
DATA: v_year1 TYPE i,
v_int TYPE i,
v_week1 TYPE kweek,
v_qurt TYPE i,
v_perd TYPE /bi0/oifiscper,
v_iweek TYPE i,
v_periv TYPE periv VALUE 'Z4'.
DATA : v_vweeks TYPE /bi0/oicalweek,
v_vperd TYPE /bi0/oifiscper,
v_vperiv TYPE /bi0/oifiscvarnt VALUE 'Z4'.
DATA : vit_weeks LIKE /bi0/scalweek OCCURS 0 WITH HEADER LINE.
DATA : v_perd1 TYPE umc_y_fiscper,
v_weeks TYPE umc_ys_dimvals,
v_pweeks TYPE i.
CASE i_vnam.
WHEN 'WPIYWEEK'. "Variable name of char. in Bex
*Check for Step 2 (After user gives inputs on selection screen)
CHECK i_step = c_after. "Step:2
CLEAR : v_year1,
v_week1,
v_iweek.
*Read the value of variable which used has entered on sel. screen
READ TABLE i_t_var_range INTO wa_var_range
WITH KEY vnam = 'WPIFYEAR'.
v_year1 = wa_var_range-low.
CALL FUNCTION 'TIME_GET_LAST_WEEK'
EXPORTING
if_year = v_year1
IMPORTING
ef_week = v_week1
EXCEPTIONS
fatal_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Get the no. of week from YYYYWW format
v_iweek = v_week1+4(2).
l_s_range-low = v_iweek.
l_s_range-sign = c_include.
l_s_range-opt = c_equal.
APPEND l_s_range TO e_t_range. "This is the output structure in which u have to add the result
Endcase.
Hope that helps.
Regards
Mr Kapadia
Assigning points is the way to say thanks in SDN. -
How to clear the value of a variable in a managed bean after AM method...
I have two inputText fields on a page - user inputs a value in FieldA and performs a search (execute w/ params)... FieldB shows up under Results table with an 'Add' button. User can enter a value in FieldB and click 'Add' to insert a new row in the Results table.
I got the insert to work by making FieldB binding = #{userState.newVisitorId} where userState is a session scoped bean.
When the page reloads after the insert, the value entered in FieldB is still there - I want to clear it out. I know 'marrying' the AM code for the insert to the View code for the bean is bad practice; what is a better way to do this?
Thanks!For anyone who might also be looking for this solution... I simply added a SetActionListener to the 'Add' button that was set as From: #{null} To: #{userState.newVisitorId} and it works like a charm.
Maybe you are looking for
-
Hi there. I have an iphone 4, which is currently synced with itunes on my laptop. I also have an ipad 2 which is currently synced with a more powerful and storage capable home computer. I would like to know if there is a way to sync my iphone 4 wi
-
Hi As a background, my WD extHDD ( 1.5T) was working fine until today. When connect to PC, it cannot be reach but the drive letter (G:) appears and after awhile show CRC errors. The HDD cannot be access. After looking at some hep pages instructions,
-
what type of wireless router is the 1st generation time capsule? Is it B, G or N? I'm trying to establish whether its causing signal degradation as a result of conflicts with my BT Home Hub router.
-
Oracle 9i Error in invoking target ntcontab.o of makefile
Does anybody know what this means / how to get the install to continue (I am using Mandrake 8.1) I am new both to Oracle and Linux, help to finally get this installed would be much appreciated.
-
Update to latest iOS. Keep getting pop up message to "Connect to iTunes to use Push Notifications". This message will not go away. Any ideas on how to fix?