oracle10g

Any suggestions on how to extract 6 million records from an oracle10g?

*爱你&永不变心* 提交于 2019-12-02 04:23:46
I just want to give you a little background Need to write a PL-SQL which will extract 6 million record joining different tables and create a file of that. Need more suggestions, specifically on how to fetch these many records. As fetching these million of records on a single go can be a highly resource intensive. So question is how to fetch these many records ? Any pl-sql will be highly appreciated. Do you need to extract the contents of a single table, or a JOIN result? Does the result have to be ordered? If so, you should first optimize your extraction query. Once you have an optimal query

Creating Multiple table in Oracle

落花浮王杯 提交于 2019-12-02 04:20:27
I am using Oracle Express 10g and I'm enter the following text to create 2 tables in the sql command line, but it is not working. CREATE TABLE student ( matric_no VARCHAR2(8), first_name VARCHAR2(20), last_name VARCHAR2(20), date_of_birth DATE ); CREATE TABLE student1 ( matric_no VARCHAR2(8), first_name VARCHAR2(20), last_name VARCHAR2(20), date_of_birth DATE ); Can anyone see what I am doing wrong. Thanks Codo By "command line" you probably mean the web application that comes with Oracle Express 10g. This application has several browser incompatibilities and is basically unable to execute

How can I create table as select (CTAS) in oracle?

一笑奈何 提交于 2019-12-02 03:54:26
问题 I need to use CTAS (Create Table As Select) to create a table named Au_Books_ZL that contains au_id, fname, lname, title_id, title, Pub_id, price and revenue (which is price*sales) . I have browsed other questions online, but they don't show how to include all the attributes (lname, fname, title_id ect.) in the query. How could I write up my CTAS to create the new table? 回答1: The syntax for creating a table would be something like CREATE TABLE au_books_zl AS SELECT au_id, fname, lname, title

How to drop list of table from a schema in Oracle?

空扰寡人 提交于 2019-12-02 03:53:02
My Oracle scott schema contains table list like that 'prefix_A' 'prefix_B' 'prefix_C' 'A' 'B' 'C' Now i want to drop list of tables ,containing table prefix like that 'Prefix_',But others table A ,B ,C will be remain same. How it is possible ? Thanks in Advance. Use dynamic SQL driving off the data dictionary. begin for trec in ( select table_name from user_tables where table_name like 'PREFIX\_%' escape `\' ) loop dbms_output.put_line('dropping table ' || trec.table_name); execute immediate 'drop table '||trec.table_name; end loop; end; It's a good idea to be precise with the LIKE clause;

Oracle - How does Oracle manage transaction specific DML statements

别来无恙 提交于 2019-12-02 03:40:30
Imagine I have this simple table: Table Name: Table1 Columns: Col1 NUMBER (Primary Key) Col2 NUMBER If I insert a record into Table1 with no commit... INSERT INTO Table1 (Col1, Col2) Values (100, 1234); How does Oracle know that this next INSERT statement violates the PK constraint, since nothing has yet been committed to the database yet. INSERT INTO Table1 (Col1, Col2) Values (100, 5678); Where/how does Oracle manage the transactions so that it knows I'm violating the constraint when I haven't even committed the transaction yet. Oracle creates an index to enforce the primary key constraint

Blank character ignored in where clause

ⅰ亾dé卋堺 提交于 2019-12-02 03:36:28
I have done the following - create table test (col char(10)); insert into test values ('hello'); select * from test where col = 'hello' I have been suggested that the above should not return any result as 'col' is 10 chars, it will be right padded with blanks, so comparing with 'hello' will not return result. But I am getting the result. Can anyone please explain this? I am using 11gR2 Looking at the Oracle Documentation on literals : Text literals have properties of both the CHAR and VARCHAR2 datatypes: Within expressions and conditions, Oracle treats text literals as though they have the

C#/Oracle: Specify Encoding/Character Set of Query?

血红的双手。 提交于 2019-12-02 03:35:46
I'm trying to fetch some Data of a Oracle 10 Database. Some cells are containing german umlauts (äöü). In my Administration-Tool ( TOAD ) I can see them very well: "Mantel f ü r Damen" (Jacket for Women) This is my C# Code (simplified): var oracleCommand = new OracleCommand(sqlGetArticles, databaseConnection); var articleResult = oracleCommand.ExecuteReader(); string temp = articleResult.Read()["SomeField"].ToString(); Console.WriteLine(temp); The output is: "Mantel f ? r Damen" Tryed on Debugging (moving mouse over variable), Debug-Window, Console-Window, File. I think I have to specify the

Ordering the strings while concatenating in oracle

旧时模样 提交于 2019-12-02 03:03:52
I am using the collect function to concatenate strings for a sql query. select id, tab_to_string(CAST(COLLECT(a.level||' '||d.Number||': '||to_char(nvl(de.eventDate,SYSDATE - 365 * 100))) AS t_varchar2_tab)) AS MyVar from Mytable groupby id The output of this query is like: Id Myvar 1 level : 27-Jan-09,level : 27-Mar-08, level : 2-Apr-10 2 level : 7-Jun-06,level : 27-Dec-08, level : 2-Nov-08 3 level : 27-July-10,level : 27-Mar-06, level : 2-Apr-10 But i want the "Myvar" value to be ordered by the date field within the concatenated string so for the Id = 1, the output should be like level : 27

C# Getting the size of the data returned from and SQL query

自古美人都是妖i 提交于 2019-12-02 02:36:30
问题 How can I get the size in bytes of the data returned from the database when executing a query? The reason for this is to compare load on the database server using two different techniques. We were running reports built from the same dataset which would load the entire dataset for every report. Now we are caching the dataset and running reports from the cache. We run reports per client, some datasets are significantly bigger than others, and I need some way to give a measurable metric for the

ORA-01855: AM/A.M. or PM/P.M. required

不羁的心 提交于 2019-12-02 01:55:53
I get the error: ORA-01855: AM/A.M. or PM/P.M. required when I try to execute following query. INSERT INTO TBL(ID,START_DATE) values (123, TO_DATE ('3/13/2012 9:22:00 AM', 'MM/DD/YYYY HH:MI AM')) Where my START_DATE column is of type "Date". I have executed following query and it gave no errors, still not success yet in above issue: ALTER SESSION SET NLS_DATE_FORMAT = "MM/DD/YYYY HH:MI AM"; Your format mask must match the format of the string you are converting. So you would either want to add SS to the format mask or remove the seconds from the string INSERT INTO TBL(ID,START_DATE) values