How to invoke math functions from dbx?
Is there an easy way to invoke math functions from dbx? If I try, for example, to call sqrt I get meaningless results:
(dbx) print sqrt(4.0)
sqrt(4) = 1074790400
(dbx)
This is from code which uses sqrt, so sqrt should be accessible. Does this need some kind of cast?
It turns out that this is a bit different than it looks: dbx is indeed able to invoke functions invoked in this way correctly; dbx just fails to print a sensible return value.
I tried with the following small function:
#include <stdio.h>
int printme(double x) {
printf("This is %g\n",x);
return (int)2*x;
Compiling this without -g, linking this with some hello world program and invoking the function from dbx gives
(dbx) print ((int (*)(double))printme)(4.0)
This is 4
((int (*)(double)) printme)(4) = &(noname)(double) at 0x8
(dbx)
The line "This is 4" clearly indicates that the function has been invoked correctly. Just the printed return value is meaningless. In this case, it is even possible to construct expressions with the return value:
(dbx) print 5 + ((int (*)(double))printme)(4.0)
This is 4
5+((int (*)(double)) printme)(4) = 13
i.e. dbx "knows" the correct return value 8. This does, however, apparently not work with return values of type double (i.e. in the original sqrt-Example).
I have therefore submitted a bug report with bugs.sun.com; I will post the BugID when (and if) this has been accepted.
Similar Messages
-
How to - invoke OAF function from outside oracle with parameters?
I have an oaf page, that does simple create/update/view functions for set of records based on custom db.
currently user has to login to oracle apps, go to resp> invoke the page> search the part number > look up all the existing records(part#,set#,rev)> click on view link to view details of specific record.
The requirement is : to invoke a set of record outside oracle.
for example : user goes on network folder and opens a doc file from : /folder-2010/AAA-101-pqr.doc
contents of doc file :
revision = 1
setNumber=2
partNumber : ABCDEF* --this needs to be a link invoking the function call to the oaf page with these set of parameters :revision, part number and set number.
....and a few more....
What I did was : I gave the OAFunc=xxxxx guest grants (http://mukx.blogspot.com/2008/07/creation-of-anonymous-page-introduction.html)
so it invokes the main page from any file outside oracle, without login required. but i still have to search the existing records for a part number and click on view link.
How can I pass the part#,set#,rev to the link so that it opens up the view page directly ?
any help would be appreciated.
thanks a ton.ok so say my function is :
MASETUPVIEW with html call : OA.jsp?page=/oracle/apps/mac/matooling/webui/WorkSheetViewPG
So from word file : Should I give the link to invoke as :
http://zzzzzz.company.com:8009/OA_HTML/OA.JSP?OAFunc=MASETUPVIEW&viewInvItemId=123456&viewMachine=101&viewRevision=C&viewSetNumber=5&viewCategory=MILLS¶mActionType=ViewWS -
How to invoke RFC function module from XI interface
Hi all,
I am having one question, How to invoke RFC function module from XI interface.
Please reply me as soon as possible.
Thanks in advance,
RadhikaHi,
To call the RFC in mapping u need to create the RFC lookups...check these links.
How we have to create the lookups?
Check this weblogs with some screenshots on how to achieve this:
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
/people/sap.user72/blog/2005/12/06/optimizing-lookups-in-xi
/people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes
lookups in xi
XI Design Guidelines
Re: RFC Lookup API
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
Regards,
Phani -
How to import a function from JS to a JSP
how to import a function from a JS to a JSP?
You cannot. You need to distinguish that those are two completely different languages. Javascript is a client side language which is only executed on the client and JSP is a server side language which is executed on the server before it arrives to the client. You can invoke each other indirectly, but you cannot use them simultaneously.
-
At Craig's suggestion: Why Invoke PERL functionality from WD-ABAP?
Craig -
This is response to your suggestion that I post my own reasons for thinking that it would be useful to be able to invoke PERL functionality from WD-ABAP.
Please note at the outset that these reasons are based on my own personal belief that the relatively new vertical sectors of bioinformatics/biomed could produce reasonably significant income for SAP in a reasonably short time if SAP decided to create application-level functionalities in these areas.
This belief is in turn based on a very significant new initiative which has been publicly announced by the university Medical Center recently voted "most-wired" (Vanderbilt) and equivalent initiatives at other university Medical Centers across the country. (BTW, I've posted a meeting time (Tue 7pm) at Tech Ed for anyone who wants to learn more about these initiatives, the new vertical sectors they define, and how SAP could EASILY play in them.)
So, with this background established, assume that SAP does decide to play in the bioinformatic/biomed sector.
SAP will rapidly find that a lot of biomed is based on the kind of bioinformatics that essentially does pattern-analysis on two kinds of strings: polynucleotide strings (DNA, mRNA, tRNA, etc.) and polypeptide strings (mainly the amino acid strings that form the "primary structures" of protiens.) For example, biomed will soon include the ID of "at risk" markers for all patients in a university medical center, indicating what diseases patients may be genetically at risk for due to SNP's and other abnormalities in their inherited DNA.
Now when such analysis is not done by running "canned" versions of well-developed programs such as the ubiqitious BLAST program for "aligning" polynucleotide or polypeptide sequences, it is done by programs written in languages that offer superb capabilities for pattern-searching and manipulation of strings, e.g. PERL.
Additionally, I know from personal experience and the experience of my SigOther that even data obtained from well-known canned programs must be further massaged by non-canned techniques that again are readily implementable in PERL and other similar languages.
Finally, a lot of bioinformatic/biomed applications require iterative batch execution of canned stat routines such as t-tests or normality tests, which can be conveniently done via calls from languages such as PERL to canned products such as STATA.
So assume SAP wants to develop a biomed application that has:
back-end data containing the usual kinds of info med centers need to know about patients, plus the new kinds of scientific info about patients that med centers are creating
a presentation component that displays these two kinds of data for query, further elaboration/refinement, and subsquent update.
For example, there will be times when a doctor will want to take scientific data on a patient from the back-end (e.g. portions of a patient's DNA), subject it to pattern-analysis of the type described above, and then store the results of the analysis as additional new scientific info in the back-end databases.
And SAP can readily provide the doctor with this capability if it allows PERL functionality to be invoked from WD/WD-ABAP components. In some cases, the PERL will simply invoke industry-standard canned programs such as BLAST and wrap the results in a way friendly to SAP. In other cases, the PERL may do the analysis itself. In other cases, the PERL may invoke stat programs. Etc, etc. etc.
The point is that there is a vast inventory of bioinformatic/biomed PERL code out there, and if SAP wants to get serious about playing in the bioinformatics/biomed sector, it will be much easier to talk to this inventory of programs rather than recreate it in JAVA or SAP inside SAP.
Anyway, please remember - this post was based on the assumption that SAP may want to get serious about playing in the bioinformatic/biomed sector.
If not, then as Rosanne Rosanadanna used to say, "Never mind".Hi David,
Where it can be used :-
Anywhere that you can insert ABAP code to run, you can integrate Perl in the manor that I laid out. The only requirements are the ability to run registered RFC programs, and to execute ABAP code including RFC calls (which is anywhere inside of an R/3 system basically).
Comparison with other techniques :-
All communication from the ABAP stack with the J2EE stack is done via RFC - this is only faster than a registerd RFC Server if Fast RFC is used which means that the J2EE stack MUST reside on the same host as the R/3 instance. Therefore there is no performance difference at that level and any performance differentiation is going to be in the programming language Perl vs Java, or payload encoding techniques (XML) at that level (not withstanding the consideration of development time).
There is also the HTTP Client communication facilities - with or without document encodings (the ICF + eg. SOAP). Again - I'd take a long hard look at whether it is necessary to be encumbered with the data packet encoding/ecapsulation overhead.
What you gain :-
Once you are in the "land of Perl" you have access to essentially any module you can find on CPAN, so any data access you require whether it be some kind of application server technology, or DB, can be fullfilled by whats available there (unless you need to roll your own?). And lets not forget algorythm implemented in Perl or Perl XS extensions - probably very important in the medical/scientifc field.
SOA (IMO) is a big ugly 4 letter word. At the end of the day, you have to look where your time and money is best spent, and whether you can achieve the desired results using Scripting Language Connector technology, or whether you feel compelled to go down a WS-* style route.
However - I would like to say this - IMO it is totally unecessary to wrap up system integration in multiple (expensive both in money, and performance considerations) layers if you are confident that you have good control over both ends of the communication streams. I believe that when your main objective is to utilise large chunks of code written in another language (rather than reimplement it in something closer to SAPs core interests), or communicate with inhouse data sources/systems (I've done this for MySQL before), then this is definitely one such case that opens the door for using my outlined approach (in the article).
Cheers,
Piers Harding.
Message was edited by: Piers Harding -
How to call javascript function from PL/SQL procedure
Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?
Hi,
I have a requirement to call Javascript function inside a After Submit Process.
clear requirement below:
1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
2. user clicks on "save files" button
3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
Hope this clarify U.
Krishna. -
How to invoke crystal reports from Oracle forms 11g R2 along with passing p
How to invoke crystal reports from Oracle forms 11g R2 along with passing parameter to it.
how to pass parameters to crystal report, please help.how to pass parameters to crystal report, please help.This would entirely depend on crystal reports and you might find informations on crystal reports related communities more likely...I for one have seen crystal reports the last time about 12 years ago. And even back then I simply acknowledged it's existence instead of working with it.
Maybe crystal reports can be invoked via a URL call which would make it simple as you'd need simply build an URL and show the report using web.show_document. But that's pure speculation. Also you might not be the first with this requirement, so the solution to your problem might be right under your nose and just a little google search away ;)
cheers -
How to call oracle function from ejb3
i'm trying to call an oracle query-function from ejb3.
The oracle function:
create or replace FUNCTION getSecThreadCount(secId in NUMBER,avai in NUMBER)
RETURN SYS_REFCURSOR is cur SYS_REFCURSOR;
m_sql VARCHAR2(250);
BEGIN
m_sql:='select count(thrId) from thread where secId='|| secid||'
and thrAvai='|| avai;
open cur for m_sql;
return cur;
END;
I'v tried several ways to call it,but all failed:
1. the calling code:
public Object getSectionThreadCount(int secId,int avai){
Query query=manager.createNativeQuery("{call getSecThreadCount(?,?) }");
query.setParameter(1, secId);
query.setParameter(2, avai);
return query.getSingleResult();
but i got the exception:
Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: java.sql.SQLException: ORA-06550: row 1, col 7:
PLS-00221: 'GETSECTHREADCOUNT' not procedure or not defined
ORA-06550: row 1, col 7:
PL/SQL: Statement ignored
2. the calling code:
@SqlResultSetMapping(name = "getSecThreadCount_Mapping")
@NamedNativeQuery(name = "getSecThreadCount",
query = "{?=call getSecThreadCount(:secId,:avai)}",
resultSetMapping = "getSecThreadCount_Mapping",
hints = {@QueryHint(name = "org.hibernate.callable", value = "true"),
@QueryHint(name = "org.hibernate.readOnly", value = "true")})
public Object getSectionThreadCount(int secId,int avai){
Query query=manager.createNamedQuery("getSecThreadCount");
query.setParameter("secId", secId);
query.setParameter("avai", avai);
return query.getSingleResult();
but i run into the exception:
Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: java.sql.SQLException: lost in index IN or OUT parameter:: 3
By the way, i have successfully called the function from hibernate. And i use oracle 11g, JBoss5 RC1.
Could anyone tell me how to call the function from EJB3?
Thanks.Here's a working model:
package.procedure: (created in example schema scott)
CREATE OR REPLACE package body data_pkg as
type c_refcursor is ref cursor;
-- function that return all emps of a certain dept
function getEmployees ( p_deptId in number
return c_refcursor
is
l_refcursor c_refcursor;
begin
open l_refcursor
for
select e.empno as emp_id
, e.ename as emp_name
, e.job as emp_job
, e.hiredate as emp_hiredate
from emp e
where e.DEPTNO = p_deptId;
return l_refcursor;
end getEmployees;
end data_pkg;
/entity class:
package net.app.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedNativeQuery;
import javax.persistence.QueryHint;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@SuppressWarnings("serial")
@Entity
@Table (name="emp")
@SequenceGenerator(name = "EmployeeSequence", sequenceName = "emp_seq")
@NamedNativeQuery( name = "getEmpsByDeptId"
, query = "{ ? = call data_pkg.getEmployees(?)}"
, resultClass = Employee.class
, hints = { @QueryHint(name = "org.hibernate.callable", value = "true")
, @QueryHint(name = "org.hibernate.readOnly", value = "true")
public class Employee implements Serializable
@Id
@Column(name="emp_id")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EmployeeSequence")
private int id;
@Column(name="emp_name")
private String name;
@Column(name="emp_job")
private String job;
@Column(name="emp_hiredate")
private Date hiredate;
// constructor
public Employee (){}
// getters and setters
public int getId()
return id;
etc...session bean:
package net.app.entity;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import net.app.entity.Employee;
import net.app.iface.ScottAdmin;
@Stateless
public class ScottAdminImpl implements ScottAdmin
@PersistenceContext
private EntityManager entityManager;
@SuppressWarnings("unchecked")
public List<Employee> getEmployeesByDeptId(int deptId)
ArrayList<Employee> empList;
try
Query query = entityManager.createNamedQuery("getEmpsByDeptId");
query.setParameter(1, deptId);
empList = (ArrayList<Employee>) query.getResultList();
return empList;
catch (Exception e)
e.printStackTrace(System.out);
return null;
}client:
package net.app.client;
import java.util.List;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import net.app.entity.Employee;
import net.app.iface.ScottAdmin;
public class ScottClient
public static void main(String[] args)
try
// create local interface
InitialContext ctx = new InitialContext();
ScottAdmin adminInterface = (ScottAdmin) ctx.lookup("ScottAdminImpl/remote");
// select employees by deptno
int deptno = 20;
List<Employee> empList = adminInterface.getEmployeesByDeptId(deptno);
// output
System.out.println("Listing employees:");
for (Employee emp : empList)
System.out.println(emp.getId() + ": " + emp.getName() + ", " + emp.getJob() + ", " + emp.getHiredate());
catch (NamingException e)
e.printStackTrace(System.out);
}Basically you just ignore the refcursor outbound parameter.
This is a stored function, have yet to try outbound refcursor parameters in stored procedures...
Edited by: _Locutus on Apr 2, 2009 2:37 PM -
How to invoke java application from ABAP
How to invoke java application from ABAP ? Suppose I needto execute a EJB wihic is running on my SAP J2EE Enigne from an ABAP Program .
Thanks,
ManishHi Manish,
did you get some further documents concerning "abap program calls ejb"?
If yes, could you please send me some informations.
Thank you for your help.
Kind regards, Patrick. -
How to invoke a servlet from MDB
Hi,
Can someone please tell me how to invoke a servlet from MDB. Actually I want to have a MDB that will invoke a servlet that takes arround ~3 minutes to process and send the response back to MDB. Any small code snippet on invoking a servlet.
Thanksnope. this is probably a bad design.
but here's a hint: whenever you have a question like this, start browsing the javadocs. chances are there's a class that might help you.
i'd recommend that you look at this:
http://java.sun.com/javase/6/docs/api/java/net/HttpURLConnection.html
% -
How to invoke business process from sap xi?
Hi...
Please tell "How to invoke business process from SAP UI's."Hi...
How to invoke business process from SAP UI's. (Eg: To trigger a process after creating an invoice) -
How to invoke BPEL process from JAVA API
Hi Guys
Any idea if you can tell me how to invoke BPEL process from JAVA API ?
What to do in BPEL process manager to achieve that?
Regards
DeepakSee http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/invoke.htm#sthref1373 and the JavaDocs http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm.
-
How to call a function from asp
Hi!, I'd like to know how to call a function from an asp page. I've written:
set rs = server.createobject("Adodb.recordset")
rs.open "call dbo.sf_Obt_Des_Producto ('0000161')",Conn
if err.description <> "" then
response.write ("No se pudo! :(")
else
response.write ("rs: " & rs(0))
end if
rs.close
set rs = nothing
but there is an error:
ORA-06576: not a valid function or procedure name
Please is very urgent!!!
Thanks.
Angie.You need to use the syntax "{call <procedure_name>}".
The {call } syntax tells the OLE DB provider that it needs to translate the call into whatever the database's procedure calling syntax is. This means that even though different databases have different syntax for calling stored procedures, your OLE DB code can be run against any of them without changing.
Justin -
Cannot execute functions from dbx
I tried calling these functions from dbx but nothing seems to work.
print strlen("hello");
dbx: can't find a system call entry point -- program not linked with libc?
loadobject shows that libc.so is mapped.
(dbx) loadobject -list | grep libc
m /lib/libc.so.1
any particular reason?uname -a
SunOS whitestar2-0 5.11 i86pc i386 i86pc snv_66 X86
dbx -V
Sun Dbx Debugger 7.1 Patch 112759-02 2003/11/11
Infact I am not able to call functions in my own library also. I get the same error. Those functions are definitely not overloaded. They are unique and are in my library.
Thanks for looking at this. Appreciate your help
Message was edited by:
slashgmg
Message was edited by:
slashgmg -
Hi, does anyone know how to invoke the JDev 10.1.3 oc4j_remote_deploy.jar from the command line? We have it working for 10.1.2, for automated deployment scripts.
If I try the same thing for 10.1.3, I get an error.
See below my command line and the output.
I think the error is in the Oc4jDcmServlet URL, the format seems to have changed from 10.1.2 to 10.1.3.
I tried to reverse-engineer by using an HTTP tracer, but that did not help.
Any help would be much appreciated.
Regards, Maarten Brugman
======================== command line: ==================
"C:\j2sdk1.4.2_09\bin\java.exe" -Djava.protocol.handler.pkgs=HTTPClient -jar C:\jdev-work\ebrp-new\ear\target\installer\oc4j_remote_deploy.jar http://lnvx0027:29805/Oc4jDcmServletAPI/ oc4jadmin ***** listApplications /oracle/oaedv03/oracle/oas/10.1.3/ontwj2e1013 UNDEFINED UNDEFINED OC4J_OEBRP
============ output: ====================================
Initializing log
Servlet interface for OC4J DCM commands
Command timeout defined at 600 seconds
Executing DCM command...
Executing command listApplications /oracle/oaedv03/oracle/oas/10.1.3/ontwj2e1013
UNDEFINED UNDEFINED OC4J_OEBRP
Command = LISTAPPLICATIONS
Opening connection to Oc4jDcmServlet
Setting userName to oc4jadmin
Sending command to DCM servlet
**** Could not check HTTP response code
** Thread[main,5,main] ** Fri May 11 17:18:13 CEST 2007 ** ** EXCEPTION: java.
net.SocketException: Unexpected end of file from server
java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:822)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:711)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:820)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:711)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:635)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:272
at oracle.j2ee.tools.remote_deploy.Oc4jDcmClient.isHttpResponseOk(Unknow
n Source)
at oracle.j2ee.tools.remote_deploy.Oc4jDcmClient.sendCommand(Unknown Sou
rce)
at oracle.j2ee.tools.remote_deploy.Oc4jDcmCommand.execute(Unknown Source
at oracle.j2ee.tools.remote_deploy.Oc4jDcmCommand.listApplications(Unkno
wn Source)
at oracle.j2ee.tools.remote_deploy.Oc4jDcmMain.main(Oc4jDcmMain.java:71)
#### HTTP response is NOT ok
Closing connection to Oc4jDcmServlet
#### DCM command did not complete successfully (-1)
#### HTTP return code was -1
============ end output =================================In my opinion, you will succeed in handling linefeeds in output texts by using an <tt><af:outputFormatted></tt> tag in conjuction with a JSF converter that replaces the linefeeds with a <tt><br></tt> tag in the text. You will have to implement a custom converter class (this is quite simple, see below) and to set it to the <tt>converter</tt> attribute of the <tt><af:outputFormatted></tt>. The converter class should look like:
public class MyLinefeedConverter implements javax.faces.convert.Converter
public MyLinefeedConverter() {
public Object getAsObject(FacesContext context, UIComponent component, String value) {
return value;
public String getAsString(FacesContext context, UIComponent component, Object value) {
if (value==null) return "";
if (value instanceof String) return ((String)value).replace("\n", "<br>");
return value.toString();
}In this way the linefeeds in your text values will be replaced by <tt><br></tt>, which will be rendered by the corresponding <af:outputFormatted> tag as line breaks.
Maybe you are looking for
-
Blank screen after disabling primary and secondary monitor on Satellite A
Hello, I tried to connect an LCD on my laptop, at the first place i went control panel -- display -- settings -- advanced -- monitor -- properties -- Device usage: disable!! That enabled the secondary LCD screen but the most stupid thing is that when
-
Doubt Regarding Materialized View
Hello, I am working on Oracle 10g. We have multiple materialized Views which we Refresh in every 15 mins. My question is that can we get data from these MV's for a particular date....??
-
I updated my flash player this morning to 11.9.900.170. SInce i have updated my videos either only play for about 25 sec then stop. These are like 5 minute videos. It seems like they just stop buffering. On youtube the videos that used to buffer very
-
Hi. I'm looking for SAPu2019s documentation format, somebody knows where it found ? I want to use it like a guide to create a internal format that we can use to reflect system changes. I will appreciate your help. Regards, Manuel H.
-
Trying to down load mountain lion but will only get to 53.25mb
trying to down load mountain lion but will only get to 53.25mb