Forum Discussion
joffre
15 years agoRegular Contributor
The concept is going to be the same as before. However, the difference being before you were using the CMD.EXE to run SQLCMD.EXE. So, now you are trying to run SQLPLUS.EXE. You'll need to do pretty much what you did before in your command string. Essentially, if you were to open up CMD.EXE, what would you type at the command prompt there to execute your SQL query?
I'm not familiar with SQLPLUS.EXE but in the brief reading out there, it seems that it does not support command-line parameters like SQLCMD.EXE or OSQL.EXE does. If you wish to execute a query against your Oracle DB, you'll need to find a similar tool to SQLCMD.EXE to utilize the shell as we did with the other SQL query.
I open the RUN and type on it "sqlplus". It will bring to me a prompt screen. On the first line I'll type the username and on the second, I'll type the password (attached). From now on, I'll type just sql commands. As an example, the code below is what I'm trying to do, but when the code arrives at the fourth line of the function Call ShellObj.Run(strRunCommand, 1, true), it stops saying "Procedure call or argument invalid"
Here is the code that I'm trying to use on sqlplus:
- Call Funcao(CriarUsuario9i)
Where CriaUsuario9i = "CREATE USER TS_F_ORA9_20112 PROFILE DEFAULT IDENTIFIED BY dev DEFAULT TABLESPACE TS_FPW_DAT_01 QUOTA UNLIMITED ON TS_FPW_DAT_01 QUOTA UNLIMITED ON TS_FPW_IND_01 ACCOUNT UNLOCK;[Enter]"
But, if I use this script line Call ConsoleCmd.Keys(CriarUsuario9i), it works.
Note: I set ConsoleCmd = Aliases.sqlplus.wndConsoleWindowClass, to save spaces on my script.