- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Pro*c can't logon remote host
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-04-2005 09:29 PM
тАО09-04-2005 09:29 PM
I got a problem while writing a ".pc" file to obtain access to a remote oracle database.
The connection part of the program is :
" EXEC SQL BEGIN DECLARE SECTION;
char username[20];
char password[20];
char db_string[20];
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE db_name DATABASE;
strcpy(username,"system");
strcpy(password,"******");
strcpy(db_string,"oracle");
EXEC SQL WHENEVER SQLERROR DO sqlerror();
EXEC SQL CONNECT:username IDENTIFIED
BY:password AT db_name USING:
db_string;
printf("\nConnected to ORACLE as user:%s\n",username);"
When I excute the program,I encountered the following error:"oracle error detected:
ora-01012:not logged on"
How can i settle the problem?
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-04-2005 09:54 PM
тАО09-04-2005 09:54 PM
Re: Pro*c can't logon remote host
to check the environment, could you run a sqlplus session with same parameters (username, password, connect string) ?
Regards
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2005 01:52 PM
тАО09-05-2005 01:52 PM
Re: Pro*c can't logon remote host
But how can i organize the connect string?
For example,using the db_name and db_string?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2005 04:52 PM
тАО09-05-2005 04:52 PM
Solutionhave a look this example:
main( argc, argv )
int argc;
char * argv[];
{
EXEC SQL BEGIN DECLARE SECTION;
varchar oracleid[31];
int x;
EXEC SQL END DECLARE SECTION;
strcpy( oracleid.arr, "scott/tiger@mydb" );
oracleid.len = strlen(oracleid.arr);
EXEC SQL WHENEVER SQLERROR DO sqlerror_hard();
EXEC SQL CONNECT :oracleid;
printf("\nConnected to ORACLE as user: %s\n\n", oracleid.arr);
x = really_complex_calculation();
exec sql insert into xx ( x ) values ( :x );
/* Disconnect from ORACLE. */
/* EXEC SQL COMMIT WORK RELEASE; */
exit(0);
}
hope this helps!
regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2005 07:23 PM
тАО09-05-2005 07:23 PM
Re: Pro*c can't logon remote host
I saw the "CONNECT:...IDENTIFIED BY:...
AT:... USING:..." way to logon to a remote host from a book,but don't know exactly how to use it.Your method looks easier and it does works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2005 07:46 PM
тАО09-05-2005 07:46 PM
Re: Pro*c can't logon remote host
have a look also at the "Connect to the Database" section at the following URL:
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a97269/pc_03dbc.htm#5881
hope this helps too!
regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2005 11:14 PM
тАО09-05-2005 11:14 PM
Re: Pro*c can't logon remote host
db_string is the host variable that constains the NET8 syntax for connecting to a non-default database on a remote node.
I meant to use the sqlplus utility to validate your environment, especially the db_string.
Check and validate your tnsnames.ora.
sqlplus system/
Regards
Jean-Luc