XSL vs CFML for conditional statements
I want to use a server side transformation of an XML document
using XSL to produce a set of HTML, Doc and PDF documents. However,
I need to do some conditional processing (mainly if then formating
issues for cases of null data) and I am wondering if I am better
off doing them in XSL or in CFML. Does any one know of performance
issues versus one way or another or can point me to some
literature?
The XSQL Pages framework has never had an <xsql:if> conditional as a built-in action, so the article must be in error.Actually, the article (written by members of the Oracle XML Product Development Team) refers to the use of "<xsl:if>" within XSQL pages, not "<xsql:if>". Here's the excerpt from the article at the site http://www.oracle.com/oramag/oracle/01-jan/index.html?o11xml.html -
Support for XSLT Tags in XSQL
Oracle XSQL pages are templates that enable you to assemble dynamic XML datapages based on one or more parameterized SQL queries. The processor then uses XSLT to transform the datapage to produce a final result in any desired XML, HTML, or text-based format. However, you can also use XSLT to assemble the XML datapages. For example, you can use XSLT to execute SQL queries conditionally by using <xsl:choose> or <xsl:if>. The following XSQL page shows the use of xsl:if to retrieve a summary or detailed information on the book list:
<?xml version="1.0"?>
<xsql:query connection="demo" xmlns:xsql="urn:oracle-xsql"
xmlns:xsl="http://www.w3.org/1999/XSL /Transform">
<xsl:if test="$detail = 'yes'">
SELECT * FROM scott.BookList
</xsl:if>
<xsl:if test="$detail = 'no'">
SELECT Title, Authorname FROM scott.BookList</xsql:query>
</xsl:if>
</xsql:query>
I'm just looking for clarification whether this is in fact true.
Thanks,
Michael
The Online XSQL Documentation features examples illustrating how to accomplish this functionality. See the doc there, and search for "XSQL Servlet Conditional Statements".
Similar Messages
-
Java programming standard for conditional statement
Hi,
Is it proper Java standard to use constants first in a conditional statement? I've never seen coding in this way, even when I was in college I never saw it in any of our books.
example:
String x = null;
if (null==x){
//Do some stuff
}kevjava wrote:
yawmark wrote:
...hence, more work.Not if "NAME_KEY" (i.e., the literal value) changes.
~If some wise guy resets it to null, then you've lost all benefit of making a constant out of it to begin withIf that happens, you've got some people problems to deal with! Anyways, if it's really a constant, it'll be final, right?
.... and I was sort-of reiterating that it was a self-named constant... you're right, of course, but I guess I'm just peaved at having to see stuff like...
private String JAN="JAN";
private String FEB="FEB";
// ...and on and on...
// later...
if (FEB.equals(month)) {
// do stuff
} else {
// do stuff
}Have you ever actually seen code like that in production? I wonder, what are you up to that a class needs its own, private, set of months?
My point is that the three-letter abbreviation is always going to be "FEB" (yes, i18N and language specializations aside)Why put them aside, though? They're not exactly corner cases -
Long execution times for TestStand conditional statements
I have two test stations – one here, one at the factory in China that has been operating for about a year. The test program uses TestStand 3.1 and calls primarily dll's developed using CVI. Up until a couple months ago, both test stations performed in a similar manner, then the computer at the factory died and was replaced with a new, faster computer. Now the same test sequence at the factory take three times as long to execute (30 min at the facotry, 10min here).
I have recoded the execution time at various point during the execution, and have found that the extra times seems to be occurring during the evaluation of conditional statements in TestStand (i.e. for loops, if statements, case statements). For example, one particular ‘for’ evaluation takes 30 ms on the test station here, but takes 400 ms at the test station at the factory (note: this is just the evaluation of the for condition, not the execution of the steps contained within the for loop).
The actual dll calls seem to be slightly faster with the new computer.
Also the ‘Module Times’ reported don’t seem to match the actual time for the module for the computer at the factory. For example, for the following piece of TestStand code:
Label1
Subsequence Call
Label2
I record the execution time to the report text in both Label1 and Label2. Subtracting one from the other gives me about 18 seconds. However the ‘Module Time’ recorded for ‘Subsequence Call’ is only 3.43 seconds.
Any body have any ideas why the long execution time with the new computer? I always setup the computers in exactly the same way, but maybe there is a TestStand setting somewhere that I have missed? Keep in mind, both test stations are running exactly the same revision of code.Got some more results from the factory this morning:
1) Task Manager shows that the TestExec.exe is the only thing using CPU to any significant degree. Also CPU Usage History show that the CPU Usage never reaches 100%.
2) I sent a new test program that will log test execution time in more places. Longer execution times are seen in nearly every area of the program, but one area where this is very dramatic is the time taken to return from one particular subsequence call. In this subsequence I log the time just before the <End Group> at then end of Main. There is nothing in Cleanup. I then log the time immediately after returning from this sequence. On the test system I have here this takes approximately 160 ms. On the test system at the factory this takes approximately 14.5 seconds! The program seems to be hanging here for some reason. Every time this function is called the same thing happens and for the same amount of time (and this function is called about 40 times in the test program, so this is kill me). -
Some help for a simple condition statement...
Hello! I wanted some help this condition statement...
There are 2 tweens called "mc_sun" and "mc_welcome" I want to
run when someone clicks on a button called "btn_home", but I don't
know exactly how to write the code because I've already tried these
2 modes and noone work at all!
THANKS FOR THE HELP!!!!I think I know what you're after here ... but I could be
wrong ;) but try this: -
IF and ABS condition statement in BEX query designer
Hi,
I would like to ask the best way for me to produce an acceptable result from Excel IF and ABS Condition statement.
The condition statement that I have on my Excel file is
=IF((A2-B2)>0,ABS(A2-B2),0)
I'm trying multiple times to reproduce this in BEX Query designer, unfortunately I'm getting a bad result or unacceptable formula.
Anyone who could help me with my issue?
Thanks,
ArnoldHi Arnold,
Thank you,
Nanda -
This is actually not a JSP question but an HTML question. I could'nt find any good html forum sites out there, and since I received excellent replies in my previous post, I am hoping that those of you who know JSP also know html. Heres my question, is there any conditional statement in html (I don't want to use scripts)? The only conditional statement I found was the logic:equal (not equal) statement. And it seems to only work for forms. I am using JSP in conjunction with html so I used an inner html variable declaration in my JSP function. This variable will be used by my html code. And I would like to check the value of that variable in html.
Heres my JSP function containing the inner html declaration:
function showItemEdit(field)
var elements = editWindowDiv.document.all;
elements("editWindowField").value = "";
fieldhtml.innerHTML = field;
var retVal = null;
retVal = window.showModalDialog("javascript:document.write(window.dialogArguments.innerHTML);editWindowInit();",editWindowDiv,
"dialogWidth:335px;dialogHeight:185px;scroll:no;status:no;unadorned:no");
if (retVal == "OK")
alert("OK");
else
alert("Cancel");
The inner html variable, fieldhtml.innerHTML, is the value I would like to check in my html code.
This is what I woul like to accomplish in my html code:
if fieldhtml == register then
<tr>
<td class="bodymd"> <bean:message key="label.register"/>:</td>
<td><input type="text" name="editWindowField" value="" maxlength="5"></td>
</tr>
else
<tr>
<td class="bodymd"> <bean:message key="label.shift_no"/>:</td>
<td><input type="text" name="editWindowField" value="" maxlength="3"></td>
</tr>
end if
I am not sure how to accomplish if-else statements in html. I would appreciate any help. Thanks!You are mixing things a bit. There is no JSP in your example. You cannot do conditional statements in HTML. However, you can use JavaScript to output HTML:
if(someCondition){
document.write("<yourHTMLTags>whatever</yourHTMLTags>");
else{
document.write("<yourHTMLTags>something else</yourHTMLTags>");
} -
Text box not empty conditional statement
I've been asked to develop a survey and, in several places, a
score is given for the completion of text box. However, if there is
no text in the box, then a score of zero should be given.
I thought the best way to do this would be to use a hidden
field with a conditional statement saying "if text box is not empty
then score=4, else score=0.
However, firstly I'm not sure how to write this and secondly,
how do you check if a text box is empty?
I think it really calls for some human input but the client
is quite sure this is how he wants it.
The scores are all going to be inserted into a mysql database
and sorted out there, so there may be some fudge available there
but if php could do something nice in the code, that would be
preferable.
Thanks in advance.
AndrewDrewbles wrote:
> However, firstly I'm not sure how to write this and
secondly, how do you check
> if a text box is empty?
Believe it or not, with the PHP function called empty();
http://docs.php.net/manual/en/function.empty.php
if (empty($_POST['fieldName'])) {
// give a score of 0
} else {
// give a positive score
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
OMP_SET_NUM_THREADS in a conditional statement?
I am having problems using OMP_SET_NUM_THREADS in a conditional statement. For example a code like following will make the program to hang indefinitely after starting to execute a parallel DO loop:
if(mybool.eq.0) then
call OMP_SET_NUM_THREADS(iprocessors)
else
call OMP_SET_NUM_THREADS(1)
endif
Is there a problem using this function in conditional statements?
I am using Forte Studio 7 under Solaris 8 and 10 (I know that it is old but for the moment this is what I have to use...).
Thanks,
RakThis is probably a bug in Forte 7.
Can you isolate the problem in a small test case and post the code here. We'll try it on the latest compiler and see if it works or not.
You know you can download Sun Studio 12 and run it on Solaris 10. (SS 12 is not supported on Solaris 8) -
Using conditional statements stored inside a variable
I'm trying to store the body of different emails inside of my
database to use in email sent with cfmail. The content of the
emails has conditional statements using cfif and other variables
based on a query running. If I set the content as a variable and
then place that inside of the cfmail tag it does not process the
cold fusion code. Is there a way that I can process this code so
that the final output is what is placed within the cfmail tag or is
it not possible to do what I'm trying to accomplish? Thanks in
advance for any ideas.Here is a sample taken from the text file. The output created
by the cfsavecontent tag is identical to the text file.
Dear <cfif IsDefined(GetData.strFirstName) AND
GetData.strFirstName IS NOT
"">#GetData.strFirstName#<cfelse>Member</cfif>,
Thank you for joining xxxxxxxxx. We're glad to
have you as a member and appreciate your support. Your
membership
application has been processed and your member packet will
arrive soon.
Your new membership number is #GetData.strCustomerID#. This
number is useful
when buying product from our online store, renewing your
membership or
contacting us with questions or comments.
<cfif GetData.ExpirationDate IS "9999-12-1">We are
especially grateful for your commitment to xxxxxxxx
through your Life Membership.<cfelse>Your membership is
current through #DateFormat(GetData.ExpirationDate, "MMMM
YYYY")#.</cfif> -
Got action sequence to "loop" but it shows in all states - conditional statement to fix it?
Using Flash Catalyst & Notepad (to open and alter the code in the "Main" MXML file) I'm able to "loop" an action sequence on the home state for my swf by changing the code as follows:
ORIGINAL CODE
<s:Parallel id="Sequence3">
ALTERED CODE
<s:Parallel id="Sequence3" effectEnd="Sequence3.play()">
The desired effect is a sequence (of 4 images) that loops whenever a user is viewing the home state. It is activated "On Application Start"
The PROBLEM is that the loop continues in all other states (it appears in the background - behind the objects that are supposed to show up on the other pages and only begins to show up in each state when the sequence begins another loop).
I am assuming I need a conditional statement --- something along the lines of:
while (condition){ statements;}
...in other words, ONLY while currentstate = "Home" it should loop the sequence. What would be the correct code for this conditional statement and where would the conditional statement be inserted to loop the sequence as desired??? Or... is there another better way??
My current code for this action sequence is:
<s:Parallel id="Sequence3" effectEnd="Sequence3.play()">
<s:Parallel target="{designlayer1}">
<s:Fade alphaTo="0" duration="500" startDelay="2100"/>
</s:Parallel>
<s:Parallel target="{bitmapimage2}">
<s:Fade alphaTo="0" startDelay="2100"/>
</s:Parallel>
<s:Parallel target="{bitmapimage3}">
<s:Fade alphaTo="0" startDelay="2100"/>
</s:Parallel>
<s:Parallel target="{bitmapimage4}">
<s:Fade alphaTo="0" startDelay="2100"/>
</s:Parallel>
<s:Parallel target="{bitmapimage5}">
<s:Fade alphaTo="0" startDelay="1650"/>
</s:Parallel>
<s:Parallel target="{bitmapimage6}">
<s:Fade alphaTo="0" startDelay="1800"/>
</s:Parallel>
<s:Parallel target="{bitmapimage7}">
<s:Fade alphaTo="0" startDelay="1950"/>
</s:Parallel>
<s:Parallel target="{designlayer5}">
<s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
<s:Fade alphaTo="0" startDelay="5300"/>
</s:Parallel>
<s:Parallel target="{bitmapimage8}">
<s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
<s:Fade alphaTo="0" startDelay="5350"/>
</s:Parallel>
<s:Parallel target="{bitmapimage9}">
<s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
<s:Fade alphaTo="0" startDelay="5350"/>
</s:Parallel>
<s:Parallel target="{bitmapimage10}">
<s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
<s:Fade alphaTo="0" startDelay="5350"/>
</s:Parallel>
<s:Parallel target="{bitmapimage11}">
<s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
<s:Fade alphaTo="0" startDelay="4750"/>
</s:Parallel>
<s:Parallel target="{bitmapimage12}">
<s:Fade alphaFrom="1" alphaTo="0" duration="0" startDelay="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="2650"/>
<s:Fade alphaTo="0" startDelay="5000"/>
</s:Parallel>
<s:Parallel target="{designlayer6}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
<s:Fade alphaTo="0" startDelay="7900"/>
</s:Parallel>
<s:Parallel target="{bitmapimage13}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
<s:Fade alphaTo="0" startDelay="7550"/>
</s:Parallel>
<s:Parallel target="{bitmapimage14}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
<s:Fade alphaTo="0" startDelay="7900"/>
</s:Parallel>
<s:Parallel target="{bitmapimage15}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
<s:Fade alphaTo="0" startDelay="7750"/>
</s:Parallel>
<s:Parallel target="{bitmapimage16}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
<s:Fade alphaTo="0" startDelay="7900"/>
</s:Parallel>
<s:Parallel target="{bitmapimage17}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="5900"/>
<s:Fade alphaTo="0" startDelay="7900"/>
</s:Parallel>
<s:Parallel target="{designlayer7}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
<s:Fade alphaFrom="1" alphaTo="0" startDelay="11000"/>
</s:Parallel>
<s:Parallel target="{bitmapimage18}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
<s:Fade alphaFrom="1" alphaTo="0" startDelay="11000"/>
</s:Parallel>
<s:Parallel target="{bitmapimage19}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
<s:Fade alphaFrom="1" alphaTo="0" startDelay="11000"/>
</s:Parallel>
<s:Parallel target="{bitmapimage20}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
<s:Fade alphaFrom="1" alphaTo="0" startDelay="11000"/>
</s:Parallel>
<s:Parallel target="{bitmapimage21}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
<s:Fade alphaFrom="1" alphaTo="0" startDelay="10650"/>
</s:Parallel>
<s:Parallel target="{bitmapimage22}">
<s:Fade alphaTo="0" duration="0"/>
<s:Fade alphaFrom="0" alphaTo="1" duration="0" startDelay="8500"/>
<s:Fade alphaFrom="1" alphaTo="0" startDelay="10800"/>
</s:Parallel>
</s:Parallel>
Thank you!!!!!!!!Figured out my issue...
I had to select each layer for the 4 photo sequence and "Remove From State" for each layer. If this is done with all layers except the "Home" state, the images show only where appropriate.
So... "Loop an action sequence" is really easy.
I've seen a lot of complaining that "FC can't do it" but with a very simple code mod, I was able to do it WITHOUT using the video timer method.
I should also mention that I've never worked with Flash at all before this project and am only self-taught in HTML (basics). I was able to make a pretty good looking Flash component for a web site and never would have attempted it without FC. I have to say, while FC is a bit limited, GUI-based Flash is a great add for Adobe and will save me over $2k per year in web admin.
To edit the document in Notepad as mentioned in the first post:
the full text can be found here http://www.judahfrangipane.com/blog/2010/09/03/flash-catalyst-jailbreak-for-flex-developer s/
Editing MXML Documents
To edit your projects MXML documents we first need to find the path to the Flash Catalyst workspace. To do this publish your Flash Catalyst project (CMD / CTRL + ENTER). Now, the browsers URL shows the path to the project workspace. So in this URL, "file:///Users/judah/Library/Application Support/Adobe/Flash Catalyst/workspace/Project/bin-debug/Main.html", the project MXML documents are located at, "file:///Users/monkeypunch/Library/Application Support/Adobe/Flash Catalyst/workspace/Project/" when on a Mac.
Flash Catalyst project files
Project Files Description
/src - location of the application source files
/bin - the location of any additional flex libraries
/bin-debug - location of testing swf
/html-template - location of the html template that wraps around your application
/src/Main.mxml - the main application file. make your application changes here
/src/Main.css - the css stylesheet of the main application
/src/components - the location of custom components and component skins
/src/assets/graphics - location of optimized FXG graphic symbols
/src/assets/images - location of images
You can edit these XML documents in any text editor. To apply the changes you need to save the file and refresh the Flash Catalyst project. You can do this by opening the changed document in Flash Catalyst code view. When we do this it will recognize the document has changed and prompt you to use the newer version of the file. Select Yes. If the project does not rebuild immediately publish it using CMD + Enter. -
Need Help W/ Conditional Statement...
Hi guys,
I have a project uploaded at:
http://www.jasonfraziercreativedesign.com/client_sites/kimyarbrough2/
After everything has loaded into place, and you click on -- say MODELING -- the photos slide away, the separator bars disappear, and the particular (sample) content is loaded in. This works wonderfully for all the buttons (MODELING, ACTING, MUSIC, SCHEDULE and ABOUT KIM) -- but only when you click on them when the site first loads.
If you try to click on the buttons again, when you're IN a section -- it will cycle through the animation again.
I know I need some kind of conditional statement that says if you're ALREADY LOOKING AT A SECTION (i.e. the sourceLoader.source = a section) then don't cycle through the animation again -- just get rid of the current content and display the appropriate new content.
If you're IN the MODELING SECTION, for instance and you click MODELING again -- I don't want Flash to do ANYTHING (ie NULL). But if you're in MODELING, and you click on ACTING -- I just want the MODELING stuff to go away and present the ACTING stuff (no animation).
Here's the pertinent AS that I have currently -- any help about where to place the proper CONDITIONAL (if/else) statement would be so appreciated:
function swap_photos_place_content(theSection:String):void {
// ANIMATE THE 4 PANEL PHOTOS LEAVING THE CONTENT AREA
var photo1Tween:Tween = new Tween(kim_photo1_mc, "y", Regular.easeOut, kim_photo1_mc.y, 620, 2, true);
var photo2Tween:Tween = new Tween(kim_photo2_mc, "y", Regular.easeOut, kim_photo2_mc.y, -600, 2, true);
var photo3Tween:Tween = new Tween(kim_photo3_mc, "y", Regular.easeOut, kim_photo3_mc.y, 620, 2, true);
var photo4Tween:Tween = new Tween(kim_photo4_mc, "y", Regular.easeOut, kim_photo4_mc.y, -600, 2, true);
// AFTER THE LAST PHOTO HAS MOVED OUT, FADE UP THE CONTENT MASK
photo4Tween.addEventListener(TweenEvent.MOTION_FINISH, fadeup_content_mask);
function fadeup_content_mask(event:TweenEvent):void {
var main_mask_fadeoutTween:Tween = new Tween(main_mask_mc, "alpha", Regular.easeOut, 1, 0, 1, true );
var content_mask_fadeupTween:Tween = new Tween(content_mask_mc, "alpha", Regular.easeOut, 0, 1, 1, true);
// AFTER THE CONTENT MASK FADES UP, THE STAGE IS READY TO LOAD IN THE CONTENT
content_mask_fadeupTween.addEventListener(TweenEvent.MOTION_FINISH, load_in_content);
function load_in_content(event:TweenEvent):void {
// BEFORE LOADING IN THE NEW SECTION, TAKE AWAY THE OLD SECTION
sectionLoader.source=null;
trace("ready to load in content");
sectionLoader.source=theSection;
// ADD LISTENERS FOR THE SECTION-CONTENT CLICKS
inv_modeling_button.addEventListener(MouseEvent.CLICK, modeling_click);
function modeling_click(event:MouseEvent):void {
trace("modeling_click");
swap_photos_place_content("modeling.swf");
inv_acting_button.addEventListener(MouseEvent.CLICK, acting_click);
function acting_click(event:MouseEvent):void {
trace("acting_click");
swap_photos_place_content("acting.swf");
inv_music_button.addEventListener(MouseEvent.CLICK, music_click);
function music_click(event:MouseEvent):void {
trace("music_click");
swap_photos_place_content("music.swf");
inv_schedule_button.addEventListener(MouseEvent.CLICK, schedule_click);
function schedule_click(event:MouseEvent):void {
trace("schedule_click");
swap_photos_place_content("schedule.swf");
inv_aboutkim_button.addEventListener(MouseEvent.CLICK, aboutkim_click);
function aboutkim_click(event:MouseEvent):void {
trace("aboutkim_click");
swap_photos_place_content("aboutkim.swf");One thing you can do is create a function that removes all the event listeners for all the buttons. Then when you click a button run that function then add event listeners for all other buttons.
-
How to use Conditional statements in SQL Loader control file
Hi,
I am using sql loader to load a flat file to the table. I am using control file for this purpose as show below:
LOAD
INTO TABLE store_shrink
TRUNCATE
FIELDS TERMINATED BY " "
TRAILING NULLCOLS
SITE_ID char,
ST_SHRINK char,
ST_REVENUE char,
SHRINK_PR char ":ST_SHRINK/:ST_REVENUE"
My question is this. If in the flat file the value of 'ST_REVENUE' is '0', then I want 'SHRINK_PR' to be '0' as well, and skip the calculation (:st_shrink/:st_revenue).
How to achieve this with the conditional statement or using any Oracle function?
Any help or suggestion is greatly appreciated.
Thanks in advance.Hi there,
I tried the following in my above query and it doesn't work somehow. Anyone has an idea? I have been on internet throughout but to no avail. Please help:
LOAD
INTO TABLE store_shrink
TRUNCATE
FIELDS TERMINATED BY " "
TRAILING NULLCOLS
SITE_ID char,
ST_SHRINK char,
ST_REVENUE char,
SHRINK_PR char "case (when :st_revenue<>'0.00' then :SHRINK_PR=:ST_SHRINK/:ST_REVENUE else :SHRINK_PR='0.00') end"
) -
'Missing select' error for update statement using WITH clause
Hi,
I am getting the below error for update statement using WITH clause
SQL Error: ORA-00928: missing SELECT keyword
UPDATE A
set A.col1 = 'val1'
where
A.col2 IN (
WITH D AS
SELECT col2 FROM
(SELECT col2, MIN(datecol) col3 FROM DS
WHERE <conditions>
GROUP BY PATIENT) D2
WHERE
<conditions on A.col4 and D2.col3>Hi,
The format of a query using WITH is:
WITH d AS
SELECT ... -- sub_query
SELECT ... -- main query
You don't have a main query. The keyword FROM has to come immediately after the right ')' that ends the last WITH clause sub-query.
That explains the problem based on what you posted. I can't tell if the real problem is in the conditions that you didn't post.
I hope this answers your question.
If not, post a complete test script that people can run to re-create the problem and test their ideas. Include a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Application Level Function for Conditional Display
I need to hide a field on Print Preview if it is null. I currently have the following PL/SQL Expression Condition:
:P305_DEPT IS NOT NULL AND v('PRINTER_FRIENDLY') <> 'YES'
It works great; now I need to do this for a lot more fields within my application. Is there a way to call a PL/SQL process defined in HTML DB, passing it the current item value, or some other way to save myself some typing?
I've tried various combinations of shortcuts, substitution strings, application processes, etc. and can't seem to get the right combination.
I'm hoping you have a cool solution, or some other ideas I can try out.
Thanks!
ChaunaciHi Raj,
All of this came up because we have several data items displayed above each report page, which allow the user to enter filter criteria. When the page is displayed in Print Friendly mode, the Select Lists display as blanks when null, but Text Boxes display as [] when null.
Our QAs have asked us to make all of the filter fields consistent in appearance in Print Friendly mode. The work-around solution is to hide the filter fields that are null when in Print Friendly mode. Therefore, we came up with the following PL/SQL Expression to use in the Conditional Display:
:P305_DEPT IS NOT NULL AND v('PRINTER_FRIENDLY') <> 'YES'
Because I will need to add the above conditional statement to many items, I was hoping to create and call an HTML DB application-level process and pass the current item value in, so my conditional display logic would look something like...
HIDE_NULL_ON_PRINT(:P305_DEPT).
When I was doing some additional testing last night, I realized my boolean logic needed to be tweaked, and it would be nice to tweak it in just one place, rather than on every field's conditional display.
I currently have it working by putting the IS NOT NULL AND v('PRINTER_FRIENDLY') <> 'YES' into an application substitution string, so my conditional logic shows as:
:P305_DEPT &HIDE_NULL_FOR_PRINT.
In trying to determine if this was the best solution, I need answers to the following issues:
1. Is there a way to generically reference the current item in the conditional display logic? I currently type in the specific item name (ex: :P305_DEPT), but it would be nice if instead I could just say &CURRENT_ITEM_NAME. (or something similar).
2. Can I create an application-level process, pass a parameter into it (the current item), and have it return a value that can be evaluated by my conditional logic display?
Thanks so much for your quick responses to this and all my previous posts. It is wonderful to be able to post a problem at the end of the day, and come in to a solution in the morning!
Chaunaci -
Handling conditional statements in design view
I have to use conditional statements for proper cross browser
compatability but the design view of Dreamweaver isn't showing
anything. Here is the code:
quote:
<!--[if !IE]>--><!--#include file="header.html"
--><!--<![endif]-->
<!--[if gt IE 6]><!--#include file="header.html"
--><![endif]-->
<!--[if lte IE 6]><!--#include file="headerie.html"
--><![endif]-->
I would think that Dreamweaver would load the first one, or
perhaps there is a setting to tell design view to function as a
particular browser.
Does this exist?http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1564018#
Ken Ford
Adobe Community Expert Dreamweaver/ColdFusion
Adobe Certified Expert - Dreamweaver CS3
Adobe Certified Expert - ColdFusion 8
Fordwebs, LLC
http://www.fordwebs.com
"justin_pdx" <[email protected]> wrote in
message
news:gdtdqe$pi2$[email protected]..
>I have to use conditional statements for proper cross
browser compatability
>but
> the design view of Dreamweaver isn't showing anything.
Here is the code:
>
>
quote:
> <!--[if !IE]>--><!--#include
file="header.html" --><!--<![endif]-->
> <!--[if gt IE 6]><!--#include
file="header.html" --><![endif]-->
> <!--[if lte IE 6]><!--#include
file="headerie.html" --><![endif]-->
>
>
> I would think that Dreamweaver would load the first one,
or perhaps there
> is a
> setting to tell design view to function as a particular
browser.
>
> Does this exist?
>
Maybe you are looking for
-
10.5 compatibility mode on 10.6
I need to run 10.5 on my imac, I currently run 10.6.8, is there any way to do it? I bought a belkin router and the software doesn't run on 10.6!!
-
Procedure with out parameter in if-then-else condition
Hi, I want to fetch the out parameter of a procedure inside another procedure that has if-then-else condition. <<Proc1_start>> if .. then <<proc2_>> --- with out parameter end if; <<proc1_end>> How to do this... Thanks.
-
Our Advast was disabled with upgrade of Firefox. We want to go back.
We upgraded Firefox to 5 and are now told that our Advast (antivirus) program will not work with the upgrade. They checked for upgrades to Advast and found none. We do not want to be without Advast. How can we go back to our prior version of Firefox?
-
After upgrading to iTunes 10.3.1 I get error -50 on startup and 1008 when I try to sign in to the Store. How do I fix this?
-
Flash Pro CS6 with Air 14 SDK not supporting iOS7 icons?
I'm trying to publish an app using Air SDK 14.0.0.110 (and tried 14.0.0.137) and there is still no place to put the iOS 7 icon files, 120x120, 76x76, and 152x152, is this correct?