oracle sql within,Problems running sql within unix shell

SunOS solftden04 5.10 Generic_150400-38 sun4v sparc sun4v

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

PL/SQL Release 12.1.0.2.0 - Production

CORE12.1.0.2.0Production

TNS for Solaris: Version 12.1.0.2.0 - Production

NLSRTL Version 12.1.0.2.0 - Production

So I'm trying to run a script in Solaris unix, which calls a case statement to generate a menu.

Within the menu, depending on what you select, will either run a unix script, or a combination of unix and sql.

But when I execute it I get the following error.

syntax error at line 49 : `<

Here is the shell script.#!/usr/bin/ksh -xv################################################### Script created 14 Nov 2016# Automating the promote process# V1.0 initial trial# Script will run the promote script, then compile the specified packages (Non prompted for the is version)# Then it will run utlrp to recompile all objects.## Add revisions to this area#------------------------------------------------------------------------------------------------------------# 11/28/2016 Removed individual scripts.  Added menu driven functionality to allow all or partial process.##################################################clear;echo "###################################################################"echo ""echo "              Enter 1 to run the full promote process              "echo "              Enter 2 for migacp and utilrp                        "echo "              Enter 3 for utilrp only                              "echo ""echo "###################################################################"echo "ENTER YOUR CHOICE:"read NUMecho ""echo ""echo ""echo ""#case $NUM in        #1) /ccia/global/bin/promote        #/home/wcis50/work/migacp        #sqlplus system/xxx<

For those that don't know, the dash in front of the EOF allows the trailing EOF to have tabs in front of it so you can keep your code formatted.  Otherwise the trailing EOF MUST be at the very beginning of a line.

Some history of the script.  The actual sql is supposed to run as sysdba.  So (AGAINST MY JUDGEMENT) I had it as  the following, and it was failing.sqlplus /nolog <

As you can see in the code, I have a whole section commented out.  That is the ACTUAL script.  The bottom portion is me just trying to simplify and narrow.  I took out the formatting option of the EOF and put the trailing EOF at the beginning of the line.  I replaced the sqlplus /nolog with the system user and password.  I also tried it as my own user and password.  But these all still throw the same error.

What am I overlooking?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值