oracle-call-interface

Use of undefined constant OCI_CRED_EXT - assumed 'OCI_CRED_EXT' laravel

99封情书 提交于 2021-01-29 18:21:04
问题 I'm trying to connect oracle database to my laravel application using this package: https://github.com/yajra/laravel-oci8 but having error with the external connection, this is the error: Here the line of error in package: https://github.com/yajra/laravel-oci8/blob/5.8/src/Oci8/Connectors/OracleConnector.php#L35 System details Operating System: macOS Mojave Version 10.14.4 (18E226) PHP Version: 7.3 Laravel Version: 5.8.* Laravel-OCI8 Version: 5.8.* Anyone can help me please? 回答1: Looks like

Bind OCI sysdate() to PDO parameter?

社会主义新天地 提交于 2021-01-28 04:42:42
问题 I want to bind sysdate function in my PDO prepared query : $db = new PDO('oci:dbname=database;charset=UTF8', 'user', 'pass'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $query = $db->prepare('SELECT :func FROM DUAL'); $query->execute(array(':func' => 'SYSDATE()')); var_dump($query->fetch()); The result return this : array (size=2) ':FUNC' => string 'SYSDATE()' (length=9) 0 => string 'SYSDATE()' (length=9) I want to get the system date of my oracle database. Is it possible ?

PHP: Binding variable to table type output parameter

烂漫一生 提交于 2020-08-26 09:54:05
问题 Ok I'm having an issue binding output param which is to return a table from an Oracle db. here's an example: procedure_name( p_first IN NUMBER, p_second IN VARCHAR2, x_table_name OUT some_table_type, x_row_count OUT NUMBER ); Everything works fine in oracle working with this procedure. I come over to PHP I try this and no go: $first = 55; $second = 'Hello'; $stm = oci_parse($conn, "begin procedure_name(:p_first, :p_second, :x_table_name, :x_row_count)); end;"); oci_bind_by_name($stm, ":p

PHP oci_execute for Multiple Statements

帅比萌擦擦* 提交于 2020-08-05 05:35:20
问题 I'm trying to issue multiple INSERT statements within a single oci_execute() call on PHP. The problem is that I get this error: ORA-00911: invalid character I'm guessing it's the ; after each statement. So now, my question is how do I make multiple INSERT statements that would work within oci_execute() ? Here's my query so far: INSERT INTO tbl (id, name) VALUES(1, 'John'); INSERT INTO tbl (id, name) VALUES(2, 'Martha'); INSERT INTO tbl (id, name) VALUES(3, 'Richard') EDIT : Note that there is