oracle11g

sorting alpanumeric strings in Oracle 11g

最后都变了- 提交于 2019-12-12 06:15:39
问题 I have a client that needs a report on Lawson tokens sorted in a strict alphanumeric order. The following is a sample test file and the query I have been using without success. I am not sure why the regex_replace is not working well here. I will appreciate any help I can get. Thanks. enter code here create table sortest (token varchar2(6)); insert into sortest values ("BR00.1'); insert into sortest values ("BRFL.1'); insert into sortest values ("BRBF.1'); insert into sortest values ("BR00.2')

Concatenate values of field depending on text selection Oracle SQL

泄露秘密 提交于 2019-12-12 05:43:44
问题 I have a table a_x with the columns A and B, column A is in CLOB format, column B number(10): A | B -----------------------------|------- atveroeosipsumloremipsumdolor| 1 stetclitakasdtest | 2 noseatakimataatveroeosipsum | 3 loremipsumdolor | 4 consetetursadipscingelitr | 5 I would like to produce this table, in order to find out, which ID goes with certain substrings: A | IDs -----------------------------|------- atveroeosipsum | 1,3 test | 2 stetclitakasd | 2 noseatakimata | 3

Oracle Query For opening and closing balance [closed]

a 夏天 提交于 2019-12-12 05:24:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . hi i have following table and data to get opening and closing balance of every account opening balance required gdate<02-oct-2013 here is my table create table ledger (account_no varchar2(10),gdate date,debit number(8),credit number(8)) insert into ledger (account_no,gdate,debit,credit) values ('10-0001','01-oct

SQL Oracle query to calculate subtotal

泄露秘密 提交于 2019-12-12 05:12:56
问题 I am googling to find proper way to make subtotals in Oracle SQL. Recording to this i make query select model, sifra, velicina, sum(nvl(magacin,0)) as suma from podmornica where model ='30001' group by sifra, velicina, cube (model) order by model, sifra, velicina I have table podmornica with columns:model, sifra, velicina, magacin But it doesn't work. Every second row in column model is null, and at the end not calculate sum. How to solve this? Thanks P.S. In one MODEL we have variations of

Cannot create JDBC driver of class '' for connect URL 'null' oracle XE MVC Spring Mybatis Tomcat 7

余生长醉 提交于 2019-12-12 05:09:02
问题 I created a simple web application with MVC Spring Integrated (or at least trying to) My batis. I am using Oracle XE database and Tomcat 7. My problem is that I am not being able to connect to my database, I created a dataSource following Apache´s documentation. Every time I run my application I get the following Exception: SEVERE: El Servlet.service() para el servlet [appServlet] en el contexto con ruta [/practicas] lanzó la excepción [Request processing failed; nested exception is org

ORA-00947: not enough values

最后都变了- 提交于 2019-12-12 04:59:41
问题 I get an error "ORA-00947: not enough values") inserting a record and can't see why! It seems to me I have the correct number of parameters: string sQuery = "insert into EventLog (UserEventLogID, USERID, EVENTSEVERITYID, LOGTIME_TZ, USEREVENTTYPEID, USEREVENTMSG) " + "values (0, :USERID, :EVENTSEVERITYID, cast(:LOGTIME_TZ as Timestamp(6) With Time Zone) at time zone '" + oLog.TimeZone + "'), " + ":EVENTTYPEID, :EVENTMSG) " + " returning USEREVENTLOGID into :EventLogID"; oraCmd = new

How to return a boolen in refcursor? [duplicate]

拟墨画扇 提交于 2019-12-12 04:59:22
问题 This question already has answers here : Is there any boolean type in Oracle databases? (10 answers) Closed 6 years ago . In the below procedure I need to return a boolean value by using refcursor CREATE OR REPLACE PROCEDURE gmmt_proc.co_col_preference_details_sp ( p_applcd IN VARCHAR2, p_rptname IN VARCHAR2, p_user IN VARCHAR2, p_out_col_pref OUT sys_refcursor, p_err_cd OUT NUMBER, p_err_msg OUT VARCHAR2 ) IS p_check BOOLEAN := true; p_val NUMBER; BEGIN BEGIN SELECT p3.col_grp_id INTO p_val

SQL Retrieving an object from VARRAY in Oracle 11g Database

为君一笑 提交于 2019-12-12 04:58:07
问题 I have a schema RTRD_W built in an Oracle 11g database that contains a table rtrd_pri that has a column NOMNL which is has a type defined as VARRAY(10) OF KPS_ADM.NUMBER_T (an object defined as a type in the KPS_ADM schema). I am trying to run a query to retrieve the KPS_ADM.NUMBER_T object inside the varray but I keep getting an error returned in my SQL syntax. The function I built is posted below CREATE or replace function RETRIEVEPRIREF RETURN KPS_ADM.NUMBER_T AS REF1 KPS_ADM.NUMBER_T;

Insert values into table B based on column from table A?

旧城冷巷雨未停 提交于 2019-12-12 04:55:01
问题 I have 2 tables, a Users table and a User_permissions table. A user can have many permissions and each permission can be assigned to many different users, although this relationship has not been configured into the database (not my decision!). Let's say 2 new permissions are created - an admin permission and a superadmin permission. Furthermore, every user in the Users table need to be given this permission by inserting the username and permission name into the User_permissions table.

How to export oracle 11g user to 10g and on a different default tablespace

て烟熏妆下的殇ゞ 提交于 2019-12-12 04:54:20
问题 I have an 11g database and I want to export a dump to import it later on a 10g database. I can use expdp with option VERSION=10.2 but my problem is that I have to import this dump on a different tablespace. thank you 回答1: You can use the REMAP_TABLESPACE parameter during the import: Remaps all objects selected for import with persistent data in the source tablespace to be created in the target tablespace. You can specify multiple mappings if necessary. 来源: https://stackoverflow.com/questions