Dynamically appending records to an existing cursor---URGENT !!!
Hi all,
I'm right now creating dynamic statistical reports in Oracle 8.1.6 on Win NT.
My query is as below:
select
TO_CHAR(a.jobpostingdate,'MM-DD-YYYY') jobpostingdate ,count(a.jobpostingid) no_jobs
FROM
JOBPOSTING a, EMPLOYEE f
WHERE
a.employeeid = f.employeeid AND
f.companyid = 2 AND
a.jobpostingdate between to_date('10-01-2002 00:00:00','mm-dd-yyyy hh24:mi:ss') AND
to_date('10-01-2003 00:00:00','mm-dd-yyyy hh24:mi:ss')
GROUP BY
TO_CHAR(a.jobpostingdate,'MM-DD-YYYY')
ORDER BY
TO_CHAR(a.jobpostingdate,'MM-DD-YYYY')
This query will give me records for everyday. But if there is no record for a certain date, then I don't get that record. This is how it works.
The result of the above query is as below:
jobpostingdate no_jobs
10-11-2002 1
10-12-2002 5
10-15-2002 4
10-16-2002 2
In the above resultset, There are no records displayed for 10-13-2002 and 10-14-2002. But my requirement is that I need both the records for 10-13-2002 and 10-14-2002 with the count as 0.
Can anybody please tell me how I can do this? Is there a way in Oracle 8.1.6? And if I need to write a function for this how do I do it ? I'm not able to find any way to do this. Or Do I need to dynamically appened cursor or something? How do I solve this problem?
Please give me a solution as soon as possible...this is very URGENT for me !!!
Thanx,
Madhavi
I did not test this, but it should work.
I understand from your posting that the missing dates are existing in the table but there is no match on these rows with employeeid join. If this is correct then the following should work,SELECT * FROM
Select TO_CHAR(a.jobpostingdate,'MM-DD-YYYY') jobpostingdate, count(*) no_jobs
FROM JOBPOSTING a, EMPLOYEE e
WHERE e.companyid = 2
AND a.employeeid = e.employeeid
AND a.jobpostingdate between
to_date('10-01-2002 00:00:00','mm-dd-yyyy hh24:mi:ss') AND
to_date('10-01-2003 00:00:00','mm-dd-yyyy hh24:mi:ss')
GROUP BY TO_CHAR(a.jobpostingdate,'MM-DD-YYYY')
UNION
Select TO_CHAR(a.jobpostingdate,'MM-DD-YYYY') jobpostingdate, 0 no_jobs
FROM JOBPOSTING a
WHERE NOT EXISTS( Select 'x' From EMPLOYEE e
WHERE e.companyid = 2 -- you might not need this condition
AND e.employeeid = a.employeeid)
ORDER BY jobpostingdate;Thx,
SriDHAR
Similar Messages
-
How to write the new records not with existing records.
hi,
I have a script.If i execute the script it writes the records.but its writing with the exisiting records.It writes not only the new records but also the old records.
for eg: the exisiting records are:
1111115-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111116-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111117-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111118-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111119-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
but now what happend is the new records such as
1111116-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111117-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111118-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111119-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
it gets appended with the old existing records,
1111117-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111118-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111119-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111113-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111114-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111115-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111116-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111117-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111118-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
1111119-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
there will be some problem happens when we are going to upload a bulk data of say 25000 records.if its gonna update 20000 records,rest 5000 records i have to do it in next step,if this is going to happen then the first 20000 records will be displayed forever.because it have the capacity to write 20000 records.thenext 500 records will not be written.so there is a chance of redundancy.how to avoid this redundancy while running this script
my script is
create or replace procedure input_tables(table1 in varchar2)
is
str varchar2(32767);
cnt number(2);
cursor c1(tname in varchar2)
is
select column_name
from all_tab_columns
where table_name = tname
order by column_id;
rec c1%rowtype;
begin
cnt:= 1;
str:= 'declare '||
'cursor c2 '||
'is '||
'select ';
open c1(table1);
loop
fetch c1 into rec;
exit when c1%notfound;
if cnt = 1 then -- Added New
str:= str||rec.column_name; -- Added New
cnt:= cnt + 1; -- Added New
else -- Added New
str:= str||'||'',''||'||rec.column_name; -- Added New
end if; -- Added New
end loop;
close c1;
str:= str||' SRC from '||table1||';'||
' r2 c2%rowtype;'||
' ft UTL_FILE.file_type;'||
' str2 varchar2(200);'|| --Added New
' begin '||
' ft := UTL_FILE.fopen(''SAMPLE'',''OUTPUT.csv'',''w'');'||
' for r2 in c2'||
' loop '||
' UTL_FILE.put_line(ft,r2.SRC);'||
' end loop;'||
' UTL_FILE.fclose(ft);'||
' end;';
execute immediate(str);
end;
thanks,
Ratheesh.Hi!
U can check the following script --
create or replace procedure input_tables(table1 in varchar2,start_col in number,last_col in number)
is
str varchar2(32767);
cnt number(2);
cursor c1(tname in varchar2)
is
select column_name
from all_tab_columns
where table_name = tname
order by column_id;
rec c1%rowtype;
begin
cnt:= 1;
str:= 'declare '||
'cursor c2 '||
'is '||
'select ';
open c1(table1);
loop
fetch c1 into rec;
exit when c1%notfound;
if cnt = 1 then -- Added New
str:= str||rec.column_name; -- Added New
cnt:= cnt + 1; -- Added New
else -- Added New
str:= str||'||'',''||'||rec.column_name; -- Added New
end if; -- Added New
end loop;
close c1;
str:= str||' SRC from '||table1||
' where rownum between '||start_col||' and '||last_col||';'|| -- Added New
' r2 c2%rowtype;'||
' ft UTL_FILE.file_type;'||
' str2 varchar2(200);'|| --Added New
' begin '||
' ft := UTL_FILE.fopen(''SAMPLE'',''OUTPUT.csv'',''w'');'||
' for r2 in c2'||
' loop '||
' UTL_FILE.put_line(ft,r2.SRC);'||
' end loop;'||
' UTL_FILE.fclose(ft);'||
' end;';
execute immediate(str);
end;
/ To print first ten rows --
exec input_tables('EMP',1,10); --first 10 rowsTo print next remain rows --
exec input_tables('EMP',11,15);N.B: No tested....
Regrads.
Satyaki De. -
Inserting a record in an internal table - Urgent
Hi Friends,
I have a requirement where in I have 2 internal tables say itab1 and itab2.Itab1 has 10 records and itab2 has one record initially.
Now I have to move the records of itab1 into itab2.
My question is if some conditions satisfy,then I need to append the records of itab1 after the single record in itab2.In some other cases I need to insert the records of itab1 before
the single record in itab2.
What is the syntax to attach the records before the record as append statement always attaches the record after the existing record.
Your help is highly appreciated.
Regards,
Vishnu.You can use insert itab index idx .
Alternative 2
... itab INDEX idx
Effect
This variant can only be used for standard tables and sorted tables. Each line line_spec to be inserted into the line before the table index idx and the table index of the following lines is increased by one. A data object of the type i is expected for idx.
If idx contains a value equal to the number of the existing table lines plus one, the new line is appended as the last line in the internal table. If idx contains a greater value, no line is inserted and sy-subrc is set to 4.
An exception that cannot be handled is raised when:
idx contains a value less than or equal to 0
A line to be inserted would cause a duplicate entry in tables with a unique table key
A line to be inserted would disrupt the sort order of sorted tables
Within a LOOP loop, you can omit the addition INDEX. Each line to be inserted is inserted before the current table line of the LOOP loop. However, if the current line is deleted in the same loop pass, the response is undefined.
read help on this .
reward if helpful -
Purchase info record does not exists in purchase organization 1000
Hi experts,
I have created a new enterprise structure in SAP. when i am creating a PO its picking the correct info record, but when i am doing GR, its giving the error as 'purchase info record does not exists in purchase organization 1000". I have maintained everything perfect. the only thing i have changed is I have moved the open and close period from 11-2002 to 12-2008 in MMPV.
Please give me some suggestions, where it can go wrong.
Thanks & Regards,
Poorna.Hi Guys,
Thanks for all yours responses, Actually what deepak said was right, but in my IDES system i am not able to create new entries in assign plant to std purchase org. I found the database view for that, V_001W_E its for table T001W. So i looked into that table i found that std purchase org was given as 1000. i made direct entries in that table, i thought the reason for this may be due to , that i copied plant from 1000. After making entries , i did not got the error message that was i am previously getting.
Thanks & Regards,
Ravi. -
How to append records in a file, through file adapter.
Hi All,
How to append records in a file, through file adapter.
I have to read data from database and need to append all records in a file.
Thanks in Advance.Hi,
I think you have a while loop to hit the DB in your Process (As you said you have to fetch data from DB 10 times if 1000 rec are there)
First sopy your DB O/P to one var
and from second time append to previous data.(Otherwise you can directly use append from starting instead of copy and append)
When loop completes you can transform to File adapter Var.
Otherwise you can configure yourFileadapter such that it will aapend current records to previous records.
You can use 'Append= true' in your file adapter wsdl.
It will append previous records to current records in the same file.
Regards
PavanKumar.M -
How to append records to a field symbols?
Hi all,
is there a way to append records from an internal table fto a field symbol of type table.Hi Daphne,
Changing internal table to which field symbol is pointing will automatically change data accessed by field-symbol as it is only pointer to internal table..
Regards,
Mohaiyuddin.. -
How to append records in MSAccess through Java using JDBC:ODBC
Hello,
I was able to retrieve records from MSAccess database through JAVA over the JDBC-ODBC bridge.
If I want to append records to a table (for eg. photo1 table containing photono., length, breadth, area as
columns) I could not able to do so through JAVA.
I am using JTable with the above fields. The user is displayed with the JTable and he has to enter
data inside the JTable and press a button titled "Append". Then the JAVA program should append
whatever the user has entered in the JTable as a single record inside the MSAccess database.
Can anyone help me please?hi i too am having similar problem. i am able to create a table in ms access through java but when i insert values i get a msg that it has inserted the values but when i check the table by opening ms-access there are no values in the table.
the insert statement i am using is
" insert into tk1 values(3,'tarun')"
further i tried using the methods commit, setAutoCommit etc with the connection object. -NO GO.
can you help me ? -
CR+LF Code at the end of each record selected in sql cursor
i am selecting some data records in a sql cursor and writing it into a file using UTL_FILE.puT in a plsql procedure.
at the end of select statement if i add ||chr(13||chr(10) iam getting CR+CR+LF code
if i add only || chr(10) i am getting LF code.
What i need is only CR+LF code. Kindly help to use any other commands.
Thanks,
Shivaji.
Edited by: Shivaji M on Apr 22, 2010 12:11 AM
Edited by: Shivaji M on Apr 22, 2010 12:36 AMIt's in the book!
"PUT_LINE terminates the line with the platform-specific line terminator character or characters."
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10577/u_file.htm#i997640 -
How to build dynamic databases(record set) for mobile?
Hi All ,
i have an applocation that needs to personalize the data for users .
i have the data available , but dont know how to personalize it fot users to download special version of my application.
how to build dynamic databases(record set) for mobile?In the load rule in the dimension build settings you would need to go to the tab dimension definition, choose the time dimension and right click on it. Select Edit properties. If you have not done so, set the dimension to be the time dimension. Then go to the generations/levels tab and set the generation names you need. For example if you want YTD, you would set the generation name to Year, if you want QTD set it to Quarter. You would set the number to the generation number that coorisponds to the generation. The DBAG has the list of names for all of the DTS members.
-
Matching score for new records added to existing workflow
Hi SDNers,
My doubt is:
I have a 2 Workflows which are already in process. The triggering event for them is Manual, Record Import.
Now I manually assigned 20 records to "Workflow A" based on Condition 1
Also, I manually assigned 20 records to "Workflow B" based on Condition 2
I am importing 30 new records. Based on the condition, I want to assign these records to the existing Workflow A / Workflow B.
Note: There is a Match stencil, so the newly created records have to be matched against the existing records in the present Workflow itself.
Is it possible to add new records o existing workflow manually?
Also, what about the Matching score? will the records be matched?
Thanks & Regards,
PritiHi Priti,
I tried restricting records using Named Searhes and Masks but it includes all the records with Match step property Records Vs All. You have to perform some maunal step either by selecting records using some search criteria or you can use Named Searches i.e.
1. Create one field say New of type boolean and by default set it to NO.
2. Create one named search for this field value to YES.
3. Create one assignment which sets the value for this field to YES and add this assignment in the workflow as the first step.
4. When ever you import records, assignment will set New=YES for all the records imported. Now, when you add more records, search the previous records using Restore Named Search function which will give the list of records imported now. You can perform Matching and Merging operation.
5. Add one more assignment to the workflow as the last step which should set New=NO so that records should not appear next time for Matching
Regards,
Jitesh Talreja -
Appendding page/pages to existing non-empty PDF Document
Hi !
I am trying to append a page to existing PDF Document without creating new PDF document page.
But I am not able to find the rigtht solution.
I used IText, JPX libraries.
can we append a page/pages to existing PDF document ? if , could you please give any example code....
Thanks in advance..........Thanks Robert,
I meant a "Log In" link in an existing page should NOW redirect to CRM Web UI login page.
My question was, in the existing non-SAP page, should there be some html/javascript code to redirect the user to the CRM Web UI login page URL?...
II don't think it's as simple as <a href="http://www.WEB_UI_URL.com"></a> I will go thru what "URL rewriting" is all about but still wondering what it takes to fulfill the requirement...Coding / server settings etc...
Sorry if repeating myself....
JD -
ORA-20212: Active audit detail record does not exist
Hi All,
While Executing the process flow using Scheduler,we got this error
"ORA-20212: Active audit detail record does not exist, cannot update audit counts.
ORA-06512: at "XXOWB.WB_RT_MAPAUDIT", line 2173
ORA-06512: at "XXOWB.WB_RT_MAPAUDIT", line 3108
ORA-06512: at "APPS.Test_MAP", line 3304
ORA-06512: at "APPS.Test__MAP", line 9341
ORA-06512: at line 1
I Will test the Mapping my running directly from Control center and then in database.
Cheers
NawneetDonot know the exact reason but when check the alert log found the error
ORA-1653: unable to extend table
and after allocating space the error was gone..
Cheers
Nawneet -
Dynamically group records by date
I am attempting to create a report that will dynamically group records into a set number of date buckets. This is similar to grouping records by a date field and setting the days, weeks, months, etc property but instead of grouping by a set time span I want to a specific number of date groups regardless of date span. So say i have records where the first date is today at 1am and the last record is today at 9 pm. I want the data grouped into 10 groups and the time calculated for that group based on total time span / 10. The first group would be 1AM to 3AM, the second would group 3AM to 5AM, etc.. The reason I am doing this is for a chart that displays record counts over time but the overall timespan will never be known until runtime. Setting the chart for hourly or weekly doesn't work because if the user runs the report over a year the dates will be illegible.
Thanks in advance!Well this SHOULD be easy. But leave it to CR make not...
You can start by finding the minimum & maximum dates within your range:
Local DateTimeVar MinDate;
MinDate := Minimum({Table.DateField})
and
Local DateTimeVar MaxDate;
MaxDate := Maximum({Person.ModifiedDate})
Then figure out what the the interval would be if the span is broken down into 10 equal parts"
DateDiff("n", {@MinDate}, {@MaxDate}) / 10
From there just use a formula to segregate each records into the appropriate groups:
EvaluateAfter({@Interval});
IF {Table.DateField} >= {@MinDate}
AND {Table.DateField} <= DateAdd("n",{@Interval}, {@MinDate}) THEN 1 ELSE
IF {Table.DateField} > DateAdd("n",{@Interval}, {@MinDate})
AND {Table.DateField} <= DateAdd("n",{@Interval} * 2, {@MinDate}) THEN 2 ELSE
IF {Table.DateField} > DateAdd("n",{@Interval} * 2, {@MinDate})
AND {Table.DateField} <= DateAdd("n",{@Interval} * 3, {@MinDate}) THEN 3 ELSE
IF{Table.DateField} > DateAdd("n",{@Interval} * 3, {@MinDate})
AND{Table.DateField} <= DateAdd("n",{@Interval} * 4, {@MinDate}) THEN 4 ELSE
IF {Table.DateField} > DateAdd("n",{@Interval} * 4, {@MinDate})
AND {Table.DateField} <= DateAdd("n",{@Interval} * 5, {@MinDate}) THEN 5 ELSE
IF {Table.DateField} > DateAdd("n",{@Interval} * 5, {@MinDate})
AND {Table.DateField} <= DateAdd("n",{@Interval} * 6, {@MinDate}) THEN 6 ELSE
IF {Table.DateField} > DateAdd("n",{@Interval} * 6, {@MinDate})
AND {Table.DateField} <= DateAdd("n",{@Interval} * 7, {@MinDate}) THEN 7 ELSE
IF {Table.DateField} > DateAdd("n",{@Interval} * 7, {@MinDate})
AND{Table.DateField} <= DateAdd("n",{@Interval} * 8, {@MinDate}) THEN 8 ELSE
IF {Table.DateField} > DateAdd("n",{@Interval} * 8, {@MinDate})
AND {Table.DateField} <= DateAdd("n",{@Interval} * 9, {@MinDate}) THEN 9 ELSE
IF {Table.DateField} > DateAdd("n",{@Interval} * 9, {@MinDate})
AND {Table.DateField} <= {@MaxDate} THEN 10
This is where CR drops the ball... IMHO... it WON'T allow you to to group by a formula field that uses an aggregate in the formula (in this case Minimum & Maximum)... It will however allow to to graph on it, which I assume is what you are actually trying to do. If anyone knows a way to work around the grouping issue, I'd love to know it myself.
HTH,
Jason -
i have one "LOGTABLE" having 3000 records, in this table daily 3-4 records will be inserted.this table have 11colums no primary key columns.
i created another temp table as "LOGTABLEMONITOR". (copied from "LOGTABLE" having 3000 records)
i am expecting which are inserting daily 3-4 records in "LOGTABLE" will be inserting temp table "LOGTABLEMONITOR" (if that 3-4 records are not exist in "LOGTABLEMONITOR")SELECT <columns>
FROM LOGTABLE
EXCEPT
SELECT <columns>
FROM LOGTABLEMONITOR;
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Hi,
I'm facing some issues to populate dynamically DNS record of APs. The IPs addressing of APs are configured via DHCP servers (MS). The DHCP server is not configured to register automatically record against DNS (MS on the same server); as said by system administrator. The problem is that some APs record are populated on the DNS and some not (even in the same subnet).
So the question is : Does LAP supports DDNS or the record needs to be done by the DHCP ?
Thanks a lot
VincentDoes it simply check AP reachability or will that collect information via SNMP from AP directly.
If SNMP, this will simply duplicate monitoring (as you already doing it via PI) & could impact the AP performance.
I would simply give "read-only" view to Prime & briefing them what/how to look something on Prime.
Not sure how many AP you got, we have close to 2K & I do not want to administer anything like what you are going to do.
HTH
Rasika
Maybe you are looking for
-
can't sync my new phone to the data on the itunes. pls help
-
How can I sync my iphone to a new itunes?
Im trying to sync my iphone with my girlfriends computer on a new itunes that she created for me, but it says i'm synced to another computer. I have no access to that computer anymore so how do I un-sync from that computer and sync to my girlfriends
-
Hi, is there a way werein the user can only input numbers and a decimal point into a text item. thanks, psdilag
-
How can it be the Mobile Hotspot feature worked, failed, and then worked again?
I am having a love hate relationship with my Galaxy S3. The latest experience happened when I arrived at the beach expecting to connect to the Internet through a mobile hotspot established on my Galaxy S III; but that was not to be. When I turned on
-
I made a pdf-slideshow in Lightroom 3. When i look at this pdf-file with the Adobe pdf-reader, then the colours are shifted to 'more reds' compared to the originals. When i look at the pdf-file within Bridge, then the colours are ok. Why is this happ