oracle10g

Access 2007 to Oracle 10g linked table — query with flawed results, but no errors thrown

早过忘川 提交于 2019-12-25 12:19:31
问题 Access 2007 databases querying linked oracle 10g tables are returning flawed result sets when using the WHERE clause to filter-out unwanted records. Oddly, some filtering is happening, but not reliably. I can reliably demonstrate/produce the problem like this: Create a *new* database with Access 2007. Create a second *new* database with Access 2007, and then "save-as" 2000. Create a third *new* database with an older version of Access. Run the following query in each database: SELECT STATUS,

How to combine multiple rows in a single row, oracle

試著忘記壹切 提交于 2019-12-25 09:28:04
问题 I have following record: And I want to return result like this: I have got this result after joining many tables. So still no idea to achieve this requirement. Note: I have tried with group by but didn't work. Query: SELECT P.CODE AS "projectNumber", P.NAME AS "projectName", P.START_DATE AS "startDate", P.END_DATE AS "endDate", TRIM (VP.firstName || ' ' || VP.lastName) AS "vp", TRIM (SRPM.firstName || ' ' || SRPM.lastName) AS "srpm", TRIM (PM.firstName || ' ' || PM.lastName) AS "pm", TRIM

ORA-22905: cannot access rows from a non-nested table item

一个人想着一个人 提交于 2019-12-25 08:26:32
问题 CREATE OR REPLACE TYPE myObjectFormat AS OBJECT ( A VARCHAR2(200), B INTEGER, C INTEGER ) / CREATE OR REPLACE TYPE myTableType AS TABLE OF myObjectFormat ; / CREATE OR REPLACE PACKAGE demo4 AS FUNCTION f1(p_abc_tab IN myTableType) RETURN myTableType PIPELINED; END; / CREATE OR REPLACE PACKAGE BODY demo4 AS FUNCTION f1(p_abc_tab IN myTableType) RETURN myTableType PIPELINED IS BEGIN FOR i in p_abc_tab.first .. p_abc_tab.last LOOP PIPE ROW (myObjectFormat(p_abc_tab(i).a,p_abc_tab(i).b,p_abc_tab

Oracle get 1hr back date

自作多情 提交于 2019-12-25 08:25:55
问题 In Oracle, I want to get specific intervals. Consider, sysdate is 10-dec-2016 10:15:23 (dd-mon-yyyy hh24:mi:ss). I want to get a date period like 10-dec-2016 09:00:00 to 10-dec-2016 10:00:00 How to get this date period through query. If you have observed this date period is 1hr back from current HH24 format and rounded to 00:00. The query should work for whatever I set. Above date period is for 1hr. I should be able to set for any number of hours like 2hrs,3hrs etc. 回答1: Something like:

Record count using Read()

倖福魔咒の 提交于 2019-12-25 07:49:03
问题 I am trying to figure out how to get the max record count before i populate a listview grid. I'm using the Oracle 10g DB and I've tried: SELECT COUNT(*) as countNum, status, date, theTitle, theMessage, date2 " & _ "FROM blah blah... messagebox.show(dr(0)) But that makes the SQL query crash. It doesnt seem as though i am about to put anything related to "count" in my query or it will crash so is there any other way i can see how many records it returns other than that? Thanks! :o) David 回答1:

ORACLE SQL | Modifying data in ORDER BY

半城伤御伤魂 提交于 2019-12-25 05:14:50
问题 following structure in a ORACLE table: FILE_NAME ----------- 12345_l.tif 12345_m.tif 12345_r.tif 12345_x.tif 12345_y.tif Need the following result: First *_m* Then *_l* Then *_r* Then * (everything else) Trying with: SELECT FILE_NAME FROM TABLE WHERE FILE_NAME LIKE '12345%' ORDER BY regexp_replace(FILE_NAME, '_m', '_1'), regexp_replace(FILE_NAME, '_l', '_2'), regexp_replace(FILE_NAME, '_r', '_3') But this gives me a wrong result. Anybody with a hint? TIA Matt 回答1: Change your ORDER BY to

What is the syntax for increasing the size of a BLOB datatype in Oracle?

爱⌒轻易说出口 提交于 2019-12-25 05:12:52
问题 Docs say : ALTER TABLE <table name> ADD (<lobcol> <LOBTYPE> <LOB_clause_same_as_for_create>) | MODIFY LOB (<lobcol>) ( [PCTVERSION <version_number>] [ { CACHE | NO CACHE [{LOGGING | NOLOGGING}] | CACHE READS [{LOGGING | NOLOGGING}] } ] ) | MOVE [ONLINE] [<physical_attributes>] [TABLESPACE <tablespace_name>] [LOGGING | NOLOGGING] [<LOB_clause_same_as_for_create>] With an example of: ALTER TABLE test_lob MODIFY LOB (image) ( STORAGE (NEXT 1M) CACHE ); I tried this with my table and column names

how to update multiple tables in oracle DB?

跟風遠走 提交于 2019-12-25 04:47:19
问题 i am using two tables in my oracle 10g. the first table having the keyword,count,id(primary key) and my second table having id, timestamp.. but i am doing any chages in the first table(keyword,count) it will reflect on the my second table timestamp.. i am using id as reference for both the tables... table1: CREATE TABLE Searchable_Keywords (KEYWORD_ID NUMBER(18) PRIMARY KEY, KEYWORD VARCHAR2(255) NOT NULL, COUNT NUMBER(18) NOT NULL, CONSTRAINT Searchable_Keywords_unique UNIQUE(KEYWORD) );

Generate Sequence of dates and time

爷,独闯天下 提交于 2019-12-25 04:46:15
问题 Is it possible to change this query below so that instead of the "OPEN" being the same it would be the LAST "INTERVALENDTIME". Unless of course it is a new day then it would be "OPEN" For example here are a few lines of date from the current version: DT OPEN CLOSE NAME INTERVAL END 8/4/2015 8/4/2015 9:00:00 AM 8/4/2015 2:00:00 PM Bob 8/4/2015 1:00:00 PM 8/4/2015 8/4/2015 9:00:00 AM 8/4/2015 2:00:00 PM Bob 8/4/2015 2:00:00 PM 8/5/2015 8/5/2015 9:00:00 AM 8/5/2015 2:00:00 PM Bob 8/5/2015 10:00

Change column type in table

与世无争的帅哥 提交于 2019-12-25 03:57:32
问题 I have a datatable called deal in Oracle with four columns: DealID: (PK) LegID OrigID Description The problem is that if I want to insert a deal with description = A, the attributes LegID and OrigID must be unique, otherwise, there is not problem. How can i make this check? I had thought a trigger after insert. There are more solutions? Thanks in advance!! 回答1: You need a function based unique index : create table tt ( DealID number(10) primary key, LegID number(10), OrigID number(10),