oracle12c

Wrong symbol inside replace function (PL/SQL, ORACLE)

不打扰是莪最后的温柔 提交于 2019-12-24 20:01:27
问题 I have below procedure inside package: PROCEDURE test1 IS InsertST varchar2(32000) : = 'INSERT INTO tableA (col1, col2) (select cola, INITCAP(REPLACE(colX, '_', '')) from tableB))'; Begin execute immediate InsertST; END during compilation I got error: Error(1177,45): PLS-00103: Encountered the symbol "_" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like like2 like4 likec between || member submultiset Something is wrong

Trigger default value of a column during UPDATE

旧巷老猫 提交于 2019-12-24 17:14:40
问题 I am wondering about this case with Oracle 12c; Table X has column A, with default value 'default' and NOT NULL modifier I insert a new row into Table X, and column A has value 'not-default' I wish to update column A of the above row to the default value of the given column, namely 'default' Is there a short way of doing this without knowing the default value? Can I do something like; UPDATE X SET A = DEFAULT_VAL(A) WHERE ... Trying to update to null obviously triggers a ORA-01407: cannot

Hibernate 3.3.0 compatibility with Oracle 12c

戏子无情 提交于 2019-12-24 16:51:56
问题 This post is similar to link But I do not find answer. I am migrating from Oracle 11g to Oracle 12c. Can I use the same dialect available with hibernate 3.3.0 org.hibernate.dialect.OracleDialect . Also I am using ojdbc14.jar which is JDBC driver version 10.2.0.3.0. And as per Oracle I need to use atleast ojdbc6.jar or minimum JDBC driver version 11.1.0.x. If I use ojdbc6.jar then I need to resolve conflicts of java.sql.date and Timestamp SQL type; change Long types to LOB types. Please

How can I select 10th, 20th, 30th … row of the result of another select query

守給你的承諾、 提交于 2019-12-24 14:49:26
问题 I have a table with a column to , from and ID . I need to select only rows with every 10th ID which is from A to B . 回答1: select * from (select * from table where from = 'A' and to ='B' order by ID) where mod(rownum/10,1) = 0 It first takes only those from 'A' to 'B', then giving them rownums, and selecting only those in the 10th 20th ETC places.. 回答2: Or you can just use select from, to, id from table1 where id like'%0' and from ='A' and to = 'B' 来源: https://stackoverflow.com/questions

Understanding behavior of remainder() function in Oracle

自古美人都是妖i 提交于 2019-12-24 12:13:16
问题 According to Oracle documentation for the remainder(n2,n1) function (https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions133.htm), the remainder(n2,n1) function evaluates to = n2 - n1 * N where N = ROUND(n2/n1) and n1 != 0. So, I would expect remainder(10,4) to return -2 using the above documented method of calculating the remainder as shown below: REMAINDER(10,4) =10 - 4 * N where N = ROUND(10/4) =10 - 4 * 3 since ROUND(10/4) = 3 =10 - 12 =-2 However, running remainder(10,4) in

What are roles and privileges to give a user in order to perform CRUD(on Oracle 12)

随声附和 提交于 2019-12-24 11:27:51
问题 I'm creating a USER on Oracle 12 c database, using TOAD . After creating the TABLESPACE , I'm creating the USER . I'm a little confusing about the many ROLES and PRIVILEGES that can be given to a USER. What are the minimum/standard roles and privileges a user must be given in order to perform CRUD operation and being able to 'edit' the database (create or delete table, DROP the schema ecc) from TOAD? Thank you 回答1: It depends on what operations are you going to perform. If you want to work

In Oracle, how do I verify the object type used from an object type hierarchy?

折月煮酒 提交于 2019-12-24 11:16:08
问题 I have a Type hierarchy in an Oracle Schema: CREATE OR REPLACE TYPE FV AS OBJECT ( idno NUMBER) NOT FINAL; / CREATE TYPE FV_Integer UNDER FV ( features INTEGER_ARRAY) NOT FINAL; / CREATE TYPE FV_Number UNDER FV ( features NUMBER_ARRAY) NOT FINAL; / I want to build a PLSQL function that veryfies which type of the hierarchy is an object: for a function dummy(obj1 FV, obj2 FV)... how can I check what is the object type of the hierarchy the user is using? For example, I want to print the objects

SELECT query with Literal characters(Colon, Semi-colon) in Oracle

*爱你&永不变心* 提交于 2019-12-24 10:14:03
问题 How can I query for data having literal chars as colon, semi-colon and some part of text in Oracle? SELECT result FROM TABLE1 WHERE result like '"generalinfo"":""Authorize-All-06262019"' Data: Result {"generated":"6/19/2019 12:54:55 PM -05:00","msgid":"SYSTEMID_115064221_2","servicenumber":"115064221","queueid":2,"expected":"7/1/2019 12:00:00 AM -05:00","startrange":"","endrange":"6/24/2019 12:00:00 AM -05:00","startdate":"6/24/2019 12:00:00 AM -05:00","flag":1,"setby":"6/5/2019 12:00:00 AM",

why system login is denied in cx_Oracle.SYSDBA mode

余生颓废 提交于 2019-12-24 08:06:26
问题 I am trying to connect to Oracle 12c through cx_Oracle module. Login using following code works where no mode is mentioned in cx_Oracle.connect method import cx_Oracle ip = 'ip' port='1521' SID='orcl' dsn_tns = cx_Oracle.makedsn(ip, port, SID) db = cx_Oracle.connect('system', 'password', dsn_tns) but for following way it shows invalid login error for cx_Oracle.SYSDBA mode. db = cx_Oracle.connect('system', 'password', dsn_tns, cx_Oracle.SYSDBA) Error: cx_Oracle.DatabaseError: ORA-01017:

Oracle.DataAccess.Client.OracleException at Connection.Open()

时光总嘲笑我的痴心妄想 提交于 2019-12-24 03:22:31
问题 this question can look like a clone of others, but I can't find a correct answer to this one. This is my scenario: I have a C# software called by webservices that need to write to an oracle database. In my test server no problems, it works like a charm, but, in another equal server it gives to me this error: Oracle.DataAccess.Client.OracleException at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx,