oracle10g

Saving data into Clob using Hibernate in Oracle 10g

☆樱花仙子☆ 提交于 2019-12-22 00:36:06
问题 I have a table with a java.sql.Clob column in Hibernate The hbm file: <class name="com.model.ClobModel" table="table1"> <id name="id" column="id"> <generator class="assigned"></generator> </id> <property name="clobData" type="clob"> <column name="ClobData"></column> </property> This is the ClobModel : private Integer id; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } private Clob clobData; public Clob getClobData() { return clobData; } public void

Reversing a string using an index in Oracle

夙愿已清 提交于 2019-12-21 22:54:14
问题 I have a table that has IDs and Strings and I need to be able to properly index for searching for the end of the strings. How we are currently handling it is copying the information into another table and reversing each string and indexing it normally. What I would like to do is use some kind of index that allows to search in reverse. Example Data: F7421kFSD1234 d7421kFSD1235 F7541kFSD1236 d7421kFSD1234 F7421kFSD1235 b8765kFSD1235 d7421kFSD1234 The way our users usually input thier search is

Change Oracle SQL Query Text before submission [closed]

与世无争的帅哥 提交于 2019-12-21 21:43:00
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . Is there a advanced oracle feature to modify the SQL Query just before it is submitted to oracle? Or may be modify the result set? Based on certain condition? Like may be based on the name of the process that

Character encoding while reading data using Java-JDBC from Oracle database

牧云@^-^@ 提交于 2019-12-21 21:24:15
问题 We have data stored in oracle 10g db which contains french character set. The requirement is to read the data and generate a output file using Java. I checked the validity of the data in Oracle db via SQL*plus and it looks good. From windows: set NLS_LANG=AMERICAN.AL32UTF8 sqlplus scott/tiger sql> select billing_address from MYTABLE t where ADDRESS_ID=1 ; billing_address ----------------------- MONTRÉAL QUÉ Now when I read the table from Java to generate a output file, the character is all

display select results inside anonymous block

爷,独闯天下 提交于 2019-12-21 12:01:16
问题 I'm trying to debug a SELECT inside a procedure, and I'm trying to this using a anonymous block. I would like that SQL Developer simply return the last SELECT statement, but I get the error: ORA-06550: line 21, column 5: PLS-00428: an INTO clause is expected in this SELECT statement Inside the procedure, I have an INTO for that select, but is there a simple way that I can simply get the results for the last SELECT statement for my debugging? I'm using anonymous block and variables so that the

cx_Oracle and output variables

吃可爱长大的小学妹 提交于 2019-12-21 10:46:27
问题 I'm trying to do this again an Oracle 10 database: cursor = connection.cursor() lOutput = cursor.var(cx_Oracle.STRING) cursor.execute(""" BEGIN %(out)s := 'N'; END;""", {'out' : lOutput}) print lOutput.value but I'm getting DatabaseError: ORA-01036: illegal variable name/number Is it possible to define PL/SQL blocks in cx_Oracle this way? 回答1: Yes, you can do anonymous PL/SQL blocks. Your bind variable for the output parameter is not in the correct format. It should be :out instead of %(out)s

Is the use of SELECT COUNT(*) before SELECT INTO slower than using Exceptions?

若如初见. 提交于 2019-12-21 06:30:05
问题 My last question got me thinking. 1) SELECT COUNT(*) INTO count FROM foo WHERE bar = 123; IF count > 0 THEN SELECT a INTO var FROM foo WHERE bar = 123; -- do stuff ELSE -- do other stuff END IF; 2) BEGIN SELECT a INTO var FROM foo where bar = 123; -- do stuff EXCEPTION WHEN no_data_found THEN --do other stuff END ; I assume number 2 is faster because it requires one less trip to the database. Is there any situation where 1 would be superior, that I am not considering? EDIT: I'm going to let

How To find Exact string match within a String in Oracle

◇◆丶佛笑我妖孽 提交于 2019-12-21 06:02:21
问题 I have an oracle table that has a column called system_access that has the following data: Read Only, Write, read only, Admin Read, Write, read only, Admin Admin, Read Only (no), read only(see mgr), Admin Based on the above sample data, I am unsure of my query to only retrieve records that match the exact words of "Read Only" and/or "read only" I do not need the records that have the "Read Only (no)" with space then bracket after it or before it or "read only(see mgr)" with no space and

What is the difference between INSTR and LIKE in Oracle?

非 Y 不嫁゛ 提交于 2019-12-21 05:00:26
问题 Can some one tell me the difference between INSTR and LIKE in Oracle? Which one is faster in Oracle10g? 回答1: That depends on the data and on the pattern. If you use like 'a%' , then Oracle can use a BTree indexes to look up the matches because it can search the btree with the start of the pattern and then consider only the subtree. This doesn't work for LIKE '%a' but you can work around this by creating a calculated column which reverses all values from the column you want to search (so you

PL/SQL: ORA-00942: table or view does not exist V$SQL

霸气de小男生 提交于 2019-12-21 04:27:34
问题 I have created a procedure and used the below statement inside that . select sql_id into v_sql_id from v_$sql where sql_text =v_sql; I am getting the following error PL/SQL: ORA-00942: table or view does not exist I have checked the synonym its owner is PUBLIC ,so it should run in this case ,but its not working . Another thing i can select sql_id from v_$sql where sql_text =v_sql; this in simple editor .Can anyone help me with this . 回答1: Database dictionary related or system tables (v_$sql