SQL Loader - want to access data from .txt file but don't want to insert
Hello,
I have situation where I have some data in .txt file and I have to load that data into one of my table.
My problem is I have fundtion get_id(a,b,c) in database which I have to call while loading the data to find out value of x.
I have value of a, b and c in txt file which I can access it using POSITION(N:M) in sql loader, but After accessing that value I just want to past to get_id() function and dont want to insert into sql loader.
any help
My control file is as below
Following field is not in database but I need to pass the value to the function to get a ESC_USER_ID. any help
OFFICE_NUM filler POSITION(32:35) ,
STATION_DESK filler POSITION(45:48),
LOAD DATA
INFILE REFERRALs.TXT
BADFILE REFERRAL_LOAD.BAD
DISCARDFILE REFERRAL_LOAD.DIS
INSERT
INTO TABLE REFERRAL
EVALUATE CHECK_CONSTRAINTS REENABLE DISABLED_CONSTRAINTS
TRAILING NULLCOLS
ID sequence (1,1),
JOB_ID POSITION (16:22) "GET_JOB_ID(:JOB_ID)" ,
CUS_ID POSITION (23:31) "GET_CUS_ID(:CUS_ID)" ,
STATUS_LU CONSTANT 'F' ,
REQUEST_USER_TYPE_LU CONSTANT 'S' ,
OFFICE_NUM filler POSITION(32:35) ,
STATION_DESK filler POSITION(45:48),
REQUEST_USER_ID POSITION(143:149) "GET_ESCUSER_ID(OFFICE_NUM,STATION_DESK,:REQUEST_USER_ID)" ,
REQUEST_DT POSITION (37:44) "to_date(:REQUEST_DT,'YYYY/MM/DD')" ,
REVIEW_USER_ID FILLER ,
REVIEW_DT FILLER ,
REFUSE_REASON_LU FILLER ,
RESULT_LU POSITION (97:97) ,
NOTIFY_STATUS_LU FILLER ,
NOTIFY_DT FILLER ,
APPOINTMENT_DT POSITION (106:113) "to_date(:APPOINTMENT_DT,'YYYY/MM/DD')" ,
RESULT_DT POSITION (98:105) "to_date(:RESULT_DT,'YYYY/MM/DD')" ,
NO_MATCH_IND CONSTANT 'N'
)
Similar Messages
-
I would like to freeze saving to icloud and perhaps transfer some of that data to my own external hard drive. I don't want to lose anything already stored there, but don't want to purchase anymore cloud space. How do i accomplish this?
It seems that saving to iCloud is a default. My Pages documents automatically save there unless I change to save to destination. I probably just need help in setting up the cloud. When I tried to change the setting, though, it told me that if I made the change, all data on icloud would be eliminated and i don't want that. I would ideally like to save everything on my external HD and not bother with iCloud. Certainly don't want to buy more storage space. Thanks for replying so promptly.
-
I want to do a drag and drop but don't want it to be a test
Hi,
Any help would be greatly appreciated.
I am using Captivate 7.
I want to do a drag and drop but don't want it to be a test. This is for brain storming---not a test.
None of the items to drag are correct or incorrect---they are just ideas. For example the 20 items could be different things you might put in your suitcase for vacation. There are no wrong answers---just your preference.
There are 20 items to be dragged. There is only one drag target. All 20 items can go to that 1 drag target.
I don't want the learner to have to drag all of the items to the target in order to finish. For example, the learner might leave 3 items out because the learner doesn't like those items. I want the learner to be able to hit submit (or any other button) at any time and go to the next slide immediately, not have to finish the drag and drop. Any ideas?
thanks!Also be aware that if you add a quiz to the project, that the drag and drop and quiz affect each other.
In a way we have been cheated into thinking that is also a learning tool for repeated attempts. With a quiz in the project it does not work.
I also tried it without the quiz. When learners now use it, the drag and drop will "hang" at times. EMBARRASING when a client phones you with a stuck learning session!!
I have spent hours with the online Adobe dudes. It some or other "buG".
"BUG" is IT code for "we designed something but did not test it well enough and now we pretend that it is some mysterious organic organism that is maliciously undermining our design" -
How to read data from txt file respectively
Hi,
I am triying to form an equation between two known points. I want to do this with the attached VI, the most critical point is that I will read the x1, y1, x2 and y2 coordinates from the same .txt file. They will be written in a .txt file and I will send them to the appropriate channel (x1, y1, x2 and y2) respectively. How can I get data in a rule from a .txt file?
Could anyone please help me with this issue,
Best regards.
Attachments:
read from txt file.vi 8 KBDear RavensFan,
Thank you very much for your helps, I am bit new to labview so I usually can not find the appropriate functions easily. And a new problem has rised in my application. I should write the A, B and C numbers in the respective series to the file 2.txt. I am able to write them in a straight forward case but I want to write the next triples (A B C) in the next row. Like this;
A1 B1 C1
A2 B2 C2
A3 B3 C3
So how can I put new line constant and space constant to my VI?
Waiting for your valuable helps,
Best regards,
Attachments:
read_from_txt_fileMOD.vi 18 KB -
I want to save data to txt file on as ,how can do it ?
hi~everyone
i have some data in inner table ,i wantto save the data into TXT file on AS, then i download the file from AS,how can come true it ?who can give me some demo or cues ,thank you very much!
Message was edited by:
deqiang zhangCheck the example program using GUI_DOWNLOAD and it may help you
report zan_guidownload no standard page heading.
tables : vttk.
data : begin of i_vttk occurs 0,
tknum like vttk-tknum,
shtyp like vttk-shtyp,
end of i_vttk.
data : begin of i_down occurs 0,
fld(255) type c,
end of i_down.
start-of-selection.
select tknum shtyp from vttk into table i_vttk.
end-of-selection.
loop at i_vttk.
concatenate i_vttk-tknum ',' i_vttk into i_down.
endloop.
call function 'GUI_DOWNLOAD'
exporting
BIN_FILESIZE =
filename = 'C:\down.xls'
filetype = 'ASC'
append = 'X'
write_field_separator = ','
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = i_vttk
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Thanks
Seshu -
Want to get data from java file
Hi,
I am creating a program using JBuilder. All is going fine but im having trouble reading data. Well, I want to read data from a java program which is in the same package of my program but when i wrote the command to read it i get a Exception saying:
"java.io.FileNotFoundException: dataControl2.java (The system cannot find the file specified)"
Below is the program i wrote to do this:
The hole point of my program is to get temporary stored data from my conrol program that stores the data and saves it to a file. This program needs to get the user name and password and if the password is enabled or not.
try {
FileInputStream fi = new FileInputStream("dataControl2.java");
ObjectInputStream oi = new ObjectInputStream(fi);
dataControl2 dat = (dataControl2) oi.readObject();
jTextField1.setText("" + dat.userName);
if (dat.usePassword == 1) {
jPasswordField1.setEditable(false);
usePassword = 1;
oi.close();
} catch (Exception e) {
jTextField1.setText("" + e.toString());
I understand that the file cant be found, that wasnt hard to work out, but the thing is that the file does exist so i think i have wrote me program wrong.
If you can see wat i have done wrong or wish to learn more about my query email me at:
[email protected]
or
[email protected]
Many Thanks,
Tomwell, i did that and this is what my program looks like now:
try {
File aFile = new File("dataControl2.java");
System.out.println("absolute path : " + aFile.getAbsolutePath());
FileInputStream fi = new FileInputStream(aFile);
ObjectInputStream oi = new ObjectInputStream(fi);
dataControl2 dat = (dataControl2) oi.readObject();
jTextField1.setText("" + dat.userName);
if (dat.usePassword == 1) {
jPasswordField1.setEditable(false);
usePassword = 1;
oi.close();
} catch (Exception e) {
jTextField1.setText("" + e.toString());
System.out.println("");
System.out.println("" + e);
Well, now i get a message saying that the file is corrupted.
I have really screwed this up but i really need to get this fixed.
If possible i can zip my java program and send it to you if you ask!
tom -
SQL Loader Approch to fetch data from Previous Data Segment.
CREATE TABLE T
RECORD_ID NUMBER,
SEG_VALUES VARCHAR2(4000)
==============================================================================
LOAD DATA
INFILE *
TRUNCATE
INTO TABLE T
WHEN SEG_VALUES <> ''
RECORD_ID RECNUM,
SEG_VALUES POSITION(1:4000)
BEGIN DATA
AAASH9561000000074120081029SYS
BBB0000001H0351
CCC0000001 6040818 078141532A 202007083020070830 36274
CCC0000002 12623239 526486168A 202008063020080630 4808
CCC0000003 13326331 530229550A 202008042620080426 V4611
CCC0000004 23554261 161340499A 202008082220080822 6868
==============================================================================
CREATE TABLE T1
FILE_ID VARCHAR2(20),
CONT_NBR VARCHAR2(20),
SEG_VALUES VARCHAR2(4000)
==============================================================================
CREATE OR REPLACE PROCEDURE P
AS
l_Fileid T1.file_id%type;
l_Contractnbr t1.CONT_NBR%Type;
BEGIN
FOR REC IN (SELECT SEG_VALUES FROM T ORDER BY RECORD_ID)
LOOP
IF SUBSTR(REC.SEG_VALUES,1,3) ='AAA' THEN
l_Fileid := SUBSTR(REC.SEG_VALUES,10,10);
ELSIF SUBSTR(REC.SEG_VALUES,1,3) ='BBB' THEN
l_Contractnbr := SUBSTR(REC.SEG_VALUES,11,5);
ELSIF SUBSTR(REC.SEG_VALUES,1,3) ='CCC' THEN
INSERT INTO T1 VALUES (l_Fileid,l_Contractnbr,REC.SEG_VALUES);
END IF;
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR (-20458,SQLERRM);
END P;
==============================================================================
Is there is any simple approch to handle the above scenario in SQL Loader Control file? if possible can you please show me?Handle the above scenario? What above scenario?
Could I guess ... you betcha. Will I guess? Quite another matter.
Please provide full version (all 3 decimal places) and a clear and concise description of what help you need. -
Pulling output data from .txt file
Hello, I am trying to have a program that allows a user to input shopping items into the program andhave that input go to a .txt file called shoppinglist, then after the user is finished, he/she can type no to stop entering items to the list and the program will then pull all the info entered to the .txt file and output it to the screen, creating a shooping list for the user. My problem is that I am not quite sure how to output the data from the .txt file to the screen. Here is my code.
import java.io.*; // uses the java io library for the
import java.util.*; // BufferedReader class
public class week5
public static void main(String [] args)
PrintWriter inputItems = null;
try
inputItems = new PrintWriter(new FileOutputStream("shoppinglist.txt"));
BufferedReader outputItems = null;
String line = null;
outputItems = new BufferedReader(new FileReader("shoppinglist.txt"));
line = outputItems.readLine();
outputItems.close();
catch(FileNotFoundException e)
System.out.println("File file.txt not found");
System.out.println("or could not be opened.");
catch(IOException e)
System.out.println("Error reading from file file.txt.");
System.out.println("This program will create a shopping list:");
String keepGoing = "yes";
String item = null;
Scanner keyboard = new Scanner(System.in);
for (int count = 1; count < 999 && keepGoing.equalsIgnoreCase("yes");count++)
//ask for input, write it to a file
System.out.print("Please enter item # " + count + ": ");
System.out.print("");
item = keyboard.nextLine();
inputItems.println(count + " " + item);
//ask if you want to keep going
System.out.print("Do you wish to enter more items (yes/no): ");
System.out.print("");
keepGoing = keyboard.nextLine();
System.out.println("Your shopping list contains: " + item);
System.out.print("");
inputItems.close();
} All the above does is output the last item entered by the user, not the whole shopping list. Any help is greatly appreciated.nim_ramesh wrote:
outputItems = new BufferedReader(new FileReader("shoppinglist.txt"));
/* I think u want to print the text here so */
line = outputItems.readLine(); // Replace this line with that while loop
outputItems.close();
He hasn't even read the user input at that point.
OP, you need to sit down and think about the exact order you want to do things in, and rewrite your code in a logical straightforward manner. It looks like you just threw some code in hoping it would work, instead of coding deliberately. I'm not insulting you or anything, I know you're new to Java. I'm just trying to give you some advice. Look at your code, and ask yourself why the following line of code appears before you've even written anything to your file:
line = outputItems.readLine(); -
How to initialize Object Array Data Provider (OADP)with data from txt file
Hi,
I want to show in a table some columnar data from a txt file. I ran the creator demo application on OADP successfully. http://blogs.sun.com/divas/entry/using_the_object_array_data
I created a javabean class to read a txt file.However, I am stuck at how I can fill the data into an OADP array:
I am familiar with C extensively but not much at java. can anyone help??
thanks..
dr.am.mohan raoThanks for that. I changed it a little bit, but when i ran this script, got ORA-06532: Subscript outside of limit.
declare
O_voucher_comment SYSADM.AP_COMMENT_COLL := sysadm.ap_comment_coll(null);
begin
FAS_AP_EXCEPTIONS.GET_VOUCHER_COMMENTS('FCCAN', '20494753', 0, 'KEHE', O_voucher_comment);
end;
PROCEDURE get_voucher_comments (
v_bu_in IN VARCHAR2,
v_voucher_in IN VARCHAR2,
v_line_in IN NUMBER,
v_userid IN VARCHAR2,
voucher_comment OUT sysadm.ap_comment_coll
IS
i NUMBER := 1;
v_comments VARCHAR2 (254) := ' ';
comment_type sysadm.ap_comment_type;
v_line_num NUMBER := 0;
CURSOR get_all_comment
IS
SELECT voucher_line_num, descr254_mixed FROM ps_fas_ap_comment
WHERE business_unit = v_bu_in AND voucher_id = v_voucher_in;
CURSOR get_line_comment
IS
SELECT descr254_mixed FROM ps_fas_ap_comment
WHERE business_unit = v_bu_in AND voucher_id = v_voucher_in
AND voucher_line_num = v_line_in;
BEGIN
--voucher_comment() := SYSADM.ap_comment_type (NULL, NULL, NULL, NULL, NULL, NULL);
--' ', ' ', 0, ' ', '', ' ' sysadm.ap_comment_coll
voucher_comment := sysadm.ap_comment_coll(null);
IF v_line_in = 0
THEN
OPEN get_all_comment;
LOOP
FETCH get_all_comment
INTO v_line_num, v_comments;
if i > 1
then
voucher_comment.EXTEND;
end if;
voucher_comment (i) := ap_comment_type (v_bu_in,
v_voucher_in, v_line_num, v_userid,
TO_DATE (TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS'), 'DD-MON-YYYY HH24:MI:SS'), v_comments );
i := i + 1;
END LOOP;
ELSE
OPEN get_line_comment;
LOOP
FETCH get_line_comment
INTO v_comments;
voucher_comment.extend(6);
voucher_comment (i) := ap_comment_type (v_bu_in, v_voucher_in, v_line_num, v_userid, TO_DATE (TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS' ), 'DD-MON-YYYY HH24:MI:SS'), v_comments);
i := i + 1;
END LOOP;
END IF;
END get_voucher_comments; -
Accessing data from encrypted file...
Hi, is it possible to read data from file that encrypted using javax.crypto.* without decrypting that file back such as Microsoft Access Database file?
If it is possible, would somebody please show me how to do that.....thank you...why it scares u?
ok lets take other example......such as .dat file....i put some data in data.dat then encrypt that file....all i want to know is it possible to read data from data.dat(encrypted one) without decrypting that file back? -
Retrieve data from txt file to generate CWGraph plot
Please help...I'm not sure this is even possible, but here is what I need to do. I wrote a DAQ program that utilizes the CWGraph control. Each second a data point is collected by the program and displayed in one of the CWGraphs. The only problem I have is that if the program is closed or crashes for some reason, I lose the data plot in my CWGraphs. The data points are collected in a txt file which is then later worked up in Excel. My question is, is there a way to retrieve these data points from the txt file and re-generate the plots when the program is opened back up? The program would then take back over and plot along in realtime. I hope this is clear enough to understand. Feel free to ask any questions and any input would be greatly appreciated!
Hi Chris,
There is not a shipping example that would demonstrate exactly what you are looking for in your application.
The reading and writing to a file will require general VB 6.0 programming as Measurement Studio does not provide a feature to assist you with that. If you are not familiar with File I/O in VB 6.0, this site may be a good starting point: File I/O - VisualBasic Examples .
Once again, parsing the input from the text file will also require general VB 6.0 programming. I am not sure how your text file will be delimited, but you can use this example as a guide to parsing the input from the file: Parse String Using A Specific Delimiter .
To convert from strings to numbers in VB 6.0, you can use the Val() function. More information about how to use that function can be found on MSDN: Val Function .
Once you have an array of doubles, you can plot the data on your waveform graph as usual. If you are not familiar with how to plot an array to a CWGraph, please take a look at our shipping examples. The Simple Graph example is a great starting point.
Jessica
National Instruments
Product Support Engineer -
Import data from txt-file with reading column names
Hello,
after changing the the export of my simulation programm I can't use the solution postet here, wich works well. (I branded the post as soluted thats why I start a ne post)
Can anybode please tell me how to adept the code to import the new type of txt file. Here the name of the columns are in the first line aof the columns, like this (with ignoring the first lines).
"TIME " "Sitzbasis_X" "Sitzbasis_Y" "Sitzbasis_Z" "Achsklammer_Z" "Antriebsachse_Z" "Gegengewicht_Z" "Lenkachse_Z"
0.000000e+000 -5.472285e+003 -1.886681e+002 1.812099e+004 4.539113e+004 -1.252936e+005 -1.499764e+004 -9.806650e+003
1.000000e-003 -1.722846e+003 -1.141275e+002 8.443419e+003 2.475389e+004 -7.533712e+004 -1.138092e+004 -9.624729e+003
2.000000e-003 -3.964053e+002 -7.694600e+001 3.186345e+003 1.399086e+004 -5.653730e+004 -9.956198e+003 -9.311346e+003
I added an example file
Thanks for Help
Gabriel
Solved!
Go to Solution.
Attachments:
TXT-File.txt 115 KBHello Gabriel
You can use the DataPlugin Wizard (Navigator>>File>>DataPlugin Wizard) to define a new file import filter for your data. It will take only one minute.
Please found the uri file I create for you. Copy the attached file to your disk, unpack it and double click the uri file.
Then you can open your file by using "open with".
Hope this help
Attachments:
TXT_File_DataPlugin.zip 4 KB -
I don't know if I want all the crap I have collected but the ease of just cloning it is attractive? Can I just bring over email and pics and some docs? What should I do? Thanks! OS 10.68 on my pro.
Having a 1TB drive (about 2/3 full) I couldn't just use TimeMachine to move into the MBA; there wasn't enough space. If I had fewer applications and especially less music I probably would have migrated from TimeMachine. What I wound up doing was cloning my MBP to an external drive and then pruning it down to about 180GB. When the MBA arrived I used that external as my source for migrating and once I was certain all was well the external became my MBA TM drive.
-
Want to use iPod as a disk, but don't want iTunes to start
Hi,
I am a college student, and I am home for the semester break. I have some files that I am wanting to transfer to my 30GB iPod from our home computer before I go back to school; but when I plug it, in iTunes always starts. My sister has an iTunes library for her Nano on our home computer, and I don't want to mess anything of her's up. Is there any way that I can set iTunes so it doesn't automatically start when I connect my iPod? Any help would be great.
Thanks,
NateI'm afraid you can't change the setting without connecting the iPod since it's in one of the iPod preference tabs. Your iPod is safe as long as it is set to update manually, if it's not then you can use a key combination on your keyboard to prevent it syncing so that you can change the setting. While connecting the iPod to the computer on Windows with iTunes 7.3 or later installed hold down the Shift + Ctrl keys together. This will stop the iPod from auto-syncing with iTunes and the iPod will appear in the source list. Wait until you are sure the iPod has mounted, and that it will not auto sync and then you can let the keys go. This may take between 20 to 30 seconds depending on your computer: iTunes - Keyboard Shortcuts for Windows
If you want to connect and use an iPod on more than one computer you need to change the update preference in the iPod Summary tab to "Manually manage music and videos" and click Apply. The content of iTunes and the iPod are not syncronised in this mode so the two can be different. You can directly access the content of the iPod and play it through iTunes and you can drag and drop whatever you want to the iPod from either library:
Using iPod with Multiple computers
Managing content manually on iPod
Syncing Music to iPod
Something else to be aware of when using an iPod in manual mode is that the "Do Not Disconnect" message will remain on the display until you physically eject the device: Safely Disconnect IPod -
There are quite a few having problems related to container.exe due to updating to 3.6.4 as I see from this forum.
I don't have video problems, never did, and sounds like if I update, it's going to start having problems..
It is possible for ff to make a patch so that we can have a user friendly and safe disable (without system code?)
I appreciate firefox very much and thank you developers for your hard work and care.
I just don't want to update until this is stable..too risky..
Thanks!
== Operating system ==
winvistAlso be aware that if you add a quiz to the project, that the drag and drop and quiz affect each other.
In a way we have been cheated into thinking that is also a learning tool for repeated attempts. With a quiz in the project it does not work.
I also tried it without the quiz. When learners now use it, the drag and drop will "hang" at times. EMBARRASING when a client phones you with a stuck learning session!!
I have spent hours with the online Adobe dudes. It some or other "buG".
"BUG" is IT code for "we designed something but did not test it well enough and now we pretend that it is some mysterious organic organism that is maliciously undermining our design"
Maybe you are looking for
-
Low level USB port power control
This may be a software question, but is there a way to keep the USB ports from powering down on a MacBook? The power-saving feature is causing some trouble for some older USB equipment we have (like things aren't waking back up ). You can do this i
-
Any pointers to how to do predictive analysis using BI
Hello All Do you have any leads/pointers about how to do forecasting/predictive-analysis using OBIEE? I am looking for how to documents or tutorials. thanks
-
Deleting iPod Photo Cache fixes iPhoto syncing error 208
Thanks to some buried posts, I learned that deleting the "iPod Photo Cache" in the iPhoto Library folder fixes the -208 error that occurs when syncing an iPod Video with images in iPhoto. Instead of manually deleting this folder, however, I used OnyX
-
To Nokia - Bluetooth problems or 6300 and 3110
Dear Nokia, Please, please you are killing everyone with your Nokia bluetooth phone incompatiblity. What do you guys intend to do? Do you acknowledge there is a problems. I bought a 6300 when I lost the best Nokia ever phone 6230i. The bluetooth conn
-
What happened to the 12th episode of The Bachelorette?
Finally, the 13th--the very last episode of The Bachelorette was available so I was able to download it tonight (Tues). But that was the very final one. The previous episode, the 12th, wasn't available. That's the most important one, where the bac