Content of Variable

Hi Expert,
I want to see content of variable , but no result by
"dbms_output.put_line" when exec procedure.
CREATE OR REPLACE PROCEDURE ms_alert_custbr (p_altcd varchar2) IS
v_altcomp msaltinval.ms_alt_comp%type;
v_altinval msaltinval.ms_alt_inval%type;
v_altstf msaltctc.ms_alt_stf%type;
v_mailadd varchar2(100);
v_emailadd varchar2(32767);
v_smail1 varchar2(50) := '/usr/local/bin/sendEmail -f [email protected] -t ';
v_smail2 varchar2(85) := ' -u "SendEmail Test" -s 123.123.123.123:25 -m "test" -a /u03/oradata/msdev/tempfile/';
v_fname varchar2(26) := v_altcomp || '_custbr.xls' ;
v_smcmd varchar2(32767) ;
CURSOR c_altinval IS
SELECT ms_alt_comp,ms_alt_inval
FROM msaltinval
WHERE ms_alt_cd = p_altcd ;
CURSOR c_altctc IS
SELECT ms_alt_stf
FROM msaltctc
WHERE ms_alt_cd = p_altcd and
ms_alt_comp = v_altcomp ;
BEGIN
OPEN c_altinval;
LOOP
FETCH c_altinval INTO v_altcomp,v_altinval ;
ms_alert_custbr_crexls(v_altcomp,v_altinval);
v_emailadd := NULL;
OPEN c_altctc ;
LOOP
FETCH c_altctc INTO v_altstf ;
SELECT ms_email_add
INTO v_mailadd
FROM msstaff
WHERE ms_staff_cd = v_altstf ;
v_emailadd := v_emailadd || ',' || v_mailadd ;
EXIT WHEN c_altctc%NOTFOUND;
END LOOP ;
CLOSE c_altctc ;
dbms_output.put_line(v_emailadd);
v_smcmd := v_smail1 || v_emailadd || v_smail2 || v_fname ;
dbms_output.put_line(v_smcmd);
Host_Command (p_command => v_smcmd) ;
EXIT WHEN c_altinval%NOTFOUND;
END LOOP;
CLOSE c_altinval;
END ms_alert_custbr ;
boris

