0
votes

I ran the below query and it connects to the server but fails to execute the query, in spite of the table being available in database

$echo "select count(*) from TARGET049;" | sqlplus username/password@user_servername

error is displayed as below:

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Mar 21 01:20:02 2017 Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected to: Oracle Database 10g Release 10.2.0.5.0 - 64bit Production

SQL> select count(*) from TARGET050 * ERROR at line 1: ORA-00942: table or view does not exist

SQL> Disconnected from Oracle Database 10g Release 10.2.0.5.0 - 64bit Production

Please suggest on how to resolve this issue, i run the above cmd from one server to execute the sql query in a different server.

1
Is the table TARGET049 or TARGET050? - codeforester

1 Answers

0
votes

Try using a here doc:

sqlplus username/password@user_servername << EOF
  select count(*) from TARGET049;
EOF