Calling a pl/sql function from oracle forms

I have written a pl/sql function in a package.
package name- sup
function name - func
I have written a when-button-pressed trigger .from here I want to call this function.
How can I do that?
Please help..

Thanks a lot..
User may select 20-30 check boxes for respective name & id...then at the end , user will hit OK...from here when-button-click will call a procedure....that will update/insert/delete a table data.The procedure I have written is:-
DECLARE
N_CNT Number(1);
D_SYSDATE Constant date :=sysdate;
Begin
select count(1)
into N_CNT
from dbtable L
where L.land_id = :BLK1.LAND_ID and
L.Operatoer_id = :BLK1.Operatoer_id and
L.suppl_id = :BLK1.suppl_id and
L.suppl_prof_id = :BLK1.suppl_prof_id;
if ((N_CNT = 0) and (:LANDLISTE.state = 'A')) then
insert into dbtable
LAND_ID,
STATE,
suppl_prof_id,
suppl_id,
OPERATOER_ID,
SIDST_OPD_DATO,
SIDST_OPD_INIT
values
:BLK1.LAND_ID,
'Y',
:BLK1.suppl_prof_id,
:BLK1.suppl_id,
:BLK1.Operatoer_id,
D_SYSDATE,
:BLK1.SIDST_OPD_INIT
elseif
((N_CNT>0 )and (:LANDLISTE.state = 'A')) then
update dbtable L
set L.SIDST_OPD_DATO = D_SYSDATE,
L.SIDST_OPD_INIT = :BLK1.SIDST_OPD_INIT
where L.land_id = :BLK1.LAND_ID and
L.Operatoer_id = :BLK1.Operatoer_id and
L.suppl_id = :BLK1.suppl_id and
L.suppl_prof_id = :BLK1.suppl_prof_id;
elseif ((N_CNT>0 ) and (:LANDLISTE.state = 'D')) then
delete from dbtable L
where L.land_id = :BLK1.LAND_ID and
L.Operatoer_id = :BLK1.Operatoer_id and
L.suppl_id = :BLK1.suppl_id and
L.suppl_prof_id = :BLK1.suppl_prof_id;
end if;
end;
Will it be able to load multiple data(20-30 at a time) to the table?
Should I write anything to commit the data in the table?
I am very new to oracle forms...please help..

