DBMS_METADATA.GET_DDL inside the pl/sql procedure

We have a requirement to drop certain materialized view and need to recreate based on certain condition inside the
pl/sql procedure.i am using the dbms_metadata to get the Mv ddls.
var1 := 'SELECT DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW,'MV_NAME','OWNER')'|| 'from dual' || ';' ;
dbms_output.put_line(var1);
But i am unable to get the create ddl syntax in var1.
Can anyone help me on this

Hi Deepu,
you are not helping us too much. You information are coming drop by drop.
Anyway, I don't have a materialized view but I have tried with a table.
Here is my test and output (what I expect you too show us too):
First test using normal SELECT FROM DUAL:
SET LONG 2000000
SET HEAD OFF
SET ECHO ON
SELECT DBMS_METADATA.get_ddl ('TABLE', 'ALERT_QT', 'SYS') FROM DUAL;
Output:
SQL>
SQL> SELECT DBMS_METADATA.get_ddl ('TABLE', 'ALERT_QT', 'SYS') FROM DUAL;
  CREATE TABLE "SYS"."ALERT_QT"
   (    "Q_NAME" VARCHAR2(30),
        "MSGID" RAW(16),
        "CORRID" VARCHAR2(128),
        "PRIORITY" NUMBER,
        "STATE" NUMBER,
        "DELAY" TIMESTAMP (6),
        "EXPIRATION" NUMBER,
        "TIME_MANAGER_INFO" TIMESTAMP (6),
        "LOCAL_ORDER_NO" NUMBER,
        "CHAIN_NO" NUMBER,
        "CSCN" NUMBER,
        "DSCN" NUMBER,
        "ENQ_TIME" TIMESTAMP (6),
        "ENQ_UID" VARCHAR2(30),
        "ENQ_TID" VARCHAR2(30),
        "DEQ_TIME" TIMESTAMP (6),
        "DEQ_UID" VARCHAR2(30),
        "DEQ_TID" VARCHAR2(30),
        "RETRY_COUNT" NUMBER,
        "EXCEPTION_QSCHEMA" VARCHAR2(30),
        "EXCEPTION_QUEUE" VARCHAR2(30),
        "STEP_NO" NUMBER,
        "RECIPIENT_KEY" NUMBER,
        "DEQUEUE_MSGID" RAW(16),
        "SENDER_NAME" VARCHAR2(30),
        "SENDER_ADDRESS" VARCHAR2(1024),
        "SENDER_PROTOCOL" NUMBER,
        "USER_DATA" "SYS"."ALERT_TYPE" ,
        "USER_PROP" "SYS"."ANYDATA" ,
         PRIMARY KEY ("MSGID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "SYSAUX"  ENABLE
   ) USAGE QUEUE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGIN
G
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "SYSAUX"
OPAQUE TYPE "USER_PROP" STORE AS LOB (
  ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
  CACHE
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))
{code}
Now with the procedure storing in CLOB variable
{code:sql}
SET SERVEROUTPUT ON SIZE UNLIMITED
SET LIN 5000
SET LONG 20000000
SET ECHO ON
DECLARE
   l_clob         CLOB;
BEGIN
   l_clob := DBMS_METADATA.get_ddl ('TABLE', 'ALERT_QT', 'SYS');
   DBMS_OUTPUT.put_line (l_clob);
