Not getting heading ouptut in sql

Hi Experts,
  I am new to SQL. I am running a query that output should go to .csv file. But in output though data is coming, headings are not displayed. Following is my query.
I want heading in first line in my query output so that it will be easy to identify what column is what for.  I would like to know what I have to add/modify to get column headings in first line.
Really appreicate your help!!
set echo off
set concat ~
set pause off
set pagesize 0
set heading off
set feedback off
set verify off
set linesize 20000
set trimspool on
set trimout on
set termout off
set colsep ','
spool &1
select   '"' ||ORDER_ID    || '"' ||','||        
         '"' ||CREATED   || '"' ||','||        
         '"' ||STATUS     || '"' ||','||        
         '"' ||TITLE      || '"' ||','||        
         '"' ||FIRST_NAME     || '"' ||','||        
         '"' ||LAST_NAME        || '"' ||','||        
         '"' ||REQUESTED_PLAN        || '"' ||','||        
         '"' ||DEVICE        || '"' ||','||       
         '"' ||BILLING_POSTCODE  || '"'  
          from 
(SELECT 
'"' || replace(ORDERS.ORDER_NUMBER, '"', '""') || '"' as "ORDER_ID",                                                           
'"' || replace(ORDERS.CREATED, '"', '""') || '"' as "CREATED",
'"' || replace(ORDERS.STATUS, '"', '""') || '"' as "STATUS",    
'"' || replace(ORDERS.TITLE, '"', '""') || '"' as "TITLE",                                                   
'"' || replace(ORDERS.FIRST_NAME, '"', '""') || '"' as "FIRST_NAME",                                         
'"' || replace(ORDERS.LAST_NAME, '"', '""') || '"' as "LAST_NAME",  
'"' || replace(ORDERS.EMAIL, '"', '""') || '"' as "EMAIL",       
'"' || replace(ORDERS.REQUESTED_PLAN, '"', '""') || '"' as "REQUESTED_PLAN",  
'"' || replace(ORDERS.DEVICE, '"', '""') || '"' as "DEVICE",
'"' || replace(ORDERS.DELIVERY_POSTCODE, '"', '""') || '"' as "BILLING_POSTCODE" 
FROM TSO_TCOM_OWNER.ORDERS
WHERE ORDERS.CREATED BETWEEN to_date('16-MAR-13') AND CURRENT_DATE
AND (ORDERS.ORDER_NUMBER like 'BP%' OR ORDERS.ORDER_NUMBER like 'BO%'))
ORDER BY ORDERS.ID DESC
spool off
exit;

One way :
set echo off
set concat ~  
set pause off 
set pagesize 0  
set heading off  
set feedback off  
set verify off  
set linesize 20000  
set trimspool on  
set trimout on  
set termout off  
set colsep ',' 
spool &1
SELECT 'ORDER_ID','CREATED','STATUS','TITLE','FIRST_NAME','LAST_NAME','EMAIL','REQUESTED_PLAN','DEVICE','BILLING_POSTCODE' FROM DUAL;
<<<<<YOURQUERY>>>>>>  -- Paste your query here.
spool off
exit;
Cheers,
Manik.

