DDL  Forms

Is there a way to do DDL operations such as alter a table with in forms .
Thanks in advance

Example 1
** Built-in: FORMS_DDL
** Example: The expression can be a string literal.
BEGIN
Forms_DDL('create table temp(n NUMBER)');
IF NOT Form_Success THEN
Message ('Table Creation Failed');
ELSE
Message ('Table Created');
END IF;
END;
Example 2
** Built-in: FORMS_DDL
** Example: The string can be an expression or variable.
** Create a table with n Number columns.
** TEMP(COL1, COL2, ..., COLn).
PROCEDURE Create_N_Column_Number_Table (n NUMBER) IS
my_stmt VARCHAR2(2000);
BEGIN
my_stmt := 'create table tmp(COL1 NUMBER';
FOR I in 2..N LOOP
my_stmt := my_stmt||',COL'||TO_CHAR(i)||' NUMBER';
END LOOP;
my_stmt := my_stmt||')';
** Now, create the table...
Forms_DDL(my_stmt);
IF NOT Form_Success THEN
Message ('Table Creation Failed');
ELSE
Message ('Table Created');
END IF;
END;
Example 3:
** Built-in: FORMS_DDL
** Example: The statement parameter can be a block
** of dynamically created PL/SQL code.
DECLARE
procname VARCHAR2(30);
BEGIN
IF :global.flag = 'TRUE' THEN
procname := 'Assign_New_Employer';
ELSE
procname := 'Update_New_Employer';
END IF;
Forms_DDL('Begin '|| procname ||'; End;');
IF NOT Form_Success THEN
Message ('Employee Maintenance Failed');
ELSE
Message ('Employee Maintenance Successful');
END IF;
END;
Example 4:
** Built-in: FORMS_DDL
** Example: Issue the SQL statement passed in as an argument,
** and return a number representing the outcome of
** executing the SQL statement.
** A result of zero represents success.
FUNCTION Do_Sql (stmt VARCHAR2, check_for_locks BOOLEAN := TRUE)
RETURN NUMBER
IS
SQL_SUCCESS CONSTANT NUMBER := 0;
BEGIN
IF stmt IS NULL THEN
Message ('DO_SQL: Passed a null statement.');
RETURN SQL_SUCCESS;
END IF;
IF Check_For_Locks AND :System.Form_Status = 'CHANGED' THEN
Message ('DO_SQL: Form has outstanding locks pending.');
RETURN SQL_SUCCESS;
END IF;
Forms_DDL(stmt);
IF Form_Success THEN
RETURN SQL_SUCCESS;
ELSE
RETURN Dbms_Error_Code;
END IF;
END;

