BUG scriptcase not working with instantclient

Latest version sc9 and I tried instant client 12.1 and 12.2 but both will not connect with scriptcase.
But connecting it using the oci_connect function in a standalaone php script works fine. All paths are correct, so I think this is yet another bug in sc.
Using the php from the scriptcase installation, 64 bit…
The paths are correct, tns_admin is reachable and connecting on the commandline using sqlplus.exe and using php oci_connect work fine…

Please verify… Why can I connect in scriptcase?? A new bug??

I am trying the full oracle 11 client now, maybe that helps…

The full oracle client also does not work as it should…
With some work and digging around I found the solution…

First of all an oci_connect which scriptcase internally seems to work on the commandline for us (what?? no PDO for oracle??).
After some trying out I found that the following should be entered in your oracle connection:

Connnection Name: this is the name you made for the connection, standard that is conn_oracle
Database Name: //1.2.3.4:555/database_name so for example: //127.0.0.1:1521/ORA11G
username is your normal username and password is your normal database password.

Still I think that it is a bug, tho doing it this way is a workaround (for the moment)…

In scriptcase 8:
If I happen to move my database somewhere else (another IP) then I only need to update my tnsnames.ora !!

In scriptcase 9:
If i happen to move my database somewhere else (another IP) then I need to change the connection and regenerate my applications…

So this solution as it is thought it is not properly done… I prefer the old scriptcase 8 way.
And to top it off, using the oracle easy connect string may be handy but not for multiple scriptcase applications… There is less change of mistakes…
So please bring this option to ONLY use the database name and not the easy connect string.

You seem to be using function conectDB() in which the connection is made… and prep_conect
In there I see:
$this->Db = db_conect_devel($_SESSION[‘scriptcase’][‘form_SCRIPTCASE_DEBUG_MESSAGES’][‘glo_nm_conexao’], $this->root . $this->path_prod, ‘project’);
and
$this->Db = db_conect($this->nm_tpbanco, $this->nm_servidor, $this->nm_usuario, $this->nm_senha, $this->nm_banco, $glo_senha_protect, “S”, $this->nm_con_persistente, $this->nm_con_db2, $this->nm_database_encoding, $this->nm_arr_db_extra_args);

All nice and well please fix this to allow the oracle easy connect string AND ALSO just the TNSNAMES.ORA database name strings as it was in scriptcase 8 !!!

So in short for scriptcase I have the following challenge:
Please install 32 bits scriptcase version 8.xxx and connect to an oracle database. Then install the 64 bits version 9.latest and do the same, then have them BOTH running…
It is needed for conversion of projects from 8 to 9 of course…

How to get scriptcase 8 (32 bit) and scriptcase 9 (64 bit) running using oracle…
if you installed SC9 the path may be somewhat screwed up. The path is reflected from your system path so in case to get it working change the path so that the path holds the 64 bit scriptcase before the 32 bit. Example:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;C:\oracle\ora10g\bin;c:\oracle\instantclient_12_1

For security you can use the latest php_oci8_12c.dll from php (64 bit). But do stay within the same PHP 7.x version. Since scriptcase runs on php 7.0.x you can only use a PHP.
The latest version I found was here: https://pecl.php.net/package/oci8
ONLY USE THE NTS version…

Hi, rr i have Oracle 11.2 to 64Bits but i Can not to connect from SC. My questions is If i Must use the php_oci8_12c.dll library or i need other for version11.2?

The oci dll on itself is not enough. You need to install the full 12.1 instant client. Next to that you need to set your tns_names.ora.
Version 12.2… seems not to work.
I advise to install als the sqlplus addon.
Get them from here: http://www.oracle.com/technetwork/to…ft-089540.html
Then install those and change your tnsnames.ora
Then first check if you can connect using sqlplus.exe in your installation.
scriptcase seems to understand the easy connect string from oracle due to a bug you van not give put the database name only in your connectionstring (it ispossible in scriptcase 7 and 8 tho, not in 9).
You can then also use an easy string like //1.2.3.4:1521/MYORACLE
This works, it is not ideal at all since you would need to regenerate your apps if the ip number changes but at least it works… In sc8 the //1.2.3.4:1521/ would not be needed at all…

Then you need to add the instantclient (assuming windows) path somewhere at the front of your path.
Once done restart your scriptcase service. Check if the paths are correct by grabbing the sysinternals suite and by starting procexp.exe (process explorer) on your server. You can find the service quite quickly I bet. In process explorer you can find your scriptcase apache server. Simply check the environment variables and be sure to check if the instantclient path is in there.

The oracle dll’s you need will then properly work.

For using it in php you then need indeed to have the extension=php_oci8_12c.dll in your extensions activated.
We dont use another over here…
You can test with php if at least oci is working:

<?php
// Create connection to Oracle
$conn = oci_connect("user", "password", "database");
if (!$conn) {
   $m = oci_error();
   echo $m['message'], "
";
   exit;
}
else {
   print "Connected to Oracle!";
}

$stid = oci_parse($conn, "SELECT TABLE_NAME FROM ALL_TABLES where table_name like 'A%'");
oci_execute($stid);

echo "<table border='1'>
";
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
    echo "<tr>
";
    foreach ($row as $item) {
        echo "    <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : " ") . "</td>
";
    }
    echo "</tr>
";
}
echo "</table>
";


// Close the Oracle connection
oci_close($conn);
?>

If that code works then oci works. Then your connection in scriptcase should work as well.

Hi rr, i installed oracle SE ver 12.1.02 () and work fine. (my oracle in same pc, so i doesn’t installed instaclient)
IN MY sc 9 My database name is: ORCL.
[ATTACH=CONFIG]n81748[/ATTACH]

SC_ORACLE_12.JPG

If you installed oracle SE then you also installed some oracle client… SE is the standard edution… It thus also has a full client…