HELP! - MONTHS OF DATA LOCKED IN BBB.file

I pray there is a simple answer for this problem, because I'm ready to throw my Playbook under a truck!
Two days ago, I sync'd my Blackberry Playbook with my PC.  The sync process created a bbb. archive file with 9G of pictures and videos from my Playbook.  During that same process, all the videos and pictures were automatically removed from my Playbook.  The files are now locked in a bbb. file on my computer, which I can not open, access, read or restore to my Playbook.  Months of photos, data, video all lost?!?  WTF!!!
I've already tried the restore option under the Blackberry Desktop Software, and it will not restore the photos and videos to the Playbook.
Is there some way to open a bbb. file?
Is there some way to restore the photos and videos to my Playbook?
Is there some way to access the photos and videos so that I can use, edit or re-save them on my PC?
Any assistance would be most appreciated!
John
Hamilton, ON

There are a couple of options for extracting and viewing data from a the backup files.
1. The IPD Parse macro is designed to read a Blackberry IPD file and create reports in MSWord or MSExcel. It is free, and you can find out more here: https://sites.google.com/site/ipdparse/home
2. Another options is MagicBerry from MenaStep... which extract from a backup IPD or BBB file, split IPD files, etc. http://menastep.com/pages/magicberry.php
3. Another IPD and BBB file utility is BlackBerry Backup Extractor, and is available for PC and Mac, and can be found here: http://www.blackberryconverter.com/ There is a free and paid version.
I'm not sure which of those might work for you.
1. If any post helps you please click the below the post(s) that helped you.
2. Please resolve your thread by marking the post "Solution?" which solved it for you!
3. Install free BlackBerry Protect today for backups of contacts and data.
4. Guide to Unlocking your BlackBerry & Unlock Codes
Join our BBM Channels (Beta)
BlackBerry Support Forums Channel
PIN: C0001B7B4   Display/Scan Bar Code
Knowledge Base Updates
PIN: C0005A9AA   Display/Scan Bar Code

