Sponsored Content
Top Forums Shell Programming and Scripting Script does not execute Insert Statement Post 302086549 by blowtorch on Thursday 24th of August 2006 08:58:30 PM
Old 08-24-2006
Amruta, you could use the shell to do this quite easily:
Code:
#####Connecting sqlplus to check the connectivity
sqlplus -s /nolog <<EOF>/dev/null
connect ${DB_LOGIN}/${DB_PASSWORD}@${DB_NAME}
oldIFS=$IFS
IFS=,
while read acctno salutation name billdate totaldue billdeductiondate billduedate templatecode billid emailid brnno billsummaryid batchno field14 field15 emailfile rest_of_the_fields; do
    echo "Insert into table"
# insert into whatever table, whichever values that you want
# after you are done, go ahead
    echo "Table Appended"
    commit;
    spool off;
    exit;
    EOF
done

field14, field15: hold the 14th and 15th fields, rest_of_the_fields: holds the fields from 17 to end of line. Everything else goes into the appropriately named variables.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do i execute in IF ELSE Statement

ls -ld /path/to/dir1 path/to/dir2 | awk '{print $8}' how to execute above script in IF ELSE Statement. Pls iam new to Unix (1 Reply)
Discussion started by: laknar
1 Replies

2. Shell Programming and Scripting

Need to execute the same statement

I have written a script for converting an IP address into its corresponding AS number in PHP. But based on the timing analysis, I've observed that it takes a long time to process large number of entries. So I need to do something directly in unix. What method would one suggest for this purpose? ... (8 Replies)
Discussion started by: Legend986
8 Replies

3. Shell Programming and Scripting

How is use sselect statement o/p in insert statement.

Hi All, I am using Unix ksh script. I need to insert values to a table using the o/p from a slelect statement. Can anybody Help! My script looks like tihs. ---`sqlplus -s username/password@SID << EOF set heading off set feedback off set pages 0 insert into ${TB_NAME}_D... (2 Replies)
Discussion started by: nkosaraju
2 Replies

4. AIX

Controling a statement to execute

Hi All I have a script which runs a piece of JOB. The jobs are in sequence and if it fails at a particular job I wanted it to be started from the point where it failed. What I did I prepared two properties file one which contains the entire List of the JOBS which are to be executed and the... (5 Replies)
Discussion started by: Prashantckc
5 Replies

5. Shell Programming and Scripting

error in insert statement

hi, When i try to run the code below, i get the following error "ksh: syntax error: `(' unexpected" i am not able to figure it out. Can anyone help me? Code: (2 Replies)
Discussion started by: ragavhere
2 Replies

6. Programming

Dynamic Insert statement

I have a form , where i will put the values to a table. I wrote a insert statement for the same. Table structure is ename | character varying(30) | eadd | character varying(30) | eid | integer | sal | integer In the statements, i don't... (1 Reply)
Discussion started by: pritish.sas
1 Replies

7. Shell Programming and Scripting

How to insert numbers to a in between statement

Hi Guys, I want to create a shell script that will give me the output below. I want to insert the numbers from the input file to my url addresses below. And from the numbers below, I want to separate the last digit with a period (i.e. from 222222222222 to 22222222222.2). Appreciate any help.... (14 Replies)
Discussion started by: pinpe
14 Replies

8. Shell Programming and Scripting

How to insert date in a statement?

Hi Guys, Can somebody help me in inserting today's DATE format (20110709) in my awk statement. I have a script but its not working. inputfile.txt: 269,1,0,AAA,430 231,2,0,BBB,430 252,3,0,CCC,430 214,4,0,DDD,430 script.sh #!/bin/bash DATE="`date +%Y%m%d`" cd /var/opt/ (8 Replies)
Discussion started by: pinpe
8 Replies

9. Shell Programming and Scripting

How to pass tablenames from a file to shell script to execute create statement in DB2

Hi, I am new to Shell Scripting, and I need to create nicknames for 600 tables in db2. I have the file names in a text file and i have to pass these table names to a shell script create nicknames in db2. Can some one please help me in this regard. (1 Reply)
Discussion started by: kamalanaatha
1 Replies

10. Shell Programming and Scripting

Convert Update statement into Insert statement in UNIX using awk, sed....

Hi folks, I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex. I have a bunch of update statements with all columns in a file which I need to convert into insert statements. UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
MONGODBDRIVERMANAGER.__CONSTRUCT(3)					 1				       MONGODBDRIVERMANAGER.__CONSTRUCT(3)

MongoDBnager::__construct - Create new MongoDB Manager

SYNOPSIS
finalpublic MongoDBDriverManager::__construct (string $uri, [array $options], [array $driverOptions]) DESCRIPTION
Constructs a new MongoDBDriverManager object with the specified options. PARAMETERS
o $uri - A mongodb:// connection URI: mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] o $options -Connection string options. Note Specifying options via the $options argument will overwrite any options with the same name in the $uri argument. o $driverOptions - Any driver-specific options not included in MongoDB connection spec. ERRORS
/EXCEPTIONS oThrows InvalidArgumentException on argument parsing errors. oThrows MongoDBDriverRuntimeException if the $uri format is invalid EXAMPLES
Example #1 MongoDBDriverManager.__construct(3) basic examples Connecting to standalone MongoDB node <?php $manager = new MongoDBDriverManager("mongodb://localhost:27017"); ?> Connecting to a replica set <?php $manager = new MongoDBDriverManager("mongodb://rs1.example.com,rs2.example.com/?replicaSet=myReplicaSet"); ?> Connecting to a sharded cluster (i.e. one or more mongos instances) <?php $manager = new MongoDBDriverManager("mongodb://mongos1.example.com,mongos2.example.com/"); ?> Connecting to MongoDB with authentication credentials for a particular user and database. <?php $manager = new MongoDBDriverManager("mongodb://myusername:mypassword@localhost:27017/mydatabase"); ?> SEE ALSO
MongoDBDriverServer::__construct, "Chapter#2 Connecting to MongoDB", Connection string URI format. PHP Documentation Group MONGODBDRIVERMANAGER.__CONSTRUCT(3)
All times are GMT -4. The time now is 09:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy