10-30-2008
how to insert data into database by reading it from a text file??
Hi....can you guys help me out in this script??
Below is a text file and it contains these:
GEF001 000093625 MKL002510 000001 000000 000000 000000 000000 000000 000001
GEF001 000093625 MKL003604 000001 000000 000000 000000 000000 000000 000001
GEF001 000093625 MKL005675 000001 000000 000000 000000 000000 000000 000001
GEF001 000093625 MKL005678 000001 000000 000000 000000 000000 000000 000001
I would like the first 3 columns of data to be read by the script to insert into the database.
The database table is
IMSERNOS
and its contains 3 fields..namely:
ImiCode varchar2(6),
CustNo varchar2(9),
SerNo varchar2(9)
How to create a script that reads the data and insert this data into the database?
im having a headache now on working on this scripts....hope you(expertists) can help
a million thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi....can you guys help me out in this script??
Below is a text file script....called Bukom.txt and it contains these:
BUKOM 20060101 2.5 2.6 2.7 2.8 2.9 2.3 2.1
BUKOM 20060102 2.4 2.5 2.6 2.7 2.7 2.6 2.4
BUKOM 20060103 2.1 ... (9 Replies)
Discussion started by: forevercalz
9 Replies
2. Shell Programming and Scripting
Hi,
Need to get help from you guys about this issue.
I need to insert data into MySql database from a text file which is located in other server.
The text file is something look like below:
Date | SubscriberNo | Call Duration
20/7/07 | 123456788 | 20
20/7/07 | 123412344 | 30
The... (4 Replies)
Discussion started by: shirleyeow
4 Replies
3. Shell Programming and Scripting
hello,
I have got the following problem that I am hoping someone can help with please.
1. I have got the following text file (below) , the columns data are
'Test Day', 'Board', 'Betting Number'.
TEXT FILE
============================================
1 3 02-01-27-28-29-30
0 1... (1 Reply)
Discussion started by: jermaine4ever
1 Replies
4. Shell Programming and Scripting
Hello,
I have a problem which is giving me headache for days, can some please help. Please see code and text fiel below. Please see text in red for the problem I am facing
# Program gets an input x from user
while read line ; do
echo... (4 Replies)
Discussion started by: jermaine4ever
4 Replies
5. Shell Programming and Scripting
Hi All,
Please help me in writing data to a file in one row.
In database there is a column which contains large data which does not fit in the file in one row. The column contains list of paths. I want to write these paths to a file in one row.
Please find the code below writes :
... (2 Replies)
Discussion started by: rajeshorpu
2 Replies
6. Web Development
If you have a text file and if you want to Insert data to your Database Table, You can do it with these queries
LOAD DATA LOCAL INFILE '/path/yourTextFile.txt' INTO TABLE yourTableName
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n' (0 Replies)
Discussion started by: sitex
0 Replies
7. Shell Programming and Scripting
Hi,
I have below type of data in a text file in unix.
Emp_Name Emp_Dept
Raj 101
Amruta 100
Shilpa 100
Rohit 123
Amol 198
Rosh 101
Gaurav 198
Number of employees can be even more.
Need a command or a... (2 Replies)
Discussion started by: rajneesh_kapoor
2 Replies
8. Shell Programming and Scripting
Enclosed is comma separated text file. I need to write a korn shell program that will parse the text file and insert the values into Oracle database.
I need to write the korn shell program on Red Hat Enterprise Linux server.
Oracle database is 10g. (15 Replies)
Discussion started by: shellguy
15 Replies
9. Programming
Hi guys, I would like to seek help on inserting data whenever the switch is on or off to my sensor mySQL database in phpMyAdmin from my control.php. I'm using Raspberry PI as my hardware and follow a few tutorials to create my own Web Control Interface, it works perfectly without insert method.... (1 Reply)
Discussion started by: aoiregion
1 Replies
10. Shell Programming and Scripting
I have a test file that I want to read and insert only certain lines into the
the table based on a filter.
1. Rread the log file 12 Hours back Getdate() -12 Hours
2. Extract the following information on for lines that say "DUMP is
complete"
A. Date
B. Database Name
C.... (2 Replies)
Discussion started by: JolietJake
2 Replies
LEARN ABOUT DEBIAN
selinux_raw_context_to_color
selinux_raw_context_to_color(3) Library Functions Manual selinux_raw_context_to_color(3)
NAME
selinux_raw_context_to_color - Return RGB color string for an SELinux security context.
SYNOPSIS
#include <selinux/selinux.h>
int selinux_raw_context_to_color(security_context_t raw,
char **color_str);
DESCRIPTION
selinux_raw_context_to_color returns a color_str associated to the raw context raw provided that the mcstransd(8) daemon is running, the
policy is an MLS type policy (MCS or MLS) and there is a color configuration file secolor.conf(5) (see the FILES section).
The color_str string is a space separated list of eight hexadecimal RGB triples, each prefixed by a hash character (#). These represent the
user:role:type:range components of the foreground and background colors. An example string is shown in the EXAMPLE section.
The returned color_str string must be freed with free(3).
If a color has not been configured for a specific user, role, type and/or range component of context raw, then selinux_raw_context_to_color
will select the color returned in color_str in order of precedence as follows:
role, type, range
user, type, range
user, role, range
user, role, type
If there are no entries in the secolor.conf file for any of the components of context raw (or the file is not present), then the default
string returned in color_str is:
----- user ---- ---- role ---- ---- type ---- ---- range ----
#000000 #ffffff #000000 #ffffff #000000 #ffffff #000000 #ffffff
RETURN VALUE
On success, zero is returned.
On failure, -1 is returned with errno set appropriately.
ERRORS
ENOENT If the mcstransd(8) daemon is not running.
FILES
selinux_raw_context_to_color obtains the translated entry from the active policy secolor.conf(5) file as returned by selinux_col-
ors_path(3). The file format is described in secolor.conf(5).
NOTES
1. The primary use of selinux_raw_context_to_color is to return a color that corresponds to a range, that can then be used to highlight
information at different MLS levels.
2. The mcstransd(8) daemon process security level must dominate the raw security level passed to it by the selinux_raw_context_to_color
function. If not, the range color selected will be as defined by the order of precedence.
EXAMPLE
selinux_raw_context_to_color returns the foreground and background colors of the context string components (user:role:type:range) as RGB
triples as follows:
user : role : type : range
fg bg : fg bg : fg bg : fg bg
#000000 #ffffff #ffffff #000000 #d2b48c #ffa500 #000000 #008000
black white : white black : tan orange : black green
SEE ALSO
selinux(8), selinux_colors_path(3), mcstransd(8), secolor.conf(5), selinux_raw_to_trans_context(3), selinux_trans_to_raw_context(3),
free(3)
SELinux API documentation 08 April 2011 selinux_raw_context_to_color(3)