Updating with SQLPLUS


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Updating with SQLPLUS
# 1  
Old 12-08-2010
Updating with SQLPLUS

I am using the following code to update a table of mine. The problem is that the long string created to tempfile5 gives me the SP2-0027 error in Oracle. Is there any way to break up my string and still preserve the integrity?

Code:
echo `awk -F "|" '{x=x","$1} END{print substr(x,2)}' $tempfile2` > $tempfile5
#echo "UPDATE $STAGINGDBSCHEMA.$TABLE L SET L.MSG_PROCESS_TS=TO_DATE($q$CURRDATETIME$q,$q"YYYY-MM-dd HH24:MI:SS"$q) WHERE L.MSG_ROW_SEQ in (`awk '{print $0}' $tempfile5`);" > $SEQSQL
#sqlplus -s <<EOF 
#set heading off
#set pagesize 0
#set tab off
#@$SEQSQL
#exit
#EOF

---------- Post updated at 10:42 PM ---------- Previous update was at 09:07 PM ----------

AHA

i just came up with a solution. I put the echo statement I used above inside the original do while loop and spooled that to .sql file. That way I had a complete update statement for each msg_row_seq. When I invoked that file in sqlplus, it ran very fast for 800+ records so think I will stick to that solution for now.
# 2  
Old 12-08-2010
the first line can be changed .(I don't understand why you need echo it)

Code:
awk -F "|" '{printf $1 ","}' $tempfile2 > $tempfile5

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Help with updating bios

I need to update a setting in the BIOS on our SCO Openserver 5.0.7 system and all I can bring up about it says I need to create a dos bootable disk of some sort. The problem is that it doesn't seem like dos is loading up fully. I created the dos bootable thumb drive on a Windows PC using Rufus... (7 Replies)
Discussion started by: hometrics
7 Replies

2. Ubuntu

16.04 not updating

Just installed the latest version on my hp stream, was tired of windows. Of the few times I've used Linux, this is the first time it won't update. Im connected to the net the updater recognizes that the OS needs 21 updates. But it won't download/install the updates. It also won't load the... (1 Reply)
Discussion started by: DabblingMadman
1 Replies

3. UNIX and Linux Applications

Problem on SQLplus command ""bash: sqlplus: command not found""

Hi all, i face an error related to my server ""it's running server"" when i use sqlplus command $ sqlplus bash: sqlplus: command not found the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup. i already check the directory... (4 Replies)
Discussion started by: clerck
4 Replies

4. Shell Programming and Scripting

Sqlplus error - sqlplus -s <login/password@dbname> : No such file or directory

i am using bash shell Whenever i declare an array, and then using sqlplus, i am getting sqlplus error and return code 127. IFS="," declare -a Arr=($Variable1); SQLPLUS=sqlplus -s "${DBUSER}"/"${DBPASS}"@"${DBASE} echo "set head off ; " > ${SQLCMD} echo "set PAGESIZE 0 ;" >> ${SQLCMD}... (6 Replies)
Discussion started by: arghadeep adity
6 Replies

5. Shell Programming and Scripting

Updating variable

Hi, I have been attempting to install source code from xcrysden with little to no luck. I have attempted to follow the instructions given on the site but made the mistake on the code I downloaded. This was pointed out to my by the developer and I have since downloaded the proper code. However... (4 Replies)
Discussion started by: Zbay
4 Replies

6. Shell Programming and Scripting

Need help for updating the folder

Hello Expert, is there any command through which i can update/replace the folder after every two months. lets say i have folder /usr/local/x_folder created on 01/01/2011 I need to update it on 31/03/2011 Please help me to get the logic :confused: Thanks (3 Replies)
Discussion started by: aks_1902
3 Replies

7. UNIX for Dummies Questions & Answers

Updating a database

i've got a database setup that references user inputs to see if they are already inputted. What I am wanting to do is allow the user to update the database by typing "update: name" where name is someone already in the database. echo "Enter your name." read NAME location=`find . -name... (2 Replies)
Discussion started by: fufaso
2 Replies

8. Shell Programming and Scripting

awk updating one file with another, comparing, updating

Hello, I read and search through this wonderful forum and tried different approaches but it seems I lack some knowledge and neurones ^^ Here is what I'm trying to achieve : file1: test filea 3495; test fileb 4578; test filec 7689; test filey 9978; test filez 12300; file2: test filea... (11 Replies)
Discussion started by: mecano
11 Replies

9. AIX

updating ssa

I am in the process of updating ssa adapters, drives and enclosures and wanted to know if there are any caveats that anyone would like to share. The documentation is not very clear on the ordering of the updates. Any tips would be appreciated. (1 Reply)
Discussion started by: chosie
1 Replies
Login or Register to Ask a Question