Showing posts with label Toad for Oracle. Show all posts
Showing posts with label Toad for Oracle. Show all posts

Tuesday, 8 November 2011

Toad for Oracle and literals containing the ampersand character

The best way to construct a valid varchar literal that won't be rejected by the script execution in Toad for Oracle is to do something like this:
'john'||chr(38)||'sally'
The fact that the chr() function returns the ampersand as execution result makes it less problematic.

The above solution works well when you have to deal with the ampersand character within a stored procedure or forms script where you can assign the value to a declared variable.

However, when it comes to a normal update statement the following works much better:
update my_table set url='/faces/myservlet?paramOne=valueOne' || '&' || 'paramTwo=valueTwo' where id='myId'

When the ampersand stands alone in a literal value it seems to get bypassed as special character!!

Hope you find it handy ampersandy!

Friday, 4 November 2011

Toad for Oracle 9.7.2.5 : Can't initialize OCI. Error -1

IF you are running Toad for Oracle on Windows 7 and you're getting the error: "Can't initialize OCI. Error -1", when you're trying to initiate a connection, THEN go to the "Properties" of the Toad shortcut in the Start Menu and in the Compatibility Tab tick the check box next to the text: "Run this program as an administrator." When you run Toad again you would be able to open connections!! 

PS: Also make sure your ORACLE_HOME environment variable is set to the correct location. Could be a show stopper in your case like in mine. :-)