Similar Messages

  • Could not get schema Object:java.sql.SQLSyntaxErrorException ora-904

    All of a sudden I get
    Could not get schema Object:java.sql.SQLSyntaxErrorException: ORA-00904: "SYS"."O"."NAME": ongeldige ID
    when doing anything in the tables tree in the connections pane
    The only thing I set recently is pga_aggregate_target
    Environment
    Oracle 11.2.0.1
    OS Windows Vista Ultimate sp2
    Sql developer 2.1.1.64.39 with its own JDK
    As the download links on OTN are broken I can not upgrade, and I'd rather not work in command line sqlplus.
    Help!!!
    Sybrand Bakker
    Senior Oracle DBA

    My copy of sqldeveloper isn't located in that directory. Would that matter?
    In the mean time I have disabled filtering the tables node. Opening the tables node doesn't result in exceptions anymore.
    Now, when I click on any table in that node I get 4 identical ora-904 error messages for sys.o.name for any table.
    Apparently it is querying either the all_objects view and it thinks it is querying sys.obj$.
    I didn't yet enable sql_trace for the session, I'm more or less giving up on sqldeveloper. I can not use the space bar in any datagrid, sqldeveloper has always been extreemly unresponsive when navigating the schema browser (as opposed to Toad), etc, etc. Too bad I bought Sue Harpers book, but I think I will be de-installing sqldeveloper soon.
    Sybrand Bakker
    Senior Oracle DBA

  • Not getting header of HTTP Response in Netweaver 7.1

    Hello,
    I m trying to use HttpURLConnection to authenticate with some site. I m able to send the request and recieve the response from the server. But I m not getting the header of the response. When I do it as simple java application everything works fine but when I deploy it as EJB on Netweaver 7.1, I m not getting the header information from the response.
    my code:
    URL  url = new URL(Some URL);
    HttpURLConnection  conn = (HttpURLConnection )url.openConnection();
    conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    conn.setRequestMethod("GET");
    conn.setInstanceFollowRedirects(true);
    conn.setUseCaches(false);
    conn.setDoOutput(true);
    OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
    wr.write(some data);
    sessionID = getSessionID(conn);
    wr.flush();
              // Get the response
    BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String resultXML = "";
    String line;
    while ((line = rd.readLine()) != null) {
          resultXML += line;
    Above I m getting the reponse from the site. But the header is not present in that response.
    So when I use  conn.getHeaderFields() I get emply Map.

    Hi Naveen,
      Please follow steps for deploying the application.
    1)open SAPMMC.
    2)You will see three green folder name and last two will contain some one digit number in last.
    3)Please note down these numbers say 1 and 2 (instance number).
    4)Open developer studio.
    5)now navigate to windows->preferences->SAP AS JAVA
    6)If any thing is listed under SAP System Instances please remove by clicking on Remove SAP System.
    7)Now under SAP Instance Identity, enter 1(see step 3)  for Instance number and IP address of your machine/ where SAPMMC is installed.
    8)Click on Register SAP Instance and press OK.
    I hope It will help you.
    Kind regards
    Sarsij

  • Not getting header item in Open Hub Destnation.

    Hi Experts,
    when i am generating flatfile by using Open hub destination to my Desktop location, i am not getting the headers.
    How can i get the headers in my xcel out put?

    HI,
        When Open hub destination is executed by using a 'xl' file the headder will be copyed to another
    xl file. If u want to get the headder and  records at one place , u can make use of Database Table to run
    Open hub destination. so a table name will be genarated with the following name as
    /BIC/XXXXXXXX     ( NAME OF THE OPEN HUB DESTINATION ). so  headder and records will be seen
    in this table.
       prasad.

  • Chart not getting columns from the SQL Query with InlineTransform(xsl)

    Hi All,
    I am using MII 12.0 . I tried to use the mii standard xsl for converting rows into columns by  Inline Transform in a SQL Query.
    while executing the Query it is giving me the correct output but i tried to load the same Query in a IChart there it is not showing me the available columns that i can able to see in simple executiion and chart is also not plotting it keeps on loading.
    Thanks in Advance.

    Hi LinoVaz,
    Some things to try for testing purposes -
    1. Don't do any Data Mapping of the query columns
    2. If a SQL Query, you may need to change the Server Scaling to use Global AutoScale.
    I found that when I mapped the inline-transformed query into a bar chart display template, and hit the Refresh button, only the first column name show in the Column Names area.  If I mapped it, I got only that column.  If I didn't map any columns, I got them all.
    Let me know if you find similar results.  I think this is likely a bug, so you may consider using a Business Logic Transaction and an XacuteQuery to accomplish the same result.
    Kind Regards,
    Diana Hoppe
    Edited by: Diana Hoppe on Mar 25, 2011 11:46 AM

  • Table column names not getting displayed

    Hi
    When i do a SELECT statement i am not getting the column names
    SQL> SELECT * FROM EE;
    aa physics 100
    bb physics 200
    PLease let me know how can i set it.
    Thank you
    Marium Thomas

    Did you modify some of the default settings (e.g. HEADING or PAGESIZE)?
    Try
    set heading onhttp://download-uk.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1011230

  • Header information not getting displayed in the lines

    Hello Everyone
    I have a very basic question - its very simple but not working for me with so many attempts
    My XML structure looks like this . In the RTF , I have header information and then a table for line information looping through G_LINES.
    IN this lines table I need the SHIP_CUSTOMER_ID of the header to be displayed. I have tried all options like <?../SHIP_CUSTOMER_ID?> or <?../G_ORDERS/SHIP_CUSTOMER_ID?> , however nothing seems to be working and I am not getting the field to be displayed. Can someone please help?
    XML structure is as follows:
    <XXSTOL_29251_PICK_TKT>
    <LIST_G_ORDERS>
    <G_ORDERS>
    <CUSTOMER_NUMBER>1411</CUSTOMER_NUMBER>
    <SHIPPING_INSTRUCTIONS1></SHIPPING_INSTRUCTIONS1>
    <SHIP_CUSTOMER_ID>256</SHIP_CUSTOMER_ID>
    <G_LINES>
    </G_LINES>
    <G_LINES>
    </G_LINES>
    </G_ORDERS
    </LIST_G_ORDERS>
    </XXSTOL_29251_PICK_TKT>

    Are you grouping within G_LINES? If so, use ../../SHIP_CUSTOMER_ID
    or send me the xml and RTF template to [email protected] so that I can get a better look at the data structure and try to help.
    Thanks,
    Bipuser

  • Header not getting  displayed in the next page in the second table

    Dear Experts ,
    I have a query regarding Header not getting  displayed in the next page in the second table of the main window. .Let me elobrate the issue.
    I have a smartform in which there are  2 tables TABLE 1 and TABLE 2 in the smartform MAIN window. TABLE 1 is for pending PO and TABLE 2 is  for future delivery date P O separated by text in between.
    Now the header for both the tables and the data are getting displayed properly if the total output is in only one page. But If there are more entries in the TABLE 1 the Header for the TABLE 2 is not getting displayed. Header for TABLE 1 yet gets displayed properly in the next page in case of more entries.
    Only issue is that Header for TABLE 2 is not getting displayed in second page but it gets displayed if the entries are less in TABLE 1 and the total output is in one page .
    Please provide a elobrate solution on this problem as the requirement is urgent.
    Thanks,
    Regards,
    Sachin Hada

    Hi Sachin,
    you need to cteate two pages FIRST and NEXT.
    in first page --> FIRST
        next       --> NEXT
    in next page
      page---> NEXT
      next ---> NEXT.
    you copy the first page main window is the same in next page
    aslo
    I think help ful for you
    thanks & Regards
    BHUPAL.

  • Header and footer of RTF template not getting carried over to Excel output

    We have Header and Footer in RTF template defined. The output of the report will be in Excel. When we run the report, the header and footer on the report are not getting carried over to excel has header and footer, instead the header and footer are printed as first line on the excel. Also, the RTF template is set to landscape but when the output is generated in excel, it is set to Portrait

    hi..
    chk this presentation...
    http://csc-studentweb.lrc.edu/swp/Berg/articles/NW2004s_what_is_new.ppt#352,3,Why NW 2004s?
    http://www.sap-hefte.de/download/dateien/1090/086_leseprobe.pdf'
    hope this helps...

  • Header data not getting updated in line item level

    Hi,
    We are trying to update Pricing date at header level but it is not gettting copied to item level.
    getting an message "The header business data does not apply to item xxxx"
    i have checked the item category and "business item" field is checked. and for the same sales order previously we were able to change the pricing date at header level and it got applied to item level but this time is is not getting applied.
    kindly suggest.

    If there are multiple line items which are having different data; in your case, Pricing Date, then in that case, when you try to change at header level, system will pop up this message.
    You can also have a look at the following note:-
    Note 336660 - Message V1403 in sales order with article order no
    G. Lakshmipathi

  • Header Vendor text is not getting displayed for PO in BBP_PD transaction.

    Hi Experts,
    We are upgrading   SRM 3.0 to SRM 7.0 .In the upgraded  sys the Header Text 'HTXT' is not getting displayed for the Purchase order created in BBP_PD. For the SCs  the Header text field is populated correctly.
    Inputs on this will be very helpful.
    Regards,
    Ravi.K

    Ravi,
    Check in IMG if the text schema is used in configuring PO transaction type. Define Transaction Types is the setting.
    SG

  • Taxcode not getting populated in MIRO Header in Dropdown

    Hi All,
    We created a new Taxcode through FTXP transaction for country and TAX schema and maintained condition records in FV11 transaction for relevant conditions.
    We created a PO with new tax code received goods.
    But while in transaction MIRO for LIV , new tax code is not getting populated at header in TAXCODE field.
    I have checked SDn for the same , they have specified OBTZ transaction for taxcode.
    I havent used this T.code in my previous assignments.
    Please throw some light on the same.
    With Regards,
    Vijaykumar P

    Hi All,
    Thaks for reply,
    But default tax code is maintained in OMR2.
    In MIRO transaction if we go to tax code tab and click Calculate Tax, the tax code in Basic data tab should get updated and all taxes has to be calculated correctly.
    But in this case the taxes are not calculated and taxcode is not appearing in dropdown also.
    Please do throw some light.
    With Regards,
    Vijaykumar P

  • Pricng not getting distributed at item level when given at header level-

    Dear all
    We are using pricing procedure in Delivery for certain freight condition types...
    When a condition type ZFRT is given manual pricing at header level,it is not getting distributed equally at item level..
    Can u tell us what exactly the problem..
    The same condition type while using in Sales order,distributes pricing to all items ...when given at header level...
    Group condition tick mark is put.Priicng is at header level tick mark is put..

    Hi,
       Go to header level of the delivery document and in conditions tab press "update" and do carry out new pricing and then give the header condition value and press activate.
    Reward me if it helps.
    Regards,
    kishore.

  • CRM Header data not getting refreshed in BADI when clicked in New order

    We have used a ORDERADM_H BADI, header badi to populate some custom field values.
    Step 1) While creating sales order in CRM(CRMD_ORDER), we are giving inputs such as sold to party , material etc.
    Step 2) Before actually saving the order, we found that we dont need this order to be created and again click on create new button in the transaction. In order header BADI, order data for the previous order is not getting refreshed. The previous GUID is still there and function module CRM_ORDER_READ still retrieves the old order values which was cancelled in the previous step. It is causing lot of issues and finally giving dump.
    basically the previous GUID is not getting refreshed. Please suggest

    Pls send the code that you have in the Badi. Did you actually compare the GUIDs manually ? Instead of CRM_ORDER_READ have you tried using CRM_ORDER_READ_OW ?

  • Table Header not getting repeated in subsequent pages

    Hi,
    I have a table and i want to table header to be repeated in subsequent pages but only till 2nd page the table header is repeated from the 3rd page onwards the table header is not repeated.
    I have selected the Header Row in hierarchy and in Pagination tab for the header row i have checked the the check box Insert Header Row in Subsequent Pages.
    After selecting the checkbox also table header is repeated only in 2 pages and not repeated after the second page.
    My table hierarchy in form is :
    TableSubform
    ---Table
    HeaderRow
    Row1
    I am using Designer 8.0 and Acrobat Reader 8.1.2
    Can you please help me in solving this issue.
    Regards,
    Bala Baskaran.s

    Hi All,
    I have selected the the check box Insert Header Row in Subsequent Pages then also the header is not getting flowed in subsequent pages only till 2nd page its getting flowed.
    I have used table wizard to create table and i have made the table subform as flowed then also table header is not repeating in subsequent pages.
    MainForm (Flowed)
    TableSubform1(Flowed)
    Table1
    HeaderRow
    Row1
    TableSubform2(Flowed)
    Table2
    HeaderRow
    Row1
    I selected TableSubform1 and in Pagination tab OverFlow Leader dropdown i selected HeaderRow, the same i did for TableSubform2 also but the table header is not getting repeated in subsequent pages.
    Please help me in solving this problem.
    Regards,
    Bala Baskaran.S

