Form based on Front End (Form based program Unit -Stored Procedure)

Hi
I have a form based on a front end package.
Package spec:
PACKAGE fpkg_csm_stud IS
type stud_rec is record
(s_id student.s_id%type
,s_last student.s_last%type
,s_first student.s_first%type);
type stud_ref_cur is ref cursor return stud_rec;
type stud_rec_tbl is table of stud_rec index by binary_integer;
procedure sp_student_query(iotb_query IN OUT stud_ref_cur)
END;
Package Body
PACKAGE BODY fpkg_csm_stud IS
procedure sp_student_query(iotb_query IN OUT stud_ref_cur)is
begin
     open iotb_query for
          Select s_id
          ,s_first
          ,s_last
          from student;
end sp_student_query;
END;
I have a datablock, STUDENt based on "fpkg_csm_stud.sp_student_query"
When I query the form I get an error, FRM-40505, on 9iAS.
However, if I created the same package as a stored database object, and based my form datablock on the database stored procedure everything works fine. I cannot find a reason why.
I know that forms can be based on front end based procedures OR backend based procs. Dont have a clue here, any help is great.
Thanks
Vijay

Hello Vijay,
as far as i know there is no way to base a block on a 'front end stored procedure',
assumed that you mean a package in a library or form.
But what should be the reason for doing so, or the other way 'round why not just use a database package?
Bernd

