Help needed with SQL to split huge data into two excel or text files.

Hi,
I have a table which has around 1850000 records. I want to split the data into two sets and import the data in .txt or execl file.
How can i break upthe records using rownum or any thing
select * from tablename where rownum<940000 fetched some records
but
when i gave select * from tablename where rownum>940000 it was not fetching records.
Guideme

when i gave select * from tablename where rownum>940000 it was not fetching records.try this
select * from (select tablename.*, rownum rn from tablename) where rn >940000

Similar Messages

  • Saving the data into the tab limited text file

    Dear Friends ,
    please help me at the earliest possible , i want to store the data into an text file which is tab limited ,previously i was able to the same into the excel sheet using the jakarta HSSF POI , an open source library to store the data into the EXCEL sheet , now friends please tell me whether is there any other open source to store the data into the tab limited text file what i mean by tablimited is the data is to be saved as
    Name        Email-id        phone          streeet          city
    sri            @some.com     9434           jahdui          hye
    asdf         @.com           3455           sdgsdf         retlike this so please suggest me
    thank you in advance,
    bye
    sriharsha

    Consult the docs for BufferedWriter and from there.
    regards
    Christian
    import java.io.*;
    public class Test
         public static void main(String[] args)
              BufferedWriter writer;
              String[][] s = { {"Name","Email-id","phone","streeet","city"},
                        {"sri","@some.com","9434","jahdui","hye"},
                        {"asdf","@.com","3455","sdgsdf","ret"}};
              try {
                   writer = new BufferedWriter(new FileWriter("out.txt"));
                   for (int j=0; j< s.length; j++) {
                        for (int i = 0; i < s[j].length; ++i) {
                             writer.write(s[j]+"\t");
                        writer.newLine();
                   writer.close();
              } catch (IOException e) {
                   e.printStackTrace();

  • Is it possible to insert data into two Excel worksheets using Report Generation Toolkit?

    I'm using the toolkit to insert data into two separate worksheets in Excel using named cells. The problem is that it tends to favor one sheet or the other. In other words, one sheet will have data and the other no data and vice versa. (Sometimes I get data in both sheets.) Is there something I can do to clear this up or is what I'm trying to do unreasonable? I would like to use two worksheets so one sheet receives text and data. The other sheet is used to format the data into a printable report. (i.e. using Excel's CONCATENATE function) The second (report) sheet is also used to receive plots (JPEG files) from LabVIEW. I'd send the plot images to the first sheet, but I can
    not see a way to automatically transfer images from sheet to sheet. I'm using LV 7.1, Win2000 and Toolkit v.1.0.1

    Hi,
    You can use the "Excel Get Worksheet.vi" under All Functions >> Report Generation >> Excel Specific >> Excel General to specify a particular worksheet as the current worksheet. Then, you can specify which worksheet you want to write to in your VI.
    Let me know if you have any further questions and good luck!
    Kileen C.
    NI

  • Help needed with variable - trying to get data from Oracle using linked svr

    Sorry if I posted this in the wrong forum - I just didn't know where to post it.
    I'm trying to write a simple stored procedure to get data from an oracle database via a linked server in SQL Enterprise manager. I have no idea how to pass a variable to oracle.
    Here's how I would get the variable in SQL:
    declare @maxkey INTEGER
    select @maxkey= MAX(keyfield) from [server].Data_Warehouse.dbo.mytable
    select * from [server].Data_Warehouse.dbo.mydetailtable where keyfield=@maxkey
    the select statement I need to do in oracle would use that variable like this:
    select * from OPENQUERY(OracleLinkedServer,'select
    * from ORACLEDB.TABLE where keyfield > @maxkey')
    and I get this message: OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer" returned message "ORA-00936: missing expression".
    I realize that I can't pass the @maxkey variable to oracle - so how do I accomplish this?

    Please refer the example in this link which deals with Oracle date format.
    You can finnd a command DECODE which is used for date formats. If you have a look at whole theory then you will get an idea.
    Link:[Bulk insert SQL command to transfer data from SAP to Oracle|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bulk-insert-sql-command-to-transfer-data-from-sap-to-oracle-cl_sql_connection-3780804]

  • Import data into oracle from a text file?

    hi guys,
    How can we import data into oracle9i release 1 from a text file with comma seperated or tab seperated delimeters?
    please help,
    Imran

    table is already created, just have to populate data into table through a dat or text file. As suggested, you would either:
    1). use SQL*Loader to load the data into this table.
    2). create external table on that data file and then do:
    INSERT INTO your_real_table
    SELECT * FROM that_external_table ;

  • Expert Help needed with Sql Loader !

    Hello Friends...I am using one .dat file that contains several values in a
    particular column and I need to load those values in different tables with
    sqlloader.....For example: in column 3 there are values 0001, 0004, 0007, 9999
    ..> values 0001 and 0004 need to be loaded into table1 and value 0007 is
    loaded into table2 and value 9999 needs to be loaded into table3.
    I can successfully use the when clause to load one value at a time but
    cannot load a range or multiple values during the sqlloader load. I can
    call and run separate .ctl files but less complexity and fewer files would
    be better. Tried everything I know but no luck, can't do loads in same
    .ctl file......Does the when clause have limitations whereby only one value
    at a time can evaluated as True or False ?
    I would like to do a Not or InBetween evaluations if possible on that
    single coulmn and then do the loads in the specific tables.
    Any help would be appreciated as I can see my hair turn grayer by the
    minute..My thanks in advance..

    You're asking sql*load to perform an unnatural act.
    Load in you dat file as-is. Create a pl/sql procedure to do the rest.
    Your batch script calls sql*load, then sql*plus to run the proc.
    Must simpler. sql*load is not a procedural language.

  • Help needed with sql long names

    i need help bringing in column names as the short name. currently my select statment is bringing in the sql longname. is there a way to bring in the short name specified in my db2 database. my code for my connection is as follows:
    driver      =(Driver) Class.forName "com.ibm.as400.access.AS400JDBCDriver");
    DriverManager.registerDriver(driver);
    conn = DriverManager.getConnection("jdbc:as400://system;date format=iso;", props);

    Try setting the sys property on the properties object.
    You can set a '.' or '/' for system or sql naming conventions!

  • Some quick help needed with certificates and split brain dns.

    I run exch 2010 and have one cas server(srv03).  I have split brain dns configured and working in my system.  I got a new certificate this year because of the new regulations that won't allow .internal names in the san portion of an ssl cert.
     I have followed several tids on the internet and still when I tried to implement it today the outlook clients started getting a popup that says [the name on the certificate is invalid or does not match the name of the site]  At the top of this popup
    is srv03.abccorp.internal which is what it was before.
    The certificate is for mail.abccorp.com and also includes autodiscover.abccorp.com and srv03.abccorp.com.  
    When I run [Get-clientAccessServer | fl Name,AutoDiscoverServiceInternalUri] the name and the Url is correct and has the .com value.
    When I run the test email autoconfiguration from my Outlook icon, and look at the log, Autodiscover URL found through SCP, is correct and it says Succeeded at the end.  In the results tab however the Server, Availability Service, OOF URL are still showing
    the .internal instead of .com.  The Internal OWA, External OWA and the OAB are correctly displaying the .com.  What commands do I need to run to change these as they seem to be the problem.
    I wasted a lot of time chasing the autodiscover before I found out about this test in outlook and realized the autodiscover url was correct. :-)
    I have two days left on my old cert that has both .com and .internal SANs so I rolled that back into service so the users stop getting messages.  Any help would be appreciated.

    Hi OTS,
    You can run the following command to Change the InternalUrl attribute of the EWS:
    Set-WebServicesVirtualDirectory -Identity "CAS_Server_Name\EWS (Default Web Site)" -InternalUrl https://mail.abccorp.com/ews/exchange.asmx
    Best regards,
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Niko Cheng
    TechNet Community Support

  • Help needed with SQL

    I have to create a join of two tables with the following fields:
    User_x
    Full_Name
    Login_Name
    Group_List
    Group_x
    Group_name
    Groupid
    In User_x table grouplist comprises of list of groups a user belongs to separated by a semi colon. e.g. 12;78;65
    Now I need to create a join where I get a list of all the users with the group they belong to.
    The result set should look like this
    User Groupname
    Tom Group1
    Peter Group2
    Kathy Group2
    and so on...
    Actual SQL wil be appreciated.
    Thanks

    Hi
    Try this:
    select use_name, group_name
    from user_x u, group_x g
    where instr(group_list, ';'||group_id||';') <> 0
    or substr(group_list, 1, instr(group_list, ';')-1) = group_id
    or substr(group_list, instr(group_list, ';', -1)+1) = group_id;
    Ott Karesz
    http://www.trendo-kft.hu

  • Help needed with sql function

    Hi,
    i have a function like below. basically what it does is, check whether first 2 places of a column_name is *'N_'*. if yes then i am replacing column_name which has *'N_' to ''*
    CASE WHEN SUBSTR(column_name,1,2) = 'N_' THEN
    *':NEW.'||REPLACE(column_name,'N_','')*
    i designed this based on the requirement. now i am facing a small issue. i have a column name 'RGN_ID'. so the above function replaces the RGN_ID as RGID as N_ comes in the middle of the column_name the above function accidentally replaces this as well. wherein i need to replace the first 2 position of column_name which starts like 'N_'
    can you please suggest any solution for this?
    Edited by: user13178284 on Jun 29, 2010 6:11 AM

    Thanks!. But i am afraid if this would help.
    there may be many column names having 'N_' at whatever position. for eg., TRAN_ID. here N_ comes at 4th and 5th position.
    i understand i need to place some kind of check above this function.so that if 'N_' comes anywhere in between the column_name i shouldnt replace it instead i should just replace column_name starting wtih 'N_'.
    any idea about this?

  • How do you save data into a tab delimited text file?

    It sounds simple if we just save the data, but here I have to enter few text entries and write values beside them. For example, if we have results like..
    Voltage 5 V
    Current 2 mA
    Power 1 mW
    What VI do you use to save the entries like this in the file. I don't want to use Report Generation VIs as it adds overhead...
    Any suggestions would be well appreciated.
    Thanks.

    Hi Act,
    They say a picture is worth a 1000 words.
    I prepared a small vi to give you an idea how it is done. There are probably much better examples available if you look around. But here goes...
    It is actually simple. The attached example is not the best approach, but as I said, it is to get you going..
    The vi allows you to create a file with the extention of your choice. You can substitute the write to file vi with a write to speadsheet. The appropriate approach is to first open the file, decide if you wish to create, append or overwrite the file, write to the file and close the file.
    All the necessary vi's are located inside the Functions Palette under File IO.
    JLV
    Attachments:
    Write_to_file_example.vi ‏32 KB

  • How to import data into JTable from a text file?

    thanks in advance!

    My guess is you will have to read the data in from the file, parse it, populate some vectors or something and use those vectors to instantiate the JTable. You could use FileReader to read in the data:
    FileReader in = new BufferedReader(new FileReader(file));then use StringTokenizer to parse it.
    m

  • DVR Splits Recorded Show into Two Segments?

    I was wondering if anyone else has had an issue with their DVR splitting a show into two segments?
    I have the Motorola 7216? Home Media DVR.  At times, when we record a show, and then go to play it, the show will be listed in the Recorded Programs as two shows.  For instance, the first listing will list that the show recorded for 7 minutes.  Then, the second listing of the same show will show that it recorded for the remaining 23 minutes.  It is the same 30 minute show, but for some reason, the DVR stops recording after so many minutes, and then finishes recording the show as a second show.
    Has this happened with anyone else, and if so, is there anything that can be done to fix this?  The only answer I have gotten from Verizon is to unplug the DVR to reset it. 
    This doesn't happen all the time, but it happens enough that I find this annoying.
    I would appreciate any input anyone can give.  Thanks.
    Solved!
    Go to Solution.

    MiMeQu wrote:
    I was wondering if anyone else has had an issue with their DVR splitting a show into two segments?
    I have the Motorola 7216? Home Media DVR.  At times, when we record a show, and then go to play it, the show will be listed in the Recorded Programs as two shows.  For instance, the first listing will list that the show recorded for 7 minutes.  Then, the second listing of the same show will show that it recorded for the remaining 23 minutes.  It is the same 30 minute show, but for some reason, the DVR stops recording after so many minutes, and then finishes recording the show as a second show.
    Has this happened with anyone else, and if so, is there anything that can be done to fix this?  The only answer I have gotten from Verizon is to unplug the DVR to reset it. 
    This doesn't happen all the time, but it happens enough that I find this annoying.
    I would appreciate any input anyone can give.  Thanks.
    This has happened to me on occasion, but  the reason was that there was a power surge, and the box rebooted.  Or, if the STB crashes and reboots, it also splits the recording.  Other than power issues or stb reboots, it hasn't happened, and I have the same STB.

  • Help needed with this form in DW

    Hi, i have created this form in dreamweaver but ive got this problem.
    In the fields above the text field, the client needs to fill in some info such as name, email telephone number etc.
    But the problem is when ill get the messages. Only the text from the large text field is there.
    What did i do wrong??
    http://www.hureninparamaribo.nl/contact.html
    Thank you
    Anybody??

    Thank you for your response. So what do i have to do to fix this?
    Date: Sun, 20 Jan 2013 07:57:56 -0700
    From: [email protected]
    To: [email protected]
    Subject: Help needed with this form in DW
        Re: Help needed with this form in DW
        created by Ken Binney in Dreamweaver General - View the full discussion
    You have several duplicate "name" attributes in these rows which also appears in the first row
    Telefoon:
    Huurperiode:
    Aantal personen:
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5008247#5008247
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5008247#5008247
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5008247#5008247. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Dreamweaver General by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Help needed with Elements 5.0

    Trying to Edit photos.  Click on Edit icon and I get the Message " Attempt to Access invalid address".  Click OK get message "Unable to connect to editor application.
    What is the problem?   I have unenstalled to program and reinstalled, I have tried repairing from CD.  Nothing works.  Please help.

    I have the disc and re-installed a couple of time. No positive result. PSE 09 which I bought thereafter is giving a lot of problems also!!!
    Date: Wed, 8 Jun 2011 10:31:24 -0600
    From: [email protected]
    To: [email protected]
    Subject: Help needed with Elements 5.0
    Doesn't really help either of us very much but I'm also having the same problem with Elements 5. I downloaded the program so I don't have disks to reinstall. And it seems from the other reply that Adobe has given up with the "old program," which incidentally was working fine until two days ago. Maybe I'll have to think about PSE9!
    >

Maybe you are looking for