Boolean() function gives true in all cases
The implementation of the boolean() function in BPEL (version 10.1.2.1.0) have an FATAL ERROR.
boolean(0) gives 1 and
boolean(false) gives 1
I have tried to make a TAR, however I cannot connect to meta-link today.
Regards,
Flemming
Thanks for your answer Clemens.
Perhaps, I missed to send you my test-case.
Try with the following assign, based on the schema below with input and output defined as boolean (in default generated bpel-syncron project):
<assign name="Assign_1">
<copy>
<from expression="boolean(bpws:getVariableData('inputVariable','payload','/client:TestIfProcessRequest/client:input'))"/>
<to variable="outputVariable" part="payload" query="/client:TestIfProcessResponse/client:result"/>
</copy>
</assign>
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/TestIf"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="TestIfProcessRequest">
<complexType>
<sequence>
<element name="input" type="boolean"/>
</sequence>
</complexType>
</element>
<element name="TestIfProcessResponse">
<complexType>
<sequence>
<element name="result" type="boolean"/>
</sequence>
</complexType>
</element>
</schema>
</types>
It gives the result
<TestIfProcessResponse>
<result>true</result>
</TestIfProcessResponse>
no mather what I gives as input in the BPEL Console.
I have tried with 0, 1, true, false.
Regards,
Flemming
Similar Messages
-
To use Boolean function in DECODE or CASE statement
Hi all
I have a scenario where i need to use a boolean function inside DECODE statement. When i tried this way iam getting "ORA-06553: PLS-382: expression is of wrong type".
I doubt whether i can use boolean function inside DECODE or not?
My query will be like this:
select decode(my_fuction( ),'TRUE',1,'FALSE',0) from dual;
Any help is highly appreciated.
Thanks
SriramOverloaded functions must differ by more than their
return type . At the time that the overloaded
function is called, the compiler doesn't know what type
of data that function will return. The compiler cannot,
therefore, determine which version of the function to
use if all the parameters are the same. -
Give me detail functions use boolean function, use detail
give me detail functions use boolean function, use detail func in calculated key figure
Hi,
Adding to that some more few links which helps you are
Defining Formulas:[http://help.sap.com/saphelp_nw70/helpdata/EN/71/0aec3b6e011341e10000000a114084/content.htm]
Percentage Functions:[http://help.sap.com/saphelp_nw70/helpdata/EN/e2/16f13a2f160f28e10000000a114084/content.htm]
Data Functions:[http://help.sap.com/saphelp_nw70/helpdata/EN/e2/16f13a2f160f28e10000000a114084/content.htm]
Boolean Operators:[http://help.sap.com/saphelp_nw70/helpdata/EN/23/17f13a2f160f28e10000000a114084/content.htm]
Technicle Notes About Formula Operators:[http://help.sap.com/saphelp_nw70/helpdata/EN/37/b4393ccab19b57e10000000a114084/content.htm]
Defining Restricted Key Figures :[http://help.sap.com/saphelp_nw70/helpdata/EN/61/d0b143aa26b849b4e79a859ea1d7d1/content.htm]
Defining Calculated Key Figures :[http://help.sap.com/saphelp_nw70/helpdata/EN/13/e072abaddb574284d22361f0b824bf/content.htm]
[http://help.sap.com/saphelp_nw70/helpdata/EN/d3/8057f830a911d4b2be0050dadfb23f/content.htm]
[http://help.sap.com/saphelp_nw70/helpdata/EN/d7/c70540ba5ee569e10000000a155106/content.htm]
Regards,
Rajkandula -
Calling boolean function from tree query
Hi all,
I have placed a tree on my sidebar region from the following query
select PAGE_NO id,
PARENT_PAGE_NO pid,
NAME name,
'f?p=&APP_ID.:'||page_no||':&SESSION.' link,
null a1,
null a2
from #OWNER#.APEX_PAGES
WHERE page_no = :APP_PAGE_ID
AND nvl(navigation,'N') = 'Y'
Its running perfectly fine. Now i have my custom function "isUserAllowed(app_user, name_of_node, isParent)" which returns a boolean expression is the logged in User has access privilege on that node.
How can i run my function inside the tree query so that node is visible only for those values in which my function returns "true"? and not on others?
With Regards,
Sunil BhatiaThe "wrapper" function would actually be pretty easy - just another function to call the one returning the boolean and convert it to some other value, numeric or character. something like (untested)
<pre>
FUNCTION wrapper_function(P_whatever varchar2) return varchar2 IS
v_return_value_c varchar2(5);
BEGIN
r_return_value_c := case boolean_function(p_whatever)
when true then 'true'
else 'false;
return v_return_value_c;
END;
</pre>
Using the function in the WHERE clause could look something like this (untested, but should work if done correctly)
<pre>
select whatever
from your_table
where wrapper_function(whatever) = 'true'
</pre> -
SQL> create or replace function my_func
2 return boolean as
3 x boolean;
4 begin
5 x := true;
6 return x;
7 end;
8 /
Function created.
SQL> select my_func from dual;
select my_func from dual
ERROR at line 1:
ORA-06552: PL/SQL: Statement ignored
ORA-06553: PLS-382: expression is of wrong type
SQL>
Above is what I thought was a simple function that returns a boolean value. I am doing a asp.net project and i need a simple function to call as a test. I have written a simple function that returns an int, string already and i dont understand the error above....
Can some one give me an example of a function that returns a boolean value based around a simple table like the emp table for example. That would be great thanks ( or else tell me whats wrong with my simple ha ! function above)I'd rather put some sort of wrapper on the oracle side. The reason for this is that the application i'm building is designed to allow users run functions or procedures and pass as many arguments as they want to the c# class. This is what I've been working on but there are data type issues arising.
create or replace function convFunc
--funcName varchar2
return number
as
a boolean;
b number;
begin
--a := myFunction();
a:=funcName
--Is there any way I can pass in the name of the function to be called
and concatenate the () brackets to it and assign it to a. I tried
funcName:= funcName||(); but it wont let me do that. The second problem is that as the function returns true or false but the function name comes in as a string there is a type mis match... There has to be some way of solving the problem on the oracle side. Again all I want from the user is the function name and parameters
Sorry if i'm annoying people with similar posts
if a=true then
b:=1;
return 1;
else
b:=0;
return 0;
end if;
end; -
Boolean Function Ifs not giving proper out put
Hi ,
I am using boolean function Ifs in message mapping of one of my scenerio.
My problem is First argument have exist function and if first argument is true it gives value of second argument but if is false , I am passing a Constant value in else condition(3rd argument) it give no out put.Can you suggest how can i resolve it.Hi Mohit,
In your case you need not to use IFs , instead make use of boolean function If , it will work fine for you.
Regards
Nishant Kumar Singh -
HOW TO MAKE A BOOLEAN FUNCTION IN LABVIEW5.0
I want to use a boolean funtion but it does not exist in existing functions?so how can I do it?I final aim is how to make a VALVE boolean function and how to use it?please teach me,experts! Thank you very much!
Hi,
what do you mean by "boolean function"?
For boolean operations you can use
1. Case structure. It is located in Functions->Structures
2. Boolean functions (such as AND, OR, NOT, etc.). They are located in Functions->Boolean
3. Comparison functions (such as equal?, greater?, less?, etc.). They are located in Functions->Comparison
You have to give more info about your problem.
Good luck.
Oleg Chutko. -
Search if a layersets with a specific name exist and execute a function if it is the case
Hello,
How can i write a script that search if a layersets with a specific name exist and execute a function if it is the case?
Some examples?
Many thanks.
Regards.
SebastienThis would check for a LayerSet if a name with DOM code – so it’s fairly slow.
var check = checkForLayersetNamed(app.activeDocument, false, "thisName");
alert (check);
////// function collect all layers //////
function checkForLayersetNamed (theParent, theCheck, theName) {
/* if (!allLayers) {var allLayers = new Array}
else {};*/
for (var m = theParent.layers.length - 1; m >= 0;m--) {
var theLayer = theParent.layers[m];
// apply the function to layersets;
if (theLayer.typename == "ArtLayer") {
// allLayers.push(theLayer)
else {
if (theLayer.name == theName) {theCheck = true};
theCheck = (checkForLayersetNamed(theLayer, theCheck, theName))
// allLayers.push(theLayer);
return theCheck
Below is AM code Paul Riggott posted some time ago in connection with linking Layer Masks.
Re: Automatically re-link layer masks
You could add a check for whether the Layer is a LayerSet, but if the name is the sole distinguishing feature this might work as a basis for your operations.
app.bringToFront();
main();
function main(){
if(!documents.length) return;
linkLayers();
function linkLayers(){
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
var count = executeActionGet(ref).getInteger(charIDToTypeID('NmbL')) +1;
var Names=[];
try{
activeDocument.backgroundLayer;
var i = 0; }catch(e){ var i = 1; };
for(i;i<count;i++){
if(i == 0) continue;
ref = new ActionReference();
ref.putIndex( charIDToTypeID( 'Lyr ' ), i );
var desc = executeActionGet(ref);
var layerName = desc.getString(charIDToTypeID( 'Nm ' ));
var Id = desc.getInteger(stringIDToTypeID( 'layerID' ));
if(layerName.match(/^<\/Layer group/) ) continue;
/* you could insert your operations in an if clause here */ -
Dear All
How I Can test boolean function that return true or false.Hi,
Write a Wrapper Function , that is, another function that is wrapped around your first fucntion, which you can call from SQL, and call it.
CREATE OR REPLACE FUNCTION check_mobile_varchar2 (p_mobile IN VARCHAR2)
RETURN VARCHAR2
IS
return_string VARCHAR2 (5) := 'FALSE';
BEGIN
IF check_mobile (p_mobile)
THEN
return_string := 'TRUE';
END IF;
RETURN return_string;
END check_mobile_varchar2
/To test:
SELECT txt
, CHECK_MOBILE_VARCHAR2 (txt) AS check_mobile
FROM table_x
;This assumes you really want a function that returns a BOOLEAN, and therefore can't be used in SQL. A lot of folks just write functions that return 'TRUE' or 'FALSE' (or 'T' or 'F', 1 or 0) in the first place.
If check_mobile is in a package, check_mobile_varchar2 should be in the same package.
Edited by: Frank Kulash on Mar 13, 2011 11:46 AM
Added RETURN startement. -
How to write Boolean function (If Then Else)?
Hi all,
I have a logic to write in the query. It is:
If (A = 0 and B = 0)
Then 0
Else
If (A = 0 and B > 0)
Then 100
Else
A/B (we want to show %)
How to use boolean function to write this Netted If Else statement? Thank you in advance!Hi
If (A = 0 and B = 0)
Then 0
Else
If (A = 0 and B > 0)
Then 100
Else
A/B (we want to show %)
1. create a formula in the query designer. and use this formula for if - else
( ( (A==0) AND (B==0) ) * 0) + ( ( a==0 ) AND (B >0 ) * 100 + (A/B*100) )
: denotes THEN
+ : denotes ELSE
See if this works.
Assign points if helpfull
From
ManesH -
Can you use boolean function in where clause
Hi,
I have a boolean function. Is it possible to use it in where clause of query.
Eg;
is_prime(13) returns boolean
select 1 from dual where is_prime(13)What about something like this
Create or replace function boolret(id number) return boolean as
begin
If id <10 then
return true;
elsif id>10 and id<100 then
return false;
else
return null;
end if;
end;
1 declare
2 id_cat boolean;
3 begin
4 id_cat:= boolret(8);
5 dbms_output.put_line(id_cat);
6* end;
SQL> /
dbms_output.put_line(id_cat);
ERROR at line 5:
ORA-06550: line 5, column 2:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 5, column 2:
PL/SQL: Statement ignored
It seems PL/Sql doesn't have any datatype like Boolean,But it handles Boolean like datatype.
Regards
Raj deep.A -
How to Use a boolean function in a process
Hi,
I created a boolean function named change_pwd with 3 varchar2 parameters : login_name, old-pwd and new_pwd. I would like to use it in a process but I can't, this is how I do it :<br><br>
select change_pwd (
v('P12_Login'),v('P12_Old_Pwd'),v('P12_New_Pwd')) from dual;
<br><br>
BennI got this error : <br><br>
ORA-06550: line 2, column 8: PLS-00382: expression is of wrong type ORA-06550: line 2, column 1: PLS-00428: an INTO clause is expected in this SELECT statement
<br><br>
and here is my function :<br><br>
create or replace function "CHANGE_PWD"<br>
(p_username in VARCHAR2,<br>
p_old_password in VARCHAR2, <br>
p_new_password in VARCHAR2)<br>
return boolean<br>
is<br>
l_count number;<br>
l_password varchar2(4000);<br>
l_stored_password varchar2(4000); <br>
l_idcontact number;<br>
begin<br>
-- Check to see if the user is in the user table<br>
select count(*) into l_count from CONTACTS where MATRICULE = p_username;<br>
if l_count > 0 then<br>
-- take the stored password<br>
select u.MOTDEPASSE, u.IdContacts into l_stored_password, l_idcontact from <br>UTILISATEURS u, CONTACTS c where u.IdContacts = c.IdContacts AND c.MATRICULE = p_username;<br>
<br>
-- apply the cash function<br>
l_password := user_hash(p_username, p_old_password);<br>
<br>
-- compare the hashed password with the stored password<br>
if l_password = l_stored_password then<br>
-- change password<br>
update UTILISATEURS set MotDePasse = user_hash(p_username, <br>p_new_password) where idcontacts = l_idcontact;
return true;<br>
else<br>
return false;<br>
end if;<br>
else<br>
return false;<br>
end if;<br>
end;<br> -
Why does the Fireworks save for web function give better results than in Photoshop?
Having used the trial version of Fireworks, I have noticed that the save for web function gives greater compression and image quality than saving for web in Photoshop. Why is this?
As Adobe are not continuing in developing Fireworks, does anyone know if will they will improve the save for web function in Photoshop to match the Fireworks version?
Are there any third party companies who anyone can recommend who will process large volumes of images for web?
ThanksOne of my favourite topics ;-P
First, the save for web function in Photoshop has not seen any real updates in a long time. In Fireworks PNG export allows for fully transparent optimized files with indexed 256 or less colours, which is impossible in the save for web function in Photohop. It is unsupported.
This is one of the reasons why Fireworks does a much better job than Photoshop. Another reason is that Photoshop adds meta junk in its exported files, and this also increases the file size (and should be removed, because there are also a number of fields which include information about your setup).
One other caveat is that Photoshop's save for web functions neither allows for a choice in chroma subsampling, and instead decides automatically below a certain quality threshold to degrade the colour sharpness quality. The user has no control over this. (Fireworks also limits the user this way.)
One thing to be careful of: FW's jpg quality setting, and PS's quality settings are very different - a 50 in Photoshop is not the same 50 setting in Fireworks.
For jpg optimization I generally use RIOT (free): http://luci.criosweb.ro/riot/
(When you install, be careful NOT to install the extra junkware!)
Fireworks cannot change the chroma subsampling to 4:2:0, which does degrade the quality a bit compared to RIOT and Photoshop in my experience. Photoshop adds useless meta information, even if the user tells it not to do that. RIOT allows you to remove that information, saving 6k. RIOT also offers an automatic mode that optimizes existing jpg images without degrading the quality further, and often saves 10k or more, depending on the images.
Interestingly enough, in my tests exported Fireworks jpg images are always reduced in file size by RIOT, due to FW's jpg export limitations, without any image degradation.
In my tests FW's jpg quality versus file size turns out to be the worst of all three. RIOT generally wins, or is at least on par with Photoshop.
As for PNG export, Photoshop's save for web function is quite abysmal. No 256 colour full transparency export is possible, while Fireworks does support this.
Having said that, there is a free alternative that leaves both Photoshop AND Fireworks in the dust: Color Quantizer. http://x128.ho.ua/color-quantizer.html
CQ is an amazing little tool: with it anyone can create PNG files with full transparency and reduced to ANY number of colours! It means that a 512 colour PNG with full transparency is now very easy to do. On top of that, for more difficult images a simple quality mask brush tool allows the user to control and retain even small colour details in a PNG, while reducing the file size to an absolute minimum.
CQ is one of the best kept secrets of a Web Developer's toolkit. And it is free!
Both RIOT and Color Quantizer have a built-in batch mode. Both are available for WIndows. Not for Mac. If you are on a Mac, try imageOptim. Not nearly as good as RIOT and CQ, but quite passable.
PS to be fair, the newest versions of Photoshop do allow for export of 8bit PNGs with full transparency through the use of its Generator functionality. But again, it cannot compete with CQ. And as far as I am aware, Generator cannot be used in Photoshop's batch processing (which, btw, is very slow! For simpler daily image processing tasks I have to do in batches, I prefer IrfanView, which is lightning fast! IrfanView). -
Function module to retrieve all the personnel numbers in the eval path
Hi all,
I want to retrieve all the personnel numbers that fall in the evaluation path.
Like if my evaluation path is "B002" ( eval path for relationship is line supervisor of ), I want a function module that retrieves all the pernrs in this wval path up to the bottom level.
if A reports to B and B reports to C and C reports to D . I want a function module to retrieve(either positions or pernrs) C, B and A when I run it for position D.
any help??
regards
Sam
regards
SamHi
U can use FM RH_STRUC_GET to get the pernr in the evaluation path
data : IT_RESULT_TAB TYPE STANDARD TABLE OF SWHACTOR .
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
ACT_OTYPE = C_OTYPE
ACT_OBJID = W_POSIT
ACT_WEGID = C_WEGID (relation B002 like )
ACT_BEGDA = W_BEGDA
ACT_ENDDA = W_BEGDA
ACT_TDEPTH = 1 ( depath 1, 2, etc )
TABLES
RESULT_TAB = IT_RESULT_TAB .
Nb : Give points if it worths -
Best design for Boolean function from simple query
Hello,
what is the most efficient, shorter, readable, simple way to make a boolean function that simply return true or false from a simple query that return 0 or 1 to n records?
Is this solution using a cursor's the best (working...):
FUNCTION is_date_present (p_date IN DATE)
RETURN BOOLEAN
IS
CURSOR chk_cursor
IS
SELECT COUNT (*)
FROM target_dates
WHERE target_date = p_date;
nb NUMBER := 0;
BEGIN
OPEN chk_cursor;
FETCH chk_cursor
INTO nb;
CLOSE chk_cursor;
IF nb >= 1
THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;Performance, clarity and simplicity are important...
ThanksWell, I prefer (not tested):
FUNCTION is_date_present (p_date IN DATE)
RETURN BOOLEAN
IS
nb NUMBER := 0;
BEGIN
SELECT COUNT (*)
INTO nb
FROM target_dates
WHERE target_date = p_date;
IF nb >= 1 THEN
RETURN TRUE;
LSE
RETURN FALSE;
IF;
END;Regards,
MiguelWhy count multiple records when you only care if you get at least 1 occurrence? Just wasted cycles.
FUNCTION is_date_present (p_date IN DATE)
RETURN BOOLEAN
IS
nb NUMBER := 0;
BEGIN
SELECT COUNT (*)
INTO nb
FROM DUAL
WHERE EXISTS
SELECT NULL
FROM target_dates
WHERE target_date = p_date
IF nb >= 1 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;Or you could just add a ROWNUM = 1 on to yours, either way.
Maybe you are looking for
-
I have a whole lot of questions in regards to Jabber, please see below: Are there API's available for the Jabber application and AnyConnect client? Is there a way to configure Jabber via a hyperlink? Much like how CUMA used to do it for Blackberrys.
-
Mid-2009 MacBook Pro sees internal SATA hard drive, but will not boot from or format
I inherited a Mid-2009 MacBook Pro (15-inch, 2.53 GHz model) with a very strange issue. It first presented itself as not being able to boot from the internal SATA hard drive that came with the computer. Nothing I tried could get it to boot, so I assu
-
Regarding Quotation & purchase order
Dear experts, I want to get clear how purchase order play a role in creating a quotation. So long i heard of process Enquiry->Quotation->Sale order -> Delivery->Billing->FI posting. But i have no idea how purchase order is used to create quotation. P
-
When I reinstall os x from the dvd, will i lose all my photos stored on my hard drive?
-
Dreamweaver 8 Off Topic Problem
I am looking for some help with an ASP form page in Dreamweaver to create an invoice in QuickBooks Enterprise 2007 using an ODBC connection. I can already create a new custoemr and edit that customer. But I need to create and modify invoices to Quick