Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Oracle connection test (http://forums.winamp.com/showthread.php?t=391155)

pkonduru 9th May 2016 23:51

Oracle connection test
 
Hi all,

I tried searching around but could not find a solution to test an oracle connection in the forums. This is what I tried doing so far:
--On the command line this works:
"sqlplus user\pwd@SID"

I am trying to run this using nsExec(all the three parameters are variables)
nsExec::Exec "sqlplus $user/$pwd@$SID"
Pop $0
Pop $1
$0 has "1"
$1 has some random number like "13390"

Is there anyway from the output I can tell connection has been successful ? I tried writing to a log file and that works

nsExec::Exec "cmd /C sqlplus $user/$pwd@$SID > C:\sqltest.log"

Any other way to test this without having to write to a log file?

--Pavan

Anders 10th May 2016 08:56

Only nsExec::ExecToStack pushes two things to the stack.

pkonduru 10th May 2016 17:06

Thanks Anders. When I use ExecToStack, there are my outputs:

$0 :"1"
$1-
SQL*Plus: Release 11.2.0.3.0 Production on Tue May 10 12:45:58 2016

Copyright (c) 1982, 2011, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>Error 45 initializing SQL*plus
Internal error

I don't get this error when I run the same command from command line:

sqlplus $username\$pwd@SID

Should I rely on the output of $0 sice it gives me 1 for a successful connection and 0 for invalid credentials?
My installer would also need to run some sql scripts and capture the output. Is there any good practices or links for this?

--Pavan

Anders 10th May 2016 21:25

0 usually means success. Maybe a 64-bit path issue? Download Process Monitor and compare the working and failing scenarios...


All times are GMT. The time now is 17:18.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.