Need Help in Formatting Spool data

Hi,
Can anyone of you let me knw how to obtain the output flat file in the below format ?
"ID"|"NAME"|"PARENT_ID"
"NQ TEL"|"14"|"Macetown"
But I am gettin the output.. as below.
VENDOR_NAME||'|'||VENDOR_ID||'|'||CITY
NQ TEL|14|Macetown
NA TEL|14|Molokai
I am using the following script in SQL PLUS and calling it with @ < file path>.
set heading on
set echo off
set feedback off
spool Y:\Spool\output1.txt
select Vendor_Name || '|' || Vendor_ID || '|' || City from vendor where city like 'Ma%';
spool off;
set feedback on
set echo on
set heading on
Can anyone help me on this.? In Addition to this, I also need to remove the line separating Header and the Data .
Thanks a ton. :)

Try this:
select ' " ' || Vendor_Name || ' " ' || ' "|" ' from vendor where city like 'Ma%';

Similar Messages

  • Need help in formatting the Date - Date does not

    Need help in formatting the Date - Date does not formats and give Not a valid month error in the below scenario.
    select oc.ST_PGM_MGR, r.ag_dnum, get_major_work_type(r.perf_eval_rtng_id) "v_work_code", r.ag_dnum_supp "supp", r.intfinal, to_char(r.formdate,'MM/DD/YYYY') "formdate", to_char(r.servfrom,'MM/DD/YYYY') "srv_from", to_char(r.servto,'MM/DD/YYYY') "srv_to", descript, add_months(to_char
    --- Bellow line of Code on trying to format it to mm/dd/yyyy gives the error
    (r.formdate, 'DD-MON-YYYY'),12) "formdate2"
    from  table REdited by: Lucy Discover on Jul 7, 2011 11:34 AM
    Edited by: Lucy Discover on Jul 7, 2011 1:05 PM

    Your syntax is wrong - look at the post above where this syntax is given:
    to_char (add_months(r.formdate,12), 'MM/DD/YYYY') "formdate2"Look at the formula from a logical perspective - "inside out" to read what is happening -
    take formdate, add 12 months
    add_months(r.formdate, 12)then apply the to_char format mask - basic syntax
    to_char(date, 'MM/DD/YYYY')Compare to your syntax:
    to_char(add_months(r.formdate, 'MM/DD/YYYY'),12) "formdate2"You will see your format string inside the call to add_months, and your 12 inside the call to to_char.
    Good luck!

  • Need help for Format HD

    Hi I need Help for Formating HD so Wat Key need hold on start up for format HD I apprciated you Help

    Jesus:
    Formatting, Partitioning Erasing a Hard Disk Drive
    Warning! This procedure will destroy all data on your Hard Disk Drive. Be sure you have an up-to-date, tested backup of at least your Users folder and any third party applications you do not want to re-install before attempting this procedure.
    • With computer shut down insert install disk in optical drive.
    • Hit Power button and immediately after chime hold down the "C" key.
    • Select language
    • Go to the Utilities menu (Tiger) Installer menu (Panther & earlier) and launch Disk Utility.
    • Select your HDD (manufacturer ID) in left side bar.
    • Select Partition tab in main panel. (You are about to create a single partition volume.)
    • _Where available_ +Click on Options button+
    +• Select Apple Partition Map (PPC Macs) or GUID Partition Table (Intel Macs)+
    +• Click OK+
    • Select number of partitions in pull-down menu above Volume diagram.
    (Note 1: One partition is normally preferable for an internal HDD.)
    • Type in name in Name field (usually Macintosh HD)
    • Select Volume Format as Mac OS Extended (Journaled)
    • Click Partition button at bottom of panel.
    • Select Erase tab
    • Select the sub-volume (indented) under Manufacturer ID (usually Macintosh HD).
    • Check to be sure your Volume Name and Volume Format are correct.
    • Click Erase button
    • Quit Disk Utility.
    cornelius

  • Need help in logging JTDS data packets

    Hi All,
    I m having web application which uses SQL Server database.
    I have to find out some problems in database connection for that there is need to log the jtds data packets.
    I have tried to use class net.sourceforge.jtds.jdbc.TdsCore but in constructor of TdsCore class there are two parameters needed one is ConnectionJDBC2 and another is SQLDiagnostic.
    I have tried a lot but it did not allow me to import class *SQLDiagnostic*.
    I need help in logging JTDS data packets. If there are any other ways or any body having any idea about logging JTDS data packets/SQLDiagnostic.
    Please reply it is urgent...!!
    Thanks in advance......!!

    if you want to use log4j then,
    in your project create a file called log4j.properties and add this
    # Set root logger level to INFO and its only appender to ConsoleOut.
    log4j.rootLogger=INFO,ConsoleOut
    # ConsoleOut is set to be a ConsoleAppender.
    log4j.appender.ConsoleOut=org.apache.log4j.ConsoleAppender
    # ConsoleOut uses PatternLayout.
    log4j.appender.ConsoleOut.layout=org.apache.log4j.PatternLayout
    log4j.appender.ConsoleOut.layout.ConversionPattern=%-5p: [%d] %c{1} - %m%n
    log4j.logger.org.apache.jsp=DEBUG
    #Addon for
    com.sun.faces.level=FINEGo to your class and add this line
    private static final Logger logger = Logger.getLogger("classname");and then you can use
    logger.info();
    logger.error();
    methods

  • Need help in loading master data.

    Hi everyone,
              I am just a beginner in BI 7.0 . I know Bw 3.5 . I need help in loading master data(flat file) in a step by step manner.
    Before posting this forum i searched and checked out other related forums too, as i am a beginner i am unable to follow them. Lots of the forums gave the help.sap.com link which i used and got a little help but not fully, so please don't send that link.  I need a step by step guideline from somebody, which says everything from the beginning till monitoring say like
    e.g.. 1) create a InfoObject by right clicking on InfoObject catalog.
    something like that.
    please help me get a clear and detail step by step procedure to load a master data (Flat File should be good) which may help me get a start will other things without much help.
    Please help me learn.
    Thanks.
    Ranjani.

    HI,
         Thanks for your reply. This is what i did.
    1) Created a Info Area.
    2) Created Info object catalog & activated
    3) created info object with nothing except some 4 attributes.
    4) Created Application compound in Infosource tab.
    5) Right clicked on Application compound and chose create Infosource in which chose a option with 3.x and chose the flexible update and gave the info object name.
    6) In info provider tab , in the Info Area right clicked and chose the Insert char as data target option.
    Now, i am stuck. I have no idea what to do next.
    I know i have to create a transformation - There are two tabs in Transformation box, what should i do there.
    Please help me from point 6 to cont., to load the data.
    Thanks.

  • Need help in fetching requested data from JSP

    Hello,
    I really need help in fecthing requested data from JSP to servlet. Can anyone assist me as soon
    as possible because I must finish my program by today.....( 20/02/2002).
    Thanks in advance.

    It is very likely that somebody can help you, if you say what your problem is. In fact somebody might already have helped you. What is your problem?

  • I need help highlighting an expiration date on my Numbers '09 spreadsheet. I want the text/fill of a cell to change color when the expiration date of an item is within 180 days of the current date.

    I need help highlighting cells on my Numbers '09 spreadsheet.  I want the cell text/fill to change color when the date is 180 days or less from the current date.  I already have a cell with the current date in it.  I also know how to change the fill/text colors.  All the cells have been formatted to show date only.  I am having trouble with the formula.  I can get to the Conditional Formatting menu and select "With Dates" but after that I am lost.  Can anyone help?
    Thank you for any assistance.
    B

    Set a Conditional Format rule as shown in the illustration below. The rule has been applied to all dates in column B of the table.
    Regards,
    Barry

  • Need help in formating a form dealing with negative currency

    Need Help!!!
    Creating forms in Adobe acrobat Pro I could format a number cell to calculate additions/subtractions of currency. If the result was negative I could get the cell to show the negative result in red text and show parentheses around them. How can I do that in LiveCycle?
    If i have to use formcalc - what would i type in?

    In LiveCycle can be done using the Numeric Field object and some formcalc script.
    Use the "Numeric Field" from the Object Library. For the Field patterns (Select the placed numeric field, On object Window Object -> Field) use "num.currency{}" to show the currency(Ex: $) and "parentheses" if its negative. Write some script to show red text/border in red .
    On exit event of the Numeric Field here is the script:
    if($.rawValue <0) then $.font.fill.color.value = "255,0,0" endif  // This will make entire text in red color if the value is negative.
    if($.rawValue <0) then $.validate.nullTest = "error" endif      //This will make border of the field in red color if the value is negative.
    Hope this helps.

  • Need help in stroring CLOB data into a table

    Hi All,
    I have a CLOB data. Which contains delimited data.
    Example:
    "111#|#ABC#|#asfsdffgh $|$222#|#XYZ#|#jdsfgdskdsf $|$"
    #|# - is column delimiter.
    $|$ - is row delimiter
    I want to extract and store the above data into a table which has 3 columns. Need help.
    I have Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    Thanks in advance,
    Girish G

    Hi Girish,
    Please go through the below url's...It will give you fair idea and solution. HOpe you know the sql *loader utility. or external table.
    http://www.oracle-base.com/articles/10g/LoadLobDataUsingSqlLoader.php
    http://www.oracle-base.com/articles/10g/ExternalTablesContainingLobData.php
    KPR.

  • Need Help with Format/Partition.. using cmd

    Okay guys.. Im kinda sick of trying to get my Recovery to work. Seems like its about to finish and everything is perfect.. then suddenly I get an error message saying that Recovery didnt work, or something like that..
    I figured I might as well try starting with a fresh hard drive, then trying the recovery again..
    So someone told me that if I have the HP Recovery disks, then I would be able to try them, even on a brand new hard drive, or a formatted one or whatever..
    Is this true?
    If so, then what I am asking you guys, is, if there is anybody that would be able to help guide me thru the steps needed, in order for me to Format my hard drive, & then partition it or whatever…
    & I wanna be able to do all this, using cmd (command prompt)
    So Please.. anyone.. your help would be greatly appreciated..
    I have an HP Pavilion dv6653cl
    Thanks!!

    Hi,
    There's no need to pre-format a new Hard Drive - if you perform a 'Factory Reset' using your Recovery Discs, these will perform a quick format and also re-create all the original partitions on the new drive as part of the process.
    A complete guide to using Recovery Discs can be found on the relevant link below.
    Performing An HP System Recovery - Windows 7.
    Performing An HP System Recovery - Windows Vista.
    Performing An HP System Recovery - Windows XP.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Java Experts please help - SimpleDateFormat.format reduces date by a day !!

    Hi,
    I am facing a very weird problem with SimpleDateFormat class. The input Date to SimpleDateFormat.format method is getting reduced by ONE DAY. This problem is happening at random and is not reproducible at will. Any help/pointers to resolve this issue is very much appreciated !!.
    Code is similar to the following code lines
    input = "2003-11-01 00:00:00.000000000";
    output = 31-Oct-2003 (strange !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.text.DateFormatSymbols;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.Hashtable;
    import java.util.Locale;
    import java.util.TimeZone;
    import java.util.SimpleTimeZone;
    public class DateTester {
    /** Default constructor for Util.
    public DateTester() {
    private static String replace(String pattern, String from, String to) {
    return replace(pattern, from, to, null);
    private static String replace(String pattern, String from, String to, String notFrom) {
    StringBuffer sb = new StringBuffer();
    boolean finished = false;
    int index = pattern.indexOf(from);
    if (index < 0) return pattern;
    do {
    if (notFrom == null ||
    notFrom.length() + index > pattern.length() ||
    !pattern.substring(index, index + notFrom.length()).equals(notFrom)) {
    sb.append(pattern.substring(0, index));
    sb.append(to);
    sb.append(pattern.substring(index + from.length()));
    finished = true;
    } else index = pattern.indexOf(from, index + from.length());
    while (!finished && index >= 0);
    if (!finished) return pattern;
    return sb.toString();
    public static void main(String[] argv) {
              String pattern = "DD-MON-YYYY";
    System.out.println("original pattern =" + pattern);
    pattern = replace(pattern, "FM", "");
    pattern = replace(pattern, "AD", "G");
    pattern = replace(pattern, "A.D.", "G");
    pattern = replace(pattern, "BC", "G");
    pattern = replace(pattern, "B.C.", "G");
    pattern = replace(pattern, "AM", "a");
    pattern = replace(pattern, "A.M.", "a");
    pattern = replace(pattern, "PM", "a");
    pattern = replace(pattern, "P.M.", "a");
    pattern = pattern.replace('\"', '\t');
    pattern = pattern.replace('\'', '\"');
    pattern = pattern.replace('\t', '\'');
    pattern = replace(pattern, "DDD", "DDD");
    pattern = replace(pattern, "DAY", "dd");
    pattern = replace(pattern, "DD", "dd", "DDD");
    pattern = replace(pattern, "HH24", "HH");
    pattern = replace(pattern, "HH12", "KK");
    pattern = replace(pattern, "IW", "ww");
    pattern = replace(pattern, "MI", "mm");
    pattern = replace(pattern, "MM", "MM", "MMM");
    pattern = replace(pattern, "MONTH", "MMMMM");
    pattern = replace(pattern, "MON", "MMM");
    pattern = replace(pattern, "SS", "ss");
    pattern = replace(pattern, "WW", "ww");
    pattern = replace(pattern, "W", "W");
    pattern = replace(pattern, "YYYY", "yyyy");
    pattern = replace(pattern, "YYY", "yyy");
    pattern = replace(pattern, "YY", "yy");
    pattern = replace(pattern, "Y", "y");
    pattern = replace(pattern, "RRRR", "yyyy");
    pattern = replace(pattern, "RRR", "yyy");
    pattern = replace(pattern, "RR", "yy");
    pattern = replace(pattern, "R", "y");
    System.out.println("converted pattern =" + pattern);
    String origDate = "2003-11-01 00:00:00.000000000";
    System.out.println("original date =" + origDate);
    Timestamp origTimeStamp = Timestamp.valueOf(origDate);
    SimpleDateFormat sdf = new SimpleDateFormat(pattern, Locale.getDefault());
    sdf.setLenient(false);
    String formattedDate = sdf.format((Date) origTimeStamp);
    System.out.println("formatted date =" + formattedDate);
    Thanks a lot for your time !

    Your code is too hard to read for me to look at it in great detail. When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read.
    However, I'm guessing it's a TimeZone issue. The midnight on 11/1 that you're setting is probably getting converted to GMT somewhere before the Date object is created. If you're in the U.S., then that's afternoon or evening on 10/31.
    Try:
    * Starting with a time that's later in the day on 11/1.
    * Formatting your date to include time and timezone when you print it. (Just for testing--you can put it back once you understand what's going on
    * Reading the Calendar, Timzone, Date, etc. APIs closely.
    * Reading any tutorials or texts you can find on the subject.
    * Writing a bunch of very small and simple tests to get an understanding of how this all fits together.
    Date/Time/TZ handling in Java is kinda tricky.

  • Need help in formatting the report created using SSRS

    I have created an image and used it as the body background. But I want that image to come at right
    Set bodyRepeat as RepeatY. 
    Currently its showing as below              I need this blue image at the right most side of the report as below
    Also I need to display text on the image.
    Need Help!!!
    Abhinav

    Hi AbhinavSultania,
    According to your description, you created a report and added background image to it, you want to display the image at right side of the report and display text on the image.
    According to my knowledge, we could not control position of background image, as a workaround, we can refer to the following steps:
    Create an image with the blue line at right side of it using Paint.
    Right-click body of the report to open Body Properties dialog box, then import the image as background image.
    Drag text box from Toolbox to the blue line of the image. Right-click inside of the text box and click Expression, we can use expression to show dynamic contents at runtime.
    The following screenshot is for your reference:
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • I need help parsing a  swift data string

    i need to parse swift financial data
    is there a way to use split or stringtokenizer for ::
    and keep the :: as part of the new seperated data.
    i want to put each string starting with :: on a seperate line in a text box.
    i gave up and tried it with a loop and a stringbuffer , and indexof.
    if (line.indexOf("::") == Strpos ){
    frame.jTextArea1.append(displayline.toString());
    displayline = new StringBuffer();
    displayline.append(line.substring(Strpos, (Strpos + 2)));
    Strpos += 2;
    if (line.indexOf("::") != Strpos ) {
    displayline.append(line.substring(Strpos, Strpos + 1));
    System.out.println( displayline);
    Strpos++;
    but i cant get that to work either.
    if anyone knows how to parse swift data please give me your email address.
    i've been doing it in cobol for 15 yrs and i just cant get the cobol techniques to translate to java.
    thanks.

    as i said
    i am really a cobol guy
    and yes as you see i did try to use indexof in my code.
    but there must be something about indexof that i'm not getting.
    it works the first time in the loop but then as i increment my start position(strpos)
    the indsex of no longer works.
    am i using the correct technique to increment the start position thru the string buffer.
    thanks guys.

  • Need help to format data

    Hi Gurus,
    I am extracting the field "CATEGORY" from oracle to BW. But I found data in the InfoCube is in exponential format (Example Cateory = 4.1030000000000000E+03 ). I don't need data in exponential format. What's the best way to fix this problem.
    Thanks
    Liza

    Hi,
    Check the downloaded file from Oracle. I guess, you opened up in Excel and then loaded into BW.
    Open it in Notepad and suppose you are creating .csv file, then open it as text file in the Excel.
    Hope, it helps.
    Thanks
    Viswa

  • Seek help to format spool file from SQL*PLUS

    I am running a Unix shell script to call a Oracle 11g SQL script from a Oracle database. In this SQL script, I need to connect to many different remote databases to select data, then sool these records as one big text file to a directory. Then email the file to related Group users. In the spool file, there is a line on the top of each page like this:
    DUMMY
    DB_NAME
    I know this is caused by connect to remote database in SQL*PLUS. My connection string is like this:
    Conn system/password@Oracle_SID
    How can I remove these lines or how to skip these lines into spool file? Please advise. Thanks in advnce. Wish all of you Happy New Year!!!

    Hi,
    It sounds like you have some kind of formatting (such as SQL*Plus TTITLE) producing the output you don't want. If that's the case, temporarily stopping the spooling might not help you. Find out what is causing the output that you don't want. You say that you know it is caused by the CONNECT statements, but it must be more than that. I've written scripts with CONNECT statements that don't have anything like what you reported at the top of each page; in fact, they don't even have pages: the output is one continuous stream. Find out what's putting the unwanted output there, and that will be a big clue as to how you can stop it.
    You say that you know the unwanted titles are there because of the CONNECT statements. If so, use database links instead of CONNECT. You don't have to use dbms_scheduler or utl_file; just eliminate the CONNECT statements. (I'm not saying that there's anything wrong with dbms_scheduler or utl_file; you should definitely investigate those tools. I'm just saying that using database links is independent of them.)
    What would happen if you did all your connecting to different databases at the OS level? Can you write a shell script that connects to each database in turn, and runs a SQL*Plus script in each one. Each SQL*Plus script would have a SPOOL or SPOOL ... APPEND command, or maybe you could build the SPOOL into a LOGIN.SQL script.

Maybe you are looking for