ORA-01790 Expression must have the same data type
select 'sal' as A, sal as B, sal as C, sal as D
from
(Select sum(sal) sal from emp)
union all
select
'comm', comm, comm, comm
from
(Select sum(comm) comm from emp)
union all
select rpad('-',10,'-') ,rpad('-',10,'-'),rpad('-',10,'-'),rpad('-',10,'-') from emp;
Get the following error when you run the above query. I know it's because of the rpad('-',10,'-') what is the best way to achieve the expected resultsI would like to have the result with underscore. What is the best way to achieve this.
Expected results:
I am developing report.
I need to have the following oupput.
How can I put underscore after the recordings.
A B C D
sal 29025 29025 29025
comm 2200 2200 2200
--------------------------------------------------
SQL> select 'sal' as A, sal as B, sal as C, sal as D
2 from
3 (Select sum(sal) sal from emp)
4 union all
5 select
6 'comm', comm, comm, comm
7 from
8 (Select sum(comm) comm from emp)
9 union all
10 select rpad('-',10,'-') ,rpad('-',10,'-'),rpad('-',10,'-'),rpad('-',10,'-') from emp;
'comm', comm, comm, comm
*
ERROR at line 6:
ORA-01790: expression must have same datatype as corresponding expression
SQL> select 'sal' as A, to_char(sal) as B, to_char(sal) as C, to_char(sal) as D
2 from
3 (Select sum(sal) sal from emp)
4 union all
5 select
6 'comm', to_char(comm), to_char(comm), to_char(comm)
7 from
8 (Select sum(comm) comm from emp)
9 union all
10 select rpad('-',10,'-') ,rpad('-',10,'-'),rpad('-',10,'-'),rpad('-',10,'-') from emp;
A B C D
---------- ---------------------------------------- ---------------------------------------- ------------------
sal 29025 29025 29025
comm 2200 2200 2200
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
A B C D
---------- ---------------------------------------- ---------------------------------------- ------------------
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
---------- ---------- ---------- ----------
16 rows selected.
SQL>
SY.
Tags: Database
Similar Questions
-
ORA-01790 expression must have the same type of data, matching expression
Expected resultsSELECT * from award_test UNPIVOT(VAL for operator in( AWARD_NAME, TOTAL_PROCEEDS, EARNING_PROCS , TOT_PROCS_EARNINGS , GROSS_PROCS , PROC_REF_DEF_ESCR , OTH_UNSP_PROCS , ISSUANCE_COST , WORK_CAP_EXP )) PIVOT(max(VAL) for award_number in ('XIAAE' as "XIAAE",'XIBNG' as "'XIBNG"))
the data stored will be populated as columnsoperator XIAAE XIBNG AWARD_NAME ab cd TOTAL_PROCEEDS 0 1 EARNING_PROCS TOT_PROCS_EARNINGS GROSS_PROCS PROC_REF_DEF_ESCR OTH_UNSP_PROCS ISSUANCE_COST WORK_CAP_EXP
Hello
Is this the same probllem like
Re: ORA-56901: no constant expression is not allowed to pivot. UNPIVOT values
?You do not post again and again the same problem. One of these threads mark as "Answered" right away; and only continue in the other. In this way, you will have only to look in one place to find answers.
I suggest marking it as 'Response', given that the other has a few examples of data. -
How I can fix this bug with my class, I get this message:
"A file in a source path must have the same package structure", as the definition, "photoviewer" package. "
It's my source WindowedApplication:
<? XML version = "1.0" encoding = "utf-8"? >
"" < mx:WindowedApplication xmlns:mx = ' http://www.adobe.com/2006/mxml '
"" xmlns = "*".
paddingBottom = paddingTop = "0" "0".
paddingLeft paddingRight '0' = '0 = '.
Layout = "vertical".
pageTitle = "Photo Viewer"
creationComplete = "init ()" viewSourceURL = "srcview/index.html" > "
< mx:Script >
<! [CDATA]
Import mx.collections.ArrayCollection;
Mx.rpc.events import. *;
PhotoViewer Import. Gallery;
PhotoViewer Import. PhotoService;
[Bindable]
private var: Gallery;
[Bindable]
private var service: PhotoService.
private function init (): void
{
service = new PhotoService("data/galleries.xml");
}
[]] >
< / mx:Script >
This is my Gallery class source:
the photoviewer package
{
Import mx.collections.ICollectionView;
Import mx.collections.ArrayCollection;
Import mx.collections.IViewCursor;
[Bindable]
public class Gallery
{
public var name: String;
public var description: String;
public var photos: ArrayCollection collection;
public var selected: int;
private var photo: Photo;
public void Gallery (gallery:Object = null)
{
photos = new ArrayCollection();
If (Gallery! = null)
{
Fill (Gallery);
}
}
public void fill(gallery:Object):void
{
myIdName = gallery.id;
This.Description = gallery.description;
This.Selected = 0;
for (var i: int = 0; i < gallery.photo.length; i ++)
{
Photo = new Photo (gallery.photo );
photos.addItem (photo);
}
}
}
}
Someone knows how to fix this error?
"A file in a source path must have the same package structure", as the definition, 'photoviewer' package. '?
Kind regards
EvsPeart
Yes. If you want to file package photoviewer Gallery you create directory photoviewer in src and move the file there.
-
How to identify columns that have the same data in a SQL query or function?
Deal all,
How to identify columns that have the same data in a SQL query or function? I have the sample data as below
!DEPT_ID EMP_ID Come on CITY STATE COUNTRY 1 1 1 June 1983 DELHI HUMAN RESOURCES India 1 2 18 January 1987 DELHI HUMAN RESOURCES India 1 3 28 November 1985 DELHI HUMAN RESOURCES India 1 4 4 June 1985 DELHI HUMAN RESOURCES India 2 5 5 June 1983 MUMBAI HD India 2 6 6 June 1983 MUMBAI HD India 2 7 7 June 1983 MUMBAI HD India . 19832 8 8 Jun MUMBAI HD India . June 19833 9 9 GURGAON DL India 3 10 10 June 1983 GURGAON DL India Now, I want to Indify columns that have the same data for the same Department ID.
Is it possible in sql unique or do I have to write the function for this? Pls Help how to write?
Thanks in advance.
You can try this?
WITH T1)
DEPT_ID, EMP_ID, DATE OF BIRTH, CITY, STATE, COUNTRY
), ()
SELECT 1, 1, TO_DATE('1.) June 1983', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL
SELECT 1, 2, TO_DATE('18.) January 1987', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL
SELECT 1, 3, TO_DATE('28.) November 1985', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL
SELECT 1, 4, TO_DATE('4.) June 1985', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL
SELECT 2.5, TO_DATE('5.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL
SELECT 2.6, TO_DATE('6.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL
SELECT 2.7, TO_DATE('7.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL
SELECT 2.8, TO_DATE('8.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL
SELECT 3, 9, TO_DATE('9.) June 1983', 'JJ. LUN. (YYYY'), 'GURGAON', 'DL', 'INDIA' OF THE DUAL UNION ALL
SELECT 3.10, TO_DATE('10.) June 1983', 'JJ. LUN. (YYYY'), 'GURGAON', 'DL', 'INDIA' OF THE DOUBLE)
SELECT DEPT_ID,
RTRIM (XMLAGG (XMLELEMENT(A,VALS||',')). Extract ('//Text ()'), ',') COLUMNS_WITH_DUPLICATE
DE)
SELECT * FROM)
SELECT DEPT_ID,
EMP_ID,
Date of birth
CITY,
STATE,
COUNTRY
DE)
SELECT DEPT_ID,
EMP_ID,
Date of birth
CITY,
STATE,
COUNTRIES,
COUNT (*) OVER(PARTITION BY DEPT_ID ORDER BY EMP_ID DESC,DOB DESC,CITY DESC,STATE DESC, COUNTRY DESC) RN
DE)
SELECT DEPT_ID,
CASE WHEN(CEID>1) AND THEN 'YES' ELSE 'NO' END AS EMP_ID.
CASE WHEN(CDOB>1) THEN 'YES' ELSE 'NO' END AS DATE OF BIRTH,
CASE WHEN(CCITY>1) AND THEN 'YES' ELSE 'NO' END AS CITY.
CASE WHEN(CSTATE>1) AND THEN 'YES' ELSE 'NO' END AS STATE.
CASE WHEN(CCOUNTRY>1) THEN 'YES' ELSE 'NO' END AS A COUNTRY
DE)
SELECT DISTINCT
DEPT_ID,
CEID,
CDOB,
CITY,
CSTATE,
CCOUNTRY
DE)
SELECT DEPT_ID,
COUNT (*) TO THE CEID (DEPT_ID PARTITION, EMP_ID),.
COUNT (*) ON CDOB (DEPT_ID SCORE, DATE OF BIRTH),
COUNT (*) ON THE CITY (DEPT_ID PARTITION, CITY),
COUNT (*) ON CSTATE (DEPT_ID PARTITION, STATE).
COUNT (*) ON CCOUNTRY (DEPT_ID, COUNTRY PARTITION)
FROM T1)))
WHERE RN = 1)
UNPIVOT (CLO FOR (VALS) IN (EMP_ID, DATE OF BIRTH, CITY, STATE, COUNTRY)))
WHERE COLS = "YES".
DEPT_ID GROUP;
OUTPUT:
DEPT_ID COLUMNS_WITH_DUPLICATE
--------- ------------------------1 CITY, COUNTRY, STATE
2 CITY, COUNTRY, STATE
3 CITY, COUNTRY, STATEPost edited by: Parth272025
-
CREATE or REPLACE (name in varchar2) procedure Compress_tab_partition
is
last_mnth_var varchar2 (8);
curr_mnth_var varchar2 (8);
number of last_mnth;
number of curr_mnth;
last_partition varchar2 (8);
high_val varchar2 (4000);
StartSelect to_char (add_months (trunc (sysdate, 'MM'),-1), 'YYYYMM') | ' 00' in the double last_mnth_var;
Select to_char (sysdate, 'YYYY') | TO_CHAR (sysdate, 'mm') | ' 00' in the double curr_mnth_var;
Select to_number (last_mnth_var) in the double last_mnth;
Select to_number (curr_mnth_var) in the double curr_mnth;Dbms_output.put_line ('Compression of GOLDMGR Table scores.' | table-name |) "to go". ») ;
Dbms_output.put_line(' ');/ * Step 1 - identify the name of the partition of the specified table must be compressed * /.
Select high_value from high_val from user_tab_partitions where table_name = table-name;
Select nom_partition into last_partition from user_tab_partitions where table_name = table-name and high_value = rtrim (high_val);/ * Step 2 - Alter partition table to compress * /.
run immediately "ALTER TABLE GOLDMGR." | table_name | ' CHANGE THE PARTITION '. last_partition | "COMPRESS by low query";
/ * Step 3 - Index rebuild step * /.
I'm in (select index_name in user_indexes where table_name = table-name)
loop
run immediately "ALTER INDEX GOLDMGR." | i.index_name |' REBUILD ";
end loop;Dbms_output.put_line (' COMPLETED: compress the Table partitions change.) ") ;
end;
/I'm getting an error like: Error (21,100): PL/SQL: ORA-00997: illegal use of the LONG data type
Please resolve.
HIGH_VALUE datatype is LONG. You may not use for a long TIME in WHERE clause expressions. You need to loop through the partitions by selecting HIGH_VALUE and then comparing. Secondly, there is no need to select double to calculate expressions. For example:
Select to_char (add_months (trunc (sysdate, 'MM'),-1), 'YYYYMM') | ' 00' in the double last_mnth_var;
should be replaced by
last_mnth_var: = to_char (add_months (trunc (sysdate, 'MM'),-1), 'YYYYMM') | ' 00'.
and there is no need to add_months here:
last_mnth_var: = to_char (trunc (sysdate, 'MM') - 1, "YYYYMM"). ' 00'.
But the main question is simply ALTER TABLE MODIFY PARTITION COMPRESS allows compression but does not compress. You must issue ALTER TABLE MOVE PARTITION COMPRESS:
SQL > create table tbl (n) partition by range (n)
2 (partition p1 values less than (maxvalue))
3. Select lpad('X',4000,'X') from dual connect by level<=>=>
4.Table created.
SQL > select bytes
2 from WHERE user_segments
3 where nom_segment = 'TBL '.
4 and nom_partition = 'P1 '.
5.BYTES
----------
830472192SQL > alter table tbl
2. change the partition p1 compress
3.Modified table.
SQL > select bytes
2 from WHERE user_segments
3 where nom_segment = 'TBL '.
4 and nom_partition = 'P1 '.
5.BYTES
----------
830472192SQL > alter table tbl
2. move the partition p1 compress
3.Modified table.
SQL > select bytes
2 from WHERE user_segments
3 where nom_segment = 'TBL '.
4 and nom_partition = 'P1 '.
5.BYTES
----------
8388608SQL >
SY.
-
ORA-00997: illegal use of the LONG data type
Hi all
11.2.0.1
ALTER TABLE SAFDB MOVE TABLESPACE DATA_TS_ENC
*
ERROR on line 1:
ORA-00997: illegal use of the LONG data type
Why illegal? How can I move this table?
Thank you very much
pK
Take a look who
http://aprakash.WordPress.com/2011/01/06/how-to-move-table-containing-long-or-LOB-columns/
Concerning
-
Of 'date and time' I tried to drag the month and year of my menu bar. He did not stay, I did several times, but nothing helped. I closed the window and went back to my Thunderbird email to see the date, I tried to use became the date in the column "date of receipt" of all of my emails back for 2011. I changed the date a few days later, and then the date is changed on all my emails. I want to cancel everything I done the dates so that the emails show when they were initially received. I managed to get "the order received" which helps a little, but I don't see the original dates.
I checked "set date and time automatically", but it does not change the dates on my saved emails.
Of 'date and time' I tried to drag the month and year of my menu bar.
Is this something Mac?
-
A file in a source path must have the same package structure
Hello
I'm creating an application. What I did to cause this error, should separate my AS3 code to another .as file in the same folder. Since then, I get this error. I tried a couple of different things as creating a new folder under the same structure with the same name as the package I said. However, no effect, it's a gave the same error.
I searched for information on this error, all suggest the same thing... I did. Probably I did not receive what they say...
However, can someone explain where I'm wrong about this?
Thanks and greetings
H.R.
My guess is you put in the right place, and the 'heap of various errors' that you refer to are compilation errors in your class. In its current location, Flex doesn't compile your class because he is in the wrong directory, so you will not see these errors. Put it back where it should be and if you get more errors that you don't understand, search with google, read actionscript docs or ask another question on the forum.
-
How to create two different smart albums with photos with the same date?
I created a smart album by using 'Date is' and ' keyword is EAA.» (The photos have a keyword like "EAA" or "Flower". Photos of keyword EAA & flower have the same date.) When I use "Corresponding to all" are has no pictures in the album. When I use "Match any" all the photos are in the album - EAA & flower. I would like an album with only pictures of CEA for that date and another album with photos of flower with the same date.
I get the same answer. I can get the date and to a key word to work with 'all' selected, but not date and keywords. So you will need two smart albums: one with date and ECA ('all' selected) and the other with date and flowers ('all' selected).
Use the file menu option ➙ new Smart Album.
Report the problem to Apple via https://www.apple.com/feedback/photos.html.
-
Syntex to create the table with the long data type
I'm looking to create a table based on another table that having the column long data type. Throw the error ORA-00997: illegal use of the LONG data type
I tired itcreate table abc_long (ag bgd long number);
create table abc_long_dummy as ( ) Select *of abc_long); - ORA-00997 error: illegal use of the LONG data type
How to get there?
I'm looking to create a table based on another table that having the column long data type.
You really don't want to do that.
LONG data type has been deprecated for some time now, use CLOB.
The TO_LOB() function will do the conversion on the fly:
create table abc_long_dummy as select ag , to_lob(bgd) as bgd from abc_long ;
-
ORA-02327: cannot create indexes on the LOB data type expression
DB 10.2.0.4
DB 5.2
I am not able to move lobindex and lobsegment. While try occurs below error
SQL > ALTER INDEX dev. "" SYS_IL0000718396C00002$ $"REBUILD THE TABLESPACE DATA_TEMP;
ALTER INDEX dev. "" SYS_IL0000718396C00002$ $"REBUILD TABLESPACE DATA_TEMP
*
ERROR on line 1:
ORA-02327: cannot create indexes on the LOB data type expression
Thank you
Published by: user13382934 on October 16, 2012 14:05correct syntax is
ALTER TABLE.MOVE the LOB (
)
STORE AS (tablespace); Where
is a name of the / columns LOB, not the name of the segment. Moving type LOB data will move its indexes as well. -
How is the new warnings to date have the same version as the oldest?
I got an email about new updates to my PC. In any case I noticed that I think that all or certain updates have the same version as the previous drivers.
So why is it?
Hello
Is the update also the same thing? In any case, if your device works Scott it is not useless to put anything.
It will also be interesting to know what model of laptop you have and updates are available.
-
I created a form to fill in professional, with several fields. When I try the form and enter data in a field - it fills the SAME data in all other fields.
Give a unique name to each field.
-
HBA/LUN names - must be the same on hosts?
Hello
I have a question about LUN and CF. Hba name must be the same for the hosts to access the same LUNS? For a long time that I touched CF I'm afraid!
Bascially, if lunA hostA access via hba1, its path name would be something like hba1:0:0:1 AND if hostB accesses lunA via hba2, it would be hba2:0:0:1. Is it a problem that the name is inconsistent? I thought I read somewhere that (conical?) names must be the same?
Man I like NFS so much more than CF!
Thanks a lot if someone could clariffy CF/LUN assignment of names for me
Rich.
What you're watching is good old CTD/CTL (controller, target, device/LUN) name. It is just a reference to how you got where you are going. Each device must be unique to a controller, and each LUN can be used once on a controller. ESX tops out at 255 LUNS (see maximum configuration for more details on this).
So you don't match at all on hosts. However, it is advisable for your mental health to ensure that each data store that is presented to a host in a HA cluster is presented to guests. This prevents the migration of VM problems.
It also makes it easier to troubleshoot (esp. communicating with a group of dedicated storage) if each of the LUNS presented Gets the same number on each host.
Virtualization of happy!
JP
Please consider awarding points for correct or helpful answers
-
ORA-01436: CONNECT loop in the user data
Hello
I have a simple bit of SQL out details on HR supervisor strings in Oracle EBS:
It will return data normally without problems - e.g. data dummy below - looks very good. The names and made up person_ids.SELECT LPAD(' ', (LEVEL - 1) * 10, ' ') || person_id level_label , LEVEL , description FROM applsys.fnd_user u , hr.per_all_assignments_f h WHERE u.employee_id = h.person_id START WITH SYSDATE BETWEEN effective_start_date AND effective_end_date AND person_id = :personid CONNECT BY PRIOR person_id = supervisor_id AND SYSDATE BETWEEN effective_start_date AND effective_end_date
However, if I try for an another person_id, for which a user receives an error in one part of the Oracle EBS, I get this error:LEVEL_LABEL LEVEL DESCRIPTION 000001 1 Person Person 1 000002 2 Harry Marry 000003 3 John Smith 000004 4 Jenna Jones 000005 4 Her Name 000006 4 His Name 000007 4 Joseph Coat 000008 4 Les Miserables 000009 3 Mister Smith 000010 3 Miss Jones 000011 3 Andrew And 000012 4 Claire So 000013 4 Hilary Hi 000014 2 Jenny Jones 000015 3 Amanda Mandy 000016 4 James Jim 000017 4 William Wonder 000018 4 Crazy Cat 000019 4 Silly Cat 000020 4 Tall Hill 000021 4 Amazing Grace 000022 3 Lovely Mountain 000023 4 Joyous Spring 000024 4 Anonymous Name 000025 4 Brian Binky
ORA-01436: CONNECT loop in the user data
I'm guessing there is a loop of supervisor happening somewhere, but I don't know how to determine where it might happen.
I was wondering if there is any way I can change the SQL code to be able to work out where the loop can be, as there are about 50 people involved in Ministry to this user and I have been through all their records and can not see a loop to look through the Oracle HR screens.
I know it's a 'big ask' to ask a vague question about some oracle SQL, so apologies for that.
Any advice much appreciated.
Thank youHello
To see loops, do something like this:
SELECT SYS_CONNECT_BY_PATH (person_id, '/') AS path FROM applsys.fnd_user u , hr.per_all_assignments_f h WHERE u.employee_id = h.person_id AND CONNECT_BY_ISCYCLE = 1 CONNECT BY NOCYCLE PRIOR person_id = supervisor_id AND SYSDATE BETWEEN effective_start_date AND effective_end_date ;
If you would care to post CREATE TABLE and instructions INSERT for some samples, so I could test it.
Note there is no START WITH clause.
If, for example, Jones is the architect of Scott, Scott is the main contractor of Adams and Adams is the architect of Jones (much to other lines is not involved in a loop), then displays 3 rows of output, such as
PATH --------------------- Jones/Scott/Adams Scott/Adams/Jones Adams/Jones/Scott
Moreover, all the same CONNECT BY queries on these tables can be a lot faster if you've made the join and date filtering in a separate subquery first:
WITH combined_data AS ( SELECT person_id, supervisor_id FROM applsys.fnd_user u , hr.per_all_assignments_f h WHERE u.employee_id = h.person_id AND SYSDATE BETWEEN effective_start_date AND effective_end_date ) SELECT SYS_CONNECT_BY_PATH (person_id, '/') AS path FROM combined_data WHERE CONNECT_BY_ISCYCLE = 1 CONNECT BY NOCYCLE PRIOR person_id = supervisor_id ;
Maybe you are looking for
-
Control parental iPod touch questions please
Hi, looking to get the iPod touch for my 11 year old, don't want him online without supervision. (1) can I block the internet connection > (2) you can't just overide the parental control with a hard reset? (3) if the hard reset is done is there a not
-
I went to play google and downloaded firefox for android, I then received a message that it would download shortly, but I never see him. the tab does not list it as an application on my tablet. When I return to re download it says "installed".
-
I could or should use a glass on my 6 s screen protector more? It will interfere with the 3D function?
-
Is - this support for Windows 2008 server
Here is, it supports to windows server 2008.
-
upgrading ram keep getting unrecognized disks check it please message of power cables
I have hp m9500y elite rinning windows 7 ultimate 64 cant upgrade ram to 8 GB to 16 gig