ROWNUM, ROWID, LEVEL, NEXTVAL, CURRVAL, USER, UID are pseudo columns in oracle. But I read in this site that SYSDATE and SYSTIMESTAMP are also pseudo columns. Is this right? how they are pseudo columns?
I have to display a 24 hours time as an index. (00:00 - 23:00) That is easy, if the data exists.
But, if the data is not regularly exists on specific hour (the time/hours is not regular, i.e: 00:00, 01:00, 05:00, 08:00, 10:00, 11:00, 23:00), then it is OK for a TABLE, but not for a CHART.
Here is the story:
I wrote an SQL statement that can "choose" what to display respectively to the the available time. The result will be displayed on the chart: Days or Time is used for X-Axis, and the respective Value on the Y-Axis.
Example:
+ if the data consists of "days" (i.e: the last 5 days from now, 16/07/2012, 17/07/2012, 18/07/2012, 19/07/2012, 20/07/2012), then the chart will show those dates on the X-Axis.
+ if the data consists of "hours" (i.e: 1 single day, from 00:00 hour - 23:00), then the chart shows hours on the X-Axis.
If the 'hours' are not regular, means: there is no data on specific hours, the query result is also not regular, means: the X-Axis-value 'jumps' irregularly.
Note: the X-Axis on the chart template can be only customized for 1 single mode, example: "Days", but of course it is not going to show up properly if the query result are in "Hours". It means: I have to find the workaround on the SQL Query.
WHILE EXISTS ( SELECT * FROM tblOrgChart WHERE fxOrgID = v_chrTempKeyDept ) LOOP v_intDept := CAST(v_chrTempKeyDept AS NUMBER) + 1 ; v_chrTempKeyDept := LPAD('',3 - LENGTH(CAST(v_intDept AS VARCHAR2)),'0') || CAST(v_intDept AS VARCHAR2) ; END LOOP;
Error: PLS-00204: function or pseudo-column 'EXISTS' may be used inside a SQL statement only
I have 8 columns. Some of them might be null.I want to display all 8 columns in my result. Not null columns will be first and null at the end.Here is a sample data :
I want to create a report by using one field and one text as columns name in layout but display the all the columns. I mention the 5 column names in query.how can I write function in summary column.
I am running a fairly busy Oracle 10gR2 DB, one of the tables has about 120 columns and this table receives on average 1500 insertions per second. The table is partitioned and the partitioning is based on the most important of the two timestamp columns. There are two timestamps, they hold different times.
Out of these 120 columns, about 15 need to be indexed. Out of the 15 two of them are timestamp, at least one of these two timestamp columns is always in the where clause the queries.
Now the challenge is, the queries we run can have any combination of the 13 other columns + one timestamp. In reality the queries never have more than 7 or 8 columns in the where clause but even if we had only 4 columns in the where clause we would still have the same problem.
So if I create one concatenated index for all these columns it will not be very efficient because after the 4th or 5th column the sorting would no longer be very useful and I believe the optimiser would simply not use the rest of the index. So queries that use the leading columns of the index in sequence work well, but if I need to query the 10th column the I have performance issues.
Now, if I create multiple single column indexes oracle will have to work a lot harder to maintain all these indexes and it will create performance issues (I have tried that). Besides, if I have multiple single column indexes the optimiser will do nested loops twice or three times and will hit only the first few columns of the where clause so I think it will kind of be the same as the long concatenated index.
What I am trying to do is exactly what the Bitmap index would do, it would be very good if I could use the AND condition that a Bitmap index uses. This way I could have N number of single column indexes which the optimiser could pick from and serve the query with exactly the ones it needs. But unfortunately using the Bitmap index here is not an option given the large amount of inserts that I get on this table.
I have been looking for alternatives, I have considered creating multiple shorter concatenated indexes but this still would not address the issue since many queries would still not be served properly and therefore would take a very long time to complete.
What I had in mind would be some sort of multidimensional index, I am not even sure if such thing exists. But essentially it would be some sort of index that could serve a query efficiently regardless of the fact that the where clause has the 1st, 3rd and last columns of the index.
So considering how widely used Oracle is and how many super large databases there are out there, this problem must be common.
I am using Oracle 10g version and I have a database created and it contains around 9 tables and 25k records, as per my current requirement I need to add few more columns in the existing tables and those new columns are going to be filled with contents from multiple languages (as of now Chinese and English). I went through Oracle 10g globalization guide and I understood that, for my requirements I need to add my new columns with data types of either NVARCHAR or NCHAR.
With my about understanding I created the following table and tried to insert some Chinese characters as follows but it's now coming as expected and I'm getting inserted only "????" in my table columns
Find below the list of actions
>create table Employee(EmpId varchar(255), EmpName NCHAR(255)); >insert into Employee(EmpId, EmpName) values('280129','彭俊睦'); >select * from Employee; 280129 ¿¿¿
>insert into Employee(EmpId, EmpName) values('28018',N'彭俊睦'); >select * from Employee; 280129 ¿¿¿ 28018 ¿¿¿
When I run the “select * from v$nls_parameters;” query I’m getting the following data
NLS_LANGUAGE ---------à SIMPLIFIED CHINESE NLS_TERRITORY---------à AMERICA NLS_CURRENCY---------à $ NLS_ISO_CURRENCY---------à AMERICA NLS_NUMERIC_CHARACTERS---------à ., NLS_CALENDAR---------à GREGORIAN NLS_DATE_FORMAT---------à DD-MON-RR [Code] .....
Is it possible to communicate with a serial device (via COM1) with oracle forms / webutil? I am able to communicate in java using RXTXcomm, but I am having problems making a bean that uses it (getting security errors and yes, I have signed the jars).
Basically, I have a scale hooked up to my COM1 port and want to be able to send commands (zero and tare) to it and read the weight from it through a form or java bean.
when we have a primary key on 4 columns and we have, say 20 million rows and we want to add one extra row. How does oracle check whether the data on the primary key is unique to the record being added compared to the 20 million rows. Does it actually compare the record being added to all the rows present in the table?
In col4 , we have to update the values of col3 (column) ... it is very easy to update the values by executing the query for each column but my requirement is ... I want to execute the query once for a table ( example select col1_abc,col2_abc from table_abc ... this will return always a single value after adding other conditions in where clause) and why I want to do this? .. because there can be multiple (might be 30 variables values) from a single table.
I have converted the columns into rows by using listagg function now I have lets a dynamic query ( for the above example).
for i in 1.2 loop
l_query := ' select col1_abc, col2_abc from table_abc'; open c1 for l_query;
end loop;
my problem is : how to hold these values and update the above table?
I have two table and trying to update tableA with data from tableB but gives an error. My TableA has columns - colA,colB,colC,colX and table B has columns - colA,colB,colX. Sample data looks like this:
this is the query I wrote update tableA a set (a.colX)=(select (b.colX) from tableB b where a.colA=b.colA and a.colB=b.colB);
When i run it gives this error:single row subquery returns more than one row.
tableB has only 1 value for colX for each colA,colB record but tableA has mutiple colA and colB repeated but for all of thsoe in table A i want to update the tableB.colX value for matching colA and colB.
I was trying to insert a row into Oracle database consisting 20 columns through IBM Web Experience Factory. I am getting "Array index out of range: 20" error message. To my knowledge insert is working fine till 7 columns. Is it a driver problem or do i need to install any fix pack?
I have migrated from postgres to oracle entire databases however some tables have spaces how can they be removed and how can i found out all the tables in a schema with spaces?
In the OWB mapping,I needed to transfer data in lob table1 to lob table2 .Both tables are in 2 different schema.The table1 has blob and clob columns.The table 2 has same structure like table 1 and the table 2 is empty.
I have created the mapping and connected directly from the source table to the target table.Also , I have created a error table for the target table table. As for the data rule method,I customized the error table to log the non unique rows.
When I start validating the mapping . I got the following error
VLD-3200 Deduplicator cannot contain LOB type columns
How to log the error in error table for transferring lob type table1 to lob type table 2
how to use APEX_ITEM.text for where the source for this comes from user input values and not for an underlying table.I have a report where three columns are coming from an actual table (one being a checkbox for selection) but then also have two additional fields on the screen that are not from a table but placeholder fields for user's to enter data.
For example, my query looks like this:
select apex_item.checkbox2(10,id), name, telephone, apex_item.text(20,NULL) as "Date Contacted", apex_item.textarea(30,NULL,5,80) as "Comment" from my_table
I am not seeing any values for the two user fields when entering values and doing a view source?
I have task. I am using oracle forms 6i. I want to import excel data to oracle forms(its common task using ole2 package). But this time I want to map the columns i.e my database table having 5 columns. and the excel file is having 2 or 3 columns then i suppose to map those columns and accordingly insert it to my table.
So far i have import column heading of excel to oracle forms, then i've provide list item for mapping each column. so that user can map excel column to database columns. Now I am confuse how to write the code so that selected columns should get inserted into database.
-more details
I have table with columns id, name, location, address, plan. in those columns i need to insert records form excel. user having a excel with 3 columns col1, col2, col3. on the form i've fetch column headers of excel and in front of that i've provide database column list , so user can match excel column with database column. e.g.
COL1 --> list value of database column COL2 -->list value of database column COL3 -->list value of database column
Once user map those column i want to insert those values into my database table (table with columns id, name, location, address, plan). and i am confuse about this code.
I need to transpose the following table columns to rows and rows to columns...Im not quite sure how to acheive this...I have the following table with fixed number of columns and dynamic number of rows based on date filter in query
MONTH_YEAR RMS RMS_OCC TTL_RMS --------------------------------------- SEPTEMBER 200917790017790 OCTOBER 2009183831278818347 NOVEMBER 2009177901460517762
and I need to display this as
COL1 SEPTEMBER 2009 OCTOBER 2009 NOVEMBER 2009 -------------------------------------------------------------- RMS 17790 18383 17790 RMS_OCC 0 12788 14605 TTL_RMS 17790 18347 17762
My database has three tables: members (with member name, member number and club number), clubs (with club name and club number) and matches (with win member number, lose member number and score).
I have a query which displays total number of matches won by a club, and number of matches lost by a club:
Quote: select c.clubname, (select count (*) from members wm, matches w where wm.memberno = w.winmember and wm.clubno = c.clubno) WINS, (select count (*) from members lm, matches l where lm.memberno = l.losemember and lm.clubno = c.clubno) LOSSES from clubs c order by WINS desc;
How can I modify this to add the WINS and LOSSES columns together in a new column? I have modified the query as such:
select c.clubname, (select count (*) from members wm, matches w where wm.memberno = w.winmember and wm.clubno = c.clubno) WINS, (select count (*) from members lm, matches l where lm.memberno = l.losemember and lm.clubno = c.clubno) LOSSES, (select count (*) from members wm, matches w where wm.memberno = w.winmember and wm.clubno = c.clubno) + (select count (*) from members lm, matches l where lm.memberno = l.losemember and lm.clubno = c.clubno) PLAYED, from clubs c order by WINS desc;
I wanted to know the consequences of adding a DEFAULT value to an existing column in a table.I understand that when you add a DEFAULT value to a column which is Nullable, Oracle updates all the null values for the column to the DEFAULT value, generating a lot of undo/redo data.
Is adding a DEFAULT value to a NOT NULL column a problem? As the column is NOT NULL, an update would not be done, so no undo/redo data will be generated.But will this cause a whole table scan? Is this advisable?
I want to insert only specific number of columns into a table by using Bulk collect and Forall.
SQL> create or replace procedure bifa_proc 2 is 3 type etab is table of emp%rowtype index by binary_integer; 4 erec etab; 5 cursor c is select * from emp; 6 begin 7 open c; [code]...
Warning: Procedure created with compilation errors.
PLS-00382: expression is of wrong type PLS-00436: implementation restriction: cannot reference fields of BULK In-BIND table of records
How to insert specific number of columns without declaring multiple table type definitions for each column by using bulk collect and forall.
I need to concatenate only columns with name starting with C and add separator between them. Is there any function do concatenate columns using separator like:
SELECT T.DUMMY P1, T.DUMMY P2, DBMS_SOMETHING.SOME_FUNCTION(',', C1,C2,C3,C4,C5) FROM DUAL T;