Oracle

Django error ORA-01461 workaround?

江枫思渺然 提交于 2021-01-27 17:52:15
问题 I have a Django (version 1.5) application that is getting this Oracle error: ORA-01461: can bind a LONG value only for insert into a LONG column After doing some database debugging, it appears that the problem is caused by doing an INSERT on the DJANGO_SESSION table with a long (roughly 2.5k characters) Unicode string value for SESSION_DATA (data type NCLOB). I have been told by a coworker that the problem does not occur on UPDATEs but only on INSERTs, because the Django database code for

No oci8 module in phpinfo()

心不动则不痛 提交于 2021-01-27 17:44:34
问题 I try to set up connection with oracle database, but I still can't even set up the module. I have rhel 7. 2 server, and I followed whole tutorial for setting up oracle instantclient and configured it with php. One thing I completely don't understand is that oci8 module displays after php -i execution: oci8 OCI8 Support => enabled OCI8 DTrace Support => disabled OCI8 Version => 2.1.3 Revision => $Id: 59f993160cf983dd24bb391b68a65a17303d2dba $ Oracle Run-time Client Library Version => 12.1.0.2

Converting German special characters to English equivalent one in Oracle SQL / PL-SQL

淺唱寂寞╮ 提交于 2021-01-27 15:51:38
问题 I want to replace all German characters of a column of a table to corresponding English characters. When I tried with Replace() function it is not returning fruitful result. I want to replace all German special characters like- Ä Ö Ü ö ä ü ß to Ae Oe Ue oe ae ue ss. Please let me know how to perform that? Do I need to change any DB settings? Please find some results below: select replace('a b c d e ä f g ö','ä','ae') from dual; Output: REPLACE('ABCDEDFGV','D','AE') a b c ae e ae f g v I am

ORA-00932: inconsistent datatypes: expected CHAR got NUMBER while adding 1 to a date

落爺英雄遲暮 提交于 2021-01-27 14:17:26
问题 Probably a silly mistake, but I couldn't figure this out myself. When I run this query in Oracle 11g. If this question is answered in SO, please let me know the link. with LAST_BUSINESS_DAY as (select DECODE(to_char(last_day(to_date('29-mar-2013')), 'D'), , '7', to_char((last_day('29-mar-2013') - 1), 'DD-MON-YYYY') , '1', to_char((last_day('29-mar-2013') - 2), 'DD-MON-YYYY') , to_char(last_day('29-apr-2013'), 'DD-MON-YYYY')) as LAST_BD from dual), HOLIDAYS as (select distinct rpt_day from rpt

how to export data frame (R) into Oracle table

倾然丶 夕夏残阳落幕 提交于 2021-01-27 13:41:29
问题 I need a piece of advice how to transfer data from R into Oracle table. I have a R-dataframe and I would like to transfer it into the specific Oracle table (the whole dataframe or some columns). As an option, transfer dataframe which is placed in a csv file via R into Oracle. I have scanned similar items throughout the inet but not find a clear and plain examples. 回答1: Check the metrod dbWriteTable of the package RJDBC Here an example dbWriteTable(jdbcConnection,"TABLE_NAME",data.frame.name.,

PL/SQL Trigger Issues

不羁的心 提交于 2021-01-27 13:33:15
问题 I am trying to write a trigger to populate a table containing information on an employee's updated salary. I'm having a problem that I can't quite wrap my head around at the moment. Here is the table to be populated: drop table SalUpdates cascade constraints; create table SalUpdates( SalSSN char(9), newSalary decimal(10,2), oldSalary decimal(10,2) ); This is my trigger: create or replace trigger t1 after update of salary on employee for each row begin insert into SalUpdates values (:old.Ssn,

Oracle PL/SQL Release 12.2.0.1.0 vs 12.1.0.2.0 - execute immediate with parameters

浪子不回头ぞ 提交于 2021-01-27 13:21:08
问题 DECLARE max_id INTEGER; BEGIN SELECT MAX(ID) + 1 INTO max_id FROM MY_TABLE; EXECUTE IMMEDIATE 'CREATE SEQUENCE MY_TABLE_ID MINVALUE 1 MAXVALUE 99999999999999 INCREMENT BY 1 START WITH ' || max_id || ' CACHE 100 NOORDER NOCYCLE NOPARTITION'; END; Above gives me ORA-00933: SQL command not properly ended when executed on Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production PL/SQL Release 12.2.0.1.0 - Production and works without errors on Oracle Database 12c Enterprise

PLS-00103: Encountered the symbol “;” when expecting one of the following:

邮差的信 提交于 2021-01-27 13:10:44
问题 I am trying to insert the answer to a user's security question, for use in the pin reset feature. Ellucian banner v8+ provides an API for running this and I very new to their API and from the looks of the error message below, I am far from running this correctly. Any help is appreciated. I tried running this in Oracle SQL Developer: execute gb_pin_answer.p_create( P_PIDM => 12345, P_NUM => 1, p_gobqstn_id => 1, p_qstn_desc => '', p_ansr_desc => 'David', p_ansr_salt => 'A123B456', p_user_id =>

Revoke Privileges in Oracle

筅森魡賤 提交于 2021-01-27 12:02:23
问题 I'm currently dealing with some GRANT options using Oracle Database Express Edition 11g. Consider the following small code example where some users grant some privileges to other users: -- User A GRANT Select, Insert, Update, Delete ON T TO B,C WITH GRANT OPTION ; -- User B GRANT Select ON T TO C WITH GRANT OPTION ; GRANT Insert ON T TO C ; -- USer C GRANT Select, Insert, Update ON T TO D ; User A is the creator of Table T and performs the following REVOKE operation. Now REVOKE Update ON T

Revoke Privileges in Oracle

可紊 提交于 2021-01-27 12:00:38
问题 I'm currently dealing with some GRANT options using Oracle Database Express Edition 11g. Consider the following small code example where some users grant some privileges to other users: -- User A GRANT Select, Insert, Update, Delete ON T TO B,C WITH GRANT OPTION ; -- User B GRANT Select ON T TO C WITH GRANT OPTION ; GRANT Insert ON T TO C ; -- USer C GRANT Select, Insert, Update ON T TO D ; User A is the creator of Table T and performs the following REVOKE operation. Now REVOKE Update ON T