Sponsored Content
Top Forums Shell Programming and Scripting Shell script for insert multiple records into a Database Post 302831851 by MadeInGermany on Friday 12th of July 2013 03:47:55 AM
Old 07-12-2013
Start with this script:
Code:
#!/bin/bash
printf "empID lo: "
read empID_lo
printf "empID hi: "
read empID_hi
printf "country: "
read country
printf "state: "
read state
printf "value #1/3: "
read val1
printf "value #2/3: "
read val2
printf "value #3/3: "
read val3
ei=$empID_lo
while [ $ei -le $empID_hi ]
do
 echo "employee($ei, $country, $state) values($val1, $val2, $val3)" 
 ei=$(($ei+1))
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script: want to insert values in database when update script runs

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)
Discussion started by: ring
1 Replies

2. UNIX for Advanced & Expert Users

unix script for update or insert records from a file to a oracle table

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)
Discussion started by: unihp1
1 Replies

3. Shell Programming and Scripting

insert values into sqlplus database using shell script

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)
Discussion started by: pradeept
2 Replies

4. Shell Programming and Scripting

shell script to insert data from gps.txt to mysql database

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)
Discussion started by: gudivada213
1 Replies

5. Shell Programming and Scripting

Parsing record into multiple records in Shell Script

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)
Discussion started by: naveed
8 Replies

6. Shell Programming and Scripting

Korn shell program to parse CSV text file and insert values into Oracle database

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

7. Shell Programming and Scripting

how to Insert values in multiple lines(records) within a pipe delimited text file in specific cols

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)
Discussion started by: vasan2815
4 Replies

8. Shell Programming and Scripting

shell script for saving oracle database records in variable

i want to retrieve value in each column of each row in sql plus and save them into array variable and echo the value in array variable (2 Replies)
Discussion started by: ramish
2 Replies

9. Shell Programming and Scripting

Need help on Insert data to phpMyAdmin mySQL database from Shell Script

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)
Discussion started by: aoiregion
4 Replies

10. Shell Programming and Scripting

Intelligent Script to Insert Records in Database Table

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
PDO_INFORMIX-DSN(3)							 1						       PDO_INFORMIX-DSN(3)

PDO_INFORMIX DSN - Connecting to Informix databases

	The  PDO_INFORMIX  Data Source Name (DSN) is based on the Informix ODBC DSN string. Details on configuring an Informix ODBC DSN are avail-
       able from the Informix Dynamic Server Information Center. The major components of the PDO_INFORMIX DSN are:

	      o DSN prefix
		- The DSN prefix is informix:.

	      o DSN
		- The DSN can be either a data source setup using odbc.ini or a complete connection string.

       Example #1

	      PDO_INFORMIX DSN example using odbc.ini

	       The following example shows a PDO_INFORMIX DSN for connecting to an Informix database cataloged as Infdrv33 in odbc.ini:

	      $db = new PDO("informix:DSN=Infdrv33", "", "");

	      [ODBC Data Sources]
	      Infdrv33=INFORMIX 3.3 32-BIT

	      [Infdrv33]
	      Driver=/opt/informix/csdk_2.81.UC1G2/lib/cli/iclis09b.so
	      Description=INFORMIX 3.3 32-BIT
	      Database=common_db
	      LogonID=testuser
	      pwd=testpass
	      Servername=ids_server
	      DB_LOCALE=en_US.819
	      OPTIMIZEAUTOCOMMIT=1
	      ENABLESCROLLABLECURSORS=1

       Example #2

	      PDO_INFORMIX DSN example using a connection string

	       The following example shows a PDO_INFORMIX DSN for connecting to an Informix database named common_db using the Informix connection
	      string syntax.

	      $db = new PDO("informix:host=host.domain.com; service=9800;
		  database=common_db; server=ids_server; protocol=onsoctcp;
		  EnableScrollableCursors=1", "testuser", "tespass");

PHP Documentation Group 												       PDO_INFORMIX-DSN(3)
All times are GMT -4. The time now is 07:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy