oracle11g

Export a BLOB image from table

扶醉桌前 提交于 2019-12-11 09:57:48
问题 I have table in Oracle 11G R2, named as PERSON_IMAGE with ID (Number) and IMAGE(BLOB) fields. Now without using the application i need to export multiple BLOBs. How can i do this? Do we have any tool/ utility for this? Example will really assist me. 回答1: SQLDeveloper can do it: http://www.thatjeffsmith.com/archive/2014/05/exporting-multiple-blobs-with-oracle-sql-developer/ I just tried it in version 4.0.3 and although the interface was a little unintuitive, it worked fine. I ended up with a

Transpose Query Result in Oracle 11g

我与影子孤独终老i 提交于 2019-12-11 09:37:42
问题 I have a query which returns out result in following Form: Element READING1 READING2 READING3 --------------------------------------- 1 0.25 1.5 3.5 2 1.3 2.3 5.5 3 4.5 5.5 4.3 .. .. .. .. n 1.5 2.3 5.5 --------------------------------------- I want output in following form: 1 2 3 .. n --------------------------------------- READING1 0.25 1.3 4.5 .. 1.5 READING2 1.5 2.3 5.5 .. 2.3 READING3 3.5 5.5 4.3 .. 5.5 i.e I have to transpose the table. I have tried using Oracle Pivot with following way

Oracle XMLTABLE function not fetching data correctly

痞子三分冷 提交于 2019-12-11 09:33:41
问题 I am using Oracle 11g XMLTABLE function to fetch data from the attached XML file. When I execute the code, I get 3 rows. I am retrieving the Products correctly generating one row for each Product corresponding to a Customer. The problem is that I'm not getting the rest of the Customer data, I' getting nulls for CustomerName, CustomerDOB, and CustomerEmail. For some reason the code that I am using, Oracle is not fetching 2 levels up. Please help! What am I doing wrong? XML <?xml version="1.0"

Oracle Loop Through Join Statement

自闭症网瘾萝莉.ら 提交于 2019-12-11 08:59:13
问题 I need to execute a statement in PL-SQL that taking a selection of Ids, executes a join against a sub-set of those ids... in the example below i have about 700000 customers, and a far more complex query than shown here in the simple while loop in this example...i'm seeding quite poor performance and am curious if chopping up my current PL-SQL into 'chunks' would yield a perf increase? Currently: declare TYPE customerIdTabType IS TABLE OF customer.CustomerId%TYPE INDEX BY BINARY_INTEGER; vars

Oracle DB User alias

别说谁变了你拦得住时间么 提交于 2019-12-11 08:33:51
问题 Is there a SQL script I could run, or some other action I could take, that would create an alias for an entire DB User? I'm running in to an issue where the User name text is too long for a particular program, and I want to create an alias or nickname for that UserId. Edits: Rather than logging in with UserId: , Password , I want to log in with UserId: , Password. The program is not under my control beyond chaning the oracle User ID / Password login credentials. 回答1: You can't create an alias

Store a Blob from Java to BD: Data size bigger than max size for this type when is clearly not

大憨熊 提交于 2019-12-11 08:26:15
问题 Ok, here we go... I am trying to call a Stored Procedure (PL/SQL), one of the parameters is a blob, but when I execute the OracleCallableStatement I get this error: java.sql.SQLException: Data size bigger than max size for this type That is oh so very frustrating.. I have tried to do the following and fails... oracleCallableStatement.setBinaryStream(3, new ByteArrayInputStream(someByteArray), someByteArray.length); I get the same error with: oracleCallableStatement.setBytes(3, someByteArray);

How to configure Oracle 11g to launch sqlplus?

元气小坏坏 提交于 2019-12-11 08:22:15
问题 On a RedHat 6 server, a third party application requires to be root to run and needs access to sqlplus. I have a running database, I can run sqlplus as user 'oracle'. When logged in as user root, 'sqlplus usr/pwd@dbname' works as expected. The trouble is that this agent needs to run sqlplus with no parameters and it always returns ORA-12546: TNS:permission denied. I've read a dozen times that enabling root to launch Oracle is a security issue but I really have no other choice. Running Oracle

Oracle Custom IsNumber Function with Precision and Scale

℡╲_俬逩灬. 提交于 2019-12-11 08:15:52
问题 Is is possible to write an Oracle function that tests to see if a string conforms to a numeric precision and scale while providing precision and scale at run-time, and not using execute immediate? Function signature would be this: FUNCTION IsNumber(pVALUE VARCHAR2, pPRECISION NUMBER, pSCALE NUMBER) RETURN NUMBER It's not valid to do something like this: DECLARE aNUMBER NUMBER(pPRECISION, pSCALE); Any ideas on how to get something like this working? 回答1: I don't think there's any simple built

Access update query of linked Oracle tables not updating properly

风流意气都作罢 提交于 2019-12-11 08:07:27
问题 I have a linked Oracle table to an Access database which has two columns I am trying to update: Oracle: EAUSER_WELL_SUMMARY - UWI (PK) - MN_FORM - MN_SRC I am using an Access table in the database to update the two columns in the linked Oracle table: Access: TMP_FORM_SRC - UWI (PK) - MAIN_FORM - MAIN_SRC Here is the SQL that is being used: UPDATE eauser_well_summary INNER JOIN [tmp_form_src] ON eauser_well_summary.WELL_UWI = [tmp_form_src].WELL_UWI SET eauser_well_summary.MAIN_HZ_FM = [tmp

Pl/Sql Trigger for changing default date format in oracle

核能气质少年 提交于 2019-12-11 08:07:09
问题 i want to ensure that every time i logon the date format is changed from '24-Apr-2014' to '24/04/2014' For that I created a pl/sql trigger as follows CREATE OR REPLACE TRIGGER CHANGE_DATE_FORMAT AFTER LOGON ON DATABASE BEGIN ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY'; END; / However i am not logged on as sysdba so perhaps thats why i get the error SQL> @C:/pl/dateTrigger.sql AFTER LOGON ON DATABASE * ERROR at line 2: ORA-01031: insufficient privileges What can i do to ensure that date