Shell script for insert multiple records into a Database
I have a table in an Informix DB into which I want to insert multiple records at a time. Data for one of the column should be unique & other column data may be the same for all the records I insert
Typical Insert Statement I use to insert one row :
Now I want to pass different values for the 'empid' column, & data in rest of the columns can remain the same.
I am looking for something like looping empid & prompting user to enter the Start & End range of values for empid When User enters Start Value as 1 & End Value as 100, the script should inset 100 records with empid's from 1 to 100
Last edited by Scott; 07-12-2013 at 04:43 AM..
Reason: Code tags
Hi ,
I am new to linux and also also to shell scripting.
I have one shell script which unpacks .tgz file and install software on machine.
When this script runs I want to insert id,filename,description(which will be in readme file),log(which will be in log file) and name of unpacked folder... (1 Reply)
Hi,
I have delimited file(|).
Sample data:
1|name|50009|DS24|0|12
2|name|30009|DS24|0|13
3|name|20409|DS24|0|14
4|name|20009|DS24|0|15
5|name|10009|DS24|0|16
I want to load this data into a oracle table (update and insert)
Please help me the commands and also... (1 Reply)
hello all,
I am new to shell scripting and to unix... so the following is my assignment..
here i am trying to insert a values into sqlplus database using shell script.
the following is my shell script
InsertDelete.sh
#! /bin/sh
echo "*********The MENU********
1.Insert The Values... (2 Replies)
Hi,
I have gps receiver, by using gpsd data i can read gps log data to my database(my sql).
Steps:
1. telenet localhost 2947 > gps.txt (press enter)
2. r (press enter) //then i will get the data like below in gps.txt file
Trying 127.0.0.1...
Connected to localhost.... (1 Reply)
Hi, I am trying to parse a very long record in a text file into multiple records by checking ADD, DELETE, or MODIFY field value in a shell script.
Input
# File name xyz.txt
ADD|N000|8015662|DELETE|N001|9915662|MODIFY|N999|85678
Output
ADD|N000|8015662|
DELETE|N001|9915662|... (8 Replies)
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)
this is Korn shell unix.
The scenario is I have a pipe delimited text file which needs to be customized. say for example,I have a pipe delimited text file with 15 columns(| delimited) and 200 rows. currently the 11th and 12th column has null values for all the records(there are other null columns... (4 Replies)
Sorry to disturb you, I would like to seek help on inserting data whenever the switch is on or off to my phpMyAdmin mySQL database from my Shell Script. I'm using Raspberry PI as my hardware and I have follow this LINK: instructables.com/id/Web-Control-of-Raspberry-Pi-GPIO/?ALLSTEPS to create my... (4 Replies)
Hello All Members,
I am new to this forum and to the shell scripting. I want to write a shell script to do the following:
Scenario: I have a pipe delimited .txt file with multiple fields in it. The very first row of the file contains the name of the column which resembles the name of the... (18 Replies)
Discussion started by: chetanojha
18 Replies
LEARN ABOUT OSF1
acctprc2
acctprc(8) System Manager's Manual acctprc(8)NAME
acctprc1, acctprc2, accton - Perform process-accounting procedures
SYNOPSIS
acctprc1 [InFile]
acctprc2
accton [OutFile]
DESCRIPTION
The three acctprc commands, acctprc1, acctprc2, and accton, are used in the runacct shell procedure to produce process-accounting reports.
acctprc1 [InFile]
The acctprc1 command is used to read records from standard input that are in a format defined by the acct structure in the
/usr/include/sys/acct.h header file. This process adds the login names that correspond to user IDs, and then writes corresponding ASCII
records to standard output. For each process, the record format includes the following seven unheaded columns: The user ID column includes
both traditional and assigned user identification numbers listed in the /etc/passwd file. The login name is the one used for the user ID
in the /etc/passwd file. The number of seconds the process consumed when executed during prime-time hours. Prime-time and nonprime-time
hours are defined in the /usr/sbin/acct/holidays file. The number of seconds the process consumed when executed during nonprime-time
hours. Total number of characters transferred. Total number of blocks read and written. Mean memory size (in kilobyte units).
When specified, InFile contains a list of login sessions in a format defined by the utmp structure in the /usr/include/utmp.h header file.
The login session records are sorted according to user ID and login name. When InFile is not specified, acctprc1 gets login names from the
password file /etc/passwd. The information in InFile is used to distinguish different login names that share the same user ID.
acctprc2
The acctprc2 command reads, from standard input, the records written by acctprc1, summarizes them according to user ID and name, and writes
sorted summaries to standard output as total accounting records in the tacct format (see the acctmerg command).
accton [OutFile]
When no parameters are specified with the accton command, account processing is turned off. When you specify an existing OutFile file,
process accounting is turned on, and the kernel adds records to that file. You must specify an Outfile to start process accounting. Many
shell script procedures expect the file name /var/adm/pacct, the standard process-accounting file.
EXAMPLES
To add a user name to each process-accounting record in a binary file and then write these modified binary-file records to an ASCII file
named out.file, enter the following line to an accounting shell script:
/usr/sbin/acct/acctprc1 < /var/adm/pacct >out.file
A user name is added to each record. The raw data in the pacct file is converted to ASCII and added to file out.file. To produce a
total binary accounting record of the ASCII output file out.file produced in example 1, enter the following line to an accounting
shell script:
/usr/sbin/acct/acctprc2 < out.file > /var/adm/acct/nite/daytacct
The resulting binary total accounting file, written in the acct format, contains records sorted by user ID. This sorted user ID
file, is usually merged with other total accounting records when an acctmerg command is processed to produce a daily summary
accounting record called /var/adm/acct/sum/daytacct. To turn on process accounting, enter:
/usr/sbin/acct/accton /var/adm/pacct To turn off process accounting, enter:
/usr/sbin/acct/accton
FILES
Specifies the command path. Specifies the command path. Specifies the command path.
RELATED INFORMATION
Commands: acct(8), acctcms(8), acctmerg(8), runacct(8)
Functions: acct(2) delim off
acctprc(8)