Using a variable in "arrayTerminatedBy" clause while using a file adapter

Hi All,
How can read a file of sample shown below using a file adapter.
ABC|20081010|
2008|xxxxxxx|
2007|yyyy|
2009|zzzzzzz|
3|20081010|
first line is the header
last line is footer
middle portion is the body
'3' in the footer is the total no of record count in the body
I am able to read the header and body.
The problem i am facing is; when it is reading the footer it is treating the footer as a record in the body and is throwing an error stating - expected the format as "yyyy"
I have to use "arrayTerminatedBy" to indicate the end of the body. But that terminating field is a varying field. How can i use this variable field in the "arrayTerminatedBy" clause.
Can any one help in reading this file
Thanks in advance
Edited by: user10308218 on 11-Oct-2008 02:23
Edited by: user10308218 on 11-Oct-2008 02:24

See if this helps, I haven't tested it but it will give you a hint in how to achieve it. As you can see I use the startsWith command. I'm not sure how to handle your detail as it seems to start with different elements every time.
cheers
James
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
targetNamespace="http://TargetNamespace.com/Write_File"
xmlns:tns="http://TargetNamespace.com/Read_File"
elementFormDefault="qualified"
attributeFormDefault="unqualified" nxsd:encoding="ASCII" nxsd:stream="chars" nxsd:version="NXSD">
<xsd:element name="FileRecord">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Header" nxsd:startsWith="ABC|" maxOccurs="1">
<xsd:complexType>
<xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
<xsd:element name="FileDate" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;"/>
<xsd:element name="Record" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
<xsd:element name="DetailData1" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;"/>
<xsd:element name="DetailData2" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;"/>
<xsd:element name="Footer" nxsd:startsWith="3|" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
<xsd:element name="FooterData" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Similar Messages

  • How can we use  form variable in where clause while personalization

    Dear,
    I have a requirment for using select in personalization, actully we have created temporary table, now we want to get data from select satatement on event"when-new-record-instance' trigger, now in action tab i have selected action which is property and message, in message column showing value "${item.q_res.transaction_id.value}" it shows on validate button but when this form variable use in action type(property) which is consist on select statement "=SELECT to_char(QTY) FROM TEST_TABLE where transaction_id = ${item.q_res.transaction_id.value}" system didn't get value pressing validate button although there is a single record in customize table while without where cluase was getting data perfectly.
    please advice.

    >
    I am looking for to decode the actual db value something in different for my report.
    like if A then Accepted
    elseif R then Rejected
    elseif D then Denied
    these conditions I have to check in where clause.
    >
    what are you trying to do?
    may be you are looking for
    select * from tab1,tab2
    where a.tab1 = b.tab2
    and
       (decode(:code, 'A','Accepted') = <table_column>
        or
        decode(:code, 'R','Rejected') = <table_column>
       or
        decode(:code, 'D','Denied') = <table_column>
       )

  • Using bind variable with IN clause

    My application runs a limited number of straight up queries (no stored procs) using ODP.NET. For the most part, I'm able to use bind variables to help with query caching, etc... but I'm at a loss as to how to use bind variables with IN clauses. Basically, I'm looking for something like this:
    int objectId = 123;
    string[] listOfValues = { "a", "b", "c"};
    OracleCommand command = new OracleCommand();
    command.Connection = conn;
    command.BindByName = true;
    command.CommandText = @"select blah from mytable where objectId = :objectId and somevalue in (:listOfValues)";
    command.Parameters.Add("objectId", objectId);
    command.Parameters.Add("listOfValues", listOfValues);
    I haven't had much luck yet using an array as a bind variable. Do I need to pass it in as a PL/SQL associative array? Cast the values to a TABLE?
    Thanks,
    Nick

    Nevermind, found this
    How to use OracleParameter whith the IN Operator of select statement
    which contained this, which is a brilliant solution
    http://oradim.blogspot.com/2007/12/dynamically-creating-variable-in-list.html

  • On MacBook Pro unable to print webpage; I get a single blank page. But I can print using Safari. Started last week while using Firefox 3.6. I downloaded Firefox 5.0--same problem.

    On MacBook Pro unable to print webpage; I get a single blank page. But I can print using Safari. Started last week while using Firefox 3.6. I downloaded Firefox 5.0--same problem.

    I am now able to do live broadcasts with my i-sight, but my original problem still exisits....
    Unsolved Problem:I need to be able to broadcast from CamTwist as CamTwist is the only program that will allow me to do what I need to do.   Justin.tv and Ustream.tv do not recognize CamTwist for reasons I can not explain.

  • I brought iphone 4s from UK and using it in India. But while using SIRI, it says, it cant find anything in India. how can I resolve this issue ?

    I brought iphone 4s from UK and using it in India. But while using SIRI, it says, it cant find anything in India. how can I resolve this issue ?

    There are some countries where FaceTime is not option on the iPhone iOS5, and there is no way to put it back, if you bought an iPhone in one of these countries.
    Apple Tells Us Exactly Where FaceTime Is Not Available

  • I just bought my phone few days ago. From the day I bought it I realized the phone heats up after a little use. It gets really hot while using Wifi and downloading. Anyone else having these issues? What's the solution to this?

    From the day I bought it I realized the phone heats up after a little use. It gets really hot while using Wifi and downloading. Anyone else having these issues? What's the solution to this?

    Your VGA is definitely corrupted and it is irreparable, so just make the HP to change your vga.
    Also next time read my post on how to keep your laptop cool to avoid same issues again.
    I assume your laptop was pretty hot during some time and that's the result you've got.
    Make it easier for other people to find solutions, by marking my answer with 'Accept as Solution', if it solves your problem.
    Click on the BLUE KUDOS button on the left to say "Thanks"

  • How to set ENV variable using user profile in solaris 10 while using ssh

    Hi,
    Please help me in setting the environment variable using user profile file while using ssh method of connection (Can I use the same ~/.profile file?)
    when i am logging in using the telnet, the environment variable is automattically set, but not when I am using SSH.
    Thanks in advance
    ushas symon

    Please list your .profile and a ls -la of your home directory.
    also list the result of env after your logged through telnet and ssh.
    There should be no difference - it depends mostly on your login shell which startup script it executes. ksh uses .profile, bash: bash_profile then .profile.

  • Skype keeps quitting when using Skype call to another computer while using

    This does not happen when using to pc's but when I use my Macbook Pro to call back home to my Desktop PC in Taiwan it never fails to disconnect after a few minutes of talk. Anyone else having these problems with Skype quitting when on a VOIP cal from computer to computer. My Skype is the latest verison.

    Hi there stylineexpat,
    I have the exact same issue here with my MBP & 10.5.x.. About 10.. 15 mins or less into the call my mbp drops the call..
    Interestingly enough, my MacPro running 10.4.11 NEVER drops a call to the same people and the same network. I mean .. never drops em.. I have been using Skype for roughly 3 years and haven't had issue until this machine and another MBP I had that was running 10.5 as well.
    I agree, It is a pain.
    I'll look to the Skype user forums too.
    Cheers, ML

  • Getting Error while running a file adapter.

    Hi all,
    I am doing a small application where I need to read an image from a shared path and send the base64code of that image in response. For that I am using File Adapter and Read
    operation. I have just hard coded the image name didnt give any wild card or expressions. I generated a service which is a proxy using the jca of that File Adapter. I added a stage
    replacing the response body with the opaque element of the request body. When I run the proxy I am getting something like *"The invocation resulted in an error: "* in response
    and in the stack trace I am getting *"Failed to set the value of context variable "body". Value must be an instance of {http://schemas.xmlsoap.org/soap/envelope/}Body."* as the fault
    reason I am unable to detect where exactly I am going wrong. Kindly help me in resolving this.
    Thanks,
    Phanindra.

    Not sure why you want to replace. Since the response of the proxy would remain to hold the request body by default.
    If you have stored the opaque element in a variable ($var_opaque), then you can do the following.
    XPath : .
    In variable : body
    Expression : $var_opaque
    Check - "Replace node content"

  • Group By clause while using a Sequence Generator

    Hello, I am performing the following query
    Select c1,c2,c3,sequence_number.nextval,
    sum(c4)
    from table
    group by c1,c2,c3,sequence_number.nextval
    My problem is that when I run this query on our 8.1.5 databases it works with no issues however when I perform this on our newly upgraded 8.1.7 database I am getting the following error: ORA-02287: sequence number not allowed here
    Any insight into if this is a bug or feature would be most appreciated.
    Thanks
    Jeff
    null

    You maybe test with this...
    Hello, I am performing the following query
    Select c1,c2,c3,sequence_number.nextval,
    sum(c4)
    from table
    group by c1,c2,c3,sequence_number.currval
    if you put sequence_number.nextval in the group by you are producing the next sequence. with the currval, you get the actual sequence.
    null

  • Using a Variable Prompt - In an analysis using Top N filter (URGENT)

    Hi Experts
    I have created a variable prompt that is setup in the following way :
    Prompt Name : Number_of_rows
    User Input : Radio Buttons
    Radio Button Values : *1/ 2* (Custom Values)
    Variable Data Type : Number
    Default Selection : *1* (Specific Custom Value)
    I have an analysis/ report that has the following columns Customer ID | Number of Orders
    I have applied a top N filter to this report using the varibale prompt :
    *Number of Orders  is in top  @{Number_of_rows}* (which is equivelent to Number of Orders is in top 1 or 2)
    However when I view the report im getting the following error
    View Display Error
    Error getting drill information: SELECT "Customer"."Customer ID" saw_0, "Sales Facts"."Number of Orders" saw_1 FROM "Sales" WHERE TOPN("Sales Facts"."Number of Orders",Number_of_rows) <= Number_of_rows
    Error Details
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Location: saw.views.evc.activate, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool, saw.threadpool, saw.threads
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27005] Unresolved column: "Number_of_rows". (HY000)
    SQL Issued: {call NQSGetLevelDrillability('SELECT "Customer"."Customer ID" saw_0, "Sales Facts"."Number of Orders" saw_1 FROM "Sales" WHERE TOPN("Sales Facts"."Number of Orders",Number_of_rows) <= Number_of_rows')}
    Please can you help
    Kind Regards
    Hiten
    Edited by: #:::HITEN:::# on 29-Nov-2012 04:24

    I'll put this as below
    My prompt will have the TopN which can be formated by TopN Orders and setting this as Presentation variable as N
    SELECT TOPN("#Sales",10) FROM "SA" order by Product
    In the report I'm using same column (Orders) with expression as below.
    TOPN("#Sales", cast(@{N}{2} as int))
    If this is not helpful for you then try to pass some default value for the Presentation variable

  • How can I use JTextField as JTable cell editor while using AbstractTableMod

    I use this code but can not edit field
    import javax.swing.table.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.text.*;
    public class Main extends JFrame {
    JTable table;
    MyTableModel tableModel;
    public Main() {
    super("Colored JTable Demonstration");
    tableModel = new MyTableModel(10, 5);
    table = new JTable(tableModel);
    DefaultTableCellRenderer colorRenderer = new DefaultTableCellRenderer() {
    public void setValue(Object value) {
    if (value instanceof ColoredItem) {
    Color fcolor = ((ColoredItem) value).getForeground();
    Color bcolor = ((ColoredItem) value).getBackground();
    this.setForeground(fcolor);
    this.setBackground(bcolor);
    setText(((ColoredItem) value).getValue());
    table.setDefaultRenderer(Object.class, colorRenderer);
    //table.setDefaultEditor(Object.class, new DefaultCellEditor(new JTextField()));
    //Set up real input validation for the integer column.
    TableCellEditor editor = new DefaultCellEditor(new JTextField()) {
    public Component getTableCellEditorComponent(JTable table,
    Object value, boolean isSelected, int row, int column) {
    super.getTableCellEditorComponent(table, value, isSelected,row, column);
    JTextField myField = (JTextField) getComponent();
    //myField.setDocument(new ValidDocument());
    return myField;
    //if(value==null) return null;
    //return null;
    int numbercolumn = table.getColumnCount();
    for(int i = 0; i< numbercolumn ; i++){
    table.getColumnModel().getColumn(i).setCellEditor(editor);
    // table.getColumnModel().getColumn(i).setCellRenderer(new ColorRenderer());
    //table.validate();
    JScrollPane scrollPane = new JScrollPane(table);
    getContentPane().add(scrollPane, BorderLayout.CENTER);
    JPanel radioPanel = new JPanel(new GridLayout(1, 5));
    JRadioButton redRadio = new JRadioButton("Red");
    JRadioButton greenRadio = new JRadioButton("Green");
    JRadioButton blueRadio = new JRadioButton("Blue");
    JRadioButton yellowRadio = new JRadioButton("Yellow");
    JRadioButton blackRadio = new JRadioButton("Black");
    // Group the radio buttons.
    ButtonGroup group = new ButtonGroup();
    group.add(redRadio);
    group.add(greenRadio);
    group.add(blueRadio);
    group.add(yellowRadio);
    group.add(blackRadio);
    radioPanel.add(redRadio);
    radioPanel.add(greenRadio);
    radioPanel.add(blueRadio);
    radioPanel.add(yellowRadio);
    radioPanel.add(blackRadio);
    RadioListener radioListener = new RadioListener();
    redRadio.addActionListener(radioListener);
    greenRadio.addActionListener(radioListener);
    blueRadio.addActionListener(radioListener);
    yellowRadio.addActionListener(radioListener);
    blackRadio.addActionListener(radioListener);
    // add radiopanel to container
    JPanel panel = new JPanel(new GridLayout(2, 1));
    panel.add(new JLabel("Select color for selected cell:"));
    panel.add(radioPanel);
    getContentPane().add(BorderLayout.SOUTH, panel);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    class ValidDocument extends PlainDocument {
    public void insertString(int index, String s, AttributeSet a)
    throws BadLocationException {
    if ((s == null) || (s.length() == 0)) {
    return;
    StringBuffer t = new StringBuffer(getLength() + s.length());
    t.append(getText(0, index));
    t.append(s);
    t.append(getText(index, getLength() - index));
    if(s.equals("1") && t.toString().equals("1")){               
    super.insertString(index, s, a);
    if(s.equals("0") && t.toString().equals("0")){
    super.insertString(index, s, a);
    if(s.equals(".") && t.toString().equals("0.")){
    super.insertString(index, s, a);
    if(s.equals("5") && t.toString().equals("0.5")){
    super.insertString(index, s, a);
    if(s.equals("b") && t.toString().equals("b")){
    super.insertString(index, s, a);
    //if (super instanceof ColoredItem) {
    // Color fcolor = ((ColoredItem) value).getForeground();
    // Color bcolor = ((ColoredItem) value).getBackground();
    // this.setForeground(fcolor);
    // this.setBackground(bcolor);
    //super.setText(t.toString());
    System.out.println("hehe");
    class RadioListener implements ActionListener {
    public void actionPerformed(ActionEvent ae) {
    int row = table.getSelectedRow();
    int column = table.getSelectedColumn();
    ColoredItem ci = (ColoredItem) tableModel.getValueAt(row, column);
    if (ae.getActionCommand().equals("Red"))
    ci.setBackground(Color.red);
    else if (ae.getActionCommand().equals("Green"))
    ci.setBackground(Color.green);
    else if (ae.getActionCommand().equals("Blue"))
    ci.setBackground(Color.blue);
    else if (ae.getActionCommand().equals("Yellow"))
    ci.setBackground(Color.yellow);
    else if (ae.getActionCommand().equals("Black"))
    ci.setBackground(Color.black);
    System.out.println(ci.getValue());
    // necessary to cause a fireTableCellUpdated event
    tableModel.setValueAt(ci, row, column);
    private class ColoredItem {
    private String value;
    private Color foreground;
    private Color background;
    public ColoredItem(String value, Color foreground, Color background) {
    this.value = value;
    this.foreground = foreground;
    this.background = background;
    public void setValue(String value) {
    this.value = value;
    public void setForeground(Color foreground) {
    this.foreground = foreground;
    public void setBackground(Color background) {
    this.background = background;
    public String getValue() {
    return value;
    public Color getForeground() {
    return foreground;
    public Color getBackground() {
    return background;
    class MyTableModel extends AbstractTableModel {
    String [] columnNames;
    ColoredItem [][] data;
    MyTableModel(int rows, int columns) {
    columnNames = createColumnElements(columns);
    data = createTableElements(rows, columns);
    public int getColumnCount() {
    return columnNames.length;
    public int getRowCount() {
    return data.length;
    public String getColumnName(int col) {
    return columnNames[col];
    public Object getValueAt(int row, int col) {
    return data[row][col];
    public Class getColumnClass(int c) {
    return getValueAt(0, c).getClass();
    public void setValueAt(ColoredItem value, int row, int col) {              
    data[row][col] = value;
    //System.out.println((ColoredItem)value.getValue());
    //temp.setValue((ColoredItem)value.getValue());
    fireTableCellUpdated(row, col);
    private String[] createColumnElements(int columns) {
    String[] data;
    data = new String[columns];
    for (int i=0; i<columns; i++) {
    data[i] = new String("Column " + i);
    return data;
    private ColoredItem [][] createTableElements(int rows, int columns) {
    ColoredItem [][]data;
    data = new ColoredItem[rows][];
    for (int i=0; i<rows; i++) {
    data[i] = new ColoredItem[columns];
    for (int j=0; j<columns; j++) {
    data[i][j] = new ColoredItem("", Color.black, Color.white);
    return data;
    public boolean isCellEditable(int rowIndex, int columnIndex) {
    return true;
    public static void main(String []args) {
    Main main = new Main();
    main.pack();
    main.setVisible(true);
    }

    JTextField jtxf=new JTextField();
         private void setColumns() {
    TableColumn column = null;
    if(this.getRowCount()>0){
    for (int i = 0; i < this.getColumnCount(); i++) {
    column = this.getColumnModel().getColumn(i);
              DefaultCellEditor dce = new DefaultCellEditor(jtxf);
              column.setCellEditor(dce);
              dce.setClickCountToStart(1);
    simply call this method in constructor it will help u

  • Can you use GPS and get Live Traffic while using Turn By Turn?

    I can see the traffic if I am not using the turn by turn but as soon as I get directions Somewhere the traffic does not display. I have to cancel the navigation so it appears. Is this normal? It does this on both apple maps and google maps.

    Can someone please help me?
    thanks

  • Can I use my home WiFi's data while using Personal Hotspot

    at the moment I'm using my personal hotspot at home, as I have no ethernet cord to run from my router to PC
    Is there someway that I can connect my phone to WiFi and then use that through my computer? or is the only way to use my own data that comes with my phone?
    This would be a great help.
    Thanks!

    It should be using your data. The hotspot connection is via 3G and is supported by your carrier. It can use wifi to connect to your computer, but it cannot use the wifi to provide the data.
    How can you connect your computer to wifi anyway. You talk about the inability to connect your computer to the router, but then you want to connect the comptuer to wifi from your router, but still want to use the Personal Hotspot. This does not make any sense. Does the router have the ability to do wifi? If so, you don't need the hotspot, just connect the PC to the router via wifi.

  • ITunes Error when using Nas drive..Error occurred while converting the file the disk can not read from or written to

    This is the error I get only when trying to convert a file to AAC.  I have my itunes library stored on a network drive it all works fine I can add files sync files with my devices exc.  Only when I dry to convert a flie from mp3 to AAC do I get this error.  Any one have any suggestions.
    Thanks
    Rick

    I wonder if the disk being referred to is actually your iPod which is not plugged in. Maybe something has stuck thinking the iPod should be there.
    Try completely removing all the iTunes related programs according to this method.
    http://support.apple.com/kb/HT1923
    Restart you PC and see if startup improves.
    If it doesn't improve you need to consider the possibility that there is something else going on.
    If The problem goes away, hopefully a fresh install will be OK.

Maybe you are looking for

  • Best practice for SCEP definition ADR?

    This is how I understand the best practice to be for configuring the SCEP definition ADR: Have synchronization run once per day during non peak hours  Configure the SCEP definition ADR to run after each synchronization rather than running in interval

  • Remote disc installation of CS3 fails on disc 2 of 2

    I'm using a Mac Book Pro to install Adobe Creative Suite 3 - Web Premium, onto my Macbook Air, using the remote disc feature in Mac OSX. The first installation disc (applications) installs and then it asks for the second disc (content) to be loaded -

  • I need help in finding ways to improve the speed of Firefox

    Hello Everyone, A week ago after using 'system restore' an error message came up saying "XPCOM failed to load". Not really knowing what to do I rebooted my computer using the "Last know configuration to have worked" or something to that effect and th

  • Create table space command with no specification of data file path.

    I am using following command for creating table space in oracle 11g CREATE TABLESPACE testTbSpace DATAFILE 'dataFileName.dbf' SIZE 50M REUSE AUTOEXTEND ON NEXT 1M MAXSIZE 32767M NOLOGGING" But it is creating datafile dataFileName.dbf at disk at follo

  • Who has upgraded to 3.1.1 trouble free

    I have been hesitant to upgrade due to all of the negative comments about 3.0. I was wondering if people have actually had no problems with the upgrade. How are things going? Is it worth the time and trouble?