END;
Output:
SQL>
SQL> DECLARE
  2     l_clob         CLOB;
  3  BEGIN
  4     l_clob := DBMS_METADATA.get_ddl ('TABLE', 'ALERT_QT', 'SYS');
  5     DBMS_OUTPUT.put_line (l_clob);
  6  END;
  7  /
  CREATE TABLE "SYS"."ALERT_QT"
   (    "Q_NAME" VARCHAR2(30),
        "MSGID" RAW(16),
        "CORRID" VARCHAR2(128),
        "PRIORITY" NUMBER,
        "STATE" NUMBER,
        "DELAY" TIMESTAMP (6),
        "EXPIRATION" NUMBER,
        "TIME_MANAGER_INFO" TIMESTAMP (6),
        "LOCAL_ORDER_NO" NUMBER,
        "CHAIN_NO" NUMBER,
        "CSCN" NUMBER,
        "DSCN" NUMBER,
        "ENQ_TIME" TIMESTAMP (6),
        "ENQ_UID" VARCHAR2(30),
        "ENQ_TID" VARCHAR2(30),
        "DEQ_TIME" TIMESTAMP (6),
        "DEQ_UID" VARCHAR2(30),
        "DEQ_TID" VARCHAR2(30),
        "RETRY_COUNT" NUMBER,
        "EXCEPTION_QSCHEMA" VARCHAR2(30),
        "EXCEPTION_QUEUE" VARCHAR2(30),
        "STEP_NO" NUMBER,
        "RECIPIENT_KEY" NUMBER,
        "DEQUEUE_MSGID" RAW(16),
        "SENDER_NAME" VARCHAR2(30),
        "SENDER_ADDRESS" VARCHAR2(1024),
        "SENDER_PROTOCOL" NUMBER,
        "USER_DATA" "SYS"."ALERT_TYPE" ,
        "USER_PROP" "SYS"."ANYDATA" ,
         PRIMARY KEY ("MSGID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "SYSAUX"  ENABLE
   ) USAGE QUEUE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "SYSAUX"
OPAQUE TYPE "USER_PROP" STORE AS LOB (
  ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
  CACHE
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))
{code}
It should be nice if you could post your tests too if they are not working.
Regards.
Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Are the Pl/sql procedure and function atomic by themself

    i want to ask a question does oracle pl/sql procedure and function support Atomicity for the database by themself , or they became atomic incase we call them using begin -- end;

    You appear to be discussing transaction scope which is completely independent of PL/SQL blocks like procedures or how you call procedures. It's all in where commits (or rollbacks) are issued.
    If you have a procedure like this
    CREATE PROCEDURE p1
    AS
    BEGIN
      INSERT INTO some_table( key, value ) VALUES( 1, 'Foo' );
      INSERT INTO some_table( key, value ) VALUES( 1, 'Bar' );
    END;where the first statement succeeds and the second statement fails as a result of a duplicate key, there will still be a Foo row in the table but the procedure will have thrown an exception. The caller of the procedure may choose to commit or rollback the change-- that will determine whether the first statement's results are made permanent. If you have a procedure like this,
    CREATE PROCEDURE p1
    AS
    BEGIN
      INSERT INTO some_table( key, value ) VALUES( 1, 'Foo' );
      commit;
      INSERT INTO some_table( key, value ) VALUES( 1, 'Bar' );
    END;the commit will make the first insert permanent regardless of whether the second statement fails no matter what the calling code does (that's one reason that putting commits in stored procedures is generally a bad idea-- the caller is in a much better position to know what other uncommitted work has been done and whether it is safe to commit.
    Justin

  • How to call sql loader ctrl file with in the pl/sql procedure

    Hi Friends,
    I am doing a project related with the transferring data using queues. In the queue , I will get a tab delimited data in the form of CLOB variable/message. I do want to store that dat in the oracle table.
    When updating data into the table ,
    1. Don't want to write that data into a file.( Want to access directly after dequeueing from the specfic queue).
    2. As the data is in tab delimited form, I want to use sql loader concept.
    How do I call the sql loader ctrl file with in my pl/sql procedure. When I searched , most of the forums recommending external procedure or Java program.
    Please Guide me on this issue. my preferrence is pl sql, But don't know about external procedure . If no other way , I will try Java.
    I am using oracle 9.2.0.8.0.
    Thanks in advance,
    Vimal..

    Neither SQL*Loader nor external tables are designed to read data from a CLOB stored in the database. They both work on files stored on the file system. If you don't want the data to be written to a file, you're going to have to roll your own parsing code. This is certainly possible. But it is going to be far less efficient than either SQL*Loader or external tables. And it's likely to involve quite a bit more code.
    The simplest possible thing that could work would be to use something like Tom Kyte's string tokenization package to read a line from the CLOB, break it into the component pieces, and then store the different tokens in a meaningful collection (i.e. an object type or a record type that corresponds to the table definition). Of course, you'll need to handle things like converting strings to numbers or dates, rejecting rows, writing log files, etc.
    Justin

  • Using cron-job to call the PL/SQL procedure for every 5 min

    Hi All,
    i wrote one procedure. using cron-job to call this PL/SQL procedure for every 5 min. i don't have any idea about cron job & what is thescript file formate .where can i place that script file. what are the details we placed in that script

    Really appreciate you. I like this approach .
    please give me advice for the below thing
    job_action =>an i give my procedure name under this?
    BEGIN
    -- Job defined entirely by the CREATE JOB procedure.
    DBMS_SCHEDULER.create_job (
    job_name => 'Job_schedule_update',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN Schedule_update; END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'FREQ=HOURLY;BYMINUTE=5',
    end_date => NULL,
    enabled => TRUE,
    comments => 'Job defined entirely by the CREATE JOB procedure.');
    END;

  • Unable to Load CSV file with comma inside the column(Sql Server 2008)

    Hi,
    I am not able load an CSV file with Comma inside a column. 
    Here is sample File:(First row contain the column names)
    _id,qp,c
    "1","[ ""0"", ""0"", ""0"" ]","helloworld"
    "1","[ ""0"", ""0"", ""0"" ]","helloworld"
    When i specify the Text Qualifier as "(Double quotes) it work in SQL Server 2012, where as fail in the SQL Server 2008, complaining with error:
    TITLE: Microsoft Visual Studio
    The preview sample contains embedded text qualifiers ("). The flat file parser does not support embedding text qualifiers in data. Parsing columns that contain data with text qualifiers will fail at run time.
    BUTTONS:
    OK
    I need to do this in sql server 2008 R2 with Service pack 2, my build version is 10.50.1600.1.
    Can someone let me know it is possible in do the same way it is handle in SQL Server 2012?
    Or
    It got resolved in any successive Cumulative update after 10.50.1600.1?
    Regards Harsh

    Hello,
    If you have CSV with double quotes inside double quotes and with SSIS 2008, I suggest:
    in your data flow you use a script transformation component as Source, then define the ouput columns id signed int, Gp unicode string and C unicode string. e.g. Ouput 0 output colmuns
    Id - four-byte signed
    gp - unicode string
    cc - unicode string
    Do not use a flat file connection, but use a user variable in which you store the name of the flat file (this could be inside a for each file loop).
    The user variable is supplied as a a readonly variable argument to the script component in your dataflow.
    In the script component inMain.CreateNewOutputRows use a System.IO.Streamreader with the user variable name to read the file and use the outputbuffer addrow method to add each line to the output of the script component.
    Between the ReadLine instraction and the addrow instruction you have to add your code to extract the 3 column values.
    public override void CreateNewOutputRows()
    Add rows by calling the AddRow method on the member variable named "<Output Name>Buffer".
    For example, call MyOutputBuffer.AddRow() if your output was named "MyOutput".
    string line;
    System.IO.StreamReader file = new System.IO.StreamReader( Variables.CsvFilename);
    while ((line = file.ReadLine()) != null)
    System.Windows.Forms.MessageBox.Show(line);
    if (line.StartsWith("_id,qp,c") != true) //skip header line
    Output0Buffer.AddRow();
    string[] mydata = Yourlineconversionher(line);
    Output0Buffer.Id = Convert.ToInt32(mydata[0]);
    Output0Buffer.gp = mydata[1];
    Output0Buffer.cc = mydata[2];
    file.Close();
    Jan D'Hondt - SQL server BI development

  • System calls from PL/SQL procedure

    I have to invoke the SqlLoader from inside the pl/sql procedure.
    I tried with HOST & SYSTEM commands but failed because of some error it was showing .
    Declare a HOST or SYSTEM
    An urgent help is required.
    Thanks in advance

    See this:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:3618360089466

  • How to open report in the browser from PL/SQL procedure

    Hi,
    I need to call the report (with destype = SCREEN) from the PL/SQL procedure and display in the browser.
    For Example: when I call P_call_report procedure in my Forms6i button or at sql*plus, the report output PDF/HTML should open in the Browser window.
    Iam Using IE, report6i, forms 6i, Oracle 8.1.7, Windows OS
    I tried using UTL_HTTP(' ') in a procedure. But when I execute the procedure at sql*plus it says Pl/sql procedure completed successfully message without opening report output in the browser window. If I copy the same url and paste it in the browser, it works.
    Please let me know if there is any solution.
    thanks alot.

    I guess event driven publishing may work. But Iam not sure about the opening of the browser from inside the procedure.

  • Ws-basic username inside pl/sql procedure published as web service

    I'm new to jdeveloper, but been working with Oracle for 13 years...
    We have used Jdevelper to expose a pl/sql procedure as a web service using the "Publish as web service..." wizard. We then used Web Services Manager in server agent mode to protect that web service using ws-basic header auth. OWSM does a lookup on the user supplied credentials against our active directory ldap server to determine if the user should be able to call the service. That all works, EXCEPT...
    The problem is that the stored procedure runs a query against data protected by virtual private database and extensive audit logs. We need access to the ws-basic credential from within oracle so that we can set the session context and pull the end-user's id for auditing purposes.
    Right now, all we know inside the stored procedure is the oracle username used to connect to the database. This is of course different from the one used to authenticate our user in the OWSM layer.
    The pl/sql procedure does not have a parameter to specify the user name, and even if it did, there is no way for us to verify that any user supplied parameter matches the credentials used in OWSM.
    So, I assume, I need to modify the code generated by the "Publish as web service" wizard and somehow pull the ws-basic credentials (just username) and push them into the Oracle session_context.
    Anyone have any sample code or advice on how to get access to ws-basic credentials or even any of the metadata on a certificate supplied to OWSM for authentication/authorization?

    I change p_action value ( before p_action => 'alta' ) now ( p_action => '"alta"' )
    res := Xxm_Web_Service_Client_Pkg.invoke(p_init_msg_list => FND_API.G_TRUE,
    p_url => 'http://198.137.253.178:7777/event/DefaultSystem/clienteService_RS',
    p_action => '"alta"',
    x_return_status => l_return_Status,
    x_msg_count => l_msg_count,
    x_msg_data => l_msg_data,
    x_req => req)
    And the invokation an ESB service from a PLSQL procedure began to work fine !!!
    Thanks for all answers
    Thans Peter !!!
    Claudio

  • Use of DBMS_METADATA.GET_DDL with respect to triggers

    We are very pleased with DMBS_METADATA for punching DDLs in general, We use the following to create executable scripts for recreating any object in our databases.
    SELECT DBMS_METADATA.GET_DDL('OBJECT_TYPE', 'OBJECT_NAME', 'SAINADM' ) from dual;
    In most types of object, the DDL produced can be executed without errors, providing that the original target object was well founded. However, we have found that in the case of a triggers, the DDL produced does not function for the following reason:
    EXAMPLE
    -- This set of instructions is produced by a metascript too complicated to show here
    SPOOL TRIGGER_NAME.trg
    SELECT DBMS_METADATA.GET_DDL('TRIGGER', 'TRIGGER_NAME', 'SCHEMA_NAME' ) txt
    FROM DUAL;
    SPOOL OFF
    END OF EXAMPLE
    This will produce the following output, spooled to the file TRIGGER_NAME.trg
    OUTPUT
    -- we have anonymised our object names
    -- the syntax is what I would like you to focus on
    CREATE OR REPLACE TRIGGER "SCHEMA_NAME"."TRIGGER_NAME"
    BEFORE INSERT on SCHEMA_NAME.TABLE_NAME FOR EACH ROW
    BEGIN
    select SCHEMA_NAME.SEQUENCE_NAME.nextval
    into :new.colname
    from dual;
    END;
    ALTER TRIGGER SCHEMA_NAME"."TRIGGER_NAME" ENABLE
    _END OF OUTPUT_
    Note what has happened.
    1. The trigger DDL has been produced
    2. So has a the ALTER TRIGGER ... ENABLE
    3. BUT => between the trigger DDL and the alter trigger statement the is no slash (of course, because naturally DBMS_METADATA does not produce such characters). BUT this is problematic, because the combination of the Create trigger statement and the alter trigger statement, without a slash in between means that the spool file is atomically illegal. Because in real life we need a slash between the two staements.
    Why is this a problem for us?
    - Because we are about to introduce the automation of object changes between our "Development" "Integration" "Quality Assurance" and "Production" databases based on the execution of files produced by DBMS_METADATA.GET_DDL. For every other type of object, the file produced is well founded and executable DDL that will create the object. But in the case of triggers, the existence of the alter trigger statement renders the foregoing create trigger statement unexecutable.
    The use of DMBS_METADATA is more or less vanilla. That is to say, there appears to be no scope for instructing DBMS_METADATA to abstain form including the alter trigger statement
    SELECT DBMS_METADATA.GET_DDL('TRIGGER', 'TRIGGER_NAME', 'SCHEMA_NAME' ) txt
    Here are my questions
    1. How can we punch the DDL for triggers without bringing the alter trigger statement
    2. Alternatively, how can we automate the insertion of the slash character in between the CREATE TRIGGER and the ALTER TRIGGER in the original metascript that creates the example spool file.
    Thanks for your attention. Every response will be welcomed.
    Edited by: user10248070 on Mar 2, 2010 3:54 AM

    You can use
    dbms_metadata.set_transform_param( DBMS_METADATA.SESSION_TRANSFORM, 'SQLTERMINATOR', TRUE );See http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10577/d_metada.htm#BGBJBFGE.
    Example:
    SQL> set long 1000
    SQL> set heading off
    SQL> select * from v$version;
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> exec dbms_metadata.set_transform_param( DBMS_METADATA.SESSION_TRANSFORM, 'SQLTERMINATOR', TRUE );
    PL/SQL procedure successfully completed.
    SQL> SELECT DBMS_METADATA.GET_DDL('TRIGGER', 'UPDATE_JOB_HISTORY', 'HR' ) txt
      2  FROM DUAL;
      CREATE OR REPLACE TRIGGER "HR"."UPDATE_JOB_HISTORY"
      AFTER UPDATE OF job_id, department_id ON employees
      FOR EACH ROW
    BEGIN
      add_job_history(:old.employee_id, :old.hire_date, sysdate,
                      :old.job_id, :old.department_id);
    END;
    ALTER TRIGGER "HR"."UPDATE_JOB_HISTORY" ENABLE;Edited by: P. Forstmann on 2 mars 2010 13:48

  • Calling PL/SQL Procedure In Another Schema Gives Unexpected Result

    I have a SQL Script that does this:
    conn pnr/<password for user pnr>;
    set serveroutput on;
    exec vms.disable_all_fk_constraints;
    SELECT owner, constraint_name, status FROM user_constraints WHERE constraint_type = 'R';
    and the disable_all_fk_constraints procedure that is owned by user 'vms' is defined as:
    create or replace
    procedure disable_all_fk_constraints is
    v_sql   VARCHAR2(4000);
    begin
    dbms_output.put_line('Disabling all referential integrity constraints.');
    for rec in (SELECT table_name, constraint_name FROM user_constraints WHERE constraint_type='R') loop
    dbms_output.put_line('Disabling constraint ' || rec.constraint_name || ' from ' || rec.table_name || '.');
    v_sql := 'ALTER TABLE ' || rec.table_name || ' DISABLE CONSTRAINT ' || rec.constraint_name;
    execute immediate(v_sql);
    end loop;
    end;
    When I run the SQL script, the call to vms.disable_all_fk_constraints disables the FK constrains in the 'vms' schema, whereas I wanted it to disable the FK constraints in the 'pnr' schema (the invoker of the procedure). I know that I could make this work by copying the disable_all_fk_constraints procedure to the 'pnr' schema and calling it as "+exec disable_all_fk_constraints;+" from within the SQL script but I want to avoid having to duplicate the PL/SQL procedure in each schema that uses it.
    What can I do?
    Thank you

    You have two issues to solve.
    First you need to write a packaged procedure that works with INVOKER rights. The default is DEFINER rights.
    The difference is excatly what you need. Usually the package has the rights from the schema where it is defined (=Definer rights). In your case schema VMS. Whereas you need the privileges from the user that calls the package (PNR).
    => Check out the documentation for INVOKER rights
    The second problem is that the view "user_constraints" will not give the results you expect when called from inside a procedure in another schema. An alternative could be to use the view DBA_CONSTRAINTS with a filter on the owner (where owner = 'PNR'). Not sure if there are other working possibilities. Well you could create a list of constraint names that you want to disable, instead of creating the list dynamically.
    And you could have another potential disaster creeping up upon you. If you run this thing, then at this moment you don't have any referential integrity anymore. You can't be sure that you can create the FKs again after this action. This is EXTREMLY DANGEROUS. I would never ever do this in any kind of production or test database. I would be very careful when I do it on a development database.

  • Link to PL/SQL procedure using a Template Manager template.

    Hi,
    I need to link a portal application report (report from SQL query) to a SQL procedure that uses a template manager template. The PL/SQL procedure requires parameters. I'm not be able to create a link based on a PL/SQL procedure. The only solution I found is to setup a link to a Form based on that procedure. But the form is only used to call the PL/SQL procedure by clicking the submit button and redirect to the template.
    Another question:
    Is it planed to support dynamic links based on column conditions?
    I'm using Portal release 3.0.7.6.2.
    thanks in advance
    Jens

    Jens,
    You may want to search the Oracle9iAS Portal Applications forum. It may have the answer you are looking for. This forum is for questions related to the Portal Development Kit.
    Thanks,
    Sue
    Sue

  • PL/SQL Procedure - security

    Hi
    I have follow this "guide" i have found in the forum to run PL/SQL Procedure when I press a button (see belov).
    But what about the security?
    If I have some hidden fields and the fields are used as parameter in the PL/SQL Procedure
    like PL/SQL_Procedure(:hidden_field1_value,:hidden_field2_value)
    And general is apex made so it is not possibel to save a page as html and edit som hidden values and save the page loccal and submit the page?
    Best Regrads
    Jesper Vels
    1) Create a region of some type or other, say HTML.
    2) Create a button of type "Create a button in region position" in this region. Sounds like you've already done this and called it PROCESS.
    3) Create a process of type PL/SQL, On Submit After Computations and Validations.
    4) Call it "Execute BUILD_WORKDAYS" (or whatever you like)
    5) The PL/SQL for the process is:
    BUILD_WORKDAYS(:P14_PROCESS_YEAR);
    6) Specify a success and failure message.
    7) In the final step of the Create Page Process wizard, select your button from the "When button pressed" select list.
    8) Then create an unconditional branch branching to the same page.

    Jesper,
    Authenticated users of your application can POST page requests containing anything they can devise. It is up to the developer to ensure that all program inputs meet security requirements.
    Scott

  • Include Button that executes PL/SQL procedure to SQL query based region

    I would like to add two columns to a SQL query region.
    These columns would not be sourced from the query, but rather would be used to execute a PL/SQL procedure.
    For example, I would like to have a manager approve or deny adding an additional employee to the department.
    There would be one button for APPROVE. And, one button for DENY.
    The PL/SQL procedure would execute to perform the required DML based upon the selected action (either APPROVE or DENY).
    A sample output would look like this:
    <APPROVE>, <DENY>, John Doe, Accountant
    <APPROVE>, <DENY>, Jane Doe, Accountant
    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?
    Thanks!
    -Reid

    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?Conditional page item? You can associate processes with buttons on a page

  • HTTPS request signed by client certificate from PL/SQL procedure

    Hi All, please help.
    The PL/SQL procedure connects to different web services, using both HTTP/HTTPS, for HTTPS sever certificates were used. Everything was OK.
    The next service requires client to sign requests with client certificate. I made the client certificate, sign it by CA, store it in Wallet Manager.
    Is here the possibility to send signed HTTPS request from PL/SQL?
    If not, how to do it using Java and encapsulate for PL/SQL?
    Please answer ASAP!!!

    It is pretty straight-forward to make HTTPS requests with UTL_HTTP.
    To do so, you first need to create an Oracle wallet on the database server host with Oracle Wallet Manager. If your database resides on Windows, I believe a short-cut has been created in the Windows menu. On Linux, it can be invoked from $ORACLE_HOME/bin/owm.
    Once the wallet is created, you need to make an additional call to utl_http.set_wallet(<wallet-directory>, <wallet-password>) before any utl_http.request or utl_http.begin_request calls. The <wallet-directory> is the wallet directory where you will find the cwallet.sso and/or ewallet.p12 files, using the format "file:/<wallet-directory>". For example:
    utl_http.set_wallet('file:/home/oracle/wallets/my_wallet/', '123456');
    When an Oracle wallet is created, it is pre-populated with common certificate authorities' certificates (e.g. Verisign). In the event that the server certificate of the HTTPS host is not signed by one of those common certificate authorities, you need to import the additional certificate authority's certificate in your wallet using Oracle Wallet Manager.

  • How to poll a PL/SQL procedure in BPEL?

    Hi,
    Normally in BPEL your start your process flows by receiving an event. You can only create a BPEL instance via a Receive or Pick activity. I have a couple of integrations where I have to continually call a PL/SQL procedure and then call another PL/SQL procedure with the output from the first procedure. This is done by invoking 2 partner links and a While activity. I got this working fine. The problem is how to create the instance. At the moment I start the flow by reading in a dummy file with a Receive event. This works for now but if the process has to be restarted it will not work since BPEL know that it has already read the file.
    I have tried to start the flow with a receive activity that calls a PL/SQL procedure but I get the error “Operation is not specified” (http://theheat.dk/bpelDb1.jpg). Normally you would use a Invoke activity when calling a PL/SQL procedure, but when I try that I get an error because I don’t have a receive activity first (http://theheat.dk/bpelDb2.jpg)
    So basically I need a way to have a receive activity call a PL/SQL procedure.
    I have the exact same problem when I need to continually call a Web Service and send the output to a PL/SQL procedure. Here I need an Invoke activity that calls the Web Service and an Invoke that calls the PL/SQL procedure but to get the flow initiated BPEL wants a receive activity.
    Regards Pete

    I found a simple solution that works but I would like to hear if anybody can see any problems with this approach:
    I create a dummy table with one row. I create a partner link that polls the dummy table every 5 minutes. The operation on the table is an update, but the Read value and Unread value are the same!
    Every 5 minutes BPEL kicks of a process that calls a PL/SQL procedure etc. There will always be a row in the dummy table and as long as my polling interval is longer than the processing time of the flow I will never have more than one process in-flight at a time. This should ensure that the solution is robust.
    Regards Pete
    Message was edited by:
    Peter Lorenzen
    Message was edited by:
    Peter Lorenzen

Maybe you are looking for

  • How to do md5 checksum in PL/SQL in 8i

    Is there any function in PL/SQL for md5 checksum?

  • Erratic ftp connection

    no matter what computer i'm on, what IP address or web server i'm connecting from/to, i get this problem. it's been going on for a couple years and i have been just living with it, but now i'm fed up. i also run into this problem on multiple installs

  • E51 can not copy music to device with Ovi Suite

    I have music files on my computer and I'm trying to copy them to my phone using Ovi Suite. According to Ovi Suite's instructions, to do this manually I have to choose the music file and select Tools - Copy to device. But this option can not be chosen

  • Correcting Colour Balance and Density with Nikon D80

    When uploading files to iPhoto6 created with a Nikon D80, I am noticing the colour balance and overall density of the files has changed from the thumbnails that appear on the camera. I find I have to make adjustments on many of the uploaded files as

  • Small company Intranet - Contribute

    I am a webdesigner (Studio MX 2004) for a small company (100 employees) and we would like to create an intranet. Currently we are looking for software to design/manage with. I have designed our website in Dreamweaver and would love to be able to util