Execution problems to call the DB table through UNIX
Hi All,
I am beginner to the Unix scripting, i am writing a script to call the DB through Unix script. I have to read the files from the given path and in each file the first column i have to pick up and delete the row in the table based on that column.
I am getting below error and correct me if the script is wrong
Thanks in advance!!
Last edited by rbatte1; 08-23-2017 at 08:43 AM..
Reason: Correctted CODE tags
Can you show us the whole output? I would expect it to start with something like this:-
Without seeing how far it gets, it will be difficult to spot the problem.
Can you confirm if the parameters contain any embedded spaces or other unusual characters?
I also notice that your quoting might be a little awry, but I don't think you've got that far yet.
What else is in the current directory when you run this? It might be that a wild-card character is getting misinterpreted because of misplaced quoting.
I was also expecting the same out put as you quoted, but i have posted the whole output. Tht's where i was also confused. Could you please correct the script for others.
Two comments:
- the error msgs and the script seem not to coincide: the line numbers given don't show the commands cited.
- somewhere in the script or its data, <CR> (\r, 0x0D, ^M) characters seem to screw up the CLI. How did you create the script / the data?
Thanks RudiC!!
I have modified the script little bit, now its failing in the DB connection part.I am able to connect to the DB through UNIX when i run the only DB script part(in another script) but i am unable to execute that in the entire script,Please look into the code and correct me
Error I am getting
Moderator's Comments:
Please use CODE tags for data as well, as required by forum rules!
Last edited by RudiC; 08-23-2017 at 12:00 PM..
Reason: Added CODE tags.
Now this is a totally different situation - the errors mentioned in post#1 have disappeared. Is this by chance or did you correct / modify anything?
The error shown occurs because in the here document as used the shell is missing the delimiter which it expects at the beginning of the line. To deploy an indented delimiter, c.f. man bash:
Quote:
If the redirection operator is <<-, then all leading tab characters are stripped from input lines and the line containing delimiter. This allows here-documents within shell scripts to be indented in a natural fashion.
How to find a word in a directory which contains many files?
i just want to count how many such words are present in all the files?
This is the code which i tried for a single file
echo "Enter the file name:"
read file
echo "Enter the word to search:"
read word
if
then
echo "The count... (4 Replies)
I want to implement a feature in my project where I want to attach the virtual IP on the interface present at the top in Routing table. I know the command to print the routing table, its "netstat -r". But I need a system call, so that I don't have to go for parsing . Can someone please provide any... (1 Reply)
Hi Team,
I created one file like tst.pl, it contains
#!/usr/bin/perl
use Spreadsheet::ParseExcel;
During execution it's showing error like use: command not found.
Pleast let me suggest how to use this perl menthods in Unix.
Thanks in Advance,
Reards,
Harris (5 Replies)
Hi,I confused how to use sed to deal with big file.
example:
the big file have some different urls just with filename.
how can i use sed to fetch url except file name and replace to other urls with filename?
thanks!!! (11 Replies)
I am new to unix and trying to execute sql script from unix. I have function already in database and trying to execute it from Cygwin unix and getting stuck. Can someone guide me where I wrote the shell script wrong
sqlplus -s scott/tiger
declare
a number:=3;
b number:=4;
c number;
d... (2 Replies)
this my source file
************* fixed ***************
Begin
equipmentId : d9
processor : fox
number : bhhhhhh
Variable # 1:
Id : 100
Type : 9
nType : s
gType : 5f
mType : 4
LField : England
DataField : london
Length ... (6 Replies)
i have been working on this for a about 12 hours today say's end of file un expected any idea's
using the bourne shell and its driving me nuts worked fine in bash but prof says make it work in bourne and good luck worth 13%
any help would be awesome
#!/bin/sh
trap "rm mnt2/source/tmp/* 2>... (1 Reply)
hi all,
i tried the following source codes:
fork1.c:
main()
{
printf("demo of fork\n");
fork();
printf("hello");
}
output:
demo of fork
hello hello
fork2.c:
main() (3 Replies)