oracle11g

Limit listagg function to first 4000 characters [duplicate]

和自甴很熟 提交于 2019-12-08 23:39:17
问题 This question already has answers here : LISTAGG function: “result of string concatenation is too long” (12 answers) Oracle - ORA-01489: result of string concatenation is too long [duplicate] (1 answer) Closed 4 years ago . I have a query that uses the listagg function to get all rows as a comma delimited string to ultimately be shipped to a big text box. I'm getting the following exception: ORA-01489: result of string concatenation is too long I know the problem is that the query being run

Generate identity for an Oracle database through Entity Framework using an exisiting stored procedure

China☆狼群 提交于 2019-12-08 21:38:44
问题 How to automatically generate identity for an Oracle database through Entity Framework? I have a function that I could call and generate the column which is not in the context how do I explicitly call the stored procedure through Entity Framework? I am using a repository pattern. Random Number generator to insert a record (where I get the primary key through a UDF and pass this to the entity to insert). 回答1: 1) Create sequence in Oracle CREATE SEQUENCE dummy_test_seq MINVALUE 1 MAXVALUE

Why can't I update more than one column at the same time using With keyword?

大城市里の小女人 提交于 2019-12-08 18:58:11
问题 I have an update statement shown below that works fine, I used a with statement in the subquery to greatly improve performance but for some reason I'm not allowed to add an additional column from the same table to update. Works: UPDATE Table_A SET (Col_One) = (WITH OneValue AS (SELECT DISTINCT t.Col_One FROM Table_Two t, Table_A a WHERE t.id = a.New_Id)) SELECT Col_One FROM OneValue); What I'd like to do is just include another column to update also from table_two like this UPDATE Table_A SET

What is the difference between MOD and REMAINDER in oracle?

[亡魂溺海] 提交于 2019-12-08 18:56:56
问题 Although both the functions perform the same operation, even they produce same o/p, what is basic difference between these two? Is there any performance related difference, if yes, then which one is better? Thanks 回答1: The documentation is pretty clear on the difference: NOTE The REMAINDER function uses the round function in its formula, whereas the MOD function uses the floor function in its formula. In other words, when the arguments are positive integers, the mod function returns a

java.lang.ArithmeticException when attempting to get connection in Oracle 11.2.0.2.0 (64 bit)

大城市里の小女人 提交于 2019-12-08 17:23:05
问题 I'm currently working with Java Stored Procedures in Oracle and am seeing some strange behaviour when attempting to get a connection within my Java code. My Java is packaged up into a jar file and then deployed into Oracle using the loadjava command line utility. A package is then created in the database which maps each method in a designated Java class to a PL/SQL function via call specifications. Some of the columns which I'm working with are CLOB s. In the Java I attempt to extract the

SPOOL returns empty files when trying to export from SQL Developer

旧时模样 提交于 2019-12-08 16:57:01
问题 I have a series of queries that I want to output to .csv files. The only tool I have to query the database is SQL Developer. I could run each query and then use the Export dialogue in SQL Developer to write them to files, but that's cumbersome, particularly when this needs to be done for multiple files every day. This works for some people Directly export a query to CSV using SQL Developer But it doesn't work for me. For example, if I try spool "C:\Users\james.foreman\Downloads\Temp\myfile

Why is this check for null associative array in PL/SQL failing?

坚强是说给别人听的谎言 提交于 2019-12-08 15:04:52
问题 I have an associative array created by a type of rowtype of a table column. To give an example, this is how it is(the table names are different, but the structure is the same): This is the DDL of the table CREATE TABLE employees ( id NUMBER, name VARCHAR2(240), salary NUMBER ); Here's what my procedure is doing: DECLARE TYPE table_of_emp IS TABLE OF employees%ROWTYPE INDEX BY BINARY_INTEGER; emp TABLE_OF_EMP; BEGIN IF emp IS NULL THEN dbms_output.Put_line('Null associative array'); ELSE dbms

SELECT FOR UPDATE with Subquery results in Deadlock

倖福魔咒の 提交于 2019-12-08 14:00:39
I have query when executed from different session is resulting in deadlock. TAB1 (ID, TARGET, STATE, NEXT) AND ID is primary key Column ID is the primary key. SELECT * FROM TAB1 WHERE NEXT = (SELECT MIN(NEXT) FROM TAB1 WHERE TARGET=? AND STATE=?) AND TARGET=? AND STATE=? FOR UPDATE In the Oracle trace file, I see the statement: DEADLOCK DETECTED Current SQL statement for this session: SELECT ID, TARGET, NEXT, STATE FROM TAB1 WHERE NEXT=(SELECT MIN(NEXT) FROM TAB1 WHERE (TARGET='$any') AND ( STATE = 0)) AND (TARGET='$any') AND (STATE = 0) FOR UPDATE The following deadlock is not an ORACLE error

oracle dbms_scheduler to run multiple procedures in parallel

此生再无相见时 提交于 2019-12-08 13:53:31
I've trying to figure out oracle's DBMS_SCHEDULER (Oracle 11g) and need help setting up the following: I have a procedure that calls a list of other procedures like this: CREATE OR REPLACE PROCEDURE RUN_JOBS AS BEGIN MYUSER.MYPROCEDURE1(); MYUSER.MYPROCEDURE2(); MYUSER.MYPROCEDURE3(); MYUSER.MYPROCEDURE4(); MYUSER.MYPROCEDURE5(); END; / I would like to use DBMS_SCHEDULER to run MYPROCEDURE3(), MYPROCEDURE4(), MYPROCEDURE5() in parallel after the completion of MYPROCEDURE2(). Can someone show me an example on how to set this up? You can refer to Chains under the DBMS_SCHEDULER package: http:/

Pass Datatable from C# to Oracle Stored procedure

拥有回忆 提交于 2019-12-08 13:37:33
问题 How to pass a datatable or dataset from C# to the stored procedure in Oracle 回答1: You can not directly. However there are several approaches : Transform your datatable/dataset to a single XML string or blob and use it as a parameter for a stored procedure. Use temporary tables to store your datatable/dataset content, so a stored procedure can process them. 回答2: If you have a dataset or a datatable that you want to insert into ORACLE, you can create an ORACLE data adapter. Then you create a