Similar Messages

  • Calling Web Service passing xml from Oracle Forms

    Hello,
    I need to call a .net web service from Oracle Forms that passes in xml data and returns xml data.
    I have seen several examples of how to create a wrapper in jdev and then to import the code
    into forms. I just have not seen any examples that are passing parmameters especially not xml
    as a parameter and that have an active wsdl that I can see how it relates to the code created.
    I have a wrapper but cannot figure out where and what notation to use to include passing in
    an xml object.
    Does anyone have an example passing in xml where the wsdl is still available to see?'
    Forms version 10.1.2.0.2. Jdev 10.1.3.4
    Thanks,
    Linda
    Edited by: lboyce on Jan 5, 2009 2:30 PM

    Also here you have several options...
    1. you can make a PJC (bean) which include a webservice stub generated with axis (you can make a stub and also test a webservice with this tool: www.soapui.org)..
    2. you can make a database webservice with JPublisher and then just call a pl/sql wrapper for this webservice
    4. you can call a webservice with java api (HttpsURLConnection, HttpURLConnection or with apache HTTPClient api) from your PJC for example:
    the code below is used as java stored procedure to call a .net webservice on https
    ====================================
    public static int getPStopnja(String polica, String reg_oznaka,
    String ime_osiguranika,
    String naziv_osiguranika,
    String leasing,
    String[] doc) {
    String l_polica="";
    String l_reg_oznaka="";
    String l_ime_osiguranika="";
    String l_naziv_osiguranika="";
    String l_leasing ="";
    URL url = null;
    HttpsURLConnection conn = null;
    BufferedReader br = null;
    String lineIn = null;
    StringBuffer sb = new StringBuffer();
    OutputStream os = null;
    int rc = 0;
    //kontrole
    l_polica = polica==null ? "":polica;
    l_reg_oznaka = reg_oznaka==null ? "": reg_oznaka;
    l_ime_osiguranika = ime_osiguranika==null ? "": ime_osiguranika;
    l_naziv_osiguranika = naziv_osiguranika==null ? "": naziv_osiguranika;
    l_leasing = leasing==null ? "": leasing;
    String body = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
    body += "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"https://services.huo.hr/web_ao/\">";
    body += "<soapenv:Header/>";
    body += "<soapenv:Body>";
    body += "<web:get_pstupanj>";
    body += "<web:param_in>";
    body += "<web:polica>"+l_polica+"</web:polica>";
    body += "<web:reg_oznaka>"+l_reg_oznaka+"</web:reg_oznaka>";
    body += "<web:ime_osiguranika>"+l_ime_osiguranika+"</web:ime_osiguranika>";
    body += "<web:naziv_osiguranika>"+l_naziv_osiguranika+"</web:naziv_osiguranika>";
    body += "<web:leasing>"+l_leasing+"</web:leasing>";
    body += "</web:param_in>";
    body += "</web:get_pstupanj>";
    body += "</soapenv:Body>";
    body += "</soapenv:Envelope>";
    SSLContext sslContext = null;
    try {
    sslContext = SSLContext.getInstance("TLS");
    X509TrustManager[] xtmArray = new X509TrustManager[|http://forums.oracle.com/forums/] { xtm };
    sslContext.init(null, xtmArray, new java.security.SecureRandom());
    } catch (GeneralSecurityException gse) {
    doc[0] = gse.toString();
    return -1;
    if (sslContext != null) {
    conn.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
    try {
    conn.setDefaultHostnameVerifier(hnv);
    } catch (Exception ex) {
    doc[0] = ex.toString();
    return -1;
    try {
    URL st = new URL("https://services.huo.hr/web_ao/web_ao.asmx");
    conn = (HttpsURLConnection)st.openConnection();
    conn.setRequestMethod("POST");
    conn.setRequestProperty("Host", "services.huo.hr");
    conn.setRequestProperty("Content-Length", "" + body.length());
    conn.setRequestProperty("SOAPAction",
    "\"https://services.huo.hr/web_ao/get_pstupanj\"");
    conn.setRequestProperty("Content-Type", "text/xml;charset=UTF-8");
    conn.setDoOutput(true);
    OutputStreamWriter wr =
    new OutputStreamWriter(conn.getOutputStream());
    wr.write(body);
    wr.flush();
    BufferedReader in =
    new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String inputLine;
    while ((inputLine = in.readLine()) != null) {
    sb.append(new String(inputLine.getBytes(),"UTF-8"));
    in.close();
    //System.out.println(new String(sb.toString().getBytes(),"ISO8559_2"));
    doc[0] = sb.toString();
    return 0;
    } catch (Exception e) {
    doc[0] = e.toString() + " ===> " + body + " ==>length= " + body.length();
    return -1;
    ====================================
    best regards
    Edited by: Peterv6i on Jan 6, 2009 8:34 AM
    Edited by: Peterv6i on Jan 6, 2009 8:40 AM

  • Calling a PL/SQL function from java

    I would like to call a pl/sql function from java. My pl/sql function is taking arrays of records as parameters. How do i proceed? Which specific oracle packages do I have to import?
    Please send an example.
    TIA,
    Darko Guberina

    Documentation here: http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref185
    says JPublisher can publish records too.
    But when I change the example given at http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref190 as following:
    PACKAGE "COMPANY" AS
    type emp_rec is record (empno number, ename varchar2(10));
    type emp_list is varray(5) of emp_rec;
    type factory is record (
    name varchar(10),
    emps emp_list
    function get_factory(p_name varchar) return factory;
    END;
    then I see <unknown type or type not found> at sql or java files generated. Any ideas?

  • Calling Sql*Loader from oracle Form builder

    How do i call sql* loader from my forms to import the external data in different formats into my existing database?
    Specify the flexibility of sql* loader to import external data from .txt files or .xls files.
    Would be thankful if certain examples are given along with the answer.

    Hi,
    1. First you have to create seperate ctl (Control files) which maps to different file formats
    2. Using Oracle Forms,
    2a) You can use the 'HOST' command to execute the command line ie. In this case executing
    SQL*Loader script
    2b) You also have the feature in ORACLE forms to read text files and load the data into
    ORACLE db.
    This can be achieved by using TEXT_IO package which comes with ORACLE Forms.
    Hope this helps
    Ta
    Shailender

  • Cancel/Break Stored PL/SQL-Procedure/Function from Oracle Forms

    Hello !
    If i call in Oracle Forms a PL/SQL-Programm stored in the dabase is there a way to break/cancel this programm from Oracle Forms ?
    Thanks in advance !
    Thomas

    <p>All I want to say is, you need to "prepare" the PL/SQL code to accept interruption, like dealing with the DBMS_APLICATION_INFO</p>If this code is not present in your PL/SQL code you won't stop it, except killing the session (that is a really dangerous option).
    Francois

  • Call a pl/sql function froma jsp

    I need to call an pl/sql function which basically returns true or false depending on the count. based on the return value I have to alert a message. how can i call the pl/sql fucntion in a jsp?
    thanks for ur help.

    You call the function the same way you would from anywhere, although i don't recommend you call database functions directly from a JSP page as it's bad form.

  • Calling BO XI Release 2 from Oracle Forms 10g

    Post Author: alexre
    CA Forum: Integrated Solutions
    Hello everybody,
    We are going to migrate the Oracle Database and the Oracle forms application to 10g to one of our clients but he wants continue using the BO so he is going to migrate BO v 4.1.6 to XI Release 2.
    Because I am not a BO specialist I would like to know
    Is it possible to publish the BO report on the WEB?
    Can I call the report directly from Oracle Forms 10g (WEB) and pass the parameters?
    Can you advice any documents related to this topic?
    Thank you in advance for your help.
    Alex

    Post Author: jsanzone
    CA Forum: Integrated Solutions
    Alex,
    Your first question leads to a "it depends" answer.  If you want to publish static content, then the report can be ran and saved as PDF, then that PDF can be made available as a link in another web server. If you want to publish dynamic content, then "no", but read on because you'll see in answer to #2 and #3 it becomes "yes".
    Your second question about calling the report directly from Oracle Forms and pass the parameters is a resounding yes!  However, you will need to have an enduring knowledge of a concept called "opendocument" within the Business Intelligence tool as well as an authentication strategy to make it all work.
    Here is the answer to your third question, please following this link:  http://support.businessobjects.com/communityCS/TechnicalPapers/be_xi_r2_opendocument.pdf.asp
    Good luck!

  • How can I invoke a sql loader from oracle form?

    I'm got a problem on invoking sql loader command from oracle form where the sql loader product has been installed in Window NT.
    Thanks for your help!

    U can use HOST procedure with NO_SCREEN option.
    this will go like
    Host('d:\orant\bin\SQLLDR80 USERID=username/password@connect CONTROL=contril_file.CTL LOG=log_file.LOG discard=discard_file.dis bad=bad_file.bad', NO_SCREEN);
    Hope this will Work
    Good Luck :-)
    Naren

  • Calling third party java page from Oracle form

    Hi,
    Is it possible to call a third party java (html+java) form page (residing in separate web service server) which would take input from standard Oracle form (OCO) page?
    The third party page would validate the fields sent by form page and then will provide the results which should be copied back into standard oracle OCO form page.
    Regards,
    Aneesh

    Don't know if you can do this from Forms PL/SQL, but you should be able to write a stored procedure in the database that does it for you. The stored procedure could use the database package UTL_HTTP to make the HTTP request and receive the response.
    Your custom stored procedure can be called from Forms PL/SQL. If you are caling to a tru web service, you can also look at the UTL_DBWS package which is a bit more high level for calling a web service, than the raw UTL_HTTP package.

  • How to call userdefined java script function in Oracle Forms 11g.

    Hi,
    I Created a java script contain a function, that will open and close the browser for some URL.
    CODE:-(webclose.jp)
    *function manageWindows() {*
    var windows = [], i = 0;
    var url =  "htttp://oracle:64578/xmlpserver/login.jsp?Go&id=admin&passwd=admini";
    *if (url.length) {*
    *windows[i] = window.open(url, ' tabWindow_'+i);*
    i++;
    *winows[i-1].close();*
    *delete windows[i-1];*
    return false;
    *}* Then i placed the javascript file in path <middleware_home>\user_projects\domains\<domain>\servers\WLS_FORMS\_WL_user\formsapp_11.1.1\e18uoi\war\
    After that i called the javascript function in to forms as
    WEB.JAVASCRIPT_EVAL_EXPR('webclose.manageWindows();');
    When running the form it showing error
    FRM-92190: JavaScript is unable to evaluate expression.
    If anybody knows pls help me.

    Always post code snippets in &#123;code&#125; tags as explained in the FAQ.
    I Created a java script contain a function, that will open and close the browser for some URL.
    CODE:-(webclose.jp)
    function manageWindows() {
    var windows = [], i = 0;
    var url = "htttp://oracle:64578/xmlpserver/login.jsp?Go&id=admin&passwd=admini";
    if (url.length) {
    windows = window.open(url, ' tabWindow_'+i);
    i++;
    winows[i-1].close();
    delete windows[i-1];
    return false;
    } Then i placed the javascript file in path <middleware_home>\user_projects\domains\<domain>\servers\WLS_FORMS\_WL_user\formsapp_11.1.1\e18uoi\war\
    After that i called the javascript function in to forms as
    WEB.JAVASCRIPT_EVAL_EXPR('webclose.manageWindows();');
    When running the form it showing error
    FRM-92190: JavaScript is unable to evaluate expression.
    If anybody knows pls help me.>
    This error has nothing to do with Forms, it is an JavaScript error.
    Most likely cause is this line
    if (url.length) {url.length returns a Whole number and so the conditions would be
    if (url.length > 0) {Or
    if (url) {  // not null checkCheers,

  • CALLING a STORED SQL FUNCTION from  Java 1.1.8

    I am trying to execute a stored function in JAVA 1.1.8, from an Oracle
    8i Database. My stored function is simple, it converts an Input Number to an output TIME string. I am unsure how to code the call from Java. Are SQL STORED PROCEDURES treated the same as SQL STORED FUNCTIONS? Do you use the CallableProcdure class or something else?
    Thanks for your input.

    yep - same way. Except no return value.

  • Calling report in JSP format from oracle forms...

    I created a report and save it in 2 formats (.rdf and .jsp)...
    Now instead of using the rdf format(which opens in a pdf inside a web browser) ...i want to call the report in jsp format

    Suhail,
    You can even call a .rdf report in HTML format. You have to set the Report Destination Format to html.
    For calling the jsp report , you don't have to do that differently either. Place your jsp report in the REPORTS_PATH directory.
    Then set your report object to that of html destination.

  • Calling web service from oracle forms 10g

    Problem Description:
    I'm following the steps as per the doc:
    http://www.oracle.com/technology/products/forms/htdocs/10gr2/howto/webservicefromforms/ws_10_1_3_from_forms.html
    to create a java stub to call external web service and then use java importer in oracle forms to call this web service from oracle forms.
    WSDL for external web service used is http://gend:83/DesignService.svc?wsdl
    The service was developed by us.
    Calling the web service using JDeveloper works fine but when I complie in Oracle Forms it returns wrong number of types of arguments in call SENDHELLO.
    The code from oracle form to call web service is as below:
    DECLARE
    jo ora_java.jobject;
    xo ora_java.jobject;
    rv varchar2(2000);
    ex ora_java.jobject;
    str varchar2(100);
    BEGIN
    jo := GendServiceClient.new;
    rv := GendServiceClient.sendHello('Nora');
    EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then
    message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
    WHEN ORA_JAVA.EXCEPTION_THROWN then
    ex := ORA_JAVA.LAST_EXCEPTION;
    message(Exception_.toString(ex));
    END;
    Any help/ideas on this is greatly appreciated. Thanks.
    Edited by: KE Nora Loera on Jun 1, 2012 1:24 PM

    My primary skill is PL/SQL but the only information I found on Oracle's site to call a web service from a 10g Form was creating a jar file and importing the java class. Since I don't want to ask our corporate IT to make changes on the UNIX box for the jar files I went a different route.
    I use UTL_HTTP.BEGIN_REQUEST to call a URL then load I load the data to a table as a CLOB since we have more than 4000 characters. Now I need to parse the XML and load it into a form. I have never done this so if there is a helpful site please let me know. I have looked at several sites but none do what I want.
    Thanks

  • Calling PL/SQL function from external Java class

    I was wondering if I was able to call a pl/sql function from an external java class? If so, would you be able to tell me briefly on how to go about it. I know I can call java methods that are internally stored in the db from pl/sql, but I was hoping I could call pl/sql from external java. Thanks,
    Kelly

    Ok, I made the changes, but I'm now getting the following error:
    Error code = 1403
    Error message = ORA-01403: no data found
    ORA-06512: at "IOBOARD.GETSTATUS", line 6
    ORA-06512: at line 1
    The ora-01403 I don't understand because there is data for the name Kelly.Brace.
    ora-06512 error: at string line string.
    Here's what the code looks like after I made the changes:
    String sql = "{?=call ioboard.GetStatus(?)}";
          // create a Statement object
          myStatement = myConnection.prepareCall( sql );
          myStatement.setString( 1, "Kelly.Brace" );
          myStatement.registerOutParameter(2, java.sql.Types.LONGVARCHAR );
          // create a ResultSet object, and populate it with the
          // result of a SELECT statement
          ResultSet myResultSet = myStatement.executeQuery();
          // retrieve the row from the ResultSet using the
          // next() method
          myResultSet.next();
          // retrieve the user from the row in the ResultSet using the
          // getString() method
          String status = myResultSet.getString(1);
          System.out.println("Hello Kelly, your status is: " + status);
          // close this ResultSet object using the close() method
          myResultSet.close();Here's what the function looks like:
    CREATE OR REPLACE FUNCTION GetStatus( user_name in varchar2)
    RETURN VARCHAR2
    is
    v_status varchar2(10);
    BEGIN
    select iob_location into v_status
    from ioboard.iob_user
    where iob_username = user_name;
      RETURN( v_status);
    END;This works perfectly in the SQL Window:
    select iob_location
    from ioboard.iob_user
    where iob_username = 'Kelly.Brace';

  • Call an executable file from oracle forms 6i

    Hello ,
    i want to call a local .exe file from oracle forms 6i passing along a couple of parameters in the command line .
    Can anyone help me out here ?
    thanks
    C.
    Edited by: user539712 on Jan 21, 2011 11:55 AM
    Edited by: user539712 on Jan 21, 2011 11:55 AM

    that worked...now i am facing a different issue now which i didnt have without the start command . i am calling iexplorer.exe but i am passing a long a url in the command line . the 2nd parameter in the url is not working so when i do :
    "start c:\progra~1\intern~1\iexplore.exe" http://localhost/hello.jsp&a=ddd&b=333
    the &b=333 is not passed (some issue with the & character i am guessing). Would you know a workaround ?
    thanks

Maybe you are looking for

  • My ipod says "connect to your computer. use itunes to restore."

    My ipod says "connect to your computer. use itunes to restore." So I plug it into the computer and itunes says it needs to restore, so I click restore, everything seems to go fine, and it says the ipod needs to restart, it does, has a lil progress ba

  • ITunes background color change

    Just after I installed the latest update for iTunes, the next time I opened it, the background color is this funky lavender/pinkish color. If I shrink the window the visible portion of the window returns white until I scroll the page. Then when the n

  • Lightroom won't allow me to enter keywords or shoot name in the Import module

    Hello... I've seen this before and fixed it, but I don't remember how I did it. Everything looks to be set up properly (I've been using Lr since the 1st public beta), and the destination volume for the DNGs is write enabled. Thanks!

  • System/webconsole:console failed fatally

    Getting a failed service every time I boot that I can't seem to fix. Here is the error message: Jun 3 12:24:14 rhea svc.startd[7]: system/webconsole:console failed fatally: transitioned to maintenance (see 'svcs -xv' for details) I've tried looking a

  • Animation Help

    Hiya, any of you guys wanting to offer your amazing skills please? So I wanted to make an animation whereby I have an abstract bird fly from off screen (right side top) to the centre of the page, then turn left slightly to tip a bucket of paint over,