Read the csv file in the Windows directory
Hi allI have a requirement to fill an Oracle table with the CSV file in the Windows directory.
Please help me to achieve this goal.
Thank you.
Published by: Amit1cs on June 4, 2013 08:46
Then I suggest you mark this thread as answered and repost on the SQL/PLSQL forum. This forum is for Developer SQL related questions.
Good luck in your task!
Tags: Database
Similar Questions
-
Read the names of files in a windows directory
Hello
I want to read the names of files in a Windows directory.
The grant of java is as follows
DBMS_JAVA.grant_permission ('USIDAS', 'java.io.FilePermission', 'N:\T050D2', 'read, write, delete');
The procedure to create a temporary table:
BEGIN
RUN IMMEDIATELY "DROP TABLE DIRLIST CASCADE CONSTRAINTS;
EXECUTE IMMEDIATE 'create a global temporary table DIRLIST '.
|| '( '
|| 'VARCHAR2 (255 BYTE) FILE NAME'
|| ') '
|| "ON COMMIT PRESERVE ROWS";
EXCEPTION
WHILE OTHERS
THEN
NULL;
END;
The java procedure:
CREATE OR REPLACE AND COMPILE the JAVA SOURCE NAMED 'DirList '.
LIKE import java. IO;
import java.sql. *;
public class DirList
{
Public Shared Sub getList (string directory)
throws SQLException
{
Path = new file (directory);
List of strings [] = path.list ();
Element string;
for (int i = 0; i < list.length; i ++)
{
item = list;
#sql {INSERT INTO DIRLIST (FILENAME)
{VALUES (: element)};
}
}
}
/
the PL/SQL procedure to call the Java procedure:
CREATE or REPLACE procedure get_dir_list (oracle_directory in)
VARCHAR2)
like java language
name 'DirList.getList (java.lang.String);
/
The call to SQL * more
SQL > exec get_dir_list ('N:\T050D2')
BEGIN get_dir_list ('N:\T050D2'); END;
*
ERROR on line 1:
ORA-29532: Java completed by eception Java exception appeal:
java.lang.NullPointerException
ORA-06512: at "USIDAS. GET_DIR_LIST', line 1
ORA-06512: at line 1
Versions:
SQL > select * from v version $;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE Production 11.1.0.7.0
AMT for HP - UX: 11.1.0.7.0 - Production Version
NLSRTL Version 11.1.0.7.0 - Production
Can someone help me solve this problem?
Thank you
Siegwinexec get_dir_list ('N:\T050D2')
Are you sure that N:\T050D2 is a valid directory on the DB server and not on your local PC?
Max
[My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/01/31/le-direttive-di-compilazione-pragma/] -
How about you, the personalization feature in reading a csv file?
I want to know about the personalization feature and how to implement it in j2me blackberry for reading a csv file
So guys someone help me about this
It is a code that I found somewhere that will provide this type of functionality.
It uses % and $ to indicate where substitutions must go, and the number between the two is used as the index in the array of strings that you provide as the second parameter.
I suspect that you can adapt it to your needs.
As Simon points out, it's really just a problem of standard Java, and you will be able to find solutions to these kinds of things looking around the Internet rather than here, where our attention is BlackBerry Java. in fact, I think I found this code somewhere on the Net.
private final static char LEFT_INDICATOR = '%'; private final static char RIGHT_INDICATOR = '$'; /** * Replace placeholders in template with parameters. * * @param message the template with placeholders * @param params array of parameters * @return buffer containing formatted message */ public static String formatMessage(String message, String[] params) { if (message == null || message.length() < 1 || params == null || params.length < 1 ) { throw new NullPointerException("formatMessage Template or parameter array is null or empty."); } boolean inside = false; boolean escaped = false; StringBuffer result = new StringBuffer(); StringBuffer placeholder = null; char lookingFor = LEFT_INDICATOR; char c; for (int i = 0; i < message.length(); i++) { c = message.charAt(i); if (c == lookingFor) { if (escaped) { result.append(c); escaped = false; continue; } if (c == LEFT_INDICATOR) { // look ahead for escaped indicator if ((i + 1) < message.length() && message.charAt(i + 1) == LEFT_INDICATOR) { escaped = true; } else { inside = true; lookingFor = RIGHT_INDICATOR; placeholder = new StringBuffer(); } } else { inside = false; lookingFor = LEFT_INDICATOR; // placeholder finished get parameter int index = -1; try { index = Integer.parseInt(placeholder.toString()); result.append(params[index-1]); } catch (Throwable t) { result.append(Characters.EM_DASH); // Something t.printStackTrace(); LibraryRepository.logEventError("Format Error for:" + message + ", placeholder: " + placeholder.toString() + ", parm #:" + params.length); } } } else { if (inside) { placeholder.append(c); } else { result.append(c); } } } // for return result.toString(); }
-
How to read the windows event in labview
I want to read the windows event viewer. Evt file to get information on the windows stop, start, restart... etc.
and save it in my database.
You might also take a peek at Microsoft LogParser. You can call the executable from the command line using System Exec. Supposedly, it also has an ActiveX interface.
-
Hi all
I bought Lenovo laptop 10 months before staple. Today in my system, a malicious program "Progressive Protection system" is automatically installed. As a result, I searched the Internet and deleted some files in windows directory in C drive. Now after restarting the system, it's popping up a message stating "you are a victim of counterfeit windows. Even I have validated my window in internet with options available always is saying that my window is not genuine. Don't know how to turn it back on. If someone can help with this problem?
I suspect that the problem is that the malware is still present - a repair installation will not get rid of it.
@Prad_121
Please follow the directions for the RDO and run the analysis offline so you can - at least, so we can be reasonably sure that the machine is free of malware.
Once completed, please post a new report MGADiag.
-
How stop on VMs by reading a CSV file or right next to the cluster
Hello
I have the CSV with the following headers: 'Name', 'Cluster', 'host ESX","data store ".
This csv lists all virtual machines powered in a cluster of XYZ.
How to read the CSV file and shudown all virtual machines?
or how can I stop the engine on the virtual machines in a cluster XYZ?
Thanks for your help,
To stop all the vm under tension is cluster xyz, you can do:
Get-Cluster-name xyz | Get - VM | Where-Object {$_.} PowerState - eq "Receptor"} |
Stop-VMGuest-confirm: $false
-
DVD player doesn't read the Windows 7 restore disk
Hello
I just bought a Samsung NP350V5C-A02UK laptop and I'm having problems with the DVD player.
It will read most discs that I put in it except the Samsung OS restore disc that came with it.
I've also downloaded an iso file of Win7 (64 bit), and created an installation of this use of the DVD disc, but then the laptop could not check the disk.
I have attached a USB DVD drive to the laptop and he could read the Samsung OK restore disc is one that makes me think of a problem with the DVD player.
In Device Manager, the DVD drive is listed as:
IDE\CDROMTSSTCORP_CDDVDW_SN-208BB___SC00___\4&32B8AC6E&0&0.1.0
Can someone help before I have send the laptop return it for a refund?
Hi Steven,
The Microsoft Article available at the following link has a fixit and a full list of steps that allows us to solve the problems of software generated in a DVD player. Please read the information contained in this article, and see if the steps mentioned in it helps you to solve this problem:
http://support.Microsoft.com/kb/982116
Note: Certain steps of this article may result in changes to the Windows registry. Any incorrect changes to the registry could prove fatal. So, to be on the safe side, please take a backup of your registry in this article before you make changes to registry.
If the steps in this article does not improve the situation, we have a high probability that the DVD drive has hardware problems. Since this is a new computer, I suggest you to contact Samsung support in this case. Samsung support would be the best point of contact for you to check your hardware. Here are the links for the Samsung support:
http://www.Samsung.com/us/support/
http://www.Samsung.com/us/support/contact
Hope this information is helpful to you. Don't answer if you need help with Windows, we will be happy to help you.
-
for the Windows directory structure question
Hi, I am confused with the use of the 'path' in the windows platform, for example, I have a directory like this structure in windows:
C:\galib247\vcpp2010\gathen, what makes a path '...... ------..' mean? Assume that the current folder is "ga".see you soon".." is the directory above the current directory. That's why "...-..." \.. "would be three records directory above where you currently are. So, if your current directory is "C:\galib247\vcpp2010\ga", then "...-..." \.. "would be the same as"C:\ ". ».
HTH,
JW
-
1 reading coulumn .csv file and display its PSD
Hello
I have a .csv file that corresponds to the readings (all the 1 second) voltage.
I am able to read using LabView, I use Read spreadsheet take his exit (all lines) and then select the first column only, pass it to build a wave form and then, view the power spectral density.
Unfortunately, nothing is displayed.
Any ideas? The file only contains double numbers (for example 0.01234 etc.). There are 50 thousand lines.
Thanks in advance.
Hello
I solved the problem in unbundeling the signal out of the PSD, then take the subsignal of greatness and him alone, then wads of scale together.
-
Cannot rename a file in the Windows directory, even with all the permissions
Hello. Long story short, I'm working on troubleshooting why Windows Update does not work. I'm following a guide that has me '2. Click Start, run and type "%windir%" (without the quotes) and press ENTER.
3. in the opened folder, find the folder named "C:\Windows\SoftwareDistribution".
4. right click on the folder, select Rename, and type "SDold" (without the quotes) to rename this folder. »
When I try to rename the file, it tells me I need to confirm this action, and the permission is denied. I click on the button continue with the shield. UAC asking you to confirm the action. After that, he always says 'Access denied Destination folder' and that I need permission to perform this action.
Try to work around this problem, I right click the folder, I am trying to rename, went to properties, you click on the tab titles and the me given the user 'Full control' permissions, identical to the administrator. That has yet to set it.
It's just one of the steps that I'm supposed to take, and I would like to see if I can find a way to do this, rather than return to the service of online support person and wait a day or two for the answer.
Thought of it myself. Restart in safe mode, enabled me to rename the file with ease.
-
just the previous question. my friends said that he never saw the temp folder before you say it comes with the operating system, but I do not know his reson to make it here.
The folder C:\Windows\Temp (or C:\WinNT\Temp) is a standard component of Windows. Programs use it to store temporary files. Boulder computer Maven
Most Microsoft Valuable Professional -
My HARD drive has not 'dead' and I can't read the windows vista product key.
I can actual almost all but 3 characters are clear.
My laptop is an ACER Aspire 4730Z.
What can I do?
Contact the manufacturer of the computer that the sticker is not readable and your hard disk is dead.
See you soon.
Mick Murphy - Microsoft partner
-
Can not read the windows product key
How can I get a replacement OEM Windows product key for HP (Microsoft site says contact manufacturer)
No.-you have No need of license with recovery discs key.
-
ODI - read CSV file and write to the Oracle table
Hello world
After 4 years, I started to work again with ODI, and I'm completely lost.
I need help, I don't know what to use for each step, interfaces, variables, procedures...
What I have to do is the following:
(1) reading a CSV file-> I have the topologies and the model defined
(2) assess whether there is a field of this CSV file in TABLE A-> who do not exist in the table is ignored (I tried with an interface joining the csv with the TABLE model a model and recording the result in a temporary data store)
Evaluate 3) I need to update TABLE C and if not I need to INSERT if another field that CSV exists in TABLE B-> if there
Could someone help me with what use?
Thanks in advance
Hi how are you?
You must:
Create an interface with the CSV template in the source and a RDBM table in the target (I'll assume you are using Oracle). Any type of filter or the transformation must be defined to be run in the stadium. (you must use a LKM for SQL file and add an IKM Sql control (it is best to trim them and insert the data when it cames to a file if you want after this process, you may have an incremental update to maintain history or something like that).)
For validation, you will use a reference constraints in the model of the oracle table: (for this you need a CKM Oracle to check constraints)
Then, you must select the table that you sponsor and in the column, you choose which column you will match.
To article 3, you repeat the above process.
And that's all. Pretty easy. If you do not have the two tables that you need to use your validation that you need to load before loading the CSV file you need valid.
Hope this can help you
-
Transfer files from UNIX server to the Windows server access path
Hello Experts, (Gud Gud same backward and Gud Mor)
Is there a way to transfer files from UNIX (Oracle database) server, to Windows server? AFAIK if path of Windows. I am able to read the file because it is on the server, but it does not recognize the Windows directory at all.
If you can share documents around this study, I will be grateful.
Kind regardsYou can download this PL/SQL package to FTP in PL/SQL. It is old, but still needs to do the job. Do not forget that in 11g, an ACL must be created to allow the code to access the network.
An alternative is to a Unix script ftp script and run (as an external process) using DBMS_SCHEDULER.
Maybe you are looking for
-
Satellite 2HW C855: win 8-10GB recovery partition can be removed?
For my Satellite C855-2HW with Win 8 OEM, I would like to a partition to separate data in addition to the OS + programs.At present 4 scores are already in use.First 450MO partition recovery, the second a third EFI 260 MB, of the score of 920 GB opera
-
HP PROBOOK 450 G2 I7: "HP PROBOOK 450 G2 I7" does support virtualization technology?
I want to buy a new HP laptop and it must support virtualization so I can use programs such as VMware and Virtualbox. 'HP PROBOOK 450 G2 I7' he takes?Thank you
-
HP3310: HP3310 driver printer for mac
My MacBookPro lost the driver for my all in one printer. HP no longer support the printer. Can anyone advise where I might be able to download the software.
-
Update Windows Installer?
How can I see which updates Windows to choose for my laptop HP Media Center? There is so much of.
-
After I uninstall some programs in windows XP service Pack 3, I loss the file association. Windows want to know what kind of program to create these files. the files are .exe. .lnk. I'm on a Dell dimension 555