Variables to UPPERCASE?

I have a variable defined in my book chapters that contain the chapter title.  E.g.,
Variable name: Chapter Title
Variable value: In the Beginning
I use this variable on the first page of each chapter, naturally.
I would also like to have a Right page header, that also displays the chapter title, as is commonly found in most non-fiction books.  But typically (if not always), this page header is in uppercase letters.  Although I could create a new variable for each chapter, and call the variable something like "Chapter Title in Uppercase Letters", this seems rather redundant, if not to mention dumb...IF...there is some trick to have Framemaker 9 uppercase the propercase version of the original variable.  Something like   $Uppercase('Chapter Title')
Is this possible in FM9?
Thanks.
PK

Sam State wrote:
I have a variable defined in my book chapters that contain the chapter title.  E.g.,
Variable name: Chapter Title
Variable value: In the Beginning
I use this variable on the first page of each chapter, naturally.
I would also like to have a Right page header, that also displays the chapter title, as is commonly found in most non-fiction books.  But typically (if not always), this page header is in uppercase letters.  Although I could create a new variable for each chapter, and call the variable something like "Chapter Title in Uppercase Letters", this seems rather redundant, if not to mention dumb...IF...there is some trick to have Framemaker 9 uppercase the propercase version of the original variable.  Something like   $Uppercase('Chapter Title')
Is this possible in FM9?
Thanks.
PK
Search Google for terms like "FrameMaker uppercase character style," without quotes.
HTH
Regards,
Peter
Peter Gold
KnowHow ProServices