> Besides, above procedure is ok or not ? somewhere need to improve ?
Most definitely not okay.
By coding a nested cursor fetch loop you are trying to re-invent an SQL join (a nested loop join to be specific) in PL/SQL. The SQL engine is very well capable of doing that without any outside assistance.
SQL is by far superior in this regard. Join the tables in SQL. Do not code manual joins in PL/SQL.
When fetching data in PL/SQL, consider using bulk collect to increase loop performance by reducing context switches from the PL/SQL engine to the SQL engine.
This code suffers from a typical (and very wrong) approach to databases that consider the database a bit bucket. The database is nothing but a file cabinet of sorts for the persistent storage of rows. SQL is then used as I/O routines to read and write records. Why treat the database as a flat file?
This approach stems from the 80's when we used COBOL and dealt with sequential files like ISAM. It has no place in the 21st century when dealing with the modern database.
Something that I seem to be repeating on a daily basis here in this forum:
1. Maximise SQL.
2. Minimise PL/SQL (or Java or Delphi or VB or C or C# or whatever)
SQL is the fastest and most powerful language to crunch database data. Use it to its full capability.

Similar Messages

  • Can not view contents of variable in debug mode (version 1.1.1.5.0)

    Hi
    I am running on WebLogic 11R1 and using OEPE 1.1.1.5.0.
    When Fast swap is enabled and I run WebLogic in debug mode using OEPE I can not view the contents of variables with the Eclipse debugger. I get the message "Expressions must contain either an expression or a block containing a well formed statement"
    However, if I disable Fast swap, i can view the variable within the Eclipse debugger
    Has anyone else had this problem?
    Regards
    Steve H

    Small correction... the soon-to-be-released version of WebLogic Server that Danny was referring to is 11gR1 PatchSet 2 or 10.3.3.

  • Evaluate the content of variables

    Dear Experts,
    is it possible to evaluate the content of variables (values) from a report (program, function module) with transaction SE30.
    Kind Regards
    Marco M.

    John Jakabcsin wrote:
    Marco,
    >
    .... then the only way yo expose them to write code to show their values.
    How is this possible?
    Regards
    Marco

  • FILE CONTENT CONVERSION/ VARIABLE SUBSTITUTION

    Hi Experts,
    I have a reciver file which should have
    HEADER
    field 1
    field 2
    DETAIL
    field 1
    field 2
    TRAILER
    field 1
    field 2
    My reciever structure is
    HEADER
    field 1
    field 2
    DETAIL
    field 1
    field 2
    TRAILER
    field 1
    field 2
    TEMP
    field 1
    I am using TEMP field1 only for variable substitution and do not want
    it to be written to file. How can i use it in FCC.
    Pl. Help
    Akhil

    Hi,
    Plz do refer the folowing links:
    Sender -
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    Key value:
    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter -
    TAB delimited
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    NAB the TAB (File Adapter)
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
    Receiver FCC no need of Endseparator
    /people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
    Regards,
    Vinod.

  • Mail rule message content as variable

    I run a minecraft serer, and i need a way to promote a player when they fill in a form on the website. Every time a player filles in the form, I get an email like this:
    New application for member:
    Naam:  <name of the pearson>
    Username:  <minecraft username of the person>
    Skype naam:  <skype name of the person>
    E-mail:  <email of the person>
    Nieusbrief:  <Whether they want to get the newsletter or not>
    I know there is a way to setup a mail rule that runs an applescript, and from that I can run a shel script, but is it posible to feed the playername to the shel script script as a variable? So from the mesage body to the apple script, and from the apple script th the shel script. First problem I face is getting the username to the apple script. Then there is the second problem: I know there is an run-shel-script thingy, but i'm not sure how to pass the variable on from the apple script to the shel scrip. (I don't have anny experience with apple scripts...)
    Anny help is appreciated.

    Hi Stefan,
    Thanks for your reply.  I am glad to hear that I am wrong again )
    In your opinion is it possible to force the Outlook Exchange server to add the content attachment every time?  I mean by doing some configuration on it...?
    The reason why we would like to do this is because when - in the content tag of a Mail Package message - we have MIME message parts that are of content-type text/html we are having problems in decoding the html back to a readable format.
    To do this we use the apache QuotedPrintableCodec Java class.
    This works fine when the content type of the message is just text/plain but we get an exception when we try with text/html.
    The exception we get is:
    org.apache.commons.codec.DecoderException: Invalid URL encoding: not a valid digit (radix 16): 13
    I don't know if this is because of the two character sets we have in the payload (utf-8 and iso-8859-1) or if it is for other reasons...
    If you could help me figure out how to forward any HTML email to another system in a readable format it would be great.
    Thanks for your support,
    Aldo

  • Read a file content into Variable

    Hi There,
    I've a file in Unix and the content of it need to be assigned to an ODI variable. How can I do it?
    Regards.
    -Bhavani

    Step 1. ODI procedure .
    Command on Target - Java bean shell.
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    BufferedReader br = new BufferedReader(new FileReader("C:\\test.txt" ));
    String strLine = br.readLine();Step 2
    Create variable and add
    SELECT '<@=strLine@>' from dual This particular code will read only first line and pass into variable.

  • How to Install Business Content BEX Variables.

    Hi Experts.
    i want to install all the standard bex variables
    (exits, formulas) available in business content.
    when i go to the business content i see lot of variables
    of 0CALDAY which one to install ?. and even after installation of all none of them seem to appear in the BEX query designer?.
    Is there anything am missing?
    Thanks,
    Hari Anand.

    Hi,
    A little correction to Aby's reply.
    You don't have to have something like Billing date mapped to 0CALDAY in transfer rules.
    It's enough to have just 0CALDAY.
    The other dates (if you need them), like billing date, receiving date etc. are created as A REFERENCE TO 0CALDAY.
    It means that to all derivative dates you may apply variables created on 0CALDAY.
    You may not see all variables installed from a business content. -- Some variables are created on a particular infoobject and you can see those variables in the left panel, beneath this infoobject.
    There are also text and formula variable that might be independent from infoobjects. You can see them while creating a formulas in structures.
    Best regards,
    Eugene

  • Record contents of variables

    Dear Friends,
    do you know a way how to achieve this.
    Record contents of the processed variables e.g. of a report or program.
    Assume any report has been performed and there is a way to record or store
    all its variables for evaluating .
    If it is not possible by abap maybe there is a way to solve it with system calls.
    I mean  same as like CALL 'ABAP_CALLSTACK  but only for variables. Maybe there is a
    system call something like CALL ABAP_STACK_VARIABLES.
    Kindly Regards
    Alex

    and list of global variables of a program:
    REPORT z_write_global_variables.
    PARAMETERS progname TYPE program DEFAULT 'SAPLSALV'.
    START-OF-SELECTION.
      PERFORM write_global_variables USING progname.
    *&      Form  find_global_variables
    FORM write_global_variables USING progname TYPE program.
      DATA lo_prog TYPE REF TO cl_abap_compiler.
      DATA lt_types TYPE scr_rtags.
      DATA ls_types TYPE LINE OF scr_rtags.
      DATA lt_result2 TYPE scr_glrefs.
      DATA ls_result2 TYPE scr_glref.
      DATA lt_grades TYPE scr_grades.
      DATA ls_grades TYPE LINE OF scr_grades.
      CREATE OBJECT lo_prog
        EXPORTING
          p_name = progname.
      ls_types-sign = 'I'.
      ls_types-option = 'EQ'.
      ls_types-low = cl_abap_compiler=>tag_data.
      APPEND ls_types TO lt_types.
      ls_grades-sign = 'I'.
      ls_grades-option = 'EQ'.
      ls_grades-low = cl_abap_compiler=>grade_direct.
      APPEND ls_grades TO lt_grades.
      lo_prog->get_all_refs(
            EXPORTING
              p_local = 'X'
              p_types = lt_types
              p_grades = lt_grades
            IMPORTING
              p_result = lt_result2 ).
      DATA l_start TYPE string.
      CONCATENATE '\' cl_abap_compiler=>tag_program ':' progname '\'
            cl_abap_compiler=>tag_data '*' INTO l_start.
      LOOP AT lt_result2 INTO ls_result2 WHERE full_name CP l_start.
        WRITE / ls_result2-full_name.
      ENDLOOP.
    ENDFORM.                    "write_global_variables

  • View contents of record variable at debug time

    My PL/SQL package I'm debugging contains some RECORD type definitions. How can I see the contents of variables fo these types at debug time.
    The data tab shows the variable with an empty value and a type of 'OPAQUE'. As things currently stand for me I am simply unable to debug this code if I can;t see the contents of my variables.
    What have I done wrong? Or is the tool currently not able to show me this information. If this is the case is there any sort of workaround.

    Naveen,
    I am able to find document_type_id with this
    SELECT --document_extra_info_id
    FROM hr_document_extra_info
    where person_id=<>
    But I am not sure how I need to see the document.
    I dont know whether document exists or not?
    My Questions are
    1) Which path will documents store at server side?
    2) I am able to create docs now and I am able to view the docs now. But I am not able to view the existing docs. I am not sure whether docs exist or not.
    for this reason, I need to check whether docs exits in the path or not? Is it conversion issue or not? Please let me know.

  • Dynamic target directory with variable substitution

    Hi everyone.
    I'm trying to save a file in a folder with receiver adapter.
    This folder is determined in runtime and passed to the adapter with variable substitution. My problem is that in RWB i get a error like this : 'Content of variable XXXXX is not safe'
    Does anybody have done a variable substituion for output directory receiver file adapter?
    Regards,
    Inigo.

    Hi,
    Check this links,
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Regards,
    Phani

  • What is the difference between Constant Window, Variable Window,Main Window

    hello all
    what is the difference between 1) Constant Window
                                                2) Variable Window
                                                3) Main Window   in SAP SCRIPT

    Hi,
    Window Types
    When defining a form window, you must select a window type for the window.
    You can choose between three types:
    Constant Windows (CONST)
    Variable Windows (VAR)
    Main Windows (MAIN)
    Constant Windows (CONST)
    Starting with Release 4.0, the system internally processes windows of type CONST similar to windows of type VAR.
    Therefore, if you create a new window, always use type VAR.
    Variable Windows (VAR) 
    The contents of variable windows is processed again for each page, on which the window appears.
    The system outputs only as much text as fits into the window. Text exceeding the window size is truncated;
    the system does not trigger a page break. Unlike constant windows, the page windows declared as variable windows may have different sizes on different form pages.
    As far as the processing of the window contents is concerned, the system currently treats constant and variable windows alike.
    The only difference is that constant windows have the same size throughout the form.
    Main Windows (MAIN) 
    Each form must have one window of type MAIN. Such a window is called the main window of the form.
    For SAPscript forms, the main window has a central meaning:
    It controls the page break.
    It contains the text body that may cover several pages.
    It allows to fix text elements at the upper and lower margins of the allocated page window (for example, for column headings).
    As soon as a window of type MAIN is full, SAPscript automatically triggers a page break and continues to
    output the remaining text in the main window of the subsequent page. Page windows of type MAIN have the same width throughout the form.
    The SAPscript composer thus avoids reformatting of the text after each page break.
    If a page does not have a main window, the system implicitly processes all other windows of the page and continues with the subsequent page.
    This page must not call itself as subsequent page (recursive call), since this would produce an endless loop.
    In such a case, SAPscript terminates the output after three subsequent pages.
    For printing header lines or totals, the different output areas of the main window are of special importance.
    go through this links:
    In Scripts Variable window and constant wind difference?
    Main Window
    Re: Main Window in SAP Script
    What is the difference between Constant window and variable window?
    Regards
    Adil

  • Security Violation during PATH Variable Substitution

    Hi -
    I' m trying to write a file with the receiver file adapter by the variable substitution feature from SP12 on.
    Whereas the %filename% variable works fine, I get for the %path% variable an exception in the adapter engine, whenever I'm trying either
    - to use an absolute path like "/tmp" or
    - composed pathnames like "tmp/test" (that are based on $XIHOME/j2ee/cluster/server0)
    Non-composed pathnames like $XIHOME/j2ee/cluster/server0/tmp by setting %path% to "tmp" work also.
    Any clue?
    I'm on AIX on SP12.
    Here is the exception:
    java.text.ParseException: Security violation encountered during variable substitution: Content of variable path is not safe
    Thanks.
    Stefan

    Hi Stefan,
    did you check the flag 'Disable Security Checks' in the communication channel?
    Regards
    Stefan

  • File-Adapter: Variable substitution form payload XML-attribute

    Hi experts,
    is possible to use XML-attribute-content for variable substitution in file-Adapter?
    extract from XML:
    <?xml version="1.0" encoding="utf-8" ?>
    - <all>
    - <transaction <b>file="filename"</b>>
    - <table name="BPAADDRESS" options="insertIfUpdateFails">
    - <record id="1">
      <hkeycol name="BPAMAINHKEY">0010500345</hkeycol>
      <hkeycol name="USAGE">Invoice</hkeycol>
      </transaction>
    I want to get the value "filename" = attribute file of transaction.
    Is this possible?
    Thanks a lot,
    Florian

    I have done this taking a field from the XML.
    You have to map the location of the field within the XML...
    Taken from:
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
    Variable Substitution (Target Directory/File Name Scheme)
    If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
    &#9679;      Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
    The variables can refer to attributes of the message header or elements of the message payload.
    &#9675;       If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
    sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,
    message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)
    message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)
    For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
    If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").
    &#9675;       If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
    namea,nameb,... corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
    The description begins at the root of the document and ends at the respective element.
    To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
    The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (“Example Value”) is set as the value for a specified variable.
    <?xml version="1.0" encoding="UTF-8" ?>
    <root>
      <dummy>
         <e1>
            <e2>Data_1</e2>
            <f/>
            <g attr="abc">text</g>
            <e2>Data_2</e2>
         </e1>
      </dummy>
      <e1>
         <e2>illegal/value</e2>
         <f/>
         <g attr="abc">text</g>
         <e2 attr="fghij">Example Value</e2>
      </e1>
    </root>
    &#9679;      To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.
    Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters “/“, “\“, and “..“.

  • Show the period value in column header using Text Variable

    We are using Posting Period & Financial Year to calculate YTD & MTD, for current year and previous years. These posting period and financial year characteristics are custom created characteristics we are using due to customer specific requirement.
    Input values are posting period, financial year and numeric value. To calculate previous year, I need to subtract numeric value from the input financial year. Every thing is working fine up to this.
    In the report I need to show the posting period and financial year values dynamically in each column header of the report for MTD, YTD for current year & previous year. I tried to achieve this using Text Variables, but I didn’t succeed. If some one can give me some idea to resolve this, it would be very helpful.
    I am excellent in ABAP coding. If you can specify me to code in User Exit, I can do it.
    Column headers should be 08.1999 Sales Qty, 08.2008 Sales Qty, 1999 Sales Qty, 2008 Sales Qty.

    Hi Abhinav,
    Try using the content text variables 0T_FYEAR and 0T_FPER3, when used in the head these variable should display the year and period specified in the RKF.
    e.g
    &0T_FPER3&. &0T_FYEAR& Sales Qty = 08.1999 Sales Qty
    If that doesnt work, try creating text replacement path variables referencing the variables you created for the year and period input. To do this click on the RKF and click on the dropdown by the yellow box next to the description on the general tab and select New Variable, enter the description, tech name and set processng by to Replacment Path, then select period as the ref. characteristic, then on the replacement path tab change replace variable with to variable and then select the variable you are using for the period input, save then hit ok, this is now a text representation of the variable your are inputing for period and can be used in the column headers, you will need to repeat the process for the fiscal year.
    Hope this helps
    Josh

  • Date format is changing in presentation variable

    Hello,
    I have a problem with date stored in presentation variable.
    I have simple prompt with calendar field (default date value is setted from repository or session variable to current date). Selected date is stored in PP_DATE presentation variable.
    I have simple report with title to show the content of variable PP_DATE.
    And now the problem.
    When I navigate to dashboard page with this report I will get date from PP_DATE variable in some format (there is difference when I use repository or session variable). After I will push the start button I will get another date format from PP_DATE variable.
    Screenshots are stored and described in this PDF: [PDF with screenshots|https://docs.google.com/uc?export=download&id=0B2LOPOBteIShMDRmYTJlYTItNmYyZC00ODdkLWE5NjktNzI1N2RlNWMwZjBk]
    There is difference between session and repository variable. When I use repository variable I will get 'TIMESTAMP .......' from PP_DATE variable, which is the default initializer in repository variable manager. I tried to delete default initializer, but I is automatically added after saving changes.
    When is the default value of prompt setted from session variable I will get another format of date from PP_DATE variable which refers to DATE_TIME_DISPLAY_FORMAT = "yyyy-mm-dd hh:mi:ss.mss" (from NQSConfig.ini). I have changed DATE_TIME_DISPLAY_FORMAT from standard value "yyyy/mm/dd hh:mi:ss" to "yyyy-mm-dd hh:mi:ss.mss" because I am reading some data from excel, where are dates stored in MSSQL format. But this is not the reason of my problem. I have the same problem also with standard DATE_TIME_DISPLAY_FORMAT.
    The result of this strange behaviour is that I am getting errors when I am doing some calculations (for example TimeStampDiff) with PP_DATE variable. I am getting error when I am navigating to dashboard page. Everything is ok after I will push the start button.
    Do you have some tips?
    Thank you

    Kishore Guggilla wrote:
    Hey,
    you are talking about so many pieces here seems..
    first letz break down your issues list..
    1. error, this is because of default date(using repository variable) used in prompt..
    2. using presentation variables in timetampdiff functions..
    3. showing variable in title list..
    we'll go through each issue..
    because, its' messed up..I think that everywhere is the same problem. So solving issue number 1 will solve my other problems.
    "1. error, this is because of default date(using repository variable) used in prompt.. "
    I want to use date prompt with default date value (from repository or session variable) and then use pp_date presentation variable from this prompt to filter my results.
    I would like to use repos. or session variables, I dont want to write some select to fill default date value in each prompt.
    I tried to change one date in initialization block from "trunc(sysdate, 'DD')" to "to_char(sysdate, 'YYYY-MM-DD')" because it is the same format as DATE_DISPLAY_FORMAT = "yyyy-mm-dd" in NQSConfig.ini
    And now it seems to be working now.
    I can use repository var. as default date value in my prompt and use date variable pp_date to filter my results. Report return result after navigation on it and after pushing Go button.
    Can you confirm me that date format in initialization block must be the same as DATE_DISPLAY_FORMAT = "yyyy-mm-dd" in NQSConfig.ini?

Maybe you are looking for

  • Message could not be delivered to mobile.

    Suddenly I'm unable to send a pic message to my phone via email. I've always been able to send pics that I've uploaded to my computer from my digital camera through my email program using [email protected] Now when I sent one I get an error message v

  • Send photos to Apple TV from Aperture?

    In my iPhone Photos library it's east to make one picture appear instantly on my Apple TV - I just tap the rectangle-with-an-arrow-pointing-into-it and select my "Apple TV" instead of "iPhone".  Can I do the same in Aperture?  I can't figure out how.

  • Line item display and sort key

    Hello,    can anybody pls let me know how can we change layout for f-53 ad f-28 and what is the significance of using sort keys and how can we use them. please let me know, thanks

  • How to use Oracle refcursor dataset output parameter from SP

    Can I request for help on how to use Oracle Output parameter from a stored procedure as a source. I need the output tobe stored in a flat file Thanks Abhijit Message was edited by: Abhijit77

  • HT2481 can you rub out a photo

    can you rub out a photo