Invoking of functions with number parameters
Oracle 9i PL/SQL dictates that
if the constraints of the formal parameter do not suffice actual parameter constraints,runtime error is raised.
I tried the following code snippet to check this out.
test_returntype7 returns a floationg point literal
test_returntype8 returns a floationg point number
SQL> create or replace function test_returntype7
2 return number
3 as
4 begin
5 null;
6 return 21.345;
7 end test_returntype7;
8
9 /
Function created.
SQL> declare
2 v_output number(1);
3 begin
4 v_output := test_returntype7;
5 dbms_output.put_line(v_output);
6 end;
7 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at line 4
--This is fine
SQL> declare
2 v_output number(2);
3 begin
4 v_output := test_returntype7;
5 dbms_output.put_line(v_output);
6 end;
7 /
--This is fine
21
PL/SQL procedure successfully completed.
--This is fine
SQL> declare
2 v_output number(3);
3 begin
4 v_output := test_returntype7;
5 dbms_output.put_line(v_output);
6 end;
7 /
21
--This is fine
PL/SQL procedure successfully completed.
SQL> declare
2 v_output number(2,3);
3 begin
4 v_output := test_returntype7;
5 dbms_output.put_line(v_output);
6 end;
7 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at line 4
--Why is this not working
SQL> declare
2 v_output number(2,10);
3 begin
4 v_output := test_returntype7;
5 dbms_output.put_line(v_output);
6 end;
7 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at line 4
--Why is this not working
SQL> create or replace function test_returntype8
2 return number
3 as
4 v_num number(2,3);
5 begin
6 v_num := 21.345;
7 return v_num;
8 end test_returntype8;
9 /
Function created.
SQL> declare
2 v_output number(2);
3 begin
4 v_output := test_returntype8;
5 dbms_output.put_line(v_output);
6 end;
7
8 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at "CERT.TEST_RETURNTYPE8", line 6
ORA-06512: at line 4
--Why is this not working
SQL>
SQL> declare
2 v_output number(2,3);
3 begin
4 v_output := test_returntype8;
5 dbms_output.put_line(v_output);
6 end;
7
8 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at "CERT.TEST_RETURNTYPE8", line 6
ORA-06512: at line 4
--Why is this not working
SQL> declare
2 v_output number(3);
3 begin
4 v_output := test_returntype8;
5 dbms_output.put_line(v_output);
6 end;
7 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at "CERT.TEST_RETURNTYPE8", line 6
ORA-06512: at line 4
--Why is this not working
Could any body clarify the behaviour of code snippets
Thanks in advance
Ann.
KK,
I tried the following
SQL> declare
2 v_output number(4,2);
3 begin
4 v_output := test_returntype7;
5 dbms_output.put_line(v_output);
6 end;
7 /
PL/SQL procedure successfully completed.
This is fine.
SQL> declare
2 v_output number(4,2);
3 begin
4 v_output := test_returntype8;
5 dbms_output.put_line(v_output);
6 end;
7 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at "CERT.TEST_RETURNTYPE8", line 6
ORA-06512: at line 4
Why is this not working
What do you mean by precision should be a part of scale?
I tried this also
SQL> declare
2 v_output number(5,3);
3 begin
4 v_output := test_returntype8;
5 dbms_output.put_line(v_output);
6 end;
7 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at "CERT.TEST_RETURNTYPE8", line 6
Thanks,
Ann.
Similar Messages
-
Question about function with in parameters
Hello,
I have a question about functions with in-parameters. In the HR schema, I need to get the minimum salary of the job_id that is mentioned as an in-parameter.
this is what I am thinking but I dont know if it's correct or not or what should I do next!
create or replace function get_minimum_salary (i_job_id in varchar2)
return number
as
begin
SELECT min_salary INTO min_sal
FROM jobs
where job_id = get_minimum_salary(xy);
RETURN i_job_id;
end get_minimum_salary;
thanks in advance
EDIT
Thanks for your help all.
Is it possible to add that if the i_job_id which is the in type parameter does not have a minimum salary then use the following function to register an error:
create or replace procedure insert_error (i_error_code in number,
i_error_message in varchar2)
as
begin
insert into error_table (error_user, error_date, error_code, error_message)
values (user,sysdate,i_error_code,i_error_message);
end insert_error;
This function is basically to say that an error has occured and to register that error, at the same time I need to print out the error using the dbms_out.put_line.
Any ideas of how to do that?
Thanks again
Edited by: Latvian83 on Jun 1, 2011 5:14 AMHI
I have made little bit changes in ur code. try this
create or replace function get_minimum_salary (i_job_id in varchar2)
return number
as
v_Min_sal jobs.salary%type=0;---- Variable declaration
begin
SELECT min_salary INTO v_ min_sal
FROM jobs
where job_id = i_job_id;
RETURN v_Min_sal;
end get_minimum_salary;
Regards
Srikkanth.M -
Function with incomplete parameters
I create a function with many parameters
and I call this function through my application
but when I call function I must declare all parameter inside this function like
ddd("a","b",0,0,0,0,0,0,0)
is there a method let function set a default value for parameter if code didn't declare itYou can send just few first parameters and the rest will be passed as false. If you need to pass, say, first and 7th parameter, then you put 6 commas between values, as there is no named parameters in VFP and all parameters are passed by position.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
Trouble invoking Axis service with multiple parameters
Hallo Java experts,
I have a problem with Axis 1.2RC2 (and Tomcat 5.0.19, JDK 1.5, Win XP) that might be quite simple, but I'm not so experienced and running out of ideas.
Everything works fine as long as I use a single Parameter. But I can't invoke service methods with more parameters, independent of the parameters' (simple) types! Different exceptions are thrown, depending on the way I invoke the service. It's either ...
- a java.lang.IllegalArgumentException (case 1)
"Tried to invoke method public java.lang.String test.server.TestSoapBindingImpl.printLongs(long,long) with arguments java.lang.Long,null. The arguments do not match the signature."
- or an org.xml.sax.SAXException (case 2)
"SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize."
Here's an example of a simple web service, that takes two longs and should return a string. In case 1 the service is invoked using a service locator in case 2 with a 'Call' object and explicitly set parameter types.
Thanks in advance for your help!
Dave
service[b]
public class TestSoapBindingImpl implements test.server.Test{
public String printLongs(long long_1, long long_2){
return "long_1 = " +long_1 +", long_2 = " +long_2;
[b]case 1
client
public class TestClient {
public static void main (String[] args) throws Exception {
TestService service = new TestServiceLocator();
Test testProxy = service.gettest();
long longVal = 1L;
response = testProxy.printLongs(longVal, longVal);
System.out.println(response);
SOAP messsage
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<in6 xmlns="urn:TestNS">1</in6>
<in7 xmlns="urn:TestNS">1</in7>
</soapenv:Body>
</soapenv:Envelope>
Axis' log file
Part of the log, where only the first argument of 'printLongs' is properly converted before the exception is thrown.
17886 org.apache.axis.utils.JavaUtils
- Trying to convert java.lang.Long to long
17886 org.apache.axis.i18n.ProjectResourceBundle
- org.apache.axis.i18n.resource::handleGetObject(value00)
17886 org.apache.axis.providers.java.RPCProvider
- value: 1
17886 org.apache.axis.i18n.ProjectResourceBundle
- org.apache.axis.i18n.resource::handleGetObject(dispatchIAE00)
17986 org.apache.axis.providers.java.RPCProvider
- Tried to invoke method public java.lang.String test.server.TestSoapBindingImpl.printLongs(long,long) with arguments java.lang.Long,null. The arguments do not match the signature.
java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:384)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:281)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:319)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:450)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:285)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:653)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:301)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
case 2
client
public class TestClient2
public static void main(String [] args) {
try {
String endpoint =
"http://localhost:1234/axis1.2rc2/services/test";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("urn:TestNS", "printLongs") );
call.addParameter("in6",
org.apache.axis.Constants.XSD_LONG,
javax.xml.rpc.ParameterMode.IN);
call.addParameter("in7",
org.apache.axis.Constants.XSD_LONG,
javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.Constants.XSD_STRING);
String response = (String) call.invoke( new Object[] { 1L, 1L } );
System.out.println(response);
} catch (Exception e) {
System.err.println(e.toString());
SOAP messsage
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:printLongs soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:TestNS">
<in6 href="#id0"/>
<in7 href="#id0"/>
</ns1:printLongs>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef>
</soapenv:Body>
</soapenv:Envelope>
Exception
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:143)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1031)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1140)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:238)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:386)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:148)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:319)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:450)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:285)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:653)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:301)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
....Dave, not sure if you still are looking for an answer but i hate seeing unreplied posts so i felt i needed to post something. I'm just beginning with this stuff as well so take my suggestions with a grain of salt....or a beer. Anyways, case 2 would show that you are getting your parameters through properly because the "deserialization" errror is targetted towards the soap reply. Most likely you are trying to receive back a none primitive type. :-D i.e. such as the problem that i'm having.
hope that helps somewhat.
graeme. -
How to invoke a function with arguments in JSTL expressions
Hi ,
I want to know how to send arguments in the JSTL expression.
I have a scenario like this
for (int i=0; i<nicList.size(); i++)
NavigationItemControl nic = nicList.get(i);
ni = nic.getNavigationItem();
//scr
if (nic.isAvailable(Mask.SYSTEM))
{ %>
<option value="<%=ni.getInternalHandle()%>" <% if(pi.getNavigationItemHandle().equals(ni.getInternalHandle())) {%>selected<%}%> ><%=nic.getLabel()%></option>
<%
} I was changed these code into JSTL ,the new one is
<c:forEach var="nic" items="${nicList}">
<c:set var="ni" value="${nic.navigationItem}"/>
<c:set var="nicAvailableMaskSystem" value="${*nic.available*}"/>
<c:set var="navigationItemHandle" value="true" />
<c:if test="${nicAvailableMaskSystem}">
<option <c:if test="${pi.navigationItemHandle==ni.internalHandle}"> selected </c:if> value="${ni.internalHandle}" >
${nic.label}
</option>
</c:if>
</c:forEach>in the above code I have problem with nic.isAvailable(Mask.SYSTEM),
Can any one help me on this how can I invoke a function in JSTL with arguments.
-BhaskarJSTL can only handle getter/setter methods. You can't pass parameters to the methods.
There are a couple of ways around this
1 - set up "mask" as a seperate attribute of the NavigationItemControl bean.
ie getMask() setMask()
and then have your isAvailable method as
public boolean isAvailable(){
return internalIsAvailable(getMask());
}Another solution is to define a static function and invoke it as a function.
public static boolean navigationAvailable(NavigationItemControl, Mask);
What does the isAvailable() method do? How complicated is it?
Hope this helps,
evnafets -
Invoke RFC function without input parameters
Is it possible to invoke RFC function that doesn't have input parameters? It returns all data from reference.
Hi Denis,
pls keep in mind that no reference parameter is allowed in RFC, you have to check that "Pass Value" flag.
Thanks
Luis -
Parallel Flow invokes async services with incorrect parameters
Hi
I'm calling an async service using 2 partnerlinks in a parallel flow.
The input variables are being assigned correctly but one of the invokes is using the wrong values.
The problem appears to be around the use of a shared variable (Invoke_initiate_InputVariable) that is 'copied' to each of the invoke variables
On invocation both services are iincorrectly nvoked with:
<Invoke_initiate_InputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<HumanTaskProcessRequest xmlns="http://itv.com/HumanTask">
<Production/>
<HumanTask>
<Title>Title2</Title>
<Priority>2</Priority>
<UserGroups>STC</UserGroups>
</HumanTask>
</HumanTaskProcessRequest>
</part>
</Invoke_initiate_InputVariable>
I can get the process to work if I remove all references to the variable Invoke_initiate_InputVariable - can anyone explain this behaviour?
Example BPEL code:
<process name="ParallelTest" targetNamespace="http://itv.com/ParallelTest"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:ns1="http://itv.com/HumanTask"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://itv.com/ParallelTest"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
<partnerLinks>
<partnerLink name="client" partnerLinkType="client:ParallelTest"
myRole="ParallelTestProvider"
partnerRole="ParallelTestRequester"/>
<partnerLink myRole="HumanTaskRequester" name="HumanTask_1"
partnerRole="HumanTaskProvider"
partnerLinkType="ns1:HumanTask"/>
<partnerLink myRole="HumanTaskRequester" name="HumanTask_2"
partnerRole="HumanTaskProvider"
partnerLinkType="ns1:HumanTask"/>
</partnerLinks>
<variables>
<variable name="inputVariable"
messageType="client:ParallelTestRequestMessage"/>
<variable name="outputVariable"
messageType="client:ParallelTestResponseMessage"/>
<variable name="Invoke_initiate_InputVariable"
messageType="ns1:HumanTaskRequestMessage"/>
<variable name="Invoke_1_initiate_InputVariable"
messageType="ns1:HumanTaskRequestMessage"/>
<variable name="Invoke_2_initiate_InputVariable"
messageType="ns1:HumanTaskRequestMessage"/>
<variable name="Receive_1_onResult_InputVariable"
messageType="ns1:HumanTaskResponseMessage"/>
<variable name="Receive_2_onResult_InputVariable"
messageType="ns1:HumanTaskResponseMessage"/>
</variables>
<sequence name="main">
<receive name="receiveInput" partnerLink="client"
portType="client:ParallelTest" operation="initiate"
variable="inputVariable" createInstance="yes"/>
<assign name="Assign_2">
<copy>
<from expression="'A Title'"/>
<to variable="Invoke_initiate_InputVariable" part="payload"
query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Title"/>
</copy>
<copy>
<from expression="5"/>
<to variable="Invoke_initiate_InputVariable" part="payload"
query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Priority"/>
</copy>
<copy>
<from expression="'GRA'"/>
<to variable="Invoke_initiate_InputVariable" part="payload"
query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:UserGroups"/>
</copy>
</assign>
<flow name="Flow_1">
<sequence name="Sequence_1">
<assign name="Assign_1">
<copy>
<from variable="Invoke_initiate_InputVariable"/>
<to variable="Invoke_2_initiate_InputVariable"/>
</copy>
<copy>
<from expression="'Title2'"/>
<to variable="Invoke_2_initiate_InputVariable"
part="payload"
query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Title"/>
</copy>
<copy>
<from expression="2"/>
<to variable="Invoke_2_initiate_InputVariable"
part="payload"
query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Priority"/>
</copy>
<copy>
<from expression="'STC'"/>
<to variable="Invoke_2_initiate_InputVariable"
part="payload"
query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:UserGroups"/>
</copy>
</assign>
<invoke name="Invoke_2" partnerLink="HumanTask_2"
portType="ns1:HumanTask" operation="initiate"
inputVariable="Invoke_2_initiate_InputVariable"/>
<receive name="Receive_2" partnerLink="HumanTask_2"
portType="ns1:HumanTaskCallback" operation="onResult"
variable="Receive_1_onResult_InputVariable"
createInstance="no"/>
</sequence>
<sequence name="Sequence_1">
<assign name="Assign_1">
<copy>
<from variable="Invoke_initiate_InputVariable"/>
<to variable="Invoke_1_initiate_InputVariable"/>
</copy>
<copy>
<from expression="'Title1'"/>
<to variable="Invoke_1_initiate_InputVariable"
part="payload"
query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Title"/>
</copy>
<copy>
<from expression="3"/>
<to variable="Invoke_1_initiate_InputVariable"
part="payload"
query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Priority"/>
</copy>
<copy>
<from expression="'NTC'"/>
<to variable="Invoke_1_initiate_InputVariable"
part="payload"
query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:UserGroups"/>
</copy>
</assign>
<invoke name="Invoke_1" partnerLink="HumanTask_1"
portType="ns1:HumanTask" operation="initiate"
inputVariable="Invoke_1_initiate_InputVariable"/>
<receive name="Receive_1" partnerLink="HumanTask_1"
portType="ns1:HumanTaskCallback" operation="onResult"
variable="Receive_2_onResult_InputVariable"
createInstance="no"/>
</sequence>
</flow>
<invoke name="callbackClient" partnerLink="client"
portType="client:ParallelTestCallback" operation="onResult"
inputVariable="outputVariable"/>
</sequence>
</process>Thanks Marc, I've done what you suggested but it hasn't fixed the problem.
Here is the updated process with scopes and local variables:
<process name="ParallelTest" targetNamespace="http://itv.com/ParallelTest" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:ns1="http://itv.com/HumanTask" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:client="http://itv.com/ParallelTest" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
<partnerLinks>
<partnerLink name="client" partnerLinkType="client:ParallelTest" myRole="ParallelTestProvider" partnerRole="ParallelTestRequester"/>
<partnerLink myRole="HumanTaskRequester" name="HumanTask_1" partnerRole="HumanTaskProvider" partnerLinkType="ns1:HumanTask"/>
<partnerLink myRole="HumanTaskRequester" name="HumanTask_2" partnerRole="HumanTaskProvider" partnerLinkType="ns1:HumanTask"/>
</partnerLinks>
<variables>
<variable name="inputVariable" messageType="client:ParallelTestRequestMessage"/>
<variable name="outputVariable" messageType="client:ParallelTestResponseMessage"/>
<variable name="Invoke_initiate_InputVariable" messageType="ns1:HumanTaskRequestMessage"/>
<variable name="Receive_1_onResult_InputVariable" messageType="ns1:HumanTaskResponseMessage"/>
<variable name="Receive_2_onResult_InputVariable" messageType="ns1:HumanTaskResponseMessage"/>
</variables>
<sequence name="main">
<receive name="receiveInput" partnerLink="client" portType="client:ParallelTest" operation="initiate" variable="inputVariable" createInstance="yes"/>
<assign name="Assign_2">
<copy>
<from expression="'A Title'"/>
<to variable="Invoke_initiate_InputVariable" part="payload" query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Title"/>
</copy>
<copy>
<from expression="5"/>
<to variable="Invoke_initiate_InputVariable" part="payload" query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Priority"/>
</copy>
<copy>
<from expression="'GRA'"/>
<to variable="Invoke_initiate_InputVariable" part="payload" query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:UserGroups"/>
</copy>
</assign>
<flow name="Flow_1">
<sequence name="Sequence_2">
<scope name="Scope_2">
<variables>
<variable name="Invoke_2_initiate_InputVariable" messageType="ns1:HumanTaskRequestMessage"/>
</variables>
<sequence name="Sequence_2">
<assign name="Assign_1">
<copy>
<from variable="Invoke_initiate_InputVariable"/>
<to variable="Invoke_2_initiate_InputVariable"/>
</copy>
<copy>
<from expression="'Title2'"/>
<to variable="Invoke_2_initiate_InputVariable" part="payload" query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Title"/>
</copy>
<copy>
<from expression="2"/>
<to variable="Invoke_2_initiate_InputVariable" part="payload" query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Priority"/>
</copy>
<copy>
<from expression="'STC'"/>
<to variable="Invoke_2_initiate_InputVariable" part="payload" query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:UserGroups"/>
</copy>
</assign>
<invoke name="Invoke_2" partnerLink="HumanTask_2" portType="ns1:HumanTask" operation="initiate" inputVariable="Invoke_2_initiate_InputVariable"/>
<receive name="Receive_2" partnerLink="HumanTask_2" portType="ns1:HumanTaskCallback" operation="onResult" variable="Receive_2_onResult_InputVariable" createInstance="no"/>
</sequence>
</scope>
</sequence>
<sequence name="Sequence_1">
<scope name="Scope_1">
<variables>
<variable name="Invoke_1_initiate_InputVariable" messageType="ns1:HumanTaskRequestMessage"/>
</variables>
<sequence name="Sequence_3">
<assign name="Assign_1">
<copy>
<from variable="Invoke_initiate_InputVariable"/>
<to variable="Invoke_1_initiate_InputVariable"/>
</copy>
<copy>
<from expression="'Title1'"/>
<to variable="Invoke_1_initiate_InputVariable" part="payload" query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Title"/>
</copy>
<copy>
<from expression="3"/>
<to variable="Invoke_1_initiate_InputVariable" part="payload" query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:Priority"/>
</copy>
<copy>
<from expression="'NTC'"/>
<to variable="Invoke_1_initiate_InputVariable" part="payload" query="/ns1:HumanTaskProcessRequest/ns1:HumanTask/ns1:UserGroups"/>
</copy>
</assign>
<invoke name="Invoke_1" partnerLink="HumanTask_1" portType="ns1:HumanTask" operation="initiate" inputVariable="Invoke_1_initiate_InputVariable"/>
<receive name="Receive_1" partnerLink="HumanTask_1" portType="ns1:HumanTaskCallback" operation="onResult" variable="Receive_1_onResult_InputVariable" createInstance="no"/>
</sequence>
</scope>
</sequence>
</flow>
<invoke name="callbackClient" partnerLink="client" portType="client:ParallelTestCallback" operation="onResult" inputVariable="outputVariable"/>
</sequence>
</process> -
Java function with oracle parameters
Hi all,
Does someone knows why i have an error using the java function setDouble with the NLS_TERRITORY = FRANCE and not with NLS_TERRITORY = AMERICA ?
what have i do to correct it ?
Thanks in advanceWhat is the output of the following, both when
NLS_TERRITORY = FRANCE and with NLS_TERRITORY = AMERICA ?
SQL> select to_number('123.45') from dual ;
TO_NUMBER('123.45')
123.45
1 row selected.
SQL> select to_number('123,45') from dual ;
select to_number('123,45') from dual
ERROR at line 1:
ORA-01722: invalid number
SQL> -
Hello! As stated above, I have the following problem: I have 2 sets (different systems) of measurement data (Voltages measured as functions of applied frequency). I would like to make curve fits with Levenber-Marquardt-method to both datasets (the datasets have the same x-values = frequencies), fitting the 2 datasets to their own separate model functions. However, the different model functions should have same values for the shared parameters (this prevents me from doing 2 totally separate curve fittings).
I have LabVIEW version 7.1, if anybody could help me with the problem, I would appreciate it very much. Thank you!Would you like to try this:
http://forums.ni.com/t5/LabVIEW/levenberg-Marquardt/td-p/668782
http://zone.ni.com/reference/en-XX/help/371361G-01/gmath/nonlinear_curve_fit/
http://digital.ni.com/public.nsf/allkb/BACF6FDF1B40993686256CC300657BA4
With LV 7.1, I don't know if we have a such feature with that version. Please check out for the latest LV versions.
BR,
Make Nguyen
NI Finland Technical Support -
Oracle Function with out parameters
Hi, I'm trying to access a stored function on an oracle server with 2 out parameters, 2 in parameters and an out ref cursor.
PL/SQL looks like this
nStatusCode OUT INTEGER,
sStatusMsg OUT VARCHAR2,
sUsrNr IN VARCHAR2,
sPassword IN VARCHAR2,
crsReturn OUT pck_cursor.retRecordSet
I drag the function onto dataset designer and it successfully maps the results to the datatable, it maps datatypes for first out parameters to decimal and string.
the method genearated for fill by looks like (out decimal?,out string,string, string, out object)
problem is, everytime i try to call this function it gives me casting exceptions for the first 2 out parameters, for the decimal it's not specified in more detail. for the other one it says there was an exception casting from OracleString to string. If I change the PL/SQL function to leave the first 2 out parameters away it works fine. Do I manually need to change the TableAdapter definitions??Hi,
I think I found the problem but not a good solution. It seems to be a problem with auto code generation for TableAdapters in the Dataset wizard. In the Parameter Definition for the Command I set DbType.Decimal and DbType.Sting for the SqlDbtype Property of the out params. The GetData and Fill Method is generated with Fill(out decimal? out1, out string out2). When I look in the generated code ith first sets the SqlDbtype as written but after this also the OracleDbtype to OracleDbType.Decimal and OracleDbType.Varchar2. The casting these types before returning the throws the exception. Any idea how to change this behavior? -
Select from function with named parameters doesn't work
Hello,
I'm trying to execute the next sql statement:
SELECT mypack.getvalue(user_id => 231, status => 'closed') AS someAlias FROM DUAL;
I'm getting the next Error:
Error: ORA-00907: missing right parenthesis
But the next works fine:
SELECT mypack.getvalue(231,'closed') AS someAlias FROM DUAL;
What I'm doing wrong?
Is there a way to call a Function and return it's result as a single-row query?
Thanks for any suggestions.Thanks for your answers.
Just want to explain what I want to accomplish:
I want to create PL/SQL statement which:
1) Calls Function in named notation way;
2) Returns a query which contains a single row - a Function result.
I know in Transact-SQL I can accomplish this the next way:
DECLARE @return_value INT
EXEC[myproc]
@id=2,
@status='ok',
@ret_param=@return_value OUTPUT
SELECT @return_value AS my_return_value
The last SELECT call returns a query with one row in it.
How can I do the same in Oracle?
Thanks a lot! -
Custom sequences or functions with default parameters
Hello!
Using the Stimulus Profile Editor, I am finding that using a sequence within a sequence to be cumbersome. This is because it requires you to declare in the main sequence, every parameter that the sub-sequence will use.
I would like to have a 'configure' sequence whose parameters are all default and do not need to be declared or passed through by every sequence that calls it. Right now, if I change one argument of the 'configure' sequence I have to go to every sequence that references it, and update the parameters and the sequence call.
Essentially, I would just like an independent subfuction that has no inputs and returns a few outputs. If the profile editor is not capable of this, what would be my next best option?
Thanks!Hello,
You can take advantage of the new features in NIVS 2014 to help against re-defining default values for your RT Sequences. Take a look at the documentation in 2014 which explains in more detail how you can use channel references in your sequences:
What's New in NI VeriStand 2014
http://zone.ni.com/reference/en-XX/help/372846H-01/veristand/whats_new/
Variables for Reading and Writing Channels in a Real-Time Sequence
http://zone.ni.com/reference/en-XX/help/372846H-01/veristand/spe_vars_chref_parameters/
Example 1a: Reading and Writing Channels Directly from a Real-Time Sequence
http://zone.ni.com/reference/en-XX/help/372846H-01/veristand/spe_tutorial_example1a/
By using channel references, you won't have to re-set default parameters. Let me know if you have any questions.
Sincerely,
Aldo A
Applications Engineer
National Instruments -
Invoking Remote Function Module.
Hi
I am invoking a remote function module from a web dynpro application(External Appln ).
The FM contains the following code snippet
first it inserts the parameters passed into a table
and then the code is
SUBMIT <report name > with parameter passing.
when i comment out the Submit statement and invoke the function module the parameters get populated in the table..but when i enable the SUBMIT statement the same set of parameters dont even get populated in the table. and i get the following exception in the logs of SAP J2ee appln server .
WDDynamicRFCExecuteException: Screen output without connection to user. , error key: RFC_ERROR_SYSTEM_FAILURE
i am not able to find a solution to this problem .
Please help.
regards
Nilesh Taunk.HI
GOOD
GO THROUGH THIS LINKS,THEY MIGHT HELP YOU TO GIVE YOU SOME MORE IDEA.
Re: RFC Error While Invoking A Remote Function Module.
RFC Error While Invoking A Remote Function Module.
http://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5303c390-0201-0010-e0b2-bfae018377f0
THANKS
MRUTYUN -
Complicated PL/SQL questions that involves function with in type parameter
Hello,
I have a question about functions with in-parameters. In the HR schema, I need to get the minimum salary of the job_id that is mentioned as an in-parameter.
this is what I am thinking but I dont know if it's correct or not or what should I do next!
create or replace function get_min_salary (i_job_id in varchar2)
return number
as
min_sal jobs.min_salary%type;
begin
SELECT min_salary INTO min_sal
FROM jobs
where job_id = i_job_id;
RETURN min_sal;
end get_min_salary;if the i_job_id which is the in type parameter does not have a minimum salary then use the following function to register an error:
create or replace procedure insert_error (i_error_code in number,
i_error_message in varchar2)
as
begin
insert into error_table (error_user, error_date, error_code, error_message)
values (user,sysdate,i_error_code,i_error_message);
end insert_error;This function is basically to say that an error has occured and to register that error, at the same time I need to print out the error using the dbms_out.put_line.
Any ideas of how to do that?
Thanks in advance>
minimum salary of the job_id
>
may be
SELECT min(min_salary) INTO min_sal
FROM jobs
where job_id = i_job_id;
if the i_job_id which is the in type parameter does not have a minimum salary then use the following function to register an error:why error?
This function is basically to say that an error has occured and to register that error, at the same time I need to print out the error using the dbms_out.put_line.
create or replace procedure insert_error (i_error_code in number,
i_error_message in varchar2)
as
begin
insert into error_table (error_user, error_date, error_code, error_message)
values (user,sysdate,i_error_code,i_error_message);
-- this
dbms_out.put_line('this');
end insert_error; -
Executing a Webi report with input parameters
How can I schedule a BO4 webi report dynamically? I have a set of tables which contains the required parameters for the reports and I need implement a mechanism which will invoke these reports with the parameters. Then I would want the reports to be placed at a specified location. I am told that this can be achieved using webservices integration. I just dont know how. Please advise.
Hi Sukanto ,
Check the below link for dynamic prompt during scheduling
http://scn.sap.com/community/businessobjects-web-intelligence/blog/2014/01/24/dynamic-default-values-with-prompt-in-webi-reports-based-on-bex-queries-in-bo
and file location check below screenshot
It might help you.
Regards,
Anish
Maybe you are looking for
-
I want to find out the medium Crete of gold
Hi my name is seng I will like to check my contract killer zombies 2 why I buy the "medium crate of gold " I dint get it from yesterday night at 7.30pm to today 6.25 pm can I now wht happen. I call to hotline but there say I have to use by email can
-
How do you tell which build you are running?
Build? Renee "MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me
-
Problem saving to pdf in print mode.
Greetings. I am switching to Firefox to avoid frequent Safari crashes. However, when I attempt to save to a pdf from a web page, using the "Print" function, characters in the font in the web page are replaced in the pdf. For example, the word "proteg
-
The SIM card already in it is international
-
Weird processing in Oracle B2B
i've sent 1000 msgs out via AS2 to my TP, then all the files in WaitAck state. after a few minutes, i saw 1 of the 1000 files(msgid = 6511) turn to Complete state. but when i check again later, file 6511 turned back to WaitAck and retrycount became 2