Maybe you are looking for

  • Can not select Nigeria from list

    when i want to register a number on Skype to go ,An Nigerian number , it can`t be foundin the list to chose from .  So now i need to know if it is an error or mayby an precaution to prevent fraud?

  • Site Web Analytics - no usage data being generated

    Hello all: I have a SharePoint Foundation 2013 farm with 2 WFE - 1 Search Server and 1 DB server.  Search Service Application has been configured and functioning properly.  Usage and health Data Service Application has been created and started.  Usag

  • Failed to open the connection. Details: Unexpected error

    I am trying to run a report which pulls up data from salesforce.com but when I enter the login credentials for salesforce I get this error. I am running Crystal Reports v14.0.2.364 RTM. It is not the login as I am able to login with the same credenti

  • ComponentWorks and Visual C++ 6.0

    How do I load the ComponentWorks 2.0.1 Controls in Visual C++ 6.0 ? Caroline Catel | mailto:[email protected] SINFOR Rhone-Alpes | Phone: (+33|0) 4 72 13 56 00 10 Place Charles Beraudier | Fax: (+33|0) 4 72 13 56 01 F-69428 LYON Cedex 03 | Web: http:

  • Installing Reader 9.0 on non-system disk?

    I'd like to install on my D: drive, because the system disk C: is pretty full. Installing Reader 9.0 consumes around 50% of the remaining free space. However, the download/install procedure doesn't provide any options whatsoever (as far as I can see)