Similar Messages

  • Need help in loading data from a csv file to a table in Oracle DB

    Hi,
    I am using sqlplus as a client to connect to the server.
    I am trying to load data from a csv file from a client to a table in Oracle DB server.
    I am trying to use the below command
    " LOAD DATA INFILE 'test.csv' INTO TABLE testTable FIELDS TERMINATED BY ',' (test1,test2,testc3,testc4); "
    But, I am encountered with the following error
    "SP2-0042: unknown command "load data" - rest of line ignored."
    Thanks in advance.
    SB

    Hey Frostmann,
    That was a nice post....
    I changed my mind to use an 'Insert into' statement from a shell script.
    I created a DB table named test and I tried using the below shell script to insert a row in the table.
    sqlplus test/test@test <<ENDOFSQL
    INSERT INTO test VALUES('test1',123,'test2','test3');
    exit
    ENDOFSQL
    A row is succesfully inserted into the table when I run the script manually, but it does not insert rows when a cron job is scheduled.
    Could you please help me with this?
    Thanks in advance.
    SB

  • Help! Check data in MS Excel file(JDBC-ODBC)

    Hi guys,
    I wrote a program that can check data in MS Excel file.
    User can input a sentence like "1->2" ,"1->3" (one determine one), then the program can find the data which violate the integrity constrains(functional dependency).For example, if we have the functional dependency "TSeq_gi->TSeq_accver", the program looks for two or more tuples with the same "TSeq_gi" value but the different "TSeq_accver" value in Excel file. These tuples violate the integrity constraint. But now,I can't figure out how to modify this program to multiple determine one. (like 1 3->5 or 1 3 4 5->7) . 1 3 ->5 means: look for 1 and 3 have same value but 5 different. I get stuck. Can some experts help me?
    The code and Excel file are in below link. Download and play it! Thank you~~
    Karen.
    http://us.f1f.yahoofs.com/bc/665bbb4/bc/Java/code.zip?bf6cljAB_wgRYVQf
    PS: You need to set up JDBC ODBC driver in MS windows "Administrative Tools" first. Data Souce name is Test .
    Main logic class:
    class MyActionListener implements ActionListener{
    public void actionPerformed(ActionEvent e){
    if (e.getActionCommand()=="SEARCH")
         try{
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         con1= DriverManager.getConnection("jdbc:odbc:Test");
         stmt2= con1.createStatement();
    input1 = new String(pathTf.getText());     
         main_loop: while(true){
    if (input1.equals("0")){     
              // break out of while(1)
              break main_loop;
         st= new StringTokenizer(input1," ,-=>");          
              while(st.hasMoreTokens()){
                   // analyze the input stream.
                   // Attention, the program didn't do the input value check.
                   input1= st.nextToken();
                   input2= st.nextToken();               
              query= "select "+ schema[Integer.parseInt(input1)-1]+ ","+ schema[Integer.parseInt(input2)-1]+ " from [Sheet1$]";     
              rs2= stmt2.executeQuery(query);     
              rowCounter= 0;
              list1.clear();
              list2.clear();
              list3.clear();
              while(rs2.next()){
                   // increase the row counter
                   rowCounter++;
                   // initial the flag
                   col1= rs2.getString(1);
                   col2= rs2.getString(2);               
                   // for the initalization
                   if (list1.isEmpty()){
                   list1.addElement(col1);
                   list2.addElement(col2);
                   row="Row 2";
                   list3.addElement(row);     
                   // compare weather exist dependance
                   else
                   for (int i=0;i<list1.size();i++){
                        // if col1 match with the first part of value in the list
                        if (((String)list1.get(i)).equals(col1)){
                             // The independence pair match
                             if (((String)list2.get(i)).equals(col2)){
                                  break;
                             else
                                  textArea.append("\n"+"Violate Integrity Constraints Found : "+" Row "+ (rowCounter+1)+ " not match with "+ list3.get(i)+".");
                                  System.out.println("\n"+" Row "+ (rowCounter+1)+ " not match with "+ list3.get(i)+".");      
                                  break;                    
                        // if col1 not match with any value, add a new record in list
                        else
                             list1.addElement(col1);
                             list2.addElement(col2);
                             row="Row "+ (rowCounter+1);
                             list3.addElement(row);
                   }// end of for
                   }//end of else
    }//end of while
    }//end of while(1): main_loop
         }catch(Exception ex){
         //System.err.println(ex);

    sorry~~I am new here!
    class MyActionListener implements ActionListener{
             public void actionPerformed(ActionEvent e){
                  if (e.getActionCommand()=="SEARCH")
                 try{
                          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                          con1= DriverManager.getConnection("jdbc:odbc:Test");
                          stmt2= con1.createStatement();
                          input1 = new String(pathTf.getText());
             main_loop: while(true){
                     if (input1.equals("0")){
                                 // break out of while(1)
                     break main_loop;
                      st= new StringTokenizer(input1," ,-=>");
                     while(st.hasMoreTokens()){
                                  // analyze the input stream.
                                     input1= st.nextToken();
                                     input2= st.nextToken();
                          query= "select "+ schema[Integer.parseInt(input1)-1]+ ","+ schema[Integer.parseInt(input2)-1]+ " from [Sheet1$]";
                     rs2= stmt2.executeQuery(query);
                     rowCounter= 0;
                     list1.clear();
                     list2.clear();
                     list3.clear();
                    while(rs2.next()){
                           // increase the row counter
                    rowCounter++;
                           // initial the flag
                    col1= rs2.getString(1);
                    col2= rs2.getString(2);
                           // for the initalization
                      if (list1.isEmpty()){
                          list1.addElement(col1);
                           list2.addElement(col2);
                            row="Row 2";
                          list3.addElement(row);
                        // compare weather exist dependance
                           else
                              for (int i=0;i<list1.size();i++){
                                // if col1 match with the first part of value in the list
                                     if (((String)list1.get(i)).equals(col1)){
                              // The independence pair match
                     if (((String)list2.get(i)).equals(col2)){
                         break;
                              else
                textArea.append("\n"+"Violate Integrity Constraints Found : "+" Row "+ (rowCounter+1)+ " not    match    with "+ list3.get(i)+".");
               System.out.println("\n"+" Row "+ (rowCounter+1)+ " not match with "+ list3.get(i)+".");
                            break;
                          // if col1 not match with any value, add a new record in list
                            else
                                 list1.addElement(col1);
                                 list2.addElement(col2);
                                 row="Row "+ (rowCounter+1);
                                 list3.addElement(row);
                       }// end of for
                   }//end of else
               }//end of while
            }//end of while(1): main_loop
                                 }catch(Exception ex){
                                     //System.err.println(ex);
                                     }

  • Need help pass in date parameter into bat file.

    Is it possible to schedule sql job to execute bat files and pass in date below.
    I want to take a system date and pass into the bat file below.  A Schedule Job will run on Monday at 9 P.M.
    I want to automate this process instead manually enter into the bat file.  Is that possible?
    Any suggestions is appreciate.  SQL 2012
    Thank you so much in advance.
    SQL Schedule job
    DECLARE @sMonday VARCHAR(25) = REPLACE(CONVERT(VARCHAR(10), GETDATE(), 1), '/', '')
    SET @sMonday = @sMonday + '_qa48_Clonedb'
    SELECT @sMonday
    --021315_qa48_Clonedb
    DECLARE @sPrevMonday VARCHAR(25) = CAST(REPLACE(CONVERT(CHAR(10), DATEADD(DAY, - (DATEPART(dw, GETDATE() ) - 1), GETDATE() ),1), '/', '') AS CHAR(6))
    SET @sPrevMonday= @sPrevMonday + '_qa48_Clonedb'
    SELECT @sPrevMonday
    --020815_qa48_Clonedb
    Result want:
    -- Testbatfile.bat
    REM 021615_qa48_Clonedb
    SET sToday = @sMonday        
    SET sPreviousWeek = @sPrevMonday
    SET sNumOfDay=07
    DiskMirror -l snapsrvcfdba n4brec01a -i privkey.ppk "snap rename sql32oltp_repl_dataf sqlsnap__brpRMSDVS050a__recent %sToday% "
    DiskMirror -l snapsrvcfdba n4brec01a -i privkey.ppk "snap rename sql32oltp_repl_logf  sqlsnap__brpRMSDVS050a__recent %sToday% "
    DiskMirror -l snapsrvcfdba l9ABC01d -i privkey.ppk "snap rename sql100oltp_repl_dataf %sPreviousWeek% sqlsnap__ABCPWSCVR050a__%sNumOfDay% "

    See
    https://sharminjahan625.wordpress.com/2013/08/30/384/
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Need help ASAP with Data Flow Task Flat File Connection

    Hey there,
    I have a Data Flow Task within a ForEach loop container.  The source of the flow is ADO.NET connection and the destination is a Flat File Connection.  I loop through a collection of strings in the ForEach loop.  Based on the string content,
    I write some data to the same destination file in each iteration overwriting the previous version. 
    I am running into following Errors:
    [Flat File Destination [38]] Warning: The process cannot access the file because it is being used by another process.
    [Flat File Destination [38]] Error: Cannot open the datafile "Example.csv".
    [SSIS.Pipeline] Error: Flat File Destination failed the pre-execute phase and returned error code 0xC020200E.
    I know what's happening but I don't know how to fix it.  The first time through the ForEach loop, the destination file is updated.  The second time is when this error pops up.  I think it's because the first iteration is not closing the destination
    file. How do I force a close of the file within Data Flow task or through a subsequent Script Task.
    This works within a SQL 2008 package on one server but not within SQL 2012 package on a different server.
    Any help is greatly appreciated.
    Thanks! 

    Thanks for the response Narsimha.  What do you mean by FELC? 
    First time poster - what is the best way to show the package here?

  • Need help in writing data to a flat file in .csv format

    Hi All,
    could you please show with a sample example to write data in .csv format using UTL_file.
    The result of the refcursor i want to write to a file in .csv format.
    How can i achieve this.
    Thx

    Hi,
    There are two ways to acheive this.
    First and which I prefer is creating a SQL script which will generate csv file at the specified location in CSV format. And then this SQL script can be called from your cron job similar to how you call stored procedure. Following is pseudo code that can be used -
    set linesize 500
    set echo off
    set feedback off
    set prompt off
    set pagesize 0
    spool <name of the csv file>.csv
    <Your select statement>;
    spool offPut select statement delimiting columns you want to use with ','. E.g. following query should create a CSV file named as abc.csv with one record and 2 columns delimited by comma. First column is ENO and second column is ENAME.
    set linesize 500
    set echo off
    set feedback off
    set prompt off
    set pagesize 0
    spool abc.csv
    select ENO || ',' || ENAME from employee;
    spool offSecond, you can write a PLSQL procedure and then call this procedure from cron job. There is a generic procedure shared by BluShadow some time back which is a very good example for this. Please refer to following link for this solution -
    REF Cursor creating CSV files
    I will suggest to use first method above if possible since it will be faster and less complicated in my opinion. Second method is recommended for scenarios where select statement is created dynamically and cannot be written during development.
    Hope this solves your purpose.
    Cheers,
    Anirudha

  • How to import data from a text file into a table

    Hello,
    I need help with importing data from a .csv file with comma delimiter into a table.
    I've been struggling to figure out how to use the "Import from Files" wizard in Oracle 10g web-base Enterprise Manager.
    I have not been able to find a simple instruction on how to use the Wizard.
    I have looked at the Oracle Database Utilities - Overview of Oracle Data Pump and the Help on the "Import: Files" page.
    Neither one gave me enough instruction to be able to do the import successfully.
    Using the "Import from file" wizard, I created a Directory Object using the Create Directory Object button. I Copied the file from which i needed to import the data into the Operating System Directory i had defined in the Create Directory Object page. I chose "Entire files" for the Import type.
    Step 1 of 4 is the "Import:Re-Mapping" page, I have no idea what i need to do on this page. All i know i am not tying to import data that was in one schema into a different schema and I am not importing data that was in one tablespace into a different tablespace and i am not R-Mapping datafiles either. I am importing data from a csv file.
    For step 2 of 4, "Import:Options" page, I selected the same directory object i had created.
    For step 3 of 4, I entered a job name and a description and selected Start Immediately option.
    What i noticed going through the wizard, the wizard never asked into which table do i want to import the data.
    I submitted the job and I got ORA-31619 invalid dump file error.
    I was sure that the wizard was going to fail when it never asked me into which table do i want to import the data.
    I tried to use the "imp" utility in command-line window.
    After I entered (imp), i was prompted for the username and the password and then the buffer size as soon as i entered the min buffer size I got the following error and the import was terminated:
    C:\>imp
    Import: Release 10.1.0.2.0 - Production on Fri Jul 9 12:56:11 2004
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Username: user1
    Password:
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Import file: EXPDAT.DMP > c:\securParms\securParms.csv
    Enter insert buffer size (minimum is 8192) 30720> 8192
    IMP-00037: Character set marker unknown
    IMP-00000: Import terminated unsuccessfully
    Please show me the easiest way to import a text file into a table. How complex could it be to do a simple import into a table using a text file?
    We are testing our application against both an Oracle database and a MSSQLServer 2000 database.
    I was able to import the data into a table in MSSQLServer database and I can say that anybody with no experience could easily do an export/import in MSSQLServer 2000.
    I appreciate if someone could show me how to the import from a file into a table!
    Thanks,
    Mitra

    >
    I can say that anybody with
    no experience could easily do an export/import in
    MSSQLServer 2000.
    Anybody with no experience should not mess up my Oracle Databases !

  • Using SQL stored procedures How to get the list of .rar files from e:\Tempbackup directories from the different remote desktop windows server and delete the .rar files which contains the current month and date

    Concept:
    Every month i need to find the list of .rar files from the
    E:/TempBackup directory from the different environments (remote desktop servers) and i need to delete the current month
    .rar files alone from the respective (E:/TempBackup) directory. below is example files structure inside the
    E:/TempBackup.
    example:
    zDROP_2014_08_31_Backups.rar
    zDROP_2014_09_31_Backups.rar
    zDROP_2014_10_31_Backups.rar
    from the above list i need to delete the zDROP_2014_08_31_Backups.rar(current month) file alone and also logs should be capture for this deletion.
    key words for this are zDROP and Current month and date.
    i need a stored procedure for this concept. could you please help on this.

    Hello,
    You can schedule an operating system task (Control Panel -> Schedule task) to either call a batch file or a PowerShell script.
    Please read the following resources for examples:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/61373719-fffb-4d94-bdbe-7d8ed8620b44/delete-filesfolders-on-remote-servers-using-powershell?forum=winserverpowershell
    http://www.networknet.nl/apps/wp/archives/943
    http://jeffwouters.nl/index.php/2011/10/powershell-script-to-delete-files-older-that-a-week/
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Need help in creating prompt for Month To Date Report.

    <span class="postbody"><font size="2">Hi All <br />I need to create a Month To Date Report using month(Start date & End date) as prompts, By default it has to run on the previous month data or if user selects his own range of dates then it has to bring the data for that range of dates ,one more thing is i am not showing the month and date columns on the report.Can any one help me how to create prompt for this in DeskI XIR2</font></span>

    Could you clarify some things? You are saying you are trying to transform the xml output of a webservice with an xsd, but an xsd is a schema that describes the allowed format of a xml file. If you want to transform xml from one format to an other (from one xsd to an other) you have to use a xsl file. You can make and test this with JDeveloper. Are you calling the webservice from esb or bpel?
    Kind Regards,
    Andre

  • I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

    I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
    Attachments:
    try2.txt ‏2 KB
    read_array.vi ‏21 KB

    The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
    Here are some of your choices to fix your problem.
    1. Change the source file to a tab delimited file. Your VI will then run as is.
    2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
    3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
    Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
    Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

  • Need help in using SQL in a jsp file to compare date and time

    hi every one,
    Actually I am doing a project using JSP. I need to compare a date field in the database (MS Acess) to the current system date and time. I have to do this in a select statement.
    I have alredy defined a variable of type Date in the JSP file and I am comparing this variable to the date in the database through a select statemant.
    Here is what I am doing
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
              java.util.Date today = new java.util.Date();
              String myDate=sdf.format(today);
    query = "SELECT Car_ID, Model_ID, Year, Ext_Color, Price from Cars where EDate <= "+myDate+" ;";
    EDate is the feild in the database and it's format is (5/12/2008 5:29:47 PM) it is of type Date/Time in MS Acess.
    when I execute the query it gives the following error
    SQL error:java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'EDate <= 2008-10-16 08:10:07'.
    I hope any one can help me with that error and answer my question, I've tried too many things but nothing helps
    Thanks in advance :-)

    Hi,
    When the comparision is needed to be done with the current date , we don't need to send in Java
    Date then format it and compare with MS Acess Date.
    In MS Access we have Date() function which will give you the current date.
    So you can try rewriting your query as following :
    query = "SELECT Car_ID, Model_ID, Year, Ext_Color, Price from Cars where EDate <= Date() ;"; ---------------------
    Hope this helps.
    Thanks

  • Help to export data into a file

    Hi,
      I am having more than 200 columns in a table. Client wants to export the data into a file with all 215 columns data. When i write the select * from tablename into a spool file. It is getting the data into a multiple lines however client wants each record into a single line.(right now records are getting into multiple lines). I tried to use to_nclob(columnname1)....to_nclob(column215), this way it is getting a single line for each record but it is taking much time(means in a table we have 10M records and explain plan is showing 3 days to export the file). Could you please help me how we can achieve these type of functionalities.
    Thanks in advance

    user586 wrote:
    Hi,
      I am having more than 200 columns in a table. Client wants to export the data into a file with all 215 columns data. When i write the select * from tablename into a spool file. It is getting the data into a multiple lines however client wants each record into a single line.(right now records are getting into multiple lines). I tried to use to_nclob(columnname1)....to_nclob(column215), this way it is getting a single line for each record but it is taking much time(means in a table we have 10M records and explain plan is showing 3 days to export the file). Could you please help me how we can achieve these type of functionalities.
    Thanks in advance
    Hardly surprising it's taking ages to export 10 million rows, if you're doing it through SQL*Plus, as that involves transporting all the data over the network to the client, which is then rendering all that data in the display (which can be slow to scroll, depending on the size of the window) etc.
    Better to get the database to access the file system directly, using UTL_FILE (though this does mean that the file is produced on the server) and then transfer the resultant file to where it needs to go.
    Example of a generic template to use as a starting point...
    As sys user:
    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    As myuser:
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;
    This allows for the header row and the data to be written to seperate files if required.
    e.g.
    SQL> exec run_query('select * from emp','TEST_DIR','output.csv');
    PL/SQL procedure successfully completed.
    Output.csv file contains:
    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10
    The procedure allows for the header and data to go to seperate files if required.  Just specifying the "header" filename will put the header and data in the one file.
    Adapt to output different datatypes and styles are required.

  • Locking and Encrypting Files Help

    I am trying to create an encrypted disk image that is both password protected and protected from being trashed.
    I've created one with disk utility and assigned a password. That part works great.
    However, while this prevents someone from getting at the files inside the disk image, it does not prevent them from destroying the image by trashing it.
    So, I've tried locking it with "Get Info." But, this does not seem like a good solution to me because someone could always unlock the image and then throw the image away.
    I think I may be missing something here. If I lock it, can other users simply "Get Info", unlock it, and then throw it away? Or are they prevented from doing that?
    Is there a better way of doing what I'm trying to accomplish?
    Thanks for any help.

    Change the owner of the image file in the Ownership & Permissions section of the Get Info window so that it is owned by an account other than yours; preferably, choose the system account. The Locked flag on an item can only be turned on or off by that item's owner or root, and changing the owner of an item requires that an administrator password be provided. In rare cases, the Locked flag on a file cannot be turned off in the Finder regardless of whether or not the file is owned by your account; a folder's Locked checkbox is always unchangeable in versions of Mac OS X prior 10.4.
    (17581)

  • Delete data from a flat file using PL/SQL -- Please help.. urgent

    Hi All,
    We are writing data to a flat file using Text_IO.Put_Line command. We want to delete data / record from that file after data is written onto it.
    Please let us know if this is possible.
    Thanks in advance.
    Vaishali

    There's nothing in UTL_FILE to do this, so your options are either to write a Java stored procedure to do it or to use whatever mechanism the host operating system supports for editing files.
    Alternatively, you could write a PL/SQL procedure to read each line in from the file and then write them out to a second file, discarding the line you don't want along the way.

  • Help! How to read data from an Excel file?

    Hi,
    I need to read data from an Excel file that may contain more then one table in a sheet. How can I read them?
    I would be eternally grateful to anyone who can give me any information.

    Did you try POI from Apache?
    http://jakarta.apache.org/poi/index.html

Maybe you are looking for

  • IPod won't update, Says Playlists Don't Exist Anymore So Can't Be Updated

    I think this might be because I used to have too much music for my 20 GB iPod, so there was a playlist my Mac created called "My iPod" and had music selections on it. but then I deleted a couple of albums from my computer so I could have all of the m

  • Problem in join with hrp1000 and hrp1001???

    Hi all, I am pasting code sAmpLE, i am having problem with join, without join the query is working. Help out. IF per_no IS NOT INITIAL.     SELECT objid sobid objid INTO TABLE lt_st_p1       FROM hrp1001 WHERE otype EQ 'P' AND objid IN per_no       A

  • After closing, Firefox still remains in task manager's processes and could not open again!

    I'm using Windows 7 Professional. I installed FireFox version 6.0.2 few days ago. Now I have problem with this. When I close the browser, it was normal .But when I open it again, nothing happens! I open Task Manger of windows, move to processes tab a

  • Cleaning Mighty Mouse?

    Not sure the best place for this... Scroll wheel stopped working - any ideas how to dismantle and clean? Thanks

  • Regarding BDC session to run immediately after creation

    Hi Abapers, Please help me out from the following situation. I need to run the BDC session immediately after creating. I beleive using RSBDCSUB we can achieve it. If it so please let me know how can we use this..... Please let me know if any other so