Oracle

The mystic getClobVal()

怎甘沉沦 提交于 2021-01-27 11:56:24
问题 I have a table (AKADMIN) with an XMLTYPE column which name is XML. I would like to use the getClobVal() with this column. select t.xml.getClobVal() /**/ , t.xml.getClobVal() -- , t.xml.getClobVal() as clobval , t.xml.getClobVal() from akadmin t where ROWID = 'AAAQc6AAIAAAADDAAA' ; In the resultset the first 4 column give CLOB type, but the fifth column XMLTYPE. I have to type any comment or alias after getClobVal() to correct (CLOB) type of the result. Why? Another issue, when I leave the

The mystic getClobVal()

僤鯓⒐⒋嵵緔 提交于 2021-01-27 11:54:21
问题 I have a table (AKADMIN) with an XMLTYPE column which name is XML. I would like to use the getClobVal() with this column. select t.xml.getClobVal() /**/ , t.xml.getClobVal() -- , t.xml.getClobVal() as clobval , t.xml.getClobVal() from akadmin t where ROWID = 'AAAQc6AAIAAAADDAAA' ; In the resultset the first 4 column give CLOB type, but the fifth column XMLTYPE. I have to type any comment or alias after getClobVal() to correct (CLOB) type of the result. Why? Another issue, when I leave the

“ORA-00922: missing or invalid option” when trying to insert into table

試著忘記壹切 提交于 2021-01-27 11:37:15
问题 When i run SQL query in oracle sql developer it is work, but in jdbc this query doesn't work and catch the java.sql.SQLSyntaxErrorException: ORA-00922: missing or invalid option. Could anyone help me ? There is my query below CREATE GLOBAL TEMPORARY TABLE MY_TABLE ( ID VARCHAR2(30 BYTE) PRIMARY KEY, NAME VARCHAR2(20 BYTE)); INSERT INTO MY_TABLE ( ID, NAME) VALUES ('My_Id' , 'My_Name' ); 回答1: It is just a quick guess, because I have no oracle available to proof it, but with MyBatis (which is

OCP 063中文考试题库(cuug内部资料)第1题

大城市里の小女人 提交于 2021-01-27 08:03:53
OCP 063中文考试题库(cuug内部资料)第1题 本套题库是OCP考试中的063(中文版)试题,由CUUG整理,如有报考OCP认证意向,可以联系cuug咨询老师。 1、请选择两项。 对于您的组织中运行的多个数据库,您希望合并备份信息并集中管理备份和恢复脚本。 可以使用哪两种备份解决方案? A)RMAN恢复目录 B) Enterprise Manager Database Express C) Oracle Secure Backup D) RMAN介质管理库 E) Enterprise Manager Cloud Control 来源: oschina 链接: https://my.oschina.net/u/4368807/blog/4926432

Oracle - In CLAUSE question when using with multiple values, making it dynamic

醉酒当歌 提交于 2021-01-27 07:46:16
问题 I just spent an hour on google and here trying to get a straight answer for how to do this in Oracle. What I need is the ability to use select in clause that constructed automatically such as select col1 from table1 where id.table IN ('1','2','3'); where the id values are passed to the stored procedure inside the array. The associative array has been defined as such: TYPE varchar_array_type IS TABLE OF VARCHAR2 (40) INDEX BY BINARY_INTEGER; Is there a simple, concrete way to do that? thanks

ORA-00998: must name this expression with a column alias

让人想犯罪 __ 提交于 2021-01-27 07:12:30
问题 I get that I should add alias with all the columns and I'm doing so but I'm still getting error. CREATE TABLE MENTIONS AS SELECT UM.USER_ID AS U_ID, UM.SCREEN_NAME AS USER_SCREEN_NAME, UM.MENTION_ID AS M_USER_ID, ( SELECT UI.USER_SCREEN_NAME AS MENTIONED_USER FROM USER_INFO UI WHERE UI.USER_ID = UM.MENTION_ID AND ROWNUM = 1 ) FROM USER_MENTION UM USER_MENTION table USER_ID SCREEN_NAME MENTION_ID 135846337 irisschrijft 774759032636727300 50117969 Chjulian 13769472 14411827 thenriques45

Create a table based on a type

為{幸葍}努か 提交于 2021-01-27 07:09:41
问题 I have this following code snippet (SQL3) : Create Type person; Create Type child AS Table Of Ref person; Create Type person AS Object (name varchar(10), father ref person, children child); I want to understand what is the difference between the first and the second create type person. Also how can I create a table Employee based on the type person and insert data into it? 回答1: what is the difference between the first and the second create type person. Create Type person; The first is a

Create a table based on a type

回眸只為那壹抹淺笑 提交于 2021-01-27 07:07:35
问题 I have this following code snippet (SQL3) : Create Type person; Create Type child AS Table Of Ref person; Create Type person AS Object (name varchar(10), father ref person, children child); I want to understand what is the difference between the first and the second create type person. Also how can I create a table Employee based on the type person and insert data into it? 回答1: what is the difference between the first and the second create type person. Create Type person; The first is a

Get table return value from PL/SQL stored function using JDBC

喜你入骨 提交于 2021-01-27 06:30:53
问题 I have a PL/SQL stored function which returns a table of integers: CREATE TYPE INT_TABLE IS TABLE OF INTEGER; CREATE FUNCTION f (someParam IN INTEGER) RETURN INT_TABLE IS ... I wish to use JDBC to retrieve the result of this function so that I can iterate through the integers in some way, be it a ResultSet , int[] , or whatever. The function f performs modifications to the database, so it cannot be called in a query such as SELECT f(42) FROM DUAL; . The return value exists to inform the

Display Time Zone description in to_char() in Oracle

无人久伴 提交于 2021-01-27 06:30:27
问题 I have a SQL query select to_char(cast(sysdate as timestamp with LOCAL time zone), 'YYYY-MM-DD, HH24:MI:SS TZR') from dual This return output as 2015-08-06, 04:09:10 +05:30 Anyone have any clue to get output as follows 2015-08-06, 04:09:10 IST Thanks in advance. 回答1: In general you cannot show time zone of TIMESTAMP WITH LOCAL TIME ZONE value, because it is always your current local time zone by definition. +05:30 is your current time zone, you can verify by this: SELECT SESSIONTIMEZONE FROM