problem with an instruction box in where clause getting ora-00905
The query runs @ 07:00 every day and must return data for the last day, except Monday when the previous 3 days must be returned.
Select ip.adm_date+ip.adm_time/86400 as admDateTime,
IP.pt_code,
ICC. Surname,
CPI.first_given_name,
IP.w_code,
"as 'MR < 24."
"as"MR 24-36"
"as 'MR 36-48."
"as"MR 48-60,"
"" as "MR 60-72",.
"as 'MR > 72."
"as 'MR finalized."
«like "Pharm/Tech",
"as 'MR criteria."
Of
k_ipreg ip, k_cpireg ICC
where ip.pt_code = cpi.pt_code
and ip.disch_date is null
and ip.adm_date between ((affaire quand (select to_char (sysdate,'d ') of double) = 1 then ip.adm_date > sysdate-3))
of another ip.adm_date > sysdate-1
end)) and sysdate
and w_code not in ("ICW", "OEN", "ANTE", "BABY", "CHILD", "DELI", "ED", "MATY", "USSN")
Try to learn to use properly the functions of Oracle:
SELECT Ip.Adm_Date + Ip.Adm_Time / 86400 AS Admdatetime , Ip.Pt_Code , Cpi.Surname , Cpi.First_Given_Name , Ip.W_Code , '' AS "MR < 24" , '' AS "MR 24-36" , '' AS "MR 36-48" , '' AS "MR 48-60" , '' AS "MR 60-72" , '' AS "MR>72" , '' AS "MR Finalised" , '' AS "Pharm/Tech" , '' AS "Met MR Criteria" FROM K_Ipreg Ip, K_Cpireg Cpi WHERE Ip.Pt_Code = Cpi.Pt_Code AND Ip.Disch_Date IS NULL AND Ip.Adm_Date BETWEEN ( ( CASE WHEN TO_CHAR ( SYSDATE, 'd' ) = 1 THEN SYSDATE - 3 ELSE SYSDATE - 1 END ) ) AND SYSDATE AND W_Code NOT IN ('ICW', 'NWB', 'ANTE', 'BABY', 'CHILD', 'DELI', 'ED', 'MATY', 'SCBU');
Tags: Database
Similar Questions
-
several instructions box in where clause
Hello
I'm trying to create report filters using substitution variables in a case statement in a where clause clause. I have several instructions box running on the same column. I don't really know how to write it. Here's what I have so far but I know I'm going in the wrong direction.
where
i.compute_zone =
case
When: P14_zone is NOT NULL
then: P14_zone
of other i.compute_zone
end
AND
i.compute_zone =
case
When: P14_zone_2 is NOT NULL
then: P14_zone_2
other: P14_zone
end
AND
i.compute_zone =
case
When: P14_zone_3 is NOT NULL
then: P14_zone_3
of other i.compute_zone
end
AND
i.compute_zone =
case
When: P14_zone_4 is NOT NULL
then: P14_zone_4
of other i.compute_zone
end
any suggestions?
Thank you
MICAH
Hi, Micah,
User12611868-Oracle wrote:
Hello
I'm trying to create report filters using substitution variables in a case statement in a where clause clause. I have several instructions box running on the same column. I don't really know how to write it. Here's what I have so far but I know I'm going in the wrong direction.
where
i.compute_zone =
case
When: P14_zone is NOT NULL
then: P14_zone
of other i.compute_zone
end
AND
i.compute_zone =
case
When: P14_zone_2 is NOT NULL
then: P14_zone_2
other: P14_zone
end
AND
i.compute_zone =
case
When: P14_zone_3 is NOT NULL
then: P14_zone_3
of other i.compute_zone
end
AND
i.compute_zone =
case
When: P14_zone_4 is NOT NULL
then: P14_zone_4
of other i.compute_zone
end
any suggestions?
Thank you
MICAH
How get the desired results of your data depends on the desired results and your data. What do you do? (I can't tell just by looking at the aat code that do not do). After CREATE TABLE and INSERT statements for some sample data and a couple of sets of parameters (variables such as p14_zone) and the exact results that your choices in each set of parameters, given the same sample data.
Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?
CASE expressions are generally not useful in a WHERE clause. CASE expressions are a convenient way to IF-THEN-ELSE logic of the places where you can't do anything other than (the SELECT clause), but WHERE the clauses allow IF-THEN-ELSE logic in any case
Maybe you want something like
WHERE MERGE (: p14_zone,: p14_zone_2,: p14_zone_3,: p14_zone_4) IS NULL
OR IN i.compute_zone (: p14_zone,: p14_zone_2,: p14_zone_3,: p14_zone_4)
It returns TRUE if all 4 parameters are set to NULL. If 1 or more of them are not NULL, then it will return TRUE if i.compute_zone is equal to one of them.
-
How to use the instruction box in where clause
Hi all
I need to use cases where clause guide me please how I can do it.
AND WHEN BOX: KAPCO = "KAPCO" THEN cla. CLASS_NAME LIKE '% KAPCO % '.
WHEN: KAPCO = "NON_KAPCO" THEN SUPERIOR (cla. CLASS_NAME) NOT LIKE '% KAPCO % '.
WHEN: KAPCO = 'ALL' GOLD: KAPCO IS NULL SO SUPERIOR (cla. CLASS_NAME) LIKE '% '.
END
Concerning
Published by: user10941925 on March 4, 2012 22:31Hello
CASE expressions return a single value, for example a VARCHAR2. They do refer to code fragments.
You usually don't need (or want) an expression BOX in a WHERE clause, or any other condition. I think that you were trying to do the equivalent of:
AND ( (:KAPCO = 'KAPCO' AND cla.CLASS_NAME LIKE '%KAPCO%') -- Don't you want UPPER on this line? OR (:KAPCO = 'NON_KAPCO' AND UPPER(cla.CLASS_NAME) NOT LIKE '%KAPCO%') OR (NVL (:KAPCO, 'ALL') = 'ALL' AND cla.CLASS_NAME IS NOT NULL) )
If you would care to post some sample data (CREATE TABLE and INSERT statements) and the results desired from this data, I was able to test this.
-
Problems of execution of a SQL function with a variable in the WHERE clause
Hello world!
I have programmed a function that returns a boolean value based on the result of the SQL. It's the function:
FUNCTION existe_secuencial (seq_name VARCHAR2) RETURN AS BOOLEAN
cursor c2 is SELECT FROM all_sequences WHERE upper (sequence_name) = sequence_name' | seq_name | ' ;
BEGIN
OPEN c2;
DBMS_OUTPUT. Put_line (nombre_seq);
Get c2 INTO kk;
If c2% NOTFOUND = True THEN
RETURNS false;
on the other
RETURNS true;
end if;
END existe_secuencial;
And I give the floor to the function of a procedure in this way:
IF existe_secuencial ("SEQ_ARQUETA") = True THEN
DBMS_OUTPUT. Put_line ('exists');
ON THE OTHER
DBMS_OUTPUT. Put_line ("' NOT exists");
END IF;
The probrem that this SQL is forced to return results because this sequence exists in the comic book, but is not, return me the FALSE value. What makes me mad is that if I change the second line of the function in this way:
> > cursor c2 is SELECT FROM all_sequences WHERE upper (sequence_name) sequence_name ="SEQ_ARQUETA";
It works find and return of sequence existing (real)
Can someone help me please, I'm quite desperate to find what is the problem with that because I do not understand why if I built the slider with a variable returns no results so that if I do write it works...
Thanks in advance!
Itziar
Frame you your variable in quotes, which makes the string literal ' |. ' seq_name | "rather than the content of the variable.
I think that something like this would be an improvement.
function existe_secuencial (seq_name VARCHAR2) return a Boolean value as
number of exist_check: = 0;
Start
Start
Select 1
in exist_check
of all_sequences
where upper (sequence_name) = upper (seq_name);
exception
When no_data_found then
null;
end;
return (exist_check = 1);
end existe_secuencial;
-
Case instructions within a Where clause clause
Hello group,
I know this has been asked several times, but I do not enter simply to a tuition assistance box in a WHERE clause. So I need help:
My current WHERE the clause reads:
A16. FULL_DATE between (SELECT (TRUNC (SysDate - 8)) From Dual) and (select (TRUNC (SysDate - 2)) double)
However, I need to 'automate' a bit, based on the current time/day of the month. I need my instruction box to say:
(Case when to_char (sysdate-3, 'mm') <>to_char (sysdate, 'mm')
then the a16. FULL_DATE (between SELECT (trunc (ADD_MONTHS ((LAST_DAY(SysDate-3)),-1)+1) and (SELECT (add_months (trunc(SysDate-2)-1)) of double)))
Of another a16. FULL_DATE between (SELECT trunc (ADD_MONTHS ((LAST_DAY (SysDate)),-1)+1) From Dual) and (select (TRUNC (SysDate - 2)) From Dual)
However, I have an error on "Else". Can someone explain what is the problem and how to fix it? I tried both 'then' and 'Else' syntax and both will run individually. So I'm quite sure that he does not like my CASE statement in general.
In advance, thank you for your help.
Don
I can't tell what your business logic, so here's a simple example of an instruction box in the where clause:
SQL > select *.
2 double
3 where dummy = case when extracted (sysdate months) = 9 then 'W '.
4 Once extracted (sysdate months) = 10 then 'X '.
When 5 extract (month from sysdate) = 11 then 'Y '.
6 else 'Z'
7 end
8;D
-
X -
Cannot run a «BUSINESS...» WHEN ' with a date in a WHERE CLAUSE condition
Hello
I need to check for a condition and date according to the date, he would check a set of host names or the other game... so I thought I could write something like this in the WHERE clause:
AND HOST_NAME IN (
CASE
WHEN TO_DATE (: StopDate, 'MON-DD-YYYY') > = TO_DATE ('22 - DEC - 2015 "," DD-MON-YYYY ') THEN
('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC') ON THE OTHER
("SERVERNAME1", "NAMESERVER2", "SERVERNAME3")
END
)
I get the following:
ORA-00907: lack of right parenthesis
00907 00000 - "lack the right parenthesis.
But there is no missing parentheses!
If I take the case... when... end, and run the host_name in ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC') (separately, they run fine)...
I also tried:
AND
( CASE
WHEN TO_DATE (: StopDate, 'MON-DD-YYYY') > = TO_DATE ('22 - DEC - 2015 "," DD-MON-YYYY ') THEN
HOST_NAME IN ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC') ELSE
HOST_NAME IN ('SERVERNAME1","NAMESERVER2","SERVERNAME3")
END
)
the error I get is:
ORA-00905: lack of keyword
00905 00000 - 'lack the key word'
What keyword miss me?
Post edited by: c75d2e42-06a0-4eb1-a576-5652edcbfbe8
Hello
c75d2e42-06a0-4eb1-A576-5652edcbfbe8 wrote:
It was a typo when transferred to the Oracle forum... the version of Oracle is: PL/SQL version 10.2.0.3.0 (10 G)
I also used IF the statement and that has not worked (in error "missing parenthesis") which I'm sure is a matter of "syntax"... I did not know that the CASE statement returns the value single only, so it's probably the problem. Is it possible to re - write this?
...
IF only works in PL/SQL. It does not in SQL, even if that SQL is embedded in PL/SQL.
There are many ways to re - write the condition. And here's one:
AND ((host_name IN ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC')
AND TO_DATE (: StopDate, "MON-DD-YYYY") > = TO_DATE ('22-DEC-2015', "MON-DD-YYYY")
)
OR (host_name IN ('servername1","Nameserver2","SERVERNAME3")
AND TO_DATE (: StopDate, "MON-DD-YYYY")< to_date="" ('dec-22-2015', =""> >
)
)
If: StopDate can be NULL, it must be a bit more complicated.
You can also use nested, such as CASE expressions
AND THE CASE
WHEN TO_DATE (: StopDate, "MON-DD-YYYY") > = TO_DATE ('22-DEC-2015', "MON-DD-YYYY")
WHILE CASE
WHEN host_name IN ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC')
AND THEN 'OK '.
END
OTHER CASES
WHEN host_name IN ('servername1","Nameserver2","SERVERNAME3")
AND THEN 'OK '.
END
END = 'OK '.
I wonder if this in your application is the best way, however. If SERVERNAMEA was put into service on December 22, maybe that that fact should be recorded in a table. If you have a table with 1 row per server, you can consider adding 2 columns DATE to show when the server was first and last used. Then, rather than use a WHERE clause to test servers appropriate, you could do an inner join.
-
DENSE_RANK - strange behavior with an instruction BOX in ORDER BY
Select the version of v$ instance;
10.2.0.5.0
Here is my example query:
WITH A AS ( select 40 as id,'708' as loc,'10-108' as act,14.5 as per from dual union select 40,'708','10-308',14.5 from dual union select 40,'708','10-708',14.5 from dual union select 40,'708','10-108',10.5 from dual union select 40,'708','10-308',10.5 from dual union select 40,'708','10-708',10.5 from dual ) select id,loc,act,per ,SUBSTR(act,4,3) as aloc ,CASE WHEN SUBSTR(act,4,3) = loc THEN 0 ELSE 1 END as "Case" ,row_number() over (partition by id,loc order by per desc, CASE WHEN SUBSTR(act,4,3) = loc THEN 0 ELSE 1 END) AS Row_Num ,dense_rank() over (partition by id,loc order by per desc ,CASE WHEN SUBSTR(act,4,3) = loc THEN 0 ELSE 1 END ) as D_Rank from A;
Here are the results, I expect:
ID ACT BY ALOC case no_lig D_RANK LOC
---------- --- ------ ---------- ---- ---------- ---------- ----------
40 708 14.5 10-708 708 0 1 1
40 708 14.5 10-108 108 1 2 1
40 708 14.5 10-308 308 1 3 1
40 708 10.5 10-708 708 0 4 2
40 708 10.5 10-108 108 1 5 2
40 708 10.5 10-308 308 1 6 2
However, these are the results I get:
ID ACT BY ALOC case no_lig D_RANK LOC
---------- --- ------ ---------- ---- ---------- ---------- ----------
40 708 14.5 10-708 708 0 1 1
40 708 14.5 10-108 108 1 2 2
40 708 14.5 10-308 308 1 3 2
40 708 10.5 10-708 708 0 4 3
40 708 10.5 10-108 108 1 5 4
40 708 10.5 10-308 308 1 6 4
Since CASE WHEN SUBSTR(act,4,3) = 0 1 loc OTHER END is not in the score, why DENSE_RANK() increments? ROW_NUMBER() behaves correctly with this CASE statement in its ORDER BY, but DENSE_RANK() does not appear.
I think I can solve my problem by removing BOX WHEN SUBSTR (act, 4, 3) = THEN ELSE 0 1 END of my COMMAND DENSE_RANK() loc, however, in academic terms, I still don't understand the above behavior. Is this a bug in DENSE_RANK or is it normal?
Hello
You're right; the expression that you called "Case" is not in clasue SCORE. If it were, then a change in the value of 'Case' would cause DENSE_RANK generate a new set of numbers, starting with 1. Tha't, it is clearly not what is happening here. In this query, a change in the 'deal' is originally results increment, not start with 1.
Don't forget the ORDER BY operation
ORDER BY w, x, y, z
the distinction between the lines to which none of the expressions w, x, y or z is different. A change in one of these expressions (in general) causes a change in the results.
In this example, 'Deal' is part of the analytical ORDER byclause DENSE_RANK, so you should expect a change in the "box" to cause a change in the value returned by DENSE_RANK.
In this query, DENSE_RANK assigns different numbers with lines that have different values of 'box '. Lower values of 'Case' will be assigned lower values of D_Rank, which is what you see.
Lines with a = 14.5 and "Breaks" = 0 get a lower D_Rank (they get D-rank = 1) than the lines with per = 14.5 and "Break" = 1 (they get D_Rank = 2).
Lines with by = 10.5 and "Breaks" = 0 get a lower D_Rank (they get D-rank = 3) of lines with by = 10.5 and "Case" = 1 (they get D_Rank = 4).
You're right about how to get the first set of results, too. If ORDER BY DESC is the ORDER byclause analytical together, DENSE_RANK assign the same number for all rows in the partition that have the same value of per, no matter what values are in all the other columns.
The fact that "The case" is a CASE expression is actually irrelevant. If you had a column, with 0 and 1 used and stored in this column in the ORDER BY clause, you would see the same behavior.
-
Error with an instruction box in a region of report
Hello
I have a report, when I use the case in the source of the region, I have an error message.
There are three fields in the report: from, to, resident
Before the deal, it works very well and as follows:
Select count (t1.id) pcount, c5, c6, seqnum
from t1, t2 tablename tablename1 2
where t1.ID = t2.pid
and (t1.resident =: P251_RESIDENT)
or t1... resident2 =: P251_RESIDENT)
and t1.pdate between to_date(:P251_FROM,'mm/dd/yyyy')
and to_date(:P251_TO,'mm/dd/yyyy')
Group of c5, c6, seqnum
After having added the condition of 'case', I
1 error has occurred
- Query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the generic "columns" box below the source of the region without analysis. ORA-00933: SQL not correctly completed command.
Select count (t1.id) pcount, c5, c6, seqnum
from t1, t2 tablename tablename1 2
where t1.ID = t2.pid
case
When: P251_RESIDENT is not null then
and (t1.resident =: P251_RESIDENT)
or t1.resident2 =: P251_RESIDENT)
end
case
When: P251_FROM is not null and: P251_TO is not null then
and t1.pdate between to_date(:P251_FROM,'mm/dd/yyyy')
and to_date(:P251_TO,'mm/dd/yyyy')
end
Group of c5, c6, seqnum
can anyone help?
Thank you
Jen
If you want SQL to return all the lines when the value of the element is zero, you test as part of the WHERE clause directly and adjust your Boolean logic accordingly.
for example
WHERE T1.ID=T2.PID AND ( :P251_RESIDENT IS NULL OR ( T1.RESIDENT = :P251_RESIDENT or T1.RESIDENT2 = :P251_RESIDENT ) ) and ( :P251_FROM is null OR to_date( :P251_FROM, 'mm/dd/yyyy' ) < T1.pdate ) and ( :P251_TO is null or T1.pdate < to_date( :P251_TO, 'mm/dd/yyyy' ) )
Your SQL required so much P251_FROM than P251_TO in order to work.
It will work with one or the other or both.
MK
-
Problem with unified message box blackBerry Smartphones
Hi all
I have problems with my BB Torch 9800. When I use the message Unified Inbox to view emails, emails have regularly occurring blank spots where there should be some text. The text is simply hidden. When I display the same message to the individual email (gmail or hotmail) Inbox, the message is complete. A battery pull solves this problem for a few hours or a few days and then it reappears. This problem started a week ago. I did not recently updated from the BONE. I didn't do a wipe and restore again... I was hoping to avoid this. There was an update to the new BB (August 6, 2012). There were some other 3rd party applications which have also been installed. I have not tried UN-installing again. Any thoughts? Thanks in advance for your help.
BioDave1955 wrote:
Hi all
I have problems with my BB Torch 9800. When I use the message Unified Inbox to view emails, emails have regularly occurring blank spots where there should be some text. The text is simply hidden. When I display the same message to the individual email (gmail or hotmail) Inbox, the message is complete. A battery pull solves this problem for a few hours or a few days and then it reappears. This problem started a week ago. I did not recently updated from the BONE. I didn't do a wipe and restore again... I was hoping to avoid this. There was an update to the new BB (August 6, 2012). There were some other 3rd party applications which have also been installed. I have not tried UN-installing again. Any thoughts? Thanks in advance for your help.
Hello and welcome to the community!
I recommend that you try to start safe mode:
- KB17877 How to start a smartphone BlackBerry in Mode safe
It will take several attempts to get the combination of keys ESC (press/release/hold) OK, so be patient. When properly in Safe Mode, let it run for some time... long enough to know if the behavior will return. Normally, Safe Mode is designed for immediate diagnosis... nor for normal operations... but in your case, run long enough in mode SAFEW in order to know if the behavior will present will actually help diagnose.
If the behavior presents while in Safe Mode, then it is likely that your OS kernel became somehow corrupted, requiring these steps you're reluctant to undertake.
Good luck and let us know!
-
Problems with the grey boxes around some text or words
We have problems with some of our
InDesign files. When the text is passed from Word there is gray outline boxes appear around some words or phrases. We have worked with the preferences and also the dictionary, and nothing seems to solve our problem.
Any suggestions?
Thanks for your help!
Did you open the links Panel and remove the links or change the Fermata? You need to change the points strong one at a time, I think. (I hate the automatic Word hyperling nonsense).
-
Problem with the instruction FOR... Once again!
Hello world
Well, I'm still doing a slideshow of car using external files and can't see the end. The current movie is here:
http://www.virtuallglab.com/projects.html
I also enclose the code. My problem is I had initially set up an animation with 2 pictures slide with text and then wait 4 seconds before slipping outside, and then next photos and text would slip in and so on, using a setInterval.
The problem is the loop FOR seems to ignore the setInterval and slides of the 'wait' service, so buckle up just quickly and get to the last picture, so now the example above, it comes the last picture (I = 9) and that's it!
Can you do not include another function in a statement FOR. Or is there a way to tell the loop TO wait for all movement is complete?
Any help greatly appreciated
***************************************************
Mx.transitions import. *;
Import mx.transitions.easing. *;
for (i = 0; i < 10; i ++) {}
var picLeft = "photos /"+ i + ".jpg"; ".
var picRight = "pics /"+ i +"b.jpg";
var txtToLoad = "text /"+ i + ".txt"; ".
this.createEmptyMovieClip("leftHolder",1);
leftHolder.loadMovie (picLeft, i, leftHolder.getNextHighestDepth ());
leftHolder._x = - 200;
leftHolder._y = 15;
var leftTween:Tween = new Tween (leftHolder, "_x", Strong.easeOut, leftHolder._x, 10, 2, true);
this.createEmptyMovieClip("centerHolder",2);
centerHolder.loadMovie (picRight, i + "b", centerHolder.getNextHighestDepth ());
centerHolder._x = 180;
centerHolder._y = 250;
var centerTween:Tween = new Tween (centerHolder, "FLF", Strong.easeOut, centerHolder._y, 15, 2, true ");
Text._x = 600;
myData = new LoadVars();
myData.onLoad = function() {}
text.carText.text = this.content;
};
myData.load (txtToLoad);
var textTween:Tween = new Tween (text, "_x", Strong.easeOut, text._x, 420, 2, true);
myInterval is setInterval (wait, 4000);.
function wait() {}
var leftTweenFinished:Tween = new Tween (leftHolder, "_x", Strong.easeOut, leftHolder._x,-200, 1, true);
var centerTween:Tween = new Tween (centerHolder, "FLF", Strong.easeOut, centerHolder._y, 250, 1, true ");
var textTween2:Tween = new Tween (text, "_x", Strong.easeOut, text._x, 600, 1, true);
clearInterval (myInterval);
}
}
***************************************************************************************** ***There is no way to tell a loop to wait for. This isn't what they are doing.
All of the loop for runs (if possible and it is not a kind of infinite loop) completely before whenever the image is rendered.
If you want to spread in time, you must use the setInterval - but not inside a loop for! If you do this, you immediately set, but the number of intervals of your loop. In this case you will also assign IDS for these intervals to the same variable, replacement effectively the value so you won't ever be able to erase most of these intervals.
That means rethink you the entire structure. Set up a kind of counter and limit like this:
var slidesToShow:Number = 10;
var curSlide:Number = 0;Then have your setInterval the curSlide increment each time it is called, and check to see if it showed all the. This is where the "loop".
As for the other part of your question - Yes you are actually two different issues in progress - once again, you can't do a loop for, wait for anything. So no there is no way to pause while you wait for your pre-teen at the end. But you can be notified when a Tween completes.
See the documentation on the tween class in the help files. You will find the onMotionFinished event. If you configure one of those to begin with everything that needs to be started when the Tween is finished.
You should also use the MovieClipLoader class to load your images, because you don't know how long it will take to load. Using this class, you get a nice event (onLoadInit) that tells you when the asset is ready for use.
Finally, I think that you might want to use instead of setInterval setTimeout. It runs only once, whereas setInterval repeat forever. So I think that your algorithm would be something like that.
1. load creditrice
2. when ready to animate in and set onMotionFinished Manager
3. when the query is finished start loading assets and setTimeout for 4 seconds.
4. when 4 seconds is up or the clip is loaded (no matter what either takes longer) go to 2 and repeat.If this is going to be run locally on a hard drive or CD you will have no problem with the length of time that it takes to load external assets, but if it's on the web it's going to take time.
-
Update statement with joins of tables and where Clause
Hi, I have MS SQL background and I try to execute an update statement in Oracle with joins of tables. However, the syntax below does not work but I think it works for MS SQL.
Basically, the base table must be attached to a master table trend with monthly snapshots, an account will be only an entry for a given date monthly. Where clause must be limited to accounts within a certain range of interest rates.
The first approach returns command SQL ORA-00933 not correctly completed, and the second approach returns ORA-01427 row below query returns multiple rows. Can anyone help? Thanks in advance!
1:
Update PenaltyAll
Set a.indicator = month (b.)
of PenaltyAll an inner join Master b on a.acctno = b.accountnumber
where a.monthend='01/31/2009' and b.date='12/31/2008' and b.apr < 20
2:
Update PenaltyAll
adjustment indicator =
(select to_char (b., 'MM')
of PenaltyAll an inner join Master b on a.acctno = b.accountnumber
"where to_char (a.monthend,'mm/dd/yyyy ') = 31 January 2009"
(et to_char(b.date,'mm/dd/yyyy') = December 31, 2008 "
and b.apr < 20)
Published by: sqlrookie on August 21, 2009 07:04I edited my post, that was my mistake, ANC you try now?
-
Need help with an instruction box with the data in the collection
It is located in the section source on my interactive form, my collection process works, but there is "-" where there should be a "$0.00 ' in the summary section.
There is a problem with my syntax of the case statement,
Select pending, records c002 c001, c003 case $ if no then ' $0.00 ' if not no c003 end other "$0.00 ' from apex_collections where collection_name ="Summary1»»"Hi Doug,.
The best way to handle this is with the NVL function, for example,
SELECT c001 Awaiting, c002 Records, NVL(c003,0) Dollars ...
and let the application manage the formatting of the field (which I suppose it's done for non-null values).
However, if you want to use the CASE statement, here is how it works:
SELECT CASE WHEN c003 IS NULL THEN 0 ELSE c003 END Dollars ...
-Jennifer
-
Problem with custom dialog box
I have a custom dialog box. The code goes here
import net.rim.device.api.system.Bitmap; import net.rim.device.api.ui.Color; import net.rim.device.api.ui.component.Dialog; import net.rim.device.api.ui.container.VerticalFieldManager; import net.rim.device.api.ui.decor.BackgroundFactory; public class CustomDialog extends Dialog{ public CustomDialog(int command,String msg,int color,int alpha){ super(command, msg, command,Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), VerticalFieldManager.FOCUSABLE); setBackground (BackgroundFactory.createSolidTransparentBackground (color, alpha)); } }
I'm the caller to another class as follows
CustomDialog d = new CustomDialog(Utils.D_YES_NO,"Do you want to exit",Color.BLUE,140); d.show();
Its display very well and as I intended it to be. But the problem is that I'm not able to get the index of the choice to perform certain actions, such as
int i=d.getSelectedValue(); if(i==Dialog.D_YES){ Dialog.alert("hi"); } }
Its do not call the dialog box, can anyone suggest me how to get the index of the choice that I chose to say YES or NO and to perform tasks accordingly
Plese try suite
CustomDialog d = new CustomDialog(Dialog.D_YES_NO,"Do you want to exit",Color.BLUE,140); d.show(); d.setDialogClosedListener(new DialogClosedListener() { public void dialogClosed(Dialog dialog, int choice) { /* * // Field descriptor #211 I public static final int YES = 4; // Field descriptor #211 I public static final int NO = -1; */ int i=choice; System.out.print("Selected Value :"+choice); if(Dialog.YES==choice){ System.out.println("Selected Value : YES"); }else if(Dialog.NO==choice){ System.out.println("Selected Value: NO"); } } });
If it is useful, please make as response and do not hesitate on LIKE button thanks
-
Problem with a Bitmap image in a ButtonField (get a 104 NullPointerException error)
Hi, I'm a beginner in programming BlackBerry Apps, well...
I tried to create a simple ButtonField customized with a bitmap inside, but I constantly get an error 104 eception: NullPointerException, here is my code to field custom buttond.
import net.rim.device.api.ui.component.ButtonField;import net.rim.device.api.ui.Graphics;import net.rim.device.api.system.Bitmap; public class CustomButtonField extends ButtonField{ private Bitmap imagen; CustomButtonField(Bitmap imagen, long style){ super(style); this.imagen = imagen; } public int getPreferredWidth(){ return 60; } public int getPreferredHeight(){ return 60; } protected void paint(Graphics graphics) { graphics.drawBitmap(0, 0, imagen.getWidth(), imagen.getHeight(), imagen, 0, 0); } protected void layout(int width, int height) { setExtent(getPreferredWidth(), getPreferredHeight()); } }
import net.rim.device.api.ui.container.MainScreen;import net.rim.device.api.system.Bitmap; public class PruebaScreen extends MainScreen{ private CustomButtonField boton; PruebaScreen(){ Bitmap imagen = Bitmap.getBitmapResource("res/img/icon.png"); boton = new CustomButtonField(imagen, 0); add(boton); }}
I suspect that my problem is due to the method of painting or the page layout, I don't know... I hope someone can help me, thank you very much in advance.
Check if your getBitmapResource returns any non-null Bitmap image. Specify the path correctly may take a few tries ("' / res/img/icon.png '," img/icon.png", etc.")
Maybe you are looking for
-
PROBLEM when scanning multi-page pdf
Hello Since the update of the sierra, I have a problem when scanning multiple page document. If I check the checkbox "merge pdf" in the scanner window, first page works fine but when I scan page #2 or one of the more page don't merge in the file pdf
-
Can I move the menu to the top right of the screen?
Hello I want to move my Menu from the top of the screen to the right bar, I can even make in iMAC - please help!
-
After having downloaded and installed the new Firefox 4.0, I learned 2 extensions could not be installed. A notice would monitor the compatibility and availability and would notify me when those extensions are available. So who's going to happen, I p
-
Using pictures of Yosemite 1.0.1 I created a 400 photo album. I custom sort them. When I copy a USB to share with friends my custom sort is lost. Is it possible to maintain the current order of photo on a USB?
-
Remove the master repository ODI
Hi, I installed the odi on my system and did some work. Now I want to reinstall ODI and start my work from scratch. I tried uninstalling, then put it back, once again. When I try to import the master repository I do not import by saying that there ar