![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem In Shell Script | satyakide | Shell Programming and Scripting | 11 | 09-24-2007 11:00 AM |
| Shell Script Menus - Rejecting invalid input (KSH) | rockysfr | Shell Programming and Scripting | 2 | 06-26-2007 04:14 PM |
| shell script problem | djt0506 | UNIX for Dummies Questions & Answers | 2 | 12-07-2005 11:29 PM |
| Problem with shell script | zylwyz | Shell Programming and Scripting | 2 | 06-29-2005 02:01 PM |
| shell script problem | strpeski | UNIX for Advanced & Expert Users | 10 | 09-03-2001 09:22 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Problem with shell script...ORA-00904:invalid identifier
Guys,
Please suggest me what's wrong with this script? #!/usr/bin/sh ############################################################################## # Author : Bhagat Singh # # # Date : Nov 13,2006 # ############################################################################## OUTPUT=$(sqlplus -s xxx/yyy#@zzz << EOF | grep -v "^$" set head off select max(ctrl_perd) from prod where code='123'; select max(ctrl_perd) from geo where code='456'; exit EOF) PROD_CTRL_PERD=$(echo $OUTPUT | awk '{ print $1 }') GEO_CTRL_PERD=$(echo $OUTPUT | awk '{ print $2 }') I'm getting error below: ERROR at line 1: ORA-00904: "123": invalid identifier (note:the output of both the queries are of "date" data type) Help me out.. Thanks, Bhagat |
|
||||
|
I checked the syntax of the shell script and it's OK.
I agree with mona that you have problem with the sql statements. Try to remove the commas from the sql statements: select max(ctrl_perd) from prod where code=123; select max(ctrl_perd) from geo where code=456; Execute the statements first in sqlplus and see if they run successfully. Send us the output you get. Nir |
|
||||
|
output syntax error
Hello,
Well the error 0094 symbolize : oerr ora 904 00904, 00000, "%s: invalid identifier" Hence i believe that there z error in declaration of yr variable output so , its better u use the variable and before that mention the default directories of yr oracle file like mention in starting of yr script . /in/local/bin/.tools.sh where tools .sh is a hidden script to call and set yr env variables of oracle and then u cal directly call sql . KRegards, Aparna |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|