Similar Messages

  • Swapping XML Parser and XSLT to Xalan 2.7.0 - Not Working (OC4J 10.1.3)

    Hi-
    I'm trying to use the latest Xercies/Xalan classes in OC4J 10.1.3 as described in the How-To swap XML Parsers document:
    http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html
    What I can see happening is that the oracle.xml shared library is successfully 'turned off', but the xalan libraries are not added. Instead, the default xml classes that are distributed with the JDK become visible. For instance, using a slightly modified version of the index.jsp page from the how-to, I get this result:
    ------ Output from JSP page ----------------
    TransformerFactory Instance: org.apache.xalan.processor.TransformerFactoryImpl
    Transformer Instance: org.apache.xalan.transformer.TransformerIdentityImpl
    Transformer Version: Xalan Java 2.4.1 (!!)
    What I expect is for that last line to say version 2.7.0, which is the version of the xalan.jar included in my shared library (code to add that line to the how-to shown below).
    I suspect what is happening is that the class loader is simply not letting a shared library override a system library - to do that you probably need to place the jar files in system endorsed directory.
    Has anyone gotten this how-to to work - actually replacing the XML parser/transform classes with the latest Xalan classes? Are you sure it is seeing the current version you placed in the shared library?
    Thanks,
    Eric Everman
    ---- My modified getXSLTDetails() method in the index.jsp page of the how-to -------
    <!-- Additional Import -->
    <%@ page import="org.apache.xalan.Version" %>
    public static String getXSLTDetails()
    Transformer transformer=null;
    TransformerFactory transformerfactory = TransformerFactory.newInstance();
         Version ver = null;
         String br = "<" + "br" + ">"; //otherwise the otn forum chocks on the break.
    try
    transformer = transformerfactory.newTransformer();
              ver = (Version) transformer.getClass().forName("org.apache.xalan.Version").newInstance();
              String ret_val =
                   "TransformerFactory Instance: "+transformerfactory.getClass().getName() + br +
                   "Transformer Instance: "+transformer.getClass().getName() + br;
              if (ver != null) {
                   ret_val = ret_val + "Transformer Version: " + ver.getVersion() + br;
              } else {
                   ret_val = ret_val + "Transformer Version not Available" + br;
              return ret_val;
    catch (Exception e)
    e.printStackTrace();
    return e.getMessage();
    }--------------------------------------------------------------------

    Steve - Thanks for responding on this.
    The Xalan SQL extension is built into Xalan. The most painless way to try it out is to run it via JEdit: www.jedit.org
    JEdit a OS Java application with a fairly painless install process (I'm assuming you already have a current JRE installed). Once its installed, you'll need to install the XSLT plugin - in JEdit goto Plugins | Plugin Manager | Install and pick the XSLT plugin. You'll need the Oracle JDBC classes on your classpath - this can be done by copying the oracle_jdbc4.jar into the [JEdit install directory]/jars directory.
    Restart to load that jar and you should be all set.
    I included a sample XSLT page at the bottom of this post that is somewhat of a template transform for the SQL extension - its more complicated then it needs to be, but it does some nice things with the results of the query. Save it as a file and make the appropriate changes to the 'datasource' parameter near the top of the file.
    Then in JEdit, open the file and make sure the XSLT plugin is visible (Plugins | XSLT | XSLT Processor Toggle - or alternately dock it in the window via global prefs). In the XSLT plugin: Allow the current buffer to be used as the source, Add that same file as a stylesheet via the '+' button, and pick a result file at the bottom. Then click the 'Transform XML' button.
    Troubleshooting: I seem to remember having some classpath errors when I tried this on windows, but others have had it work w/o issues. I do remeber that the XSLT plugin had a popup window that gave a pretty good explaintion of the problem, if it occurs. Also, for some reason the XSLT plugin will not create a new file for the output, so its often best to create a file first, then choose it as the output. Of course, you can always run a transformation from the command line or w/in an applicatoin. Full docs on the Xalan SQL extension can be found at: http://xml.apache.org/xalan-j/extensionslib.html#sql
    Here is my sample XSLT transform using the SQL extension:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              xmlns:sql="http://xml.apache.org/xalan/sql"
              xmlns:str="http://exslt.org/strings"
              xmlns:xalan="http://xml.apache.org/xalan"
              extension-element-prefixes="sql str xalan">
         <xsl:output indent="yes"/>
         <xsl:param name="driver">oracle.jdbc.OracleDriver</xsl:param>
         <xsl:param name="datasource">jdbc:oracle:thin:jqpublic/jqpublic@server_name:1521:dbname</xsl:param>
         <xsl:param name="jndiDatasource"><!-- jndi source for production use w/in enterprise environment --></xsl:param>
         <xsl:param name="debug">true</xsl:param>
         <xsl:variable name="connection" select="sql:new()"/>
         <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
         <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
         <!--
              The query:  You could pass parameters in to this query to build a where clause, but here is a simple example.
              Also, its nice to wrap the query with a max row number to prevent huge results.
         -->
         <xsl:param name="query">
         select * from (
      SELECT
              'One' FIELD_1,
              'Two' FIELD_2
         FROM DUAL
         ) where rownum < 100
         </xsl:param>
         <!-- Essentially, create a XConnection object -->
         <xsl:variable name="connection" select="sql:new()"/>
         <xsl:template match="/">
        <xsl:choose><!-- Connect using JNDI -->
          <xsl:when test="$jndiDatasource != ''">
            <xsl:if test="not(sql:connect($connection, $jndiDatasource))">
              <xsl:message>Failed to connect to db via jndi connection</xsl:message>
              <xsl:comment>Failed to connect to db via jndi connection</xsl:comment>
              <xsl:if test="$debug = 'true'">
                <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
            </xsl:if>
          </xsl:when>
          <xsl:otherwise><!-- Connect using connection string -->
            <xsl:if test="not(sql:connect($connection, $driver, $datasource))">
              <xsl:message>Failed to connect to db via driver/url connection</xsl:message>
              <xsl:comment>Failed to connect to db via driver/url connection</xsl:comment>
              <xsl:if test="$debug = 'true'">
                <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
            </xsl:if>
          </xsl:otherwise>
        </xsl:choose>
              <!--
              The results of the query.  The rowset is brought back in 'streaming' mode,
              so its not possible to ask it for the number of rows, or to check for zero
              rows.  There is a switch to disable streaming mode, but this requires all
              rows to be brought into memory.
              -->
              <xsl:variable name="table" select="sql:query($connection, $query)"/>
              <xsl:if test="not($table)">
                   <xsl:message>Error in Query</xsl:message>
                   <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
              <page>
                   <!-- Your xalan environment -->
                   <xsl:copy-of select="xalan:checkEnvironment()"/>
                   <!-- Build a bunch of metadata about the rows -->
                   <meta>
                        <cols>
                             <xsl:apply-templates select="$table/sql/metadata/column-header"/>
                        </cols>
                   </meta>
                   <rowset>
                        <!--
                             With streaming results, you must use the apply-temmplates contruct,
                             not for-each, since for-each seems to attempt to count the rows, which
                             returns zero.
                        -->
                        <xsl:apply-templates select="$table/sql/row-set"/>
                   </rowset>
              </page>
              <xsl:value-of select="sql:close($connection)"/><!-- Always close -->
         </xsl:template>
         <xsl:template match="row">
              <row>
                   <xsl:apply-templates select="col"/>
              </row>
         </xsl:template>
         <xsl:template match="column-header">
              <col>
                   <xsl:attribute name="type">
                        <xsl:value-of select="@column-typename"/>
                   </xsl:attribute>
                   <xsl:attribute name="display-name">
                        <xsl:call-template name="create-display-name"/>
                   </xsl:attribute>
                   <xsl:value-of select="@column-name"/>
              </col>
         </xsl:template>
         <!-- Convert column names to proper caps: MY_FIELD becomes My Field -->
         <xsl:template name="create-display-name">
              <xsl:variable name="col-name">
                   <xsl:for-each select="str:tokenize(@column-name, '_')">
                        <xsl:value-of
                             select="concat(translate(substring(., 1, 1), $lowercase, $uppercase), translate(substring(.,2), $uppercase, $lowercase), ' ')"/>
                   </xsl:for-each>
              </xsl:variable>
              <xsl:value-of select="substring($col-name, 1, string-length($col-name) - 1)"/>
         </xsl:template>
         <!-- Creates data columns named 'col' with a column-name attribute -->
         <xsl:template match="col">
              <col>
                   <xsl:attribute name="column-name"><xsl:value-of select="@column-name"/></xsl:attribute>
                   <xsl:value-of select="."/>
              </col>
         </xsl:template>
    </xsl:stylesheet>

  • Confused by user reports - childs/detail

    SQL Dev user reports are very powerful and I like them very much. I am a little bit worried that I am not able to explore and employ all user report features. I found the documentation a little bit short. But maybe I overlooked something or I am not an explorer as I used to be.
    My problems:
    1) I do not know the difference between detail and child sub-reports
    2) I have not figured out how to pass values from "parent" report into Script / plsql-dbms_output / code sub-report
    What I am trying to do:
    I have a log table LOG_MSG with inbound messages for entities. The message (table row) has ID and content.
    There is also table LOG_ERROR which records errors for messages identified by ID (LOG_MSG.ID = LOG_ERROR.MSG_ID). I successfully used "Type: Detail, Style: Table" sub-report to display message errors for the active row. Neat :-)
    Now I am facing this problem. Message is composed from values separated by `|'. I would like to parse a message and display in subreport each message parameter in new row. I have a PL/SQL procedure, which parses a message and stores the parameters in global temporary table. So the report SQL should be something like:
    BEGIN P_PARSE (:ID); END;
    SELECT *
    FROM TMP_PARAMS;
    Should I use Detail or Child type? Table / script / ... style? How to pass a parameter to Script subreport? My every attempt to pass a value from parent repor failed (:ID, &ID, #ID#) :-(
    Thank you for your help.

    Hi,
    I have this report and it works:
    Master:
    select 'X' dummy, 123 num
    from dual
    union
    select 'Y' dummy, 456 num
    from dual
    Detail (on single line and with bind variable in UPPERCASE):
    declare bind1 varchar2(100) := :DUMMY; begin dbms_output.put_line ('There is '||bind1||' in master.'); end;
    The column from master must be in uppercase when used in child pl/sql and whole pl/sql must be on single line.
    Note the difference in upper/lowercase for dummy column. Even it is un lowercase in master, in child it must be in uppercase.
    In this way it works for me.
    Regards Libor

  • Variables at ODI 11.1.1.7 must be uppercase?

    Hi guys,
    Recently, I have upgrade ODI from 10g to 11.1.1.7 at the upgrade guide I saw that variables in ODI 11.1.1.5 must be in uppercase if they are not in this format I can use "".
    This apply to ODI 11.1.1.7?

    I believe it applies. Why dont you just test this in ODI 11.7?

  • Uppercase variable in a Sapscript

    Hi all,
    i need to modify a sapscript. In my sapscript i have a variable named &W_LANDX&, this variable is fulled with the form GET_COUNTRY in a program Z_GET_DATA.
    The text country is obtained by the following code :
    SELECT SINGLE landx FROM t005t INTO w_landx
      WHERE spras = sy-langu
        AND land1 = w_land1.
    My problem is that the &W_LANDX& is always in uppercase and the text come from landx50 of t005t table. I don't know how this is possible. When i debug w_landx is correct but when i print the form i have the problem.
    Thanks for help.

    Does your W_LANDX variable refers to the T005T-LANDX50?
    Basically, we need to have the variable which can hold the values preserving its Cases. The field T005T-LANDX50 is able to hold the cases because the domain of the T005T-LANDX50 has the "Lowercase" on.
    Regards,
    Naimesh Patel

  • Can you pass an array URL variable

    Hi,
    Doing a form which I want to validate, then re-display with
    error messages and the keyed data still in place should there be
    errors, or go onto a second form if all ok.
    I have tried to use <form
    action="<?=$_SERVER['PHP_SELF']?>" but as the various
    outcomes result in different screens I can't see how to do it
    without having reams of duplicate code - I couldn't make it work
    satisfactorily anyway.
    So I decided to do it in two stages - form (user screen) + a
    separate validation routine which passes validation results back if
    there are errors by calling the first screen but with URL variables
    to trigger process variations or go onto screen 2 if all ok.
    But I'm struggling with this .. two questions:
    i) Ideally I would like to use a session variable to pass
    actual error messages back to screen one in the event of errors but
    if I undertand things correctly (which is by no means certain)
    $S_Session is already an associatve array so it wouldn't be so easy
    to just add a variable number of messages to it and then know what
    you are unpacking elsewhere ... do you know what I mean?
    Perhaps if I give you my second question it may help
    illustrate what I'm going on about in part 1
    ii) The way I have tried to do it is to set it up as an array
    ($ERRORS) in the validation module and then added a text string
    each time I hit a specific error. The hope was that I could then
    send this back via the URL for further process but I'm getting
    syntax problem so maybe this is not possible .... a brief example
    Input Form php:
    $ERRORS = array();
    $ERRORS = $_GET['errors']
    if (sizeof($ERRORS) > 0) {
    echo "<p class=\"val_err_hdr\"> *** Validation
    error(s) - please correct the entries and try again ***
    </p>";
    blah blah
    Validation php:
    $ERRORS=array();
    if(!$loginFoundUser) {
    $ERRORS[] = "This e-mail address entered has already been
    registered on our database - if you have already registered you
    can"; }
    header("Location: input.form.php?errors=$ERRORS");
    When I run this I get a syntax error 'unexpected T_IF' on the
    'sizeof'' function condition.
    Any help much appreciated.

    .oO(patricktr)
    > Doing a form which I want to validate, then re-display
    with error messages and
    >the keyed data still in place should there be errors, or
    go onto a second form
    >if all ok.
    OK, quite common.
    > I have tried to use <form
    action="<?=$_SERVER['PHP_SELF']?>"
    Avoid short open tags, they are unreliable. Use "<?php
    print " instead
    of just "<?=" to be safe and independent from the server
    configuration.
    >but as the
    >various outcomes result in different screens I can't see
    how to do it without
    >having reams of duplicate code - I couldn't make it work
    satisfactorily anyway.
    What's a "screen" in this case? Just another part of the form
    or a
    completely different page?
    > So I decided to do it in two stages - form (user screen)
    + a separate
    >validation routine which passes validation results back
    if there are errors by
    >calling the first screen but with URL variables to
    trigger process variations
    >or go onto screen 2 if all ok.
    Don't use URL parameters in such a form processing scenario.
    Use a
    session instead, that's what they are for. The length of URLs
    is limited
    and there are things you simply don't want to pass between
    pages, but
    keep on the server instead.
    > But I'm struggling with this .. two questions:
    >
    > i) Ideally I would like to use a session variable to
    pass actual error
    >messages back to screen one in the event of errors but if
    I undertand things
    >correctly (which is by no means certain) $S_Session is
    already an associatve
    >array so it wouldn't be so easy to just add a variable
    number of messages to it
    >and then know what you are unpacking elsewhere ... do you
    know what I mean?
    The $_SESSION array itself is strictly associative, the used
    indexes
    must be strings or the serialization of the session data will
    fail.
    But if course you can always do things like this:
    $_SESSION['errors'] = array();
    $_SESSION['errors'][] = 'something went wrong';
    > Perhaps if I give you my second question it may help
    illustrate what I'm going
    >on about in part 1
    > ii) The way I have tried to do it is to set it up as an
    array ($ERRORS) in the
    >validation module and then added a text string each time
    I hit a specific
    >error. The hope was that I could then send this back via
    the URL for further
    >process but I'm getting syntax problem so maybe this is
    not possible .... a
    >brief example ...
    As said above - use the session instead.
    > Input Form php:
    > $ERRORS = array();
    > $ERRORS = $_GET['errors']
    There's a ';' missing at the EOL (this causes the error you
    mentioned
    below).
    Just a naming hint: Variables should not be named all
    uppercase (except
    for the predefined superglobal arrays). Such names should be
    reserved
    for constants. The most common style looks like this:
    myNiceFunction()
    $myNiceVariable
    MY_NICE_CONSTANT
    > if (sizeof($ERRORS) > 0) {
    if (!empty($_SESSION['errors'])) {
    > header("Location: input.form.php?errors=$ERRORS");
    The Location URI must be absolute including scheme and
    hostname. This is
    required by the HTTP spec:
    header("Location:
    http://$_SERVER[HTTP_HOST
    But I'm still not sure why you would need this redirect. The
    entire
    handling of a form (validation, processing) can be done on a
    single
    page. Only if the processing succeeds, you might want to
    redirect to
    some result page.
    Micha

  • Why can't I access the variables in my threads?

    hello.
    another question about threads..
    ==========================
    I have an inner class that implements Runnable (i.e. a thread) and has a variable in it. I want to be able to access that variable from outside the thread class so that I can set or retrieve the variable.
    here is the code for the program
    class myClass
         public static void main(String[] args)
              myClass c = new myClass();
         myClass()
              Thread t = new Thread(new myThread());
              t.number = 1;
              t.start();
         class myThread implements Runnable
              int number = 0;
              public void run()
         }//end myThread
    }//end myClassthe line
    t.number = 1;
    where I try to set the number variable to 1 gives me an error (in the MyClass constructor)
    This is my error
    AccessThreadVars.java:11: cannot find symbol
    symbol  : variable number
    location: class java.lang.Thread
              t.number = 1;
                        ^
    1 errorif I put a method in myThread, and then try to call that method from myClass (via t.MethodName()) it gives me that same error telling me it can't find it..
    what am I doing wrong? how can I get access my thread's variables and methods??

    1. Type names should start with an uppercase letter
    2. t is defined as a Thread, not as a myThread
    (which, may I insist, should be "MyThread"), so the
    compiler has no means of detecting that "number" is
    an accessible field of the object... which wouldn't be accessible anyway, cause you're trying to get attributes from your Runnable after wrapping it inside a Thread.
    Why don't you do something like :
    MyThread t = new MyThread();
    t.number = 1;
    new Thread(myThread).start();?
    I bet you don't use Thread's own methods anyway...

  • Accessing the variable in field symbol of nested internal table

    Hi,
    I am unable to access the variable in field symbol.
    The data in field symbol has nested structure. We need to access a variable in nested structure.
    Please find the code below:
          LOOP AT <i_fincorp> into <fs_fincorp>.
            l_madefor = <FS_FINCORP>-data_UI-ZZ0010.
          ENDLOOP.
    datatype of <i_fincorp> is type any table and <fs_fincorp> is type any.
    there is a structure 'data_ui' in <i_fincorp> and we need value of field 'ZZ0010' in data_ui structure.
    But, we are getting syntax error for statement in loop stating "There is no component like 'data_ui' in <fs_fincorp>".
    Can anyone please help me solving this issue.
    Regards,
    Santosh

    So simply access it dynamically
    data: nested_field type c length 50.
    field-symbols <nested_field> type any.
    "build the nested field name dynamically
    concatenate
           'DATA_UI'    "first give structure name
           'ZZ0010'  "then give field name (all in uppercase!)
    into nested_field
    separated by '-'.  "now you have DATA_UI-ZZ0010
    "so assing this nested field
    LOOP AT <i_fincorp> into <fs_fincorp>.
       assign component (nested_field) of structure <fs_fincorp> into <nested_field>. 
    ENDLOOP.
    Regards
    Marcin

  • Copy variable from one thread to another

    My program requires user to input a java file which contains the run() method.
    In the input file, user can declare variables and use those variables inside the run method. User also need to enter the number of threads to be spawned.
    The problem is how can I construct some method like "copy" which can copy the variable from one thread to another in my program? I can't do that since I don't know the name of the variables that the user inputted.
    I've tried this:
    class helloworld extends thread{
    void run(){
    String a="hello";
    String b="world";
    copy(0,1,a,b)
    class myProgram {
    Class c = Class.forName(fileName);         // file name of user's file     
    Thread t[] = new Thread[p];             // p is number of threads
         for (int i=0; i<p; i++){             // create threads      
                   t[i] = (Thread) c.newInstance();  
                   t.start();
    public void copy(int sourThread, int destThread, String s1, String s2){
    t[sourThread].s1=t[destThread].s2
    But it doesn't work. It said "cannot resolve symbol s1 and s2".
    please help. urgent. Thanks a lot in advance.

    You need to seriously reconsider what you're allowing the user to do. The short answer to your problem is to use a shared, synchronized associative array.
    However, since the user can specify any number of threads, you will have to resolve deadlocks, and the fact that you're asking this question suggests you will have problems doing so until you have read up on threads and shared variables in more detail. (I don't mean to be dismissive. Deadlocks and shared variables have to be customized to the application, i.e., you have to figure out just when each thread will need access to the variable, what kind of access, and when.)
    In the meantime, take a step back and take a look at the big picture.
    From what you've said, I would guess a common example of your application is that I want to be able to read file "foo.dat", uppercase each letter in the file, and write it out to "fooXXX.dat" where XXX reflects the thread number. And specify any number of threads I want.
    Threads would not be the best way to accomplish this. Do this serially.
    Alternatively, I could interpret your problem as in you need to create a main() function that's capable of reading someone else's dot-class file, clone the object and start it. In which case, why do you want to share variables? If the user did his job correctly, then his file will already contain shared variables (or copy them as appropriate). All you have to do is clone the object via the new keyword, then call start() in it.
    You cannot share something when you don't know what you're sharing.
    The third option is that you're doing this as an academic exercise (i.e., homework). Granted, yes, your professor may ask you to do things illogically just to prove they can be done. Unfortunately, we're not supposed to help you in that case. People who read this forum generally try to find logical and efficient ways of doing things.

  • Using global variable in package

    Hi. I have created a function (Retrieve_SerialNo) which returns a variable, which I use throughout my package. I would like to assign this variable as a global variable to be used by all functions and procedures in the package. Can someone help me in the declaration of this variable as a global variable? Also, is it necessary for me to initialize this variable whenever the package executes. If yes, how would I do this?
    CREATE OR REPLACE PACKAGE BODY Supply_Item_Interface AS
    FUNCTION Retrieve_SerialNo RETURN VARCHAR2 IS
        v_serial_no VARCHAR2(20);
        CURSOR Serial_Code IS
          SELECT S.Serial_Code
            FROM Spare_Parts s, Orders r
           WHERE s.serial_code = r.serial_code;
      BEGIN
        OPEN Serial_Code;
        LOOP
          FETCH Serial_Code
            INTO v_serial_no;
          EXIT WHEN Serial_Code%NOTFOUND;
          v_serial_no := v_serial_no;
        END LOOP;
        CLOSE Serial_Code;
        RETURN v_serial_no;
      EXCEPTION
        WHEN OTHERS THEN
          RETURN NULL;
      END;

    user13415143 wrote:
    Hi. I have created a function (Retrieve_SerialNo) which returns a variable, which I use throughout my package. I would like to assign this variable as a global variable to be used by all functions and procedures in the package.All variables have scope or "visibility". A variable defined in a procedure is only visible within that procedure.
    A variable defines in a package body. is visible within that package body (i.e. procedures and functions in that package body can "see" that variable.
    A variable defined in the package definition? Well, who can see the definitions of procedures and function in a a package header/definition? Everyone else basically (other PL/SQL packages and procedures and functions). So this is also true for variables defined in the package interface. These are global variables that not only can be used by the code in that package's body, but also can be used by other packages and PL/SQL code.
    So when you create a global variable you need to decide on its scope:
    - define it in package header for global usage in all PL/SQL code
    - define it in package body for global usage within that package only
    CREATE OR REPLACE PACKAGE BODY Supply_Item_Interface AS
    ..snipped..Ugly code as there is no need to use an explicit cursor if returning a value from a single row. Also buggy code. If there are multiple rows returned by the cursor, the function returns the serial of the last random row. How does this make sense?
    This is what I would expect to see from a function like this. You pass it a unique identifier and it returns the applicable attribute (column) value for it.
    E.g.
    create or replace function GetSerialNo( orderNo number ) return number is
      serialNo number;
    begin
      select
        s.serial_code into serialNo
      from spare_parts s,
           orders o  
      where s.serial_code = o.serial_code
      and o.order_no = orderNo;
      return( serialNo );
    exception when NO_DATA_FOUND then
      return( null )
    end;Also note that there is no need to write ugly uppercase code. This is not a proper coding standard. Programming standards for all languages (ranging from C# to Java to Delphi to Visual Basic to C/C++) specify that camelcase should be used for variables and pascalcase for procedures/functions/methods. Uppercase is very seldom used and then only for constant names and compiler options/flags for example.
    Coding reserved words in uppercase? That is just plain silly - and not found in today's programming languages. Do yourself a favour and forget the idiotic standards used by some for PL/SQL and look at the standards for Java and .Net/C# - as the latter are the de facto standards for programming (and have been for the last 2 decades and more).

  • Record Set Variables used in PHP and MYSQL model

    PHP MYSQL server model.
    I'e been using dreamweaver for ages and have allways admired
    how well they have kept compatibility between versions. The recent
    8.02 release was a little bit of a shock when I had to start
    rewriting all my PHP MYSQL recordset queries!
    In the bulk of my SQL queries I detect on of two states for a
    query parameter and in some queries the parameters are used more
    then once. By creating a single variable in for the recordset I've
    allways been able to check and recheck the single variable in the
    query using the standard recordset. Now in version 8.02 I am
    getting the error: Missing type for variable:colname
    So where:
    SELECT *
    FROM links
    WHERE LinkID = colname or colname=-1
    ORDER BY `Level` DESC
    used to work it does not work any more!
    I'm being forced to rewrite the query:
    SELECT *
    FROM links
    WHERE colname in (-1,LinkID)
    ORDER BY `Level` DESC
    Simple enough but where the queries get more complex the more
    variables I have to define!
    This is not Cool! Can we get a bug fix for this so that I
    dont have to rewrite all my queries!
    P.S. Since when did anyone say that the Dreamweaver was SQL
    injection safe! This issue should have been resolved back in the
    Ultradev days! I guess Kudos goes to Adobe for finally trying to
    address one of the biggest glaring issues dreamweaver has had since
    it's inception. I was allways kinda upset that I was forced to pass
    variables as text to sprintf when I knew they where numbers!
    If I Look at the resultant code now I'm sure the result
    sprintf will still be using %s instead of optionally specifying one
    of the many diferent types (
    % - a literal percent character. No argument is required.
    b - the argument is treated as an integer, and presented as a
    binary number.
    c - the argument is treated as an integer, and presented as
    the character with that ASCII value.
    d - the argument is treated as an integer, and presented as a
    (signed) decimal number.
    e - the argument is treated as scientific notation (e.g.
    1.2e+2).
    u - the argument is treated as an integer, and presented as
    an unsigned decimal number.
    f - the argument is treated as a float, and presented as a
    floating-point number (locale aware).
    F - the argument is treated as a float, and presented as a
    floating-point number (non-locale aware). Available since PHP
    4.3.10 and PHP 5.0.3.
    o - the argument is treated as an integer, and presented as
    an octal number.
    s - the argument is treated as and presented as a string.
    x - the argument is treated as an integer and presented as a
    hexadecimal number (with lowercase letters).
    X - the argument is treated as an integer and presented as a
    hexadecimal number (with uppercase letters).
    This would further protect a query from being SQL Injected!
    I'd hope that Adobe would enable a Site specfic setting or
    something that would change the behaviour to match the passed
    parameter to sprintf with the specified variable type (I'd guess
    best practice to be Numeric be type f Text be type s and Date as
    type s as well)

    Start by saying bump.
    I've still no word from Adobe if they are doing anything with
    this problem. Any one had any replys from Adobe on it? Any one
    found a work around with recoding queries?

  • How can I reference a variable in Regexp

    Hello Friends,
    I have this Regexp, to extract the county code: (971)
    select regexp_replace (regexp_replace('000971-05 7910 - 324324','\D'),'^0*(971)?0?') from dual;It is fine and does the need..
    But, thinking in the future, someone may need to eliminate the country code of (961), so it is better if I put the code in a variable, but
    How can I reference the county code using a variable in Regexp:
    declare
    a varchar2 (15);
    code number := 971;
    begin
    select regexp_replace(regexp_replace('000971 05 7910 - 324324','\D'),'^0*(code)?0?') into a from dual;
    dbms_output.put_line ( a);
    end;but, it does not work ??
    Best Regards,
    Fateh

    venx08 wrote:
    You need to bind the code variable value in the regular expression patternYes, that's the idea, but there is a caveat. You might need to escape every regexp special character that appears in code. If, for example code is 'A*B' you need to transform it into 'A\*B' unless you really want 'A*B' to be interpreted as uppercase A repeated zero or more times followed by uppercase B.
    SY.

  • Assiging value to a variable

    Hello All,
    I am transferring a file from one server to another server.
    File name is stored as Wip_DD-MM-YY .i.e if we run the program today the file is stored as Wip_18-FEB-09.txt.
    This file i need to transfer.
    My question is how do we assign the this filename to a variable.
    i treid in the following way
    export MYFILE=wip_`date +%d-%b-%y.txt`
    ftp -v -n testone << EOF
    user user_name pass_Word
    cd /D01/tl/Test/outbound
    ascii
    get $MYFILE
    bye
    EOF
    But i am getting error as follows Wip_18-Feb-09.txt: is not an identifier.
    Also i would like get the month name as FEB not as feb.
    Please let me know
    Kind Regards,
    Kumar

    user624202,
    The text 'File name is stored as Wip_DD-MM-YY' is not correct. It is stored as DD-MON-YY according to your text.
    Also, the first letter of "wip" is written with a capital in your text, and with a lowercase in the script. Please check.
    In order to get the month in uppercase, do the following (write the case of the first letter of wip according to the true name):
    export MYFILE="Wip_$( date +%d )-$( date +%b | tr [:lower:] [:upper:] )-$( date +%y ).txt" In order to understand where the 'is not an identifier' is coming from, more detailed logging of the execution is needed.
    I would like to emphasize that ftp is not a good solution, use sftp (part of the openssh suite) if possible. This will enable you to do authentication based on certificates, so you can do:
    scp user@host:/path/to/file . which will copy a remote file to the current directory. that's far simpler, and better to administer because there's no password.

  • PHP Code, Variables & CSS. Would this work?

    Hello,
    I am new to PHP, this is my first script I have made without any help, I am using xammp to test my site, but the basics of the code is this. I am adding an include code into the navigation menu and in the CSS I have defined certain rules for the nav. Now in the code when you click on one of the links, it will change the variable to a corresponding number. The Code is pretty much self explanatory.
    Menu.php:
    <?
    $active = 1;
    ?>   
        <ul>
          <li><a href="#"  onclick="<? $active = 1; ?>" class="<? if ($active = 1){?>#navigation ul li a.active<? } ?>">Portfolio</a></li>
          <li><a href="#"  onclick="<? $active = 2; ?>" class="<? if ($active = 2){?>#navigation ul li a.active<? } ?>">Web Examples</a></li>
          <li><a href="#"  onclick="<? $active = 3; ?>" class="<? if ($active = 3){?>#navigation ul li a.active<? } ?>">Contact Me</a></li>
        </ul>
    Menu CSS:
    #navigation { text-align: right; font-weight: bold; text-transform: uppercase; font-size:14px; line-height:18px; height:70px;}
    #navigation ul{ list-style-type: none; }
    #navigation ul li{ display:inline; padding-left:15px; }
    #navigation ul li a{ text-decoration: none; color:#fff; }
    #navigation ul li a:hover,
    #navigation ul li a.active { color:#ffe6a5; }
    Now what I want to happen is when you click on one of the links, it will change to active, changing the color of the text to tell the visitor that, that link is active. Now normally I would do it though CSS, changing the texts rule to the active, but in order to be able to change buttons without having to do it though all the pages and also because I want to start using PHP more.
    The Include works, as you can see below, but the code above does not work, because the home button should be a light yellow color.

    I can't comment on your PHP, but you can achieve your desired result quite simply using this demo from Nancy.
    http://alt-web.com/Articles/Persistent-Page-Indicator.shtml

  • Problems accessing object variables in a Vector

    Hello all... perhaps someone can help:-
    I have a Vector - "ToolList" - which contains objects - "Tools". These tools have characteristics like: "ToolName", "Weight", "Dimensions".
    I'm trying to get the "ToolName" of each object listed in a ComboBox but I can't even access the "ToolName", farless list them in a combobox!
    How can this done?
    Ray.

    Hello all... perhaps someone can help:-
    I have a Vector - "ToolList" - which contains objects
    - "Tools". These tools have characteristics like:
    "ToolName", "Weight", "Dimensions".
    I'm trying to get the "ToolName" of each object listed
    in a ComboBox but I can't even access the "ToolName",
    farless list them in a combobox!I think I understand what you want. You want the name of the tool to appear in the combo box, but you're getting some garbage about Tools, right?
    When you add an object (or a vector of objects) to a ComboBox, it'll use the toString() method of those objects to get a String to display.
    So... in your Tools class, make a method
    public String toString()
        return ToolName;
    }HTH,
    Radish21
    PS Conventionally variable names start with lowerCase, as do methods. Only classes start with UpperCase.

Maybe you are looking for

  • ME22N : Change PO Line item to Display Mode, After All quantity has GRN

    Hi Experts, In ME22N,  PO change mode if the line item has checked with 'Delivery Completed' Indicator in 'Delivery' tab I want to shows that row always in 'Display' mode. Please help me to modify that table control within the exit. I'm using, Enhanc

  • Chrome, Mountain Lion and Full Screen Interactive Mode

    I'm running into an issue when entering Full Screen (Interactive) Mode-- long story short, the Message and "Allow" button are over-magnified and don't appear on the screen for me to click, thereby making it impossible to use other keystrokes (and see

  • Seeking workarounds to give effect of INSERT...SELECT...RETURNING

    What is the most efficient way to get record counts from subqueries within an INSERT INTO () SELECT () statement on Oracle 11g? I feel like I'm too close to the code to see the obvious answer here. Background: I am building a dynamic data quality tes

  • Dynamic Action - Field Overlapping

    Dear Colleagues, I have written Dynamic Actions for Extension Of Probation & Confirmation. However when i am executing confirmation action, system replaces the Extension Of Probation field in IT0041. Please advise how to go about it. Regards, Garima

  • Locking secondary display for slideshow.  Auto Export after tethered shooting?

    I use LR 3.5 when I shoot tethered.  It seems the upgrade to 3.5 helped with the inconsistent connection problem on my D3. I still get dropped but not as often. Thanks for working on that. I've been using LR for a photo booth arrangement.  I add logo