The use of serialize

Hi all,
I am trying to use the serialize xpath function to serialize an xml variable to a string, but nothing is stored in the string:
/process_data/myString = serialize(/process_data/myXmlVar/*, true())
What am I doing wrong?
Thanks in advance.
Sincerely
Kim

Do you need the /*? I think I've serialized an XML document without it.
Ryan D. Lunka
Cardinal Solutions Group
[email protected]

Similar Messages

  • What is the use of Serializable Interface in java?

    Hello friends,
    I have one dout and i want to share with u guys:
    Why Serializable interface made and actully
    what's the use of it?
    At which place it become useful ?
    It is not contain any method then why it is made?
    If anyone have any idea about this then please reply.
    Thanks in advace
    Regards,
    Jitendra Parekh

    t is not contain any method then why it is made?To point out to the user of a class (and the programs) that the design of this class is conforming to certain restraints needed for Serialization.

  • Use of serialization

    Hi..
    what is the use of serialization in java? if i implements Serializable in my class, then what happens???

    Konyv.java
    import java.util.*;
    import java.lang.*;
    import java.io.*;
    class Konyv implements Comparable {
    private String szerzo_;
    private String cim_;
    private int ar_;
    // get fugvenyek
    public int getAr() { return ar_; }
    public String getCim() { return cim_; }
    public String getSzerzo() { return szerzo_; }
    // set fugvenyek: nincsenek, beallitani csak a konstruktorban
    // konstruktor
    public Konyv(String szerzo, String cim, int ar)
    szerzo_ = szerzo;
    cim_ = cim;
    ar_ = ar;
    // egyeb helper fuggvenyek
    public int getCimSzavainakSzama()
    int ret = 0;
    StringReader rd = new StringReader(cim_);
    StreamTokenizer st = new StreamTokenizer(rd);
    try
    int token = st.nextToken();
    while (token != StreamTokenizer.TT_EOL && token != StreamTokenizer.TT_EOF)
    switch (token)
    case StreamTokenizer.TT_NUMBER:
    case StreamTokenizer.TT_WORD:
    ret++;
    break;
    default:
    break;
    token = st.nextToken();
    catch( Exception e )
    // TODO: a V2-ben implementalni
    System.out.println("Exception: "+e);
    rd.close();
    return ret;
    public int compareTo(Object o)
    Konyv masik = (Konyv)o;
    return szerzo_.compareTo(masik.szerzo_);
    public void nyomtat()
    System.out.println("Szerzo: "+szerzo_);
    System.out.println("Cim: "+cim_);
    System.out.println("Ar: "+ar_);
    Konyvtar.java
    import java.util.*;
    class Konyvtar {
    private TreeMap allomany;
    private Integer maxId;
    // konstruktor public Konyvtar()
    allomany = new TreeMap();
    maxId = new Integer(1);
    // konyvtar kezelo fuggvenyek
    public void listaz()
    // szerzo szerint sorrendben
    if( allomany.size() > 0 )
    Vector konyvek = new Vector(allomany.values());
    Collections.sort(konyvek);
    Iterator i = konyvek.iterator();
    while( i.hasNext() )
    Konyv k = (Konyv)i.next();
    k.nyomtat();
    public int ujKonyv(String szerzo, String cim, int ar)
    int ret = maxId.intValue();
    Konyv uj_konyv = new Konyv(szerzo,cim,ar);
    allomany.put( maxId, uj_konyv );
    maxId = new Integer(maxId.intValue()+1);
    return ret;
    public void konyvTorlese(int id)
    Integer torlendo = new Integer(id);
    if( allomany.containsKey(torlendo) )
    allomany.remove( torlendo );
    class CimbenLegtobbSzoSzerint implements Comparator {
    public int compare(Object o1,Object o2)
    int k1 = ((Konyv)o1).getCimSzavainakSzama();
    int k2 = ((Konyv)o2).getCimSzavainakSzama();
    if( k1 == k2 ) { return 0; }
    else if( k1 > k2 ) { return 1; }
    else return -1;
    public void nyomtatLegtobbSzobolAlloCim()
    // cimben levo szavak szerint
    if( allomany.size() > 0 )
    Vector konyvek = new Vector(allomany.values());
    Collections.sort(konyvek,new CimbenLegtobbSzoSzerint());
    int pos = konyvek.size()-1;
    System.out.println(
    "Legtobb szobol allo cim: "+((Konyv)konyvek.get(pos)).getCim());
    public void statisztika()
    System.out.println("=================");
    System.out.println("= STATISZTIKA =");
    HashSet szerzok = new HashSet();
    HashSet cimek = new HashSet();
    int ossz_ertek = 0;
    if( allomany.size() > 0 )
    Vector konyvek = new Vector(allomany.values());
    Iterator i = konyvek.iterator();
    while( i.hasNext() )
    Konyv k = (Konyv)i.next();
    szerzok.add( k.getSzerzo() );
    cimek.add( k.getCim() );
    ossz_ertek += k.getAr();
    System.out.println("Szerzok szama: "+szerzok.size());
    System.out.println("Cimek szama: "+cimek.size());
    System.out.println("Ossz ertek: "+ossz_ertek);
    main.java import java.util.*;
    import java.lang.*;
    import java.io.*;
    class zh {
    public static void printMenu()
    System.out.println("=============");
    System.out.println("= MENU =");
    System.out.println("=============");
    System.out.println("1 - Konyv felvitel");
    System.out.println("2 - Konyv torles");
    System.out.println("3 - Konyv lista");
    System.out.println("4 - Legtobb szobol allo cim");
    System.out.println("5 - Statisztikai adatok");
    System.out.println("6 - Kilepes");
    System.out.println("Valassza ki a kivant menupontot [1-6]: ");
    public static void main(String[] args)
    boolean do_loop = true;
    Konyvtar kvt = new Konyvtar();
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    try
    while( do_loop )
    printMenu();
    String valasz = in.readLine();
    if( valasz.compareTo("6") == 0 ) { do_loop = false; }
    else if( valasz.compareTo("1") == 0 )
    System.out.println("Adja meg a konyv Szerzojet, Cimet, Arat (mind ujsorban)");
    String szerzo = in.readLine();
    String cim = in.readLine();
    String ar = in.readLine();
    int id = kvt.ujKonyv(szerzo,cim,Integer.parseInt(ar));
    System.out.println("----------------");
    System.out.println("A felvitt konyv leltari azonositoja: "+id);
    System.out.println("----------------");
    else if( valasz.compareTo("2") == 0 )
    System.out.println("Adja meg a torolni kivant konyv leltari azonositojat");
    String id = in.readLine();
    kvt.konyvTorlese( Integer.parseInt(id) );
    else if( valasz.compareTo("3") == 0 )
    kvt.listaz();
    else if( valasz.compareTo("4") == 0 )
    kvt.nyomtatLegtobbSzobolAlloCim();
    else if( valasz.compareTo("5") == 0 )
    kvt.statisztika();
    catch( Exception e )
    };

  • What is the main use of serialization?

    Can anyone plz tell me the purpose of serialization?

    It's just state, just raw data. People tend to get
    caught up in thinking they need to serialize an
    entire object, but the truth about serializationis,
    it's just taking enough of the state of an object
    that you can re-construct that object It's also the relationships, which form a directed
    graph that allows cycles. Those relationships, too, are manageable. I've got a serialization library that serializes to - naturally! - XML, and takes care of those relationships, too. Each reference object in a graph is serialized exactly once, regardless of how many objects refer to it.
    That's just one of the tricky parts, and where most
    of the "magic" occurs in Java serialization. Also
    much of the pain -- it seems that everyone who uses
    serialization reaches a point of wondering why their
    program is leaking memory (then they discover that
    the input and output streams hold onto the references
    needed to break cycles and preserve within the
    graph).
    Even more tricky is the question of static versus
    instance data, given that static data can change over
    time, and the instance state may depend on the static
    data (although, to be honest, this is more an issue
    of design than serialization).
    However, in general I agree with you that most cases
    that need "serialization" can get away with simple
    state marshaling. I know of one project that
    eliminated a huge amount of communication overhead by
    marshaling their POJOs as CORBA objects.
    I'm not so sure that JLabel fits into that category.
    You could say that a label is defined by its
    dimensions, position, and content. However, it's
    place in the hierarchy is also important, and in most
    cases the dimensions and position are determined by
    the parent's layout manager ... except in the cases
    where they aren't. Presumably you'd be serializing the parent as well, though
    On the other hand, you can't
    simply serialize a Swing GUI and expect to
    deserialize it in another application, because the
    GUI is tied to the display, and the serialization
    mechanism has no way to recreate that relationship.You wouldn't want to, anyway. There's enough state to be serialized that you can re-build it without having to clone like that
    My point is, though, that there's nothing the Serializable-centric mechanism does that you can't do yourself

  • The Problem in serialization.

    The serialization issue is a trivial one at the moment. However the threat of a version change is imminent considering the next release of JDK 6 "Mustang" may have considerable improvements especially on the Swing side. Therefore, I strongly encourage you to write your own code to persist the tree data into a file. Such a logic is much preferable as it will over-come the issues with serialization.
    The main problem with a version change is that every serializable class uses a special random number stored in a private static field called serialVersionUID. So when the serializable class is serialized, this number is also persisted to the serialized form.
    When the object is de-serialized, the number is also deserialized. Java checks the de-serialized number against the serialVersionUID field of the class and verifies if the two match. If they do, it means that the deserialized data is in the right format of the class. If they differ, a InvalidClassException is thrown. Every new version of the class changes this unique number. Hence an object serialized with an older version of the class will not be allowed to be de-serialized by a new version of that class and vice-versa.
    This mechanism allows developers to version their new releases and ensures that serialization and deserialization operations remain consistent across multiple-versions and prevent invalid state of the object.

    The serialization issue is a trivial one at the moment. However the threat of a version change is imminent considering the next release of JDK 6 "Mustang" may have considerable improvements especially on the Swing side.Don't make statements like this unless you know what you're talking about. Do you know that Sun's JDK release policies prevent them from doing that in the middle of a release? and that they haven't done such a thing in 13 years? Do you have any actual evidence that they are going to change serialVersionUIDs in the middle of a release?
    Therefore, I strongly encourage you to write your own code to persist the tree data into a file.
    I would strongly encourage developers not to use Serialization on Swing objects at all, which curiously enough is what the Javadoc has been saying for ten years. You should use java.beans.XMLEncoder for this. That's what it is for.
    Such a logic is much preferable as it will over-come the issues with serialization.Home-grown code is never preferable to what is provided in the JDK.
    The main problem with a version change is that every serializable class uses a special random number stored in a private static field called serialVersionUID.That's not a 'problem'. That's part of the solution.
    Every new version of the class changes this unique number.Only if you don't declare your own static final long serialVersionUID.
    This mechanism allows developers to version their new releases and ensures that serialization and deserialization operations remain consistent across multiple-versions and prevent invalid state of the object.Exactly. I suggest you read the Versioning section of the Serialization specification before posting again on this topic, and also read up on Long Term Persistence in Java Beans. You have much of this information back to front, and you don't appear to have heard of either defining your own serialVersionUID or Long Term Persistence.
    And your claim that Sun will change serialVersionUIDs in the middle of Java release 6 is just ludicrous.

  • [svn] 1648: This checkin makes public our modifications to Velocity 1. 4 which make the parse tree serializable.

    Revision: 1648
    Author: [email protected]
    Date: 2008-05-09 14:24:44 -0700 (Fri, 09 May 2008)
    Log Message:
    This checkin makes public our modifications to Velocity 1.4 which make the parse tree serializable.
    Velocity has a slow parser and template lookup mechanism so we save 25% time in the MXML compiler by only using merge at runtime and loading a serialized form of the parse tree from the classpath.
    There's a simple class flex.util.SerializedTemplateFactory that has a main method to serialize a template and a load method to load a template.
    Another significant change is that macros and their arguments are not parsed at runtime; we parse them once at parse time and they are just evaluated at runtime. The original Velocity liked to concatenate tokens in its production rules and then re-parse at runtime.
    It turns out that re-serializing the parse trees is still pretty expensive, so the next step would be to codegen a Java class that does all the velocity actions without any of the Velocity runtime necessary.
    Bugs: -
    QA: No
    Doc: No
    Reviewer: Jono
    Modified Paths:
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/app/VelocityEngin e.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/Runtime.j ava
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/RuntimeCo nstants.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/RuntimeIn stance.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/RuntimeSe rvices.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/RuntimeSi ngleton.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/Velocimac roFactory.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/Velocimac roManager.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/directive /Foreach.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/directive /Include.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/directive /Macro.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/directive /VMProxyArg.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/directive /VelocimacroProxy.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/Pa rser.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/Pa rser.jj
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/Pa rser.jjt
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/To ken.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/bu ild
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTComment.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTDirective.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTEscape.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTEscapedDirective.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTIdentifier.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTMethod.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTNumberLiteral.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTReference.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTSetDirective.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTStringLiteral.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTText.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/ASTWord.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/Node.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/runtime/parser/no de/SimpleNode.java
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/org/apache/velocity/util/introspectio n/Info.java
    Added Paths:
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/flex/
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/flex/util/
    flex/sdk/trunk/modules/thirdparty/velocity/src/java/flex/util/SerializedTemplateFactory.j ava

    Dave,
    First of all, THANK YOU! THis is extremely timely and helpful; exactly what I've been looking for.
    I'm with you all the way until the end, right here:
    wrap the elements into the required delimiters.
    my $returnValue = sprintf('"%s" <%s> (%s) [%s]', $displayName, $emailAddress, $username, $userIdentifier);
    return ETC, ETC
    Did this part lose some formatting in the post? Where are the line breaks? Is it one unbroken string?
    Dual 2GHz G5   Mac OS X (10.4.6)  
    Dual 2GHz G5   Mac OS X (10.4.6)  
    Dual 2GHz G5   Mac OS X (10.4.6)  

  • What is the use of Marker Interfaces?

    What is the use of marker interfaces?
    As it is not having any methods or fileds what is the benefit I will get by implementing those interfaces?
    Servlet implements SingleThread
    What it will do behind the scenes exactly as singleThread model is marker interface

    The use of marker interfaces is to act as markers (shock horror)
    It is quite a common way to tell a program what a class can/can't do: Cloneable, Serializable etc etc
    This doesn't change the functionality of the class itself, but is more an indication as to what can be done with this class.
    In this case the servlet container can then tell whether or not it implements the interface, and can treat it accordingly. Implementing this interface tells the container you want it to run this servlet in singleThreaded mode.
    Thats all there is to it.
    It would be along the lines of
    Servlet servlet = loadServlet("...")
    if (servlet instanceof SingleThreadModel){
    // Single threaded servlet - start new process for it
    else {
    // regular servlet - reuse existing object.

  • What is the use of Externalizable interface?

    What is the use of Externalizable? and what is the diff b/w Serializable and Externalizable interfaces?

    What is the use of Externalizable?Read the API docs, they explain it.
    and what is the
    diff b/w Serializable and Externalizable interfaces?Well, read the API docs of Serializable, too, and then find the difference.

  • Does FrameMaker 12 have an LEID value for use with serialization via AAMEE?

    Does FrameMaker 12 have an LEID value for use with serialization via AAMEE?

    I wish life was that easy :-).
    You have a valid argument; So I had this kind of test going. I had 50,000 messages of
    type-1 first loaded into the queue. Then I had 100 messages of type-2 loaded on to the
    queue.
    At this point, I issued a conditional dequeue that skipped type-1 messages and only
    asked for type-2 messages. I saw the full table scan.
    Then I created another test case 1 million type-1 messages had to be skipped.
    Still full table scans. I am not convinced that the doing full table scans is the best query
    plan out there. Cost Based Optimizer tends to disagree for some reason. May be
    it is right; But I have to avoid FTS when possible. As you know, not only blocks
    used by the existing rows in the table get scanned, but also every block until the
    high water mark level.
    One might say for a table with volatile data that comes and goes on a daily basis, million is an extreme case. Howvere, I am building a general purpose infrastructure based
    on AQ and cannot rule out consumers who misbehave.
    Are there better ways to handle multiple types of consumers on a single physical queue ? I need to be able dequeue specific consumer types if necessary, and this has to be
    done in a performant manner.
    Other alternatives I can think are
    1. Using a multi consumer queue such that there is one subscriber for each message
    type. Use multiple agent sets in a listen method to listen to messages and then
    control what agents we pass into listen method.
    Any pattern suggestions welcome.
    Thanks
    Vijay

  • How to use Avro Serialization for ASA input

    Hi There,
    I am trying to use Avro serialization format for Streaming Analytics input data. I am using Event Hub as my data source. Based on the answer to a similar question in this forum about CSV format, it seems like ASA expects header/schema information to
    be included with each event, rather than defined externally. So, each of my input events is a proper Avro Data File, with schema included followed by multiple binary records. I have tried to verify this format using the "Test" button in the Azure
    Streaming Portal. When I upload a file containing my Avro event, the portal returns "Unable to parse JSON" error. I have double checked that my input is indeed marked as Avro serialization and not JSON.
    Can you let me know what the expected Avro data format is? 
    Thanks,
    Dave

    Hi Mahith,
    I am now able to reproduce the FieldsMismatchError. I am attaching the log. Could you help debug this issue?
    Correlation ID:
    000593f0-4c05-412b-b096-2cf818bf6e9f
    Error:
    Message:
    Missing fields specified in create table. Fields expected: avgLight, avgOffLight, avgHum, avgLrTemp, avgBrLight, avgBrTemp, avgLrLight, avgOffHum, avgLrHum, avgOffTemp, avgBrHum, avgTemp, groupId, ts. Fields found: avgLight, avgOffLight, avgHum, avgLrTemp, avgBrLight, avgBrTemp, avgLrLight, avgOffHum, avgLrHum, avgOffTemp, avgBrHum, avgTemp, groupId, ts.
    Message Time:
    2015-01-15 00:28:59Z
    Microsoft.Resources/EventNameV2:
    sharedNode92F920DE-290E-4B4C-861A-F85A4EC01D82.hvac-input_0_c76f7247_25b7_4ca6_a3b6_c7bf192ba44a#0.output
    Microsoft.Resources/Operation:
    Information
    Microsoft.Resources/ResourceUri:
    /subscriptions/d5c15d24-d2ef-4443-ba7e-8389a86591ff/resourceGroups/StreamAnalytics-Default-Central-US/providers/Microsoft.StreamAnalytics/streamingjobs/hvac
    Type:
    FieldsMismatchError

  • HT2589 We have purchase 5 apple minis and would like them all on one account.  That way we can monitor the use of these units.  they will be used strickly for a business application.  can I use one account in itunes or must i have multiple.

    We have purchased 5 apple minis and would like them all on one account, that way we can monitor the use of these units.  They will be used strickly for a business application.  Can I use one account in itunes or must i have multiple.

    Not going to happen the way you want it to.
    When you add a gift card balance to the Apple ID, it's available for the Apple ID.
    Probably best to create unique Apple ID's for each... this will also make things easier in the future as purchases are eternally tied to the Apple ID they were purchased with.

  • Wield char with the use of matnr

    Hi All,
    my requirement is like:
    I need 1 selection option which seems like parameter type mara-matnr.
    when I put any material with the using of "*", it sud be fetch all the material with combination.
    I did the code for that but somtime it fails..
    TABLES: rqm00.
    TYPES : BEGIN OF tp_matnr,
              matnr       TYPE mara-matnr,
            END OF tp_matnr.
    DATA: w_text  TYPE string.
    CONSTANTS:  c_wild   TYPE c VALUE '*',
                c_per    TYPE c VALUE '%'.
    DATA: t_matnr  TYPE STANDARD TABLE OF tp_matnr,
          wa_matnr type tp_matnr.
    SELECT-OPTIONS : s_matnr  FOR   mara-matnr  NO INTERVALS NO-EXTENSION.
    IF s_matnr-LOW CA c_wild.
          W_TEXT = S_MATNR-LOW.
          REPLACE ALL OCCURRENCES OF c_wild IN s_matnr-LOW WITH c_per.
    ENDIF.
      SELECT matnr
             FROM  mara
          INTO TABLE t_matnr
          WHERE matnr LIKE S_MATNR-LOW.
    IF SY-SUBRC = 0.
    loop at t_matnr into wa_matnr.
    write: wa_matnr-matnr.
    endloop.
    ENDIF.
    What should I do? what is the right solution which should not be fail in any condition.
    Thanks & Regards,
    Jaten Sangal
    Edited by: Jaten.sangal on Nov 18, 2009 11:26 AM

    Hi
    I just Executed this Code and working Fine
    TABLES: rqm00.
    TYPES : BEGIN OF tp_matnr,
    matnr TYPE mara-matnr,
    END OF tp_matnr.
    DATA: w_text TYPE string.
    CONSTANTS: c_wild TYPE c VALUE '*',
    c_per TYPE c VALUE '%'.
    DATA: t_matnr TYPE STANDARD TABLE OF tp_matnr,
    wa_matnr type tp_matnr.
    parameters : s_matnr type mara-matnr. " Replace this Parameters and proceed further
    *IF s_matnr-LOW CA c_wild.
    *W_TEXT = S_MATNR-LOW.
    REPLACE ALL OCCURRENCES OF c_wild IN s_matnr WITH c_per.
    *ENDIF.
    SELECT matnr
    FROM mara
    INTO TABLE t_matnr
    WHERE matnr LIKE S_MATNR.
    IF SY-SUBRC = 0.
    loop at t_matnr into wa_matnr.
    write:/ wa_matnr-matnr.
    endloop.
    ENDIF.
    Did you try this one
    Cheerz
    Ram
    Edited by: Ramchander Krishnamraju on Nov 18, 2009 11:41 AM

  • On the use of VARCHAR2 vs. CHAR

    I'm posting an e-mail thread that has been moving around in my organization, whith guidance from an Oracle representative.
    The basic issue concerns the use of CHAR vs. VARCHAR2 when defining a table in Oracle.
    I would like to get some comments from the community at large.
    1. Business semantics should be represented in every aspect of a database, application, and design as far as I am concerned. Noteably, if the business rule at a corporate entity is clearly stated that when using Oracle the use of CHAR should be limited to those attribute implementations which have the following characteristics; a) The attribute may not be null, b) The attribute must have a character in each of the declared positions.
    2. When the Visual Basic application began writing data to the CHAR columns in your application someone should have had a discussion with the developer to find out why this was happening. If the business semantics changed then the logical implemention of the business semantics should have changed as well. That the two were disconnected is not a problem with the CHAR type, it is a problem with the designer or the developer. The bottom line on this instance is that the column should have been defined as a VARCHAR2 data type since the business semantics no longer complied with the criteria set forth in the previous paragraph.
    3. I think Oracle trys to load as much of the data from a table or index into shared memory, in this case the database block buffers, as it can in order to facilitate query operations. If Oracle has enough memory and can load a table or index into memory, it will do so. At the same time the database engine will move previously cached data out of memory to accommodate the new requirement.
    -----Original Message-----
    Thank you for the detail information on CHAR and VARCHAR2. It got me thinking with a DBA hat. I worked as a DBA before and I did use the CHAR type and I will share my experience/thought on CHAR.
    I don't like to use the char type like Tom has advised because Oracle does not check to see if the value being inserted fills up the column or not which can lead to a problem. And there is no performance gain or save space in Oracle.
    I worked as a DBA before, I used char type on the "must fill/always filled" column (pre DMDC). The application was written in VB with Oracle back end. At some point, VB started inserting values that are short of the column width and created a minor problem (it was supposed to be filled column). The problem was quickly identified and fixed, but it caused an issue.
    I realize that I don’t want to define it as a "must fill/always filled" column if you can't enforce it by simply defining the char data type on a table and prevent possible issue in the future.
    For a manager, in order to use the char properly, you have to hire client developers with Oracle experience or provide a basic Oracle training in order to avoid the problem I mentioned above in order to use the char type correctly.
    I think you, Tom and I are saying the same thing really. Only difference is that Tom and I can not think of a good reason why anyone would like to indicate the business semantics using column type on the database, when it can lead to more work/issues.
    In regards to wasted 25 million byes, why would Oracle load the table with 25 million rows? Shouldn't it use an index? Don't you have a serious problem if Oracle is loading table with the 25 million rows?
    Just my two cents... : )
    -----Original Message-----
    May I beg to differ?
    CHAR plays a vital role in the intuitive interpretation of a database schema. If designed correctly, the use of CHAR tells anyone who is in the know that this is a must fill column. Thus if a column is defined as CHAR(3) everyone should know that the column will always contain three characters. Defining the column as VARCHAR2(3) does not tell you anything about the data other than that the column may contain 0-3 characters.
    Also, If a column is defined as CHAR the column should always be populated. One of the nice features of VARCHAR2 is that if the column is defined at the end of a table, there is no storage overhead until that column is actually populated. Thus if you have a table that has an identifier that is nine characters in length and will always be populated with nine characters, an attribute which describes the type of identifier which is contained in the first column and which must always be populated and is a must fill attribute, and another column which is descriptive and may vary in length or not be populated at time of insert; the following definition does not express the business semantics of the entity:
    COL_CD VARCHAR2(9)
    COL_TYP_TXT VARCHAR2(26)
    COL_TYP_CD VARCHAR2(2)
    The above definition also does not take advantage of inherent storage features of Oracle; notably there is a wasted place holder between COL_CD and COL_TYP_TXT and between COL_TYP_TXT and COL_TYP_CD. The next definition does take advantage of the storage features but does not represent the business semantics of the entity:
    COL_CD VARCHAR2(9)
    COL_TYP_CD VARCHAR2(2)
    COL_TYP_TXT VARCHAR2(26)
    The above definition does not waste space storing a place holder between COL_TYP_CD and COL_TYP_TXT if the COL_TYP_TXT may be null. The column separator will only be used when the column contains data. The below definition satisfies both the storage and business semantics issues:
    COL_CD CHAR(9)
    COL_TYP_CD CHAR(2)
    COL_TYP_TXT VARCHAR2(26)
    This may seem pedantic in nature until you consider the situation where there are 25 million rows in the table represented by the above entity. If each row has a NULL COL_TYP_TXT value then the first example wasted 25 million bytes of storage and 25 million bytes of memory if the full table is loaded into memory. This is an issue which cannot be ignored in high volume databases.
    You may wish to know why it is important to define a must fill/always fill column as a CHAR to express the business semantics of an attribute. I can't give a definitive answer to that other than to say that it is just good database manners.
    So please, continue to use CHAR when the shoe fits. Don't throw something away that has use just because it is not popular or in the mode.
    Also, if I am mistaken in any of the above, please feel free to educate me.
    Thanks.
    -----Original Message-----
    Subject: RE: Oracle on the use of VARCHAR2 vs. CHAR
    Ignore if you already got this. This is just FYI.
    -----Original Message-----
    Below is a detailed answer to your VARCHAR2 or CHAR questions from our Database expert Tom Kyte. The short answer is VARCHAR2 is what you want to use. If you have any questions or want to discuss this in more detail let me know.
    A CHAR datatype and VARCHAR2 datatype are stored identically (eg: the word 'WORD' stored in a CHAR(4) and a varchar2(4) consume exactly the same amount of space on disk, both have leading byte counts).
    The difference between a CHAR and a VARCHAR is that a CHAR(n) will ALWAYS be N bytes long, it will be blank padded upon insert to ensure this. A varchar2(n) on the other hand will be 1 to N bytes long, it will NOT be blank padded.
    Using a CHAR on a varying width field can be a pain due to the search semantics of CHAR.
    Consider the following examples:
    ops$tkyte@8i> create table t ( x char(10) ); Table created.
    ops$tkyte@8i> insert into t values ( 'Hello' );
    1 row created.
    ops$tkyte@8i> select * from t where x = 'Hello';
    X
    Hello
    ops$tkyte@8i> variable y varchar2(25)
    ops$tkyte@8i> exec :y := 'Hello'
    PL/SQL procedure successfully completed.
    ops$tkyte@8i> select * from t where x = :y; no rows selected
    ops$tkyte@8i> select * from t where x = rpad(:y,10);
    X
    Hello
    Notice how when doing the search with a varchar2 variable (almost every tool in the world uses this type), we have to rpad() it to get a hit.
    If the field is in fact ALWAYS 10 bytes long, using a CHAR will not hurt -- HOWEVER, it will not help either.
    The only time I personally use a CHAR type is for CHAR(1). And that is only because its faster to type char(1) then varchar2(1) -- it offers no advantages.
    If you just use varchar2 everywhere, no problem
    My advice is, has been, will be very loudly stated as:
    IGNORE THE EXISTENCE OF CHAR.
    period. If you never use char, you never compare char to varchar2, problem solved.
    And if you use char and compare a char(n) to a char(m) they will never compare either.
    Just say NO TO CHAR.
    **************************************************

    Hi,
    >>A CHAR datatype and VARCHAR2 datatype are stored identically (eg: the word 'WORD' stored in a CHAR(4) and a varchar2(4) consume exactly the same amount of space on disk, both have leading byte counts).
    Ok, but on the other hands:
    SGMS@ORACLE10> create table x (name char(10), name2 varchar2(10));
    Table created.
    SGMS@ORACLE10> insert into  x values ('hello','hello');
    1 row created.
    SGMS@ORACLE10> commit;
    Commit complete.
    SGMS@ORACLE10> select vsize(name),vsize(name2) from x;
    VSIZE(NAME) VSIZE(NAME2)
             10            5
    SGMS@ORACLE10> select dump(name),dump(name2) from x;
    DUMP(NAME)                                         DUMP(NAME2)
    Typ=96 Len=10: 104,101,108,108,111,32,32,32,32,32  Typ=1 Len=5: 104,101,108,108,111Cheers

  • Restrict the use of index while quering

    Hi All
    I have a simple emp table with columns empid, name, sal. Empid has a primary key imposed.
    Now when i write a statement like this,
    select * from emp where empid = <value>;
    the optimizer will make use of index.
    The question is........... is there anyway to make oracle bypass the use of index without change in above query.

    Why do you worry of performance issues when the table size is small , when it is huge and the column you r trying use in the query is also indexed the oracle finds the Best execution method to do the execution whether index exists or not , Oracle has a very intelligent Optimizer and no need to use hints unless and until it is really mandatory or when u r using a very complex query where Oracle is not able to deduce the best Execution plan . But by all means you should look at the execution plan how a cerain query Oracle knows of doing it or when u have a diferering opinion then only at that point you force a Optomizer Hint . For other normal cases like the one you are asking it is best to get the results how Oracle executes it and no forcing is required .

  • I was told of an application that will allow the use of a second screen to view my data and files, but I forgot its name. I'd like to make the connection because my LCD is broken.

    I was told of an application that will allow the use of a second screen to view my data and files, but I forgot its name. I'd like to make the connection because my LCD is broken.

    You don't need an application, just plug a compaitble monitor into the display port of your MacBook Pro, set the screen up in System Preferences>Displays

Maybe you are looking for

  • Output SYS_REFCURSOR when cursor structure is not known

    If i have a variable of type "SYS_REFCURSOR". This cursor will be passed to various procedures which open various recordset for that cursor, with various number of columns in cursor. How to output cursor all columns? 1. Maybe java will have metadata

  • My iPad shows that I have apps that need updated but apps do not update.

    My App Store shows I have apps needing updated but nothing is there to update. I have signed out, shutdown & restarted but still nothing. This worked last time, but now same issue again.

  • Moving to a new PC

    My wife is currently using a second license for Acrobat Pro on her lap top and wishes to move it to her new home desk top, please can someone advise us of the procedure? Also, the new computer is running Vista and the version of Acrobat Pro currently

  • Logic 7.1.1

    I know it's old but till now has worked great. I need to know how to assign more memory to the program. Is that possible? I'm working on a project and when I try to save it says "out of memory". Help

  • Customizing the QBE

    Hi, Does anyone know how can I customize the QBE? I want to remove the format mask textbox, the align combo box and the case sensitive check box? any help would very appreciated... thanks in advance, Miguel