Similar Messages

  • How do I get data to the from in a form based on a stored procedure

    I would like to create a form based on a stored procedure. I have bound LOV's that lookup the ID of the data that is to be displayed on the form. Then I have a button that reads the database and populates the fields on the form. This is our current UI standard on our portal site, and I need to copy that UI exactly in order to mix HTML DB code with our current portal code because we can not afford to re-write all our code in portal to HTML DB. Can this be done, and how can it be done? Thanks

    We are developing an entire HR system for our organization using portal forms. I am trying to prototype in HTML DB to see if we can switch our future development to this new product. However, we already have 50 or so forms that follow a certain user interface look and feel in portal. I am trying to create this interface look and feel in HTML DB. What we are doing in Portal is have a lookup section at the top of each form where you find the record you want to update with LOV's, sometimes 2 or 3 bound together, and then have a lookup button that does PL/SQL to read the database and populate the fields on the form. Then there is an Update button at the end of the form that takes the fields off the form and passes them to a stored procedure. I can not figure out how to do the Lookup button type of code to read information and bring it to the form when doing a form based on a stored procedure.

  • How to use one forms fields, program units in another form.

    The whole proceessing and update is happening in one main form.
    Main form has all the fields and a reprocess button which re-creates records if they have error. Record name is the primary key.
    I have another small form, which just shows the list of record names in the system. I want a reprocess button next to each record name so that user will be able to just select any record name and press reprocess button to recreate any record data.
    There are a lot of fields in main form and program units , which are used by the reprocess button.
    Any suggestions like how to go for it?

    You can either pass all the relevant data from the Small Form to the Larger form and make it reprocess the data or you can move the Program Units to a PL/SQL Library (.pll) and attach the library to your smaller form where you can call the program units. Either option requires changes to the Larger form to enable it to process a record passed to the form as a parameter or to externalize the Forms Program Units to a library.
    Personaly, I would recommend you move the Program Units to a Library. This would enable you to use the processes in any form (that has the library attached).
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Form on table: Using stored procedure to update?

    I have a view which joins a handful of tables. I have a PL/SQL API that contains all the necessary business logic and translations to update the tables underlying this view.
    If I use the HTMLDB wizard to create a form on this view, it would automatically generate plain INSERT/UPDATE statements for DML against the view. How can I make it use my API instead? (Yes, I can probably plug in my API in INSTEAD OF triggers on the view, but I really dont want to do that)
    [Of course, the reason I would use the built-in form-on-table wizard is to get the automatic lost-update detection, locking, etc features]
    Help? Thanks

    The wizards are there to help you build typical pages like "form based on a table", "form on based a stored procedure".
    There is no wizard for "form based on a view, using my own API for inserts, updates and delete" - but that doesn't prevent you building such a form by hand. I have built similar forms, and found it quite easy to approach it like this:
    1) use "form based on a stored procedure" to create a form based on your API insert procedure
    2) add further buttons and processes to call your API's update and delete procedures
    3) add an "on load" process to select the row from the view and populate the form for update or delete
    You need to add some logic for context-sensitivity - e.g. Update and Delete buttons only appear when in "update mode", etc.

  • Dynamic sql and block based on a stored procedure

    Hi!
    I'm triying to generate a block based on a stored procedure. I want the stored procedure to execute a dynamic sql, but I'm having getting the error "PLS-00455 cursor 'AULOCASLATE' cannot be used in dynamic SQL OPEN statement".
    I have the following code:
    CREATE OR REPLACE package pkg_f0015 is
    type rClieInstSlate is record
    (clie_id CMS_CLIENTS.ID%type
    ,client_nm varchar2(1000)
    ,cs_no CMS_CLIENTS.CS_NO%type
    ,dob CMS_CLIENT_NAMES.BIRTH_DT%type);
    type tClieInstSlate is table of rClieInstSlate;
    type uClieInstSlate is ref cursor return rClieInstSlate;
    procedure prLocationSlateQry(
    auLocaSlate in out uClieInstSlate,                anCsNo in CMS_CLIENTS.CS_NO%type,
    avClieNm in varchar2,
    avSearchType in varchar2,
    avLotyCd in CMS_LOCATION_TYPES.CD%type);
    end pkg_f0015;
    CREATE OR REPLACE PACKAGE BODY pkg_cms_f0015 is
    procedure PRLocationSlateQry( auLocaSlate in out uClieInstSlate,
    anCsNo in CMS_CLIENTS.CS_NO%type,
    avClieNm in varchar2,
    avSearchType in varchar2,
    avLotyCd in CMS_LOCATION_TYPES.CD%type) IS
    vSelect varchar2(5000);
    vAddCond varchar2(1000);
    vSupLevel varchar2(50);
    begin
    vSelect := 'select clie.ID,'||
    ' CLIENT_NAME,'||
    ' clie.CS_NO,'||
    ' clna.BIRTH_DT dob'
    ' from CMS_CLIENT_NAMES clna,'||
    'CMS_CLIENTS clie'||
    ' where clna.CLIE_ID = clie.ID';
    if avSearchType= 'C' then
    vAddCond := ' and clie.CS_NO = nvl('||anCsNo||',clie.CS_NO)';
    vSelect := vSelect || vAddCond;
    open auLocaSlate for vSelect;
    end if;
    end PRLocationSlateQry;
    end;
    I wonder if what I want is possible

    OK,
    Now it works. Previously we had the parameter p_guid declared as RAW, which obviously is not any good. :)
    Radovan
    Edited by: biciste on Apr 28, 2009 4:57 PM

  • How to create a LOV based on a stored procedure returning a cursor

    Hello,
    I've tried to search the forum, but did not find much. We are facing a problem of large LOVs and creating large TMP files on the app server. Our whole application is drived by store procedures. LOVs are built manually by fetching data from cursors returned from stored procedures. That creates the issue when whole LOV needs to be stored in the memory and thus the TMP files.
    Is there anyway how to create LOV based on a procedure returning cursor ?
    Thank you,
    Radovan

    Hello,
    As of now we populate the record group by looping through the ref cursor and adding rows into it. Is there a better way? That forces the whole record group to be stored in a memory on the app server.
    Thank you,
    Radovan

  • Null pointer in setTableLocation for a report based on a stored procedure

    im using the crjavahelper class and setTableLocation to change the datasource of a stored procedure based report and its throwing a null pointer exception somewhere in the sdk.  This is happening with sqljdbc4.jar and sql2005 and jdk 1.6.
    Jan 20, 2010 12:43:37 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.NullPointerException
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.do(SourceFile:4605)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:621)
         at com.crystaldecisions.sdk.occa.report.application.b0.if(SourceFile:75)
         at com.crystaldecisions.sdk.occa.report.application.b0.b(SourceFile:106)
         at com.crystaldecisions.sdk.occa.report.application.bb.int(SourceFile:96)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(SourceFile:151)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(SourceFile:106)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:2159)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:543)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:3898)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.setTableLocation(SourceFile:2906)
         at com.businessobjects.samples.CRJavaHelper.changeDataSource(CRJavaHelper.java:191)
         at org.apache.jsp.index_jsp._jspService(index_jsp.java:114)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Unknown Source)
    any ideas? I tried using the jtds driver and it doesnt throw the exception but it doesnt return any data either, ive never gotten a stored procedure based report to work with it.
    Jeremy

    Check out this forum post:
    Problem using Null as a parameter with a stored procedure

  • .sql program VS stored procedure

    Hi,
    We are in the process of migrating a lot of .sql files into Oracle warehouse Builder programs.
    So most of them will be converted to stoted procedure, Before committing anything , Just a quick question ..
    Can there be any statements which is ONLY possible in .SQL files (OS level files)
    and which is NOT possible in Stored procedure ?
    cheers
    Ranjeesh

    Depends on what kind of code you have in those SQL-script files.
    SQL*Plus commands cannot be used in PL/SQL procedure, e.g. COLUMN-formatting, environment SETting, and BREAK etc.
    There should not be any problem with converting DMLs. But, in case of DDLs you will have to use dynamic PL/SQL.

  • How to call 'C' programs from stored procedures?

    Hi
    Did anybody tried to call 'C' programs
    from oracle stored procedures?
    If anybody knows, can you please send
    how to configure the listener.ora and
    tnsnames.ora. If its possible post all the
    information from the begining with examples.
    thanks....

    Oracle JDBC did not support return a result set, if you are using Oracle 9i, you can use pipeline function, then using the TABLE() function the get the row.
    Good Luck.
    Welcome to http://www.anysql.net/en/

  • Execute programs from stored procedures

    I will execute a extern program from a stored procedure. Is there anybody who knows that or how to send mail from Oracle without UTL_SMTP?

    See my reply to 'chaitanyadatir' just below your post.
    null

  • How to Pass parameters to Crystal report 10 based on Oracle Stored Procedur

    Hi,
    I use the following code to pass the parameters:
    Rep.Tables[0].ConnectBuffer := Connection_Str;
    Rep.Tables[0].AliasName := 'REP';
    Rep.Connect.Propagate := True;
    Rep.ParamFields.ByName('Lang', '').CurrentValue := IIF(BiDiMode = bdRightToLeft, '2', '1');
    Rep.ParamFields.ByName('SESSION_ID', '').CurrentValue := IntToStr(Session_id);
    Rep.WindowState := wsMaximized;
    Rep.Show;
    The 1st parameter 'Lang' which created from crystal report pass well,
    but the 2nd parameter 'SESSION_ID' which created from Oracle Stored Procedures give the following Error:
    Error: 202 Parameter Name could not be found u2013 ParamFields.ByName
    However in MS SQL Server the above code work fine with the 2 Parameters.
    Any one has solution,

    Hello,
    Click on the businessobjects Tab above and then select Samples and dowload the sample app you for your SDK. There are a few samples for changing/setting Parameters.
    The Parameter collection has all parameters.
    Thank you
    Don

  • Create BO 4 universe based on netezza stored procedures

    Hi All
    Can we create Universe using Netezza Stored procedures.
    Thanks

    Hi,
    As I said this is the only way to build universes on SAP ERP (ECC 6.0).
    This application is currently a prototype but it is planned to deliver an official support of SAP ERP (ECC 6.0) by Data Federator in the coming weeks.
    Data Federator will be used for both XI 3.1 and BI 4.x to access SAP ERP data: this access will be provided only for the XI 3.1 release, we also plan to support it in BI 4.1.
    Regards
    Didier

  • Documenting Program Units in Procedure Builer

    I would like to generate documentation from my procedures.
    Is there a documentation tool in Oracle Procedure Builder that corresponds to something like JavaDoc in the JDK Environments?
    null

    Hello PCZ,
    I guess that the priority level is set in the same way like triggers. For example, when a trigger is created in item-level, block-level and form-level, the item-level is given the highest priority and that only would execute. Isn't it?
    Similar to that, when a subroutine is defined in Form, PLL and Database, since being in local, the subroutine in Form only would be invoked. I don't think that you can change this default behaviour.
    In case if you want to overload this default behaviour, you can use the package concept. as suggested by Bernd.
    Warm Regards,
    Raja

  • Calling programs for stored procedures

    Is it possible to call an executable program or DLL module from
    a PL/SQL block? If yes, how?

    Read the manual regarding 'external routines'
    http://technet.oracle.com/docs/products/oracle8i/doc_library/817_
    doc/appdev.817/a76939/adg11rtn.htm#1656

  • Forms Data-Block based on stored procedures - REF CURSOR feature NOT FUNCTIONING

    This topic is related to another topic in this forum titled "FORMS HOW TO SET QUERY SOURCE ARGUMENTS??" I posted my message there as well. I am posting as a NEW TOPIC so that it catches the attention of Oracle Support.
    I built a data form based on a stored procedure and REF CURSOR IN OUT parameter.
    My procedure takes a IN parameter to fill in the criteria for the OPEN <cursor_variable> select ... where ... statement.
    In the Value setting of the Query source Arguments , I set the VALUE to ":BLOCK_NAME.ITEM_NAME" at design time to supply the input value to the procedure. this works to the extent of making available the form item value to the stored procedure parameter. I verified this by doing an insert into some debug table , of the incoming parameter value inside my stored procedure.
    The cursor gets opened properly into the REF cursor variable. I verified this by fetching a record into a local variable and inserting the value into a debug table again in the stored procedure.
    (I took care to close and re-open the REF cursor variable again - so that the front-end can continue to fetch it from the first record. )
    ***** PROBLEM **************
    But the front end forms runtime is giving me a FRM-40301 - query returned no records even though the REF cursor is returned properly opened.
    Did anybody else face the same problem ??
    Please post what you found.
    Thanks,
    Shankaran
    null

    This topic is discussed at length in another thread "How Set Value For Query DataSource Arguments?"
    But I am posting the findings here as well.
    THIS TOPIC IS CLOSED.
    My Bad. The problem Cause : I did not include all columns in the
    cursor rowtype in the Data-block. In the wizard for the data block , I selected ONLY the columns that I needed. But I was doing a Select * from <my_table> in my open cursor <Cursor-Variable> .... The <Cursor Variable>
    itself was declared <my_table>%rowtype
    FIX : The Data Block structure (columns included as items) should match the cursor record Structure. One may or may not
    display all the columns in the LAYOUT though.
    But I don't understand why it gives such a misleading message like FRM-40301 Query retrieved no records. Oracle Team fix it.
    Hope this helps people who face the same problem.
    Thanks,

Maybe you are looking for