Where the conditional statement
HelloI'm trying to reuse this page so that it can be used by different areas of my request. Currently, it displays all tables in a particular schema. I would like to reuse so that it could be used by another page that displays only the tables of a particular schema with a particular value set to 'Y' or 'n'. I have tried using if / case identified in SQL and PL/SQL, but none work. My PL/SQL statement gives the error:
Query cannot be parsed, please check the syntax of your query. (ORA-06550: line 1, column 9: PLS-00103: encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use form current cursor symbol "" has been omitted.) Ora-06550: line 2, column 18: PLS-00103: encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use form current)
-----
The code is:
declare
q varchar2(4000);
begin
q:= 'select UNIQUE_ROWID,
OET_TBL_NM,
OEP_ACTIVE_IN
from #OWNER#.VIEW_EDIT_DB
where oeu_id = :P21_DB and OET_TBL_OWN_NM = :P21_SCHEMA ';
if :P21_Repl != null then
q:=q|| ' and OEP_ACTIVE_IN = :P21_Repl ';
end if;
q:=q|| ' group by OET_TBL_NM, oeu_id, OET_TBL_OWN_NM, OEP_ACTIVE_IN, UNIQUE_ROWID
order by OET_TBL_NM, OEP_ACTIVE_IN ';
The key is the: P21_Repl comparison, which is where I try to reuse this page (: P21_Repl would take a 'Y' or the value "n" of a page or be null on the other). Is that what the problem/solution any idea? Thanks for any help.Mike
Published by: Gerd June 22, 2009 00:34
Hello
What about
SELECT "UNIQUE_ROWID"
, "OET_TBL_NM"
, "OEP_ACTIVE_IN"
FROM "#OWNER#"."VIEW_EDIT_DB"
WHERE oeu_id = :p21_db
AND oet_tbl_own_nm = :p21_schema
AND NVL( :p21_repl, 'X' ) = DECODE( :p21_repl, NULL, 'X', oep_active_in )
GROUP BY oet_tbl_nm
, oeu_id
, oet_tbl_own_nm
, oep_active_in
, unique_rowid
ORDER BY oet_tbl_nm
, oep_active_in
See you soon
Ben
http://www.munkyben.WordPress.com
Don't forget to mark the answers useful or correct ;)
Tags: Database
Similar Questions
-
Hello
I want to use the case (or decode etc.) in which a part of sql.
I want to find the number of rows depending on where the conditions.
For example, I have a table b, d, e, p and s are fields of this table.
If the value of the field b is 1 then my condition clause that will be value fields d, e value fields
If the value of the fields of b is 2 then my condition clause where the declaration will be p field value < s value fields.
Select count (*) of A
where
(if b = 1 then) d, e
(if b = 2 then) p < s
How can I achieve this?where (b = 1 and d
-
DBMS_XMLGEN. GETXML confusing WHERE the condition of clause?
I can't quite wrap my head around that, but I found the following query
Select * from user_views
where dbms_xmlgen.getxml ("select text from user_views where view_name =" "|") view_name | ') like '% view_table_name % '.
I am totally confuse everything, that's what makes the WHERE condition in the query?
When I run the game "highlight text" it returns nothing
If anyone knows why the WHERE clause is necessary?
Thank yourodneyc8063 wrote:
I don't understand why there are extra, extra quotes | and the "solomon_is_cool".Additional citations have nothing to do with dbms_xmlgen. In string literals Oracle must be in quotes by acronym. So what do you do if literal contains a quotation, for example O'Reily? The rule is, apostrophe inside the quoted string must be preceded by a second single quote. Thus, to produce the O string literal 'Reily, one must use 'O' Reily'. Now, back to dbms_xmlgen.get_xml. She waits for the SQL statement as a parameter. What SQL statement we want to produce? It would be:
Select the text from user_views where view_name = "some-view-name."
Right? Then, how the chain of the SQL statement above should look like? One way is to double single quotes:
"Select the text from user_views where view_name =" some-view-name "'.
But some-name-of-view is stored in the column of our query view_name. We have therefore concatenate the piecies which are:
(1) text select lieral user_views where view_name = '
(2) column view_name
(3) literal 'If we end up having:
"Select the text from user_views where view_name ="' | view_name | ''''
Now, you have replaced with solomon_is_cool view_name. This will not work because there is no solomon_is_cool column is user_views. What you probably wanted was:
"Select the text from user_views where view_name ="solomon_is_cool"'.
Then:
dbms_xmlgen. GetXml ("select text from user_views where view_name ="solomon_is_cool"'") would look like to display user named solomon_is_cool text is tiny, which again could be a problem since the names, except between quotes, are stored in the data dictionary for uppercase. In any case, the counting of single quotes in string literals can be confusing. In the new versions of oracle introduced then Q-literals,
dbms_xmlgen. GetXml ("select text from user_views where view_name =" "|") view_name | '''')
could be replaced by more readable:
dbms_xmlgen. GetXml (Q'[select text from user_views where view_name = ']' | view_name |) Q'[']')
For example:
SQL> select Q'[select text from user_views where view_name = ']' || view_name || Q'[']' from user_views where rownum < 3; Q'[SELECTTEXTFROMUSER_VIEWSWHEREVIEW_NAME=']'||VIEW_NAME||Q'[']' ------------------------------------------------------------------------------ select text from user_views where view_name = 'EMP_VW' select text from user_views where view_name = 'REMOTE_DDL_VIEW_TEST' SQL>
SY.
-
spend the conditional statements
Hello everyone I've been working on a duty where we created a game of the match. It is for me to find a way to tell the script action what difficulties the game of the user of the game to. There are 3 easy buttons, mediym, hard. Each sets out an increased number of cards say 4 to 8 easy for way etc.
We are supposed to use the conditional switch to do this. My problem is how do you know what button was clicked the switch?
Here's the code so far, he is only set up for the easy right now. It works fine until I tried to set up the switch.
Thanks for any help you might be able to give.
package {}
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events. *;
import flash.text.TextField;
import flash.utils.Timer;
import flash.utils.getTimer;
import flash.media.Sound;
SerializableAttribute public class Match extends MovieClip {}
var showingCard:Card = null;
const DELAY_TIME = 1000;
public void Match() {}
trace ("Match");
introscreen.btnMenu.btnEasy.addEventListener
addChild (introScreen);
If a card is displayed showingCard refers to it
card otherwise
introScreen.btnMenu.btnEasy.addEventListener (MouseEvent.CLICK, onClickButton);
} / / end of the constructor
function onClickButton(e:MouseEvent):void {}
trace ("onClickButton");
{Switch (e.Target.Level)}
'easy ': case study
layoutCards (2);
break;
}
}
//
function layoutCards(gridSize:int):void {}
trace ("layoutCards");
put gameScreenOnTop
addChild (gameScreen);
creat bridge of the faceValues valid
var Bridge: Array = [];
var lastFrame:int = gridSize * gridSize / 2 + 1;
for (var k: int = 2; k < = lastFrame; k ++) {}
Deck.push (k, k);
}
trace (Deck);
layout maps
for (var i: int = 0; i < gridSize; i ++) {}
for (var j: int = 0; j < gridSize; j ++) {}
trace (i, j);
Map: map of var = new Card();
size
Card.Width = stage.stageWidth/gridSize;
Card.Height = stage.stageHeight/gridSize;
location
Card.x = i * card.width;
Card.y = j * card.height;
important assign a face value, drawn randomly from the deck
card.faceValue = randomInteger (2.19).
card.faceValue = deck.splice (randomInteger (0, deck.length - 1), 1);
Listening
card.addEventListener (MouseEvent.CLICK, onClickCard);
Add
card.gotoAndStop (1)
gameScreen.addChild (card);
} //j
} //i
} / / end of method of positioning cards
makecard start clickable
function onClickCard (e:MouseEvent) {}
trace ("onClickCard");
var clickedCard:Card = (e.target) Card;
Turn the card clicked
clickedCard.visible = false;
Click on the first map in pair
3 cases
1 card clicked is the first in the bet
See the map and remomber it
make it not clickable at the moment
If (showingCard == null) {}
trace ("FirstCard")
clickedCard.gotoAndStop (clickedCard.faceValue); external
showingCard = clickedCard; internal
clickedCard.removeEventListener (MouseEvent.CLICK, onClickCard);
}
2A - click map is a second pair, and friendly the FirstMatch
both take-out
Else if (clickedCard.faceValue == showingCard.faceValue) {}
trace ("match")
gameScreen.removeChild (clickedCard);
gameScreen.removeChild (showingCard);
showingCard = null;
}
2B - clickedCard is second and not a match for the first.
Return both
else {}
clickedCard.gotoAndStop (clickedCard.faceValue);
freeX during a short period of time
addChild (blockScreen);
var: timer = new Timer(DELAY_TIME,1);
timer.addEventListener (TimerEvent.TIMER,
function onTimer(e:Event) {function //annonymus
delay this code
clickedCard.gotoAndStop (1);
showingCard.gotoAndStop (1);
clickable map list
showingCard.addEventListener (MouseEvent.CLICK, onClickCard);
showingCard = null;
addChild (gameScreen);
}
);
Timer.Start ();
}
}
} / / Match class
} / / packages
When I click on the easy button in the swf file I get this message.
ReferenceError: Error #1069: property not found on flash.display.SimpleButton level and there is no default value.
to Match / onClickButton)
The switch statement checks the 'e.target.level' to see which option has been selected, the part level of this being the word "Easy" or anything else. e.Target points to the object that sent the event, which seems to be a SimpleButton object. But a SimpleButton object cannot have the properties created for her as a movieclip can, in order to verify his 'level' property is looking for something that is not normally.
Where assign you the level of ownership, of what object it give you?
(hindsight: don't want to jump on the reaction of Dave.) This meets an ask me if... I always check before submitting a message to see if someone answered while I was devise a response and normally go back on the forum to check... If if I don't post unless there is a marked difference is answers this time I just went back one level and not seen no response, so I thought that none received... it looks like going back to the forum is the right path to follow)
-
Procedure of the ODI - Bind Variables in the conditional statements
In an ODI procedure, is it possible to add a conditional statement around bind variable? For example, if I use OdiOutFile as the command on the target and Oracle as the command on the Source, I can use bind variables to fill the data in this table (we are in fact using OdiInvokeWebService and passing a XML structure very complex, but it's easier for testing):
OdiOutFile-FILE = C: / TEST. TXT
< person >
< first > #FIRSTNAME < / first >
< Middle > #MIDDLENAME < / Middle >
< last > #LASTNAME < / last >
< / person >
It is a way to add a conditional statement using one of these bind variables? For example, if I wanted to test #MIDDLENAME null and null value, produced this portion of XML, such as:
OdiOutFile-FILE = C: / TEST. TXT
< person >
< first > #FIRSTNAME < / first >
< % if (#MIDDLENAME! = null) {% >}
< Middle > #MIDDLENAME < / Middle >
< %} % >
< last > #LASTNAME < / last >
< / person >
This type of scriptlet syntax seems to work fine, as long as the binding variable is not in the mix (if I put "true is true" or "true == false" in the case, it shows or does not show this line in the XML file, as expected). I use ODI 11.1.1.7.0
----------------------
Post edited by: KevinPratt
Thanks for the reply! As suggested, in what follows, I changed the command and it works as you want
OdiOutFile-FILE = C: / TEST. TXT-APPEND
< person >
< first > #FIRSTNAME < / first >
< @ if (!) (("#MIDDLENAME".equals(""))) {@ >}
< Middle > #MIDDLENAME < / Middle >
{< @} @ >
< last > #LASTNAME < / last >
< / person >
Using the syntax <@ ...="" @="">serve your purpose. Also, I think you might want to include the variable binding in the quotation to avoid syntax errors.
@>
-
Start or stop the conditional statement
I have an animation that plays from the beginning to the end. I would like to add a conditional statement that
IF the animation is to play and click the ANIMATION BUTTON, it stops and goes back to the framework.
OTHERWISE (if the animation is on frame one (did not play) it starts to play the end.)
My script goes like this-
animation_btn.addEventListener (MouseEvent.CLICK, startplaying);
function startplaying (event: MouseEvent); {} void
Play();
Animation.Play ();
}
the animation is the name of the animation time line.
Your help is very appreciated.
assuming that the movieclip you wish to order is the animation:
animation_btn.addEventListener (MouseEvent.CLICK, startplaying);
function startplaying (event: MouseEvent); {} void
{if(animation.currentFrame==1)}
Animation.Play ();
} else {}
animation.gotoAndStop (1);
}
}
-
Select without where the condition
Hello
Is there is no why select lines of two albums without using a where condition.
-
AnimeshAnimesh Tripathi says:
HelloIs there is no why select lines of two albums without using a where condition.
-
AnimeshWithout a doubt.
There are only two lines in your table and then just a Select will do the job. (I'm kidding ;-))
If you have a hierarchical data in your tables, it might be possible:
with employee as ( select 1 emp_id, 'ABC' ename, to_date('01-02-2013', 'DD-MM-YYYY') doj, null mgr_id from dual union all select 2 emp_id, 'ABC1' ename, to_date('02-02-2013', 'DD-MM-YYYY') doj, 1 mgr_id from dual union all select 3 emp_id, 'ABC2' ename, to_date('03-02-2013', 'DD-MM-YYYY') doj, 1 mgr_id from dual union all select 4 emp_id, 'ABC3' ename, to_date('04-02-2013', 'DD-MM-YYYY') doj, 2 mgr_id from dual union all select 5 emp_id, 'ABC4' ename, to_date('05-02-2013', 'DD-MM-YYYY') doj, 3 mgr_id from dual ) select emp_id, ename, mgr_id manager_id, prior ename manager_name from employee start with mgr_id is null connect by prior emp_id = mgr_id and level <= 2; EMP_ID ENAME MANAGER_ID MANAGER_NAME ---------------------- ----- ---------------------- ------------ 1 ABC 2 ABC1 1 ABC 3 ABC2 1 ABC
-
Go to dynamic WHERE the condition in the slider accordingly.
Hi all
I am facing a problem with the cursor with dynamic WHERE condition in a function.
Here's the FUNCTION:CREATE OR REPLACE FUNCTION EXCEPTION_MERGE(TABLE_NAME IN VARCHAR2, TAB_NAME IN VARCHAR2) RETURN VARCHAr2 IS stmt_tabcols VARCHAR2(32767); v_columnname VARCHAR2(32767); CURSOR C1 IS SELECT 'A.'||A.COLUMN_NAME ||' = '|| 'B.'||B.COLUMN_NAME COLUMN_NAME FROM ( SELECT COLUMN_ID, COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = TABLE_NAME AND COLUMN_NAME NOT IN ('ERROR_TAB_ID','ERROR_LOAD_DATE') ) A, ( SELECT COLUMN_ID, COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = TAB_NAME ) B WHERE A.COLUMN_ID = B.COLUMN_ID; BEGIN FOR TABCOL IN C1 LOOP stmt_tabcols := stmt_tabcols ||TABCOL.COLUMN_NAME||','; END LOOP; stmt_tabcols := RTRIM(stmt_tabcols, ','); RETURN stmt_tabcols; END;
She throws, below error:SELECT EXCEPTION_MERGE('WC_W_TEST_FS','WC_W_TEST_FS_GBL') FROM DUAL;
If I REPLACE TABLE_NAME table_name with hard coded values, it works fine. Can someone look at the code and let me know the question.ORA-06502 : PL/SQL : Numeric or value error : character string buffer too small
Published by: ace_friends22 on Sep 9, 2012 13:08The first function TABLE_NAME parameter has the same name as the column of USER_TAB_COLUMNS...
Change the names of the parameters to say nom_table_p...Concerning
Etbin
-
Case where the Condition when Clause Condition use
Hello
How can I use case in the where condition and in when I need to use a condition, be clearly
I need to get the following
When I run the present, I'm missing keyword error.and (case WHEN :PROMT = 'Closed' then status_date >= trunc(sysdate)) end)
How can I solve this?I think you can do it just like this:
... and ( :PROMPT != 'Closed' or status_date >= trunc(sysdate) ) ...
-
Need help with the conditional statement.
I have a conditional configuration to check the 6 values, and I don't know how to put in place. I know that the way I have it Setup is wrong, but I'm stuck here after several attempts of other variants.
LINE OF CODE IN QUESTION:
If (eventObject.info.name! = "marker2" |) "marker4" | "marker5" | "marker6" | "marker7" | "marker8")
FULL CODE BLOCK:
var listenerObject:Object = new Object();
listenerObject.cuePoint = {function(eventObject:Object):Void}
If (eventObject.info.name! = "marker2" |) "marker4" | "marker5" | "marker6" | "marker7" | {"marker8")}
var listenerObject:Object = new Object();
listenerObject.stateChange = {function(eventObject:Object):Void}
trace (_root.theVideo.State);
If {(_root.theVideo.paused)
mclContinue._visible = true;
var myTween:TweenLite = new TweenLite (mclContinue,.35, {_alpha:100, ease:Back.easeOut, onComplete:contBtn});})
} else {}
var myTween:TweenLite = new TweenLite (mclContinue,.35, {_alpha:0, ease:Back.easeOut, onComplete:contBtn});})
}
}
_root.theVideo.addEventListener ("stateChange", listenerObject)
}
}
_root.theVideo.addEventListener ("cuePoint", listenerObject)
Thank you.You are welcome.
-
Where the conditional, or PL/SQL block as a source for an interactive report?
I have this situation: my app's main screen displays a list of documents. For now, there must be a quick way to 'security' integrated, so that administrators can see all documents, but only other users can see what documents, they created (connection of the creator is stored in the table of documents). In the future we will use probably VPD to enforce certain rules, but for the moment we need a quick solution.
So I stored administrators in a separate table. Now I want the interactive Act report on the homepage as follows:
-If an admin is connected, it must have this query: select field 1, 2, 3 area in documents
-For all other users: select the field 1, 2, area 3 documents where creator =: app_user
Is this possible in a single interactive report? I could do two reports with different queries, and make conditional depending on who is connected, but this gives me two interactive reports to maintain. Is it possible to use a PL/SQL block as a source for the report? I tried, but I get a syntax error. Is it possible to do where proviso on somehow?Hello
Install the demo application to your workspace:
Home > create an Application and select Demo Application.Check page 1 interactive report. This should give idea how.
BR, Jari
-
Hello
I have setup a COM interface for TestStand (TS) to run some scripts in TestComplete (TC). Normally, when TestComplete has finished executing the script, it returns a 0 or 1 to designate the success/failure during the TestStand step (step test for example String value). It worked well.
However, now I need TestComplete to regain a vaule (e.g. 32) TS and TS need to assess this value in a while statement. So if the TC value is 32, I would have some statement in TS ike:
While (return value! = 30)
Do something...
Thank you
Jigg,
No, the program does not have a new thread. It's just a single sequential thread. She called other sequential files, and that's all.
I think I'll have some luck with the StationGlobal. It seems to work (for example by setting the StationGlobal a single sequence file automatically updates the Stationglobal in another movie file, sort of like passing the reference value)
Thank you!
-
Formatting check box for the conditional statements in Adobe Acrobat format, form editor
I'm looking for the format I should use boxes in Adobe Acrobat Pro XI, forms, Java Script Editor. I am very familiar with this, as well as the use of the IF / AND statements. I'm NOT using LiveCycle.
Algorithm:
-If either CB1 or CB2 are checked, then empty, equal
-Si CB2 is checked then equal "N/a".
D ' other...
I don't know how I should be charged the formula. I was also curious, I noticed in the properties of the box that the value of exports could be retained. I've seen different variables, including here, Yes, 0, 1, True, etc. Will there be an impact on the code?
var v1 = + this.getField ("Check Box1") .value;
var v2 = + this.getField ("Check Box2") .value;If ((v1 == "") & (v2 == "")) event.value = "";
ElseIf (v2! == 'Off') event.value = "n/a";
else event.value = ("... ») ;
Any help is greatly appreciated.
-Yes, of course. If you change the value of the export of the boxes - and then you have to adjust your code accordingly to take into account.
-The value of a checkbox that is unchecked is always "Off".
-When you add the symbol '+' before this.getField("XXX").value you want to convert it to a number. That doesn't look like a good idea in your case, then you should drop.
-L' Boolean AND operator in JS is &, not &.
-
How to use the NAME OF THE MONTH where the condition in the date column?
Hi guys,.
He comes to the table.
SQL > desc ACMINUTESPDFTEST;
Name Null? Type
----------------------------------------- -------- ----------------------------
DATE OF ACDATE
TYPE VARCHAR2 (10)
Here, I tried 2 following queries, but I couldn't get the correct result
Select the types, seqno, acdate of ACMINUTESPDFTEST, where acdate like to_date ('NOV', 'MY');
or
Select the types, seqno, acdate from ACMINUTESPDFTEST where acdate = to_date ('NOV', 'MY');
(for both the query, the result is the same)
TYPES ACDATE
---------- ------------
ROSE NOVEMBER 1, 10
but the table with the following data:
TYPES ACDATE
---------- ------------
ROSE NOVEMBER 14, 10
WHITE NOVEMBER 15, 10
ROSE NOVEMBER 1, 10
Any suggestion why I could not get a good result.You can do this:
where to_char(acdate,'MON') = 'NOV'
-
Help: Form sum from the ranks (of the conditional statements)
I hope someone more advanced that I am.
I have a form with a table requesting entry for travel expenses. Rows contain for receipt number (auto-remplit with a whole number), Date, name of the vendor, Type of expense (drop-down filled beforehand with a variable), payment Type (drop-down filled beforehand with a variable), costs cost (user imput data to integer), Exchange Office (drop-down filled beforehand with a variable), Conversion rate, the cost of expenses in U.S. dollars (calculated total cost of spending * currency).
The table has a row of data called 'Élément', and there is a button to add a row to the table.
Table auto are the cost of the expenditure in USD field so there is total on the table.
On the previous page (summary page), there is another table. This table summarizes the fees information based on the Type of expenditure and the payment Type.
Currently I have the following formula to calculate the amount under certain conditions fees according to the table below, based on the response to the Type of expenditure and the payment Type. This example is meant to summarize all of the expenses that are "51807 - dues/contributions" and whose payment type is NOT equal "BMC-credit card."
Form1. #subform [1]. Table1.Row1.Expense_51087::calculate - (JavaScript, client)
var sum = 0;
aLines var = form1.resolveNode ("#subform [3].") General_Expense.item [*] ");"
for (var i = 0; i < aLines.length; i ++)
{
If (. expense_type.rawValue aLines.item [i] == "51807 - dues/contributions")
& & aLines.item [i].payment_type.rawValue! = 'BMC-credit card')
sum += aLines.item [i].total.rawValue;
}sum;
However, it does not add the values. It doesn't do anything.Any suggestions? I'll change the formcalc is someone has the solution. I have a formcalc formula works, but it doesn't have the sum of several lines, only the first entry.
Here is the sketch of the shape:
http://www.Brynmawr.edu/Provost/documents/Travel_Form.PDF
This is a modified version of your form. ... with a few suggestions:
1. you should always call your subforms. I changed your subforms without title to page1, Page2... This makes things easier to follow when error messages are generated.
2. I did 1 calculation in the table on page 2. By placing it on the Calc event dependence is established between this field and a field named in the Calc. So when one of these fields is changed, the script is run.
3. I use has to loop through each row in the table on Page 3 and if the coonditions are met, we update the value on Page2.
The syntax to get each item in the line is illustrated in the calc (using an expression xfa.resolveNode ("string") is the only way to get these values).
Hope that helps
BTW - nice shape looking
Paul
Maybe you are looking for
-
try to use on windows Tablet 8 and is sec_error_oscp_future_response
There are a few sites that he let Access me, but when I try to access yahoo, he won't do any except give me the error message.
-
Can anyone help?
-
version 5 loaded on windows 7. all went well for a while. one day, using, normal screen ratio doubled in width; that is half of the page disappears off the screen to the right (on a widescreen). When applied full-screen mode, the ratio is very good.
-
Impossible to download Skype mobile is compatible
-
original title: Chess Titans Why are my moves in Chess Titans not saved to the output on my PC when this function is OK on my laptop?