Similar Messages

  • Referencing Global Variable in Forms DDL (Form Personalization R12)

    Team,
    I'm saving a profile option in a Global variable GLOBAL.FLINV_PROFILE_VALUE when a form opens.
    Then I am clearing the variable using Forms DDL and calling FND_PROFILE.SAVE function.
    I need to then reset the profile option with a second call to FND_PROFILE.SAVE. I'm trying to use Forms DDL, i.e.
    DECLARE
    a BOOLEAN;
    BEGIN
    a := fnd_profile.SAVE ('PER_SECURITY_PROFILE_ID'
    , '''||:global.flinv_profile_value||'''
    , ''USER''
    , ''1110''
    , NULL
    , NULL
    END;
    but I'm not finding a proper way to pass that global variable. Is there a way to reference these variables in the DDL? Should I use 'Call a procedure' and format the call differently?
    Any ideas are welcome.
    Joe

    Not sure why your using an anonymous block. Personalization rules should look like the following in a *.ldt file.
    BEGIN FND_FORM_CUSTOM_RULES "314"
    FUNCTION_NAME = "INV_INVITSNU"
    DESCRIPTION = "Disable Query-Enter Mode"
    TRIGGER_EVENT = "WHEN-NEW-BLOCK-INSTANCE"
    TRIGGER_OBJECT = "MTL_SERIAL_NUMBERS"
    SEQUENCE = "20"
    CREATED_BY = "34307"
    CREATION_DATE = "2012/04/22"
    OWNER = "USER123"
    LAST_UPDATE_DATE = "2012/04/22"
    LAST_UPDATE_LOGIN = "145888118"
    ENABLED = "Y"
    FIRE_IN_ENTER_QUERY = "N"
    FORM_NAME = "INVITSNU"
    RULE_TYPE = "A"
    BEGIN FND_FORM_CUSTOM_ACTIONS "314" "314"
    SEQUENCE = "10"
    PROPERTY_VALUE = "5"
    ARGUMENT_TYPE = "B"
    CREATED_BY = "34307"
    CREATION_DATE = "2012/04/22"
    OWNER = "USER123"
    LAST_UPDATE_DATE = "2012/04/22"
    LAST_UPDATE_LOGIN = "145888118"
    TARGET_OBJECT = "MTL_SERIAL_NUMBERS"
    ACTION_TYPE = "P"
    ENABLED = "Y"
    OBJECT_TYPE = "BLOCK"
    MESSAGE_TYPE = "S"
    BUILTIN_TYPE = "C"
    LANGUAGE = "*"
    PROPERTY_NAME = "195"
    MENU_SEPERATOR = "N"
    END FND_FORM_CUSTOM_ACTIONS
    BEGIN FND_FORM_CUSTOM_SCOPES "314" "20" ""
    LAST_UPDATE_DATE = "2012/04/22"
    OWNER = "USER123"
    CREATION_DATE = "2012/04/22"
    CREATED_BY = "34307"
    LAST_UPDATE_LOGIN = "145888118"
    END FND_FORM_CUSTOM_SCOPES
    END FND_FORM_CUSTOM_RULES

  • DML/DDL/Forms

    1.Can any one write a select statement to generate sequencial number ?
    2.How to print the duplicate records from a table ?
    3.What is the difference between a WHERE Clause and HAVING Clause?
    4.What is the difference between Key-Next Trigger and When-Validate Trigger?
    5.What is a Transaction in Oracle?
    6.What are Database triggers and Stored Procedures?
    7. What is the difference between Function,Procedures,Packages?
    Hope it is enough for the day..Will write more question upon receving answers for the above..
    Guruprasad T.N.

    A 1 Check the Create Sequence
    A 2 In Form When We Are In Detail Section
    Can use Function Key F4 For Copying the Prev. record as it to the Next Record.
    A 3 Where Clause Is used for the Resticting For the Single Row Funtions.
    and Having is used for Group Functions
    Q4 What is the difference between Key-Next Trigger and When-Validate Trigger..
    Ans : Key Next Item can used for developer required Rotines ...While When -validate-trigger can be used for the Check the Validation of the Record.
    I provid u the Answers but....The is important piece of work
    Remaing Next Time.......
    Regards.
    M.Azam Rasheed
    ([email protected])
    MCS,OCP
    null

  • Assign Task to a specific user based on the value of DDL from the form

    Hello,
    Can any one please advise me on how to assign a task to a specific user based on the value of the drop down list from the form. E.g. user fills the form and before they submit the form they have to select one of the name from the drop down list so the form can go to that person for approval.
    Thanks in advance,
    Han

    I got it works now by using the xpath expression (in workbench) to assign to the selected user from the DDL in the form.

  • Fill DDL based on other field values in offline interactive adobe form

    Hi,
    I have a requirement where in i need to fill the values for a dropdown list  based on 3 other field values in offline adobe interactive forms which uses web service to interact with SAP.
    Note: I read many blogs and posts in SDN , but couldn get much info ab the same, so posting a new thread.
    Thank you.
    Regards,
    Soumya

    Hi Soumya,
    It is possible but a little bit tough and will make your form heavier.
    The solution is advisable only when there is not very much data required for the drop down(May be not more than 500 values as it will create performance issue).
    You can create a hidden table on the form contaning data for all the combinations. Depending on the selection of another 3 fields you can write the code to select only those values from this hidden table which are applicable to that selection. These values you can add to the drop down list removing the previous values.
    Only you have to do is on calculate or vlaidate event of target DDL you have to write your code.
    Pseudocode:
    1. Clear your DDL using deleteItem() method.
    2. Loop at your hidden table.
    3. Inside the loop check for applicable entries depending on selection in other 3 fields.
    4. Select the appropriate vlaues
    5. Add using additem method().
    Refer formCalc or JavaScript help for the appropriate code.
    Hope this will be helpfull.
    Regards,
    Vaibhav

  • Forms ddl insert

    I have gone over many forms ddl code and still cannot get this insert statement right.... I have worked on this for a day now so any help would be thankful
    I have a when button pressed trigger
    with this code
    Declare
    REMP_ID number(2);
    Request_ID number(7);
    Pending Varchar2(10);
    begin
         REquest_ID := :control.text_item126;
         pending := 'P';
         remp_id := :global.tracker;
    /*This is so I know that my variables are working*/
         :text_item136:= remp_id;
         :text_item137:= pending;
         :text_item138:= request_id;
         :text_item139:= sysdate;
    FORMs_DDL('INSERT INTO request VALUES('||remp_id||''','''||request_ID||''','''||sysdate||''','''||Null||''','''||pending||')');
    /*have tried variations of single quotes to no avail*/
    End;

    FORMs_DDL('INSERT INTO request VALUES('||remp_id||''','''||request_ID||''','''||sysdate||''','''||Null||''','''||pending||')');
    <p>If your value of remp_id is 123, and request_ID is 456, your statement would translate to this:
    <p>INSERT INTO request VALUES(123','456','31-JAN-06','','P)Not a well-formed statment.
    <p><font color="red">But WHY do you need Forms_DDL anyway? What is wrong with a straight insert statement:</font>
    <p>INSERT INTO request
      values(:global.tracker,:control.text_item126, sysdate, null, 'P');And just some advice: Never code an insert statement without naming the columns in the table. If the table gets altered and a column is added, your code will fail.
    <p>> still nothing is actually being inserted into the database
    <p>Are you forgetting that a commit is necessary after issuing a SQL insert/update/delete from a form?

  • Based on DDL value ,How to make few other fields visible in Adobe forms in SAP CRM??

    Hi All,
            I need to make few fields visible in adobe forms, based on the dropdown value which user selects.....

    Hi Vignesh,
         In the "EXIT" or "CLICK"event of the particular Drop down field you can write the below code(in Java script).
    if (this.rawvalue == <value> )
          <field name>.presence = "invisible";
    else
        <field name>.presence = "visible";
    Thanks,
    Ashok N.

  • Reg. DDL in Tabular form in Apex

    Hi,
    I have used a select list in Tabular form report. My select list is retrieving only 21 rows.
    But the performance is very slow. Please help me to increase the speed of processing.
    Thanks,
    Madhu

    Hello Madhu,
    Can you post the query of your select list - and of your tabular form (or report). Why do you assume the problem is in the select lst? What happens to the performance if you omit the select list?
    Regards,
    Roel
    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.logica.com/

  • How to use DDL-Operations in before processing the form

    I want to drop and create a sequence when i make a form with
    WEBDB at the part "before processing the form" where i can add a
    PL/SQL code in a varius text area.
    Sybille Krvnert

    not sure in webdb how to do that, but I think you can put the
    code in the before proccessing form and after processing form
    block. In portal that should work, or you can place code in the
    button events for the save/insert/update buttons to do that like
    this:
    create sequence .....
    doInsert;
    drop sequence ....

  • DDL in Forms..

    Hi ..
    I need to know if possible ..how to create table or user with privligase in DEVELOPER2000 form Builders I can do it using SQL but I wanna build a FORM to do this job,, I tryed creating procedure but always gives errors..
    Please I need to know if it possible and how ??
    thanx

    You can try using the FORMS_DDL built-in, or dynamic SQL using the DBMS_SQL package. (Look in the database for documentation on DBMS_SQL.)
    Regards,
    Robin Zimmermann
    Forms Product Management

  • Generate Query in PLSQL to return Well Formed XML with Multiple records

    Hi there
    This is very urgent. I am trying to create a PLSQL query that should retrieve all records from oracle database table "tbl_Emp" in a well formed xml format. The format is given below
    *<Employees xmlns="http://App.Schemas.Employees" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">*
    *<Employee>*
    *<First_Name></First_Name>*
    *<Last_Name></Last_Name>*
    *</Employee>*
    *<Employee>*
    *<First_Name></First_Name>*
    *<Last_Name></Last_Name>*
    *</Employee>*
    *</Employees>*
    To retrieve data in above format, I have been trying to create a query for long time as below
    SELECT XMLElement("Employees",
    XMLAttributes('http://App.Schemas.Employees' AS "xmlns",
    *'http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi"),*
    XMLElement("Employee", XMLForest(First_Name, Last_Name)))
    AS "RESULT"
    FROM tbl_Emp;
    But it does not give me the required output. It creates <Employees> tag with each individual record which I don't need. I need <Employees> tag to be the root tag and <Employee> tag to repeat and wrap each individual record. Please help me in this as this is very urgent. Thanks.

    Hi,
    Please remember that nothing is "urgent" here, and repeating that it is will likely produce the opposite effect.
    If you need a quick answer, provide all necessary details in the first place :
    - db version
    - test case with sample data and DDL
    That being said, this one's easy, you have to aggregate using XMLAgg :
    SELECT XMLElement("Employees"
           , XMLAttributes(
               'http://App.Schemas.Employees' AS "xmlns"
             , 'http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi"
           , XMLAgg(
               XMLElement("Employee"
               , XMLForest(
                   e.first_name as "First_Name"
                 , e.last_name  as "Last_Name"
           ) AS "RESULT"
    FROM hr.employees e
    ;

  • Form where testing if radiobuttonlist is null and then display message

    I created a test form to try to get this work and can't seem to make it work. In my form I have a ddlist on page 1. on page 2 I have a subform that the selection in the ddl makes visible--that's working.
    There is a radiobuttonlist in the subform. I'd like to check on the submit button if ddl == 2 and radiobuttonlist == null then display a message. Here is my script:
    //Create a variable to hold the document object
    var 
    v3 = form1.page1.division.rawValue;
    var 
    v15 = form1.page2.pcEquip.dirAbove.RadioButtonList.rawValue;  
    if 
    ((v3 == 2) && (v15 == null)) {
    xfa.host.messageBox( "Please indicate whether the associate is a director or above" );
    xfa.host.setFocus("form1.page2.pcEquip.dirAbove.RadioButtonList");
    else 
    Button3.execEvent("click");
    The script is finishing as desired with the email window, but doesn't catch that the radiobuttonlist is null. Any help would be appreciated.
    Thanks,
    MDawn

    Hi,
    Test the radio button exclusion group against an emply string. For example:
    if (v15 == "")
         // your script here.
    Hope that helps,
    Niall

  • Populating Drop-down List in Interactive Forms for Java

    Hi,all
    I need to populate a drop-down list in Interactive Form.
    I tried to do it by using Dynamic Properties of the drop-down
    list,but didn't give nothing.At the same time I have successfully
    populated a simple drop-down list(on webdynpro view),which I
    replaced near my InteractiveForm.
    What may be the problem?
    Regards,
    Michael

    Use the DDL from the Web Dynpro pallette. Bind the same/ similar attribute of the DDL you used in the web Dynpro view in the interactive form also... this should work..
    Thanks and Regards,
    Anto.

  • Dbms_Sql in forms 9i

    We are migrating forms from forms6i to 9i
    In forms 6i they are using the below
    code.
    l_cursor := dbms_sql.open_cursor;
    dbms_sql.parse(l_cursor, l_stmt,2);
    l_result := dbms_sql.execute(l_cursor);
    dbms_sql.close_cursor(l_cursor);
    In forms9i this is giving a compilation error.
    I created a procedure in the database with this code
    and calling the procedure in my forms9i, it is not giving compilation error, but at runtime it is giving this error
    Error ORA-00942: table or view does not exist
    ORA-06512: at "SYS.DBMS_SYS_SQL line 826
    ORACE-06512: at "SYS.DBMS_SQL", line 39
    ORA-06512: at "scott.sample" line 6
    please suggest what to use instead of dbms_sql to solve this problem

    DBMS_SQL is a server-side package, and DBMS_SQL.Native is a package variable. Server-side package variables cannot be accessed from forms. You can substitute the number 1 for the variable, though.
    However, Oracle does not support using dbms_sql from Forms, anyway. You can use Exec_SQL, which is a Forms-side package, and it is almost the same as DBMS_SQL.
    However, if you are just issuing some DDL, Forms_DDL will work fine. It is only when you want to retrieve data from the server that you need to use Exec_SQL.

  • Multiple connection in one form, is it possible?

    Im trying to access two different database (P.O.7 and the other is an ODBC Compliant) in one form.
    First thing i did was to run the wizard on each block using different login (1 for my PO7 and also the other) and it was successful, but when I try to execute the form, it just cant recognized the other block! since im only connected to other datasource....
    Any suggestion on what should i do with this....

    Check out the EXEC_SQL command under help in Forms
    The EXEC_SQL package allows you to access multiple Oracle database servers on several different connections at the same time. Connections can also be made to ODBC data sources via the Open Client Adapter (OCA), which is supplied with Developer. To access non-Oracle data sources, you must install OCA and an appropriate ODBC driver.
    The EXEC_SQL package contains procedures and functions you can use to execute dynamic SQL within PL/SQL procedures. Like the DBMS_SQL package, the SQL statements are stored in character strings that are only passed to or built by your source program at runtime. You can issue any data manipulation language (DML) or data definition language (DDL) statement using the EXEC_SQL package.

Maybe you are looking for

  • HP Officejet 6500 e709a, printer offline

    Hello, In our office, several computers are able to print, through the network, from this printer. However, our manager's laptop, (Gateway with 1.6g processor, xp 2002 w/ service pack3) is now not printing from this wirelessly. Problem has persisted

  • Clean Install Mavericks and Restoring files

    Good afternoon everyone, I want to do a clean install of Mavericks on my iMac so I have a fresh system to work with.  Having read all the blogs I think I understand how to actually do the clean install via a USB stick but there appears to be a wide r

  • Can ipod nano sync calendars from windows office 2002

    I have a brand new ipod nano 3rd Generation and I can sync contacts from my windows address book. But I cant sync any calendar info or any to-do lists. It shows that "windows outlook must be installed to sync calendars". I have MS Outlook installed a

  • How to create Product, Software Component..after the XI Installation

    Hi Experts, SAP XI was installed completely. After this, I would like to test some sample File – File scenario. But I am not sure, how to create the Product, Software Component etc. I am able to login and run the SXMB_IFR to get the XI tools. Can som

  • How-to use Application Dictionary ?

    To access an external SOAP service from Forte, I installed iPlanet Integration Server. I also managed to create a Application Dictionary component with Service Information to access the SOAP service. How can I use this Application Dictionary in my Fo