Ora-12154 when working with Pro*fortran. [message #375800] |
Sun, 14 December 2008 21:41 |
nitintz
Messages: 5 Registered: December 2008
|
Junior Member |
|
|
Hi All,
when i try to include a select statement in my pro*fortran code
I am getting Ora-12154 TNS could not resolve service name
The select query is given below.
EXEC SQL SELECT PERIOD_NAME, UBR, UER
1 INTO :ENAME, :SAL, :COMM
2 FROM TEST
I am using the 32bit version of libraries and the compilation is happening without any problem.
Earlier when i tried with 64 bit libraries i was getting errors during compilation.
Note: I am not getting any errors when I run only the conect statement.
|
|
|
|
Re: Ora-12154 when working with Pro*fortran. [message #375823 is a reply to message #375817] |
Mon, 15 December 2008 00:58 |
nitintz
Messages: 5 Registered: December 2008
|
Junior Member |
|
|
Hi,
Sorry I forgot to mention earlier that I am able to connect to the database through Sql*plus using the same connect string as in pro*fortran.
Also i am not getting this error when just connecting from pro*fortran, But error is seen when I try to do any select or insert statement in the code
Regards
Nitin
[Updated on: Mon, 15 December 2008 01:01] Report message to a moderator
|
|
|
|
|
|
Re: Ora-12154 when working with Pro*fortran. [message #375848 is a reply to message #375841] |
Mon, 15 December 2008 02:57 |
nitintz
Messages: 5 Registered: December 2008
|
Junior Member |
|
|
the code is given below
PROGRAM QUERY
IMPLICIT NONE
EXEC SQL BEGIN DECLARE SECTION
CHARACTER*20 UIDPWD
CHARACTER*20 ENAME
INTEGER SAL
INTEGER COMM
INTEGER I
DIMENSION ENAME(4)
DIMENSION SAL(4)
DIMENSION COMM(4)
EXEC SQL END DECLARE SECTION
EXEC SQL INCLUDE SQLCA
EXEC SQL WHENEVER SQLERROR DO CALL SQLERR
* LOG ON TO ORACLE.
UIDPWD='DEVELOPMENT/DEV@DEV'
* EXEC SQL WHENEVER SQLERROR DO CALL SQLERR
EXEC SQL CONNECT :UIDPWD
* EXEC SQL WHENEVER SQLERROR DO CALL SQLERR
PRINT *,'CONNECTED TO ORACLE'
I=1
* EXEC SQL WHENEVER NOT FOUND GOTO 7400
* EXEC SQL WHENEVER SQLERROR DO CALL SQLERR
EXEC SQL SELECT PERIOD_NAME, UBR, UER
1 INTO :ENAME, :SAL, :COMM
2 FROM TEST
* 3 WHERE UBR=1000
* EXEC SQL WHENEVER SQLERROR DO CALL SQLERR
7400 END
SUBROUTINE SIGNOFF (NUMQ)
INTEGER NUMQ
EXEC SQL INCLUDE SQLCA
PRINT 8000, NUMQ
8000 FORMAT (/, ' TOTAL NUMBER QUERIED WAS: ', I4)
PRINT 8200
8200 FORMAT (/, ' HAVE A GOOD DAY.', /)
EXEC SQL COMMIT WORK RELEASE
STOP
END
SUBROUTINE SQLERR
EXEC SQL INCLUDE SQLCA
EXEC SQL WHENEVER SQLERROR CONTINUE
PRINT 9000
9000 FORMAT (/, ' ORACLE ERROR DETECTED: ')
PRINT *, SQLEMC
* 9200 FORMAT (' ', A70)
EXEC SQL ROLLBACK WORK RELEASE
STOP
END
The TNSPING output is
$ tnsping dev
TNS Ping Utility for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production on
15-DEC-2008 13:27:49
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
/erp/oracle/devdb/9.2.0/network/admin/DEV_qdevelop/sqlnet_ifile.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=qdevelop.quest-
global.com)(PORT=1522)) (CONNECT_DATA= (SID=DEV)))
OK (1270 msec)
$
The SQL*plus connect output is
$ sqlplus /nolog
SQL*Plus: Release 9.2.0.6.0 - Production on Mon Dec 15 13:29:38 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn development/dev@dev
Connected.
SQL>
|
|
|
Re: Ora-12154 when working with Pro*fortran. [message #376393 is a reply to message #375848] |
Wed, 17 December 2008 03:44 |
Frank Naude
Messages: 4581 Registered: April 1998
|
Senior Member |
|
|
Everything looks perfectly fine to me. Something else you can try is to remove the "@DEV" part from the connect string to see if you can make a local connection.
PS: Is Pro*Fortran still supported? If so, you can always log a call with Oracle Support.
|
|
|
Re: Ora-12154 when working with Pro*fortran. [message #376568 is a reply to message #376393] |
Wed, 17 December 2008 21:19 |
nitintz
Messages: 5 Registered: December 2008
|
Junior Member |
|
|
HI,
I am not able to connect if I revome the connect string in the profor code, but connection is happening from sqlplus prompt.
And I have no idea about the support, as a new bee I was just trying to get this connection going and then worrry about the support.
Just observed that when the dimension of array ENAME is increased (to > number of rows in select statement) I got a new error
ORA-02112: SELECT into returns too many rows.
So I changed the code to something like this,
changes are added :ENAME(I) instead of ENAME earlier
and now I get the following error
ORA-00905: Missing keyword
The new code looks like this.
PROGRAM QUERY
IMPLICIT NONE
EXEC SQL BEGIN DECLARE SECTION
CHARACTER*20 UIDPWD
CHARACTER*20 ENAME
DIMENSION ENAME(5)
INTEGER J
EXEC SQL END DECLARE SECTION
EXEC SQL INCLUDE SQLCA
EXEC SQL WHENEVER SQLERROR DO CALL SQLERR
* LOG ON TO ORACLE.
UIDPWD='DEVELOPMENT/DEV@DEV'
* EXEC SQL WHENEVER SQLERROR DO CALL SQLERR
EXEC SQL CONNECT :UIDPWD
* EXEC SQL WHENEVER SQLERROR DO CALL SQLERR
PRINT *,'CONNECTED TO ORACLE'
* EXEC SQL WHENEVER NOT FOUND GOTO 7400
* EXEC SQL WHENEVER SQLERROR DO CALL SQLERR
EXEC SQL SELECT PERIOD_NAME
1 INTO :ENAME
2 FROM DEVELOPMENT.TEST
* 3 WHERE UBR=1000
DO 200 J= 1,4
PRINT *, ENAME(J)
200 CONTINUE
STOP
7400 END
SUBROUTINE SQLERR
EXEC SQL INCLUDE SQLCA
EXEC SQL WHENEVER SQLERROR CONTINUE
PRINT 9000
9000 FORMAT (/, ' ORACLE ERROR DETECTED: ')
PRINT *, SQLEMC
* 9200 FORMAT (' ', A70)
EXEC SQL ROLLBACK WORK RELEASE
STOP
END
Somebody Please help to resolve this problem.
Thanks in advance
Nitin
[Updated on: Thu, 18 December 2008 02:52] Report message to a moderator
|
|
|