DDL with PL/SQL

I am rusty at PL/SQL first of all. Can someone please tell me how to submit the following:
"create table &tmptable like template_table"
from with in a PL/SQL procedure.
where &tmptable = sysdate or something unique.
Compiler complains about the create statement, ugh. Must I reference an Oracle package to run DDL??
Thanks You !!

Thanks again John, indeed I have had the cursor defined as you mentioned all along with REF CURSOR. But there must be something else....I don't want to take too much of you time but I do appreciate your help. Does anyone else have any ideas?
OPEN dataset FOR SELECT * FROM strOpenCursorSQL;
gives me PLS-00201: identifier 'STROPENCURSORSQL' must be declared...........when it is!!
OPEN dataset FOR 'SELECT * FROM ' || strTableName
gives me PLS-00455: cursor 'DATASET' cannot be used in dynamic SQL OPEN statement
where
CREATE OR REPLACE PROCEDURE INVENTORYROLLUP (dataset IN OUT Inv_Data.InvCurTyp, dtEndDate IN date)
AS.......
strTableName := to_char(sysdate);
strOpenCursorSQL := 'SELECT * FROM ' || strTableName;
......OPEN statements are in the Procedure here
and
CREATE OR REPLACE PACKAGE "INV_DATA" AS
TYPE InvCurTyp IS REF CURSOR RETURN INVROLLUP%ROWTYPE;
END inv_data;

Similar Messages

  • Read consistency in query with pl/sql functions

    Not sure if this is a bug or feature, but a query containing a user-defined pl/sql function does not include tables accessed within the pl/sql function in the read consistent view of data, eg
    select myfunc from tableA
    myfunc is a stored function that queries tableB and returns a value
    If a change to tableB is committed in another session during fetch phase of select statement, then fetched rows reflect the changes. The database does not recognise tables accessed in the plsql function as being part of the query.
    This happens in 7.3.4 and 8.1.6. Don't have 9i so can't tell.
    Anyone know if this is a bug or feature?
    Aside: you can also drop the plsql function whilst the fetch is running. It will kill the fetch. No DDL lock taken on the plsql function whilst select is running! Seems wrong.

    I don't know Forms but I know SQL*Plus and Oracle database. Normally PL/SQL running on the database can only access files on the host where the database instance is running even if you start PL/SQL with a SQL*Plus connection from another host.
    PL/SQL runs only the database instance not on the client side even if you start the PL/SQL code from a remote connection with SQL*Plus.

  • Regarding use of DDL in PL/SQL

    Hai,
    Can someone help me in understanding why we can't use DDLs in PL/SQL.
    I will be really thankful to you.
    Gursimran

    > Can someone help me in understanding why we can't use DDLs in PL/SQL.
    A simple analogy.
    A DDL is like a recipe to make a meal. PL/SQL (Oracle) is like the kitchen in a restaurant.
    What works best? Having an excellent menu of choice meals - having the kitchen work from a fixed list of known recipes?
    Or allowing diners to sit down at a table, think about what they will like, and then supplying the kitchen with a "dynamic" recipe to prepare that meal?
    The kitchen will have a problem coping with dynamic recipes. It may not have the right ingredient. It may not have sufficient ingredients. A single recipe may need to use the flame griller for an extended period of time, which means no other meals can be made while that recipe's meal is made. Etc.
    Dynamically creating objects, or changing objects (all done via DDLs) is like a dynamic recipe. It may work. It may not work. Depends on whether other processes are using (locking) resources required to complete that DDL. It also means that code cannot refer to this object as it does not exist yet - it will only exist at some point of time while the code is busy running.
    This is not a sensible approach. Yes, there are exceptions to this.. but exceptions are just that. Exceptions that is not the norm and not the standard.
    There is no need to DDLs in PL/SQL 99% of the time. And that remaining 1% needs to be carefully looked at to determine whether it is indeed an exception.
    The Oracle Kitchen works best when the meals to be made is from a known menu.

  • XML Publisher Report with PL/SQL

    Hi
    Like to know how to develop the XML Publisher Report with PL/SQL, i did the following
    1. created a pkg like as below
    CREATE OR REPLACE PACKAGE BODY APPS.TEST_XMLTAG_PKG AS
    PROCEDURE main (errbuf OUT VARCHAR2,
    retcode OUT NUMBER
    ) IS
    BEGIN
    DECLARE
    ctx DBMS_XMLGEN.ctxHandle;
    xml CLOB;
    BEGIN
    ctx := dbms_xmlgen.newcontext('select * from scott.emp');
    dbms_xmlgen.setrowtag(ctx, 'MY-ROW-START-HERE');
    xml := dbms_xmlgen.getxml(ctx);
    dbms_output.put_line(xml);
    Fnd_file.put_line (fnd_file.LOG, XML);
    END;
    END;
    END TEST_XMLTAG_PKG;
    this pkg produces the output with xml tag in the view log.
    I have registered the conc program & xml rtf but it does not produce the output in PDF, , I am not able to get the xml tag when i click the Diagnostics --> View XML.
    can you please let me know the next steps involved.
    Regards
    Yram

    I think the problem is because there is no begin and end tag. save the xml from the logfile and open with xml editor or IE.. then you will see the problem.
    add Begin and end tag...then you should be fine.. i.e
    fnd_file.put_line(fnd_file.output,'<EMP_DATA>'); -- begin Tag
    tx := dbms_xmlgen.newcontext('select * from scott.emp');
    dbms_xmlgen.setrowtag(ctx, 'MY-ROW-START-HERE');
    xml := dbms_xmlgen.getxml(ctx);
    dbms_output.put_line(xml);
    Fnd_file.put_line (fnd_file.LOG, XML);
    fnd_file.put_line(fnd_file.output,'</EMP_DATA>'); -- End Tag
    Hope this helps..>Good Luck
    Ravi

  • How to get JDev 10.1.2/ADF working with MS SQL Server Identity Column

    Hello JDevTeam & JDevelopers,
    I want to use JDev/ADF with a MS SQL Server 2005 database that contains tables employing IDENTITY Columns.
    Using JDev/ADF and DBSequence with an Oracle database employing before triggers/sequences accomplishes what I am trying to do except I want to accomplish the same thing using a MSSQL Server 2005 database. Unfortunately I cannot change the database.
    I have been able to select records but I am unable to insert records (due to my lack of knowledge) when using MS/SQL Server Identity Columns with JDev/ADF.
    The following are the steps taken thus far.
    Step1: Create table named test in the 2005 MSSQL Server (see script below).
    Step2: Register 3rd Party JDBC Driver with JDeveloper; Using use Tools/Manage Libraries. Create a new entry in User Libraries with the following;
         Library Name     = Ms2005Jdbc
         Class Path     = C:\dev\Ms2005Jdbc\sqljdbc_1.0\enu\sqljdbc.jar
         (note: Latest TYPE 4 JDBC driver for Microsoft SQL Server 2005 - free at http://msdn.microsoft.com/data/ref/jdbc/)
    Step3:Create New Database Connection;
         Connection Name = testconn1
         Type = Third Party JDBC Driver
         Authentication Username = sa, Password = password, Check Deploy Password
         Connection
              Driver Class = com.microsoft.sqlserver.jdbc.SQLServerDriver     
              Library = Ms2005Jdbc     
              Classpath = C:\dev\Ms2005Jdbc\sqljdbc_1.0\enu
              URL = jdbc:sqlserver://192.168.1.151:1433;instanceName=sqlexpress;databaseName=test
         Test Connection = Success!
    Step5: Create a new application workspace using Web Application default template
    Step6: In Model project, Create new Business Components Diagram.
    Step7: Create new Entity Object. Goto to connections/testconn1, open tables and drag table test onto the diagram.
    Step8: Generate Default Data Model Components by right-clicking on Entity Object. Except all the defaults.
    When I test the Appmodule I select the view object and can scroll through all the records without error. If I try to insert a record, I get JBO-27014: Attribute testid in test is required.
    Going back to the EntityObject I deselect the Mandatory attribute and re-run the test. Now when I try to insert it accepts the value for testname but it does not update the PK testid like it would using an "JDev/ADF/DBSequence/Oracle database/before trigger/sequence" solution.
    Going back to the EntityObject and selecting refresh on insert does not solve this problem either. Changing the URL connection string and adding "SelectMethod=cursor" did not help and changing the SQl Flavor to SQLServer produced errors in the Business Components Browser. I've tried overriding isAttributeChanged() and other things as well.
    I am totally stuck! Can anyone provide a solution?
    Thanks for you help,
    BG...
    Create table named test
    use [testdb]
    go
    set ansi_nulls on
    go
    set quoted_identifier on
    go
    create table [test](
         [testid] [int] identity(0,1) not null,
         [testname] [nvarchar](50) collate sql_latin1_general_cp1_ci_as not null,
    constraint [pk_test] primary key nonclustered
         [testid] asc
    )with (pad_index = off, ignore_dup_key = off) on [primary]
    ) on [primary]

    Figured it out!
    When using the MS SQL Server 2000 Database with the MS JDBC 2000 Driver you specify the SQL Flavor to SQLServer. However setting the SQL Flavor to SQLServer with MS SQL Server 2005 Database and the MS JDBC 2005 Driver will *** fail ***.
    When working with the MS SQL Server 2005 Database and the MS JDBC 2005 Driver you set the SQL Flavor to SQL92 and the Type Map to Java.
    If using a named instance like I am you would specify the URL = jdbc:sqlserver://<db host ip address>:<listening port>;instanceName=<your instance name>;selectMethod=cursor;databaseName=<your database name> (note: leave out the < >)
    The 2005 Driver Class is different then the 2000 and is specified as com.microsoft.sqlserver.jdbc.SQLServerDriver
    Note: In a default MS SQL Server 2005 installation the listening port will change *** everytime *** the host is restarted! You can override this though.
    For the primary key you need to deselect the Mandatory attribute in the EntityObject editor.
    Set Refresh on insert/update = no.
    Set Updateable = never.
    Now my Primary Keys which get their values from the Identity Column are working with ADF in a predictable way.
    Simple enough but I have been away from this stuff for awhile.
    BG...

  • Calculating values from row to row with pure sql?

    Hello,
    I'm searching for a way to calculate values from row to row with pure sql. I need to create an amortisation table. How should it work:
    Known values at start: (they can be derived with an ordinary sql-statement)
    - redemption amount RA
    - number of payment terms NT
    - annuity P (is constant in every month)
    - interest rate IR
    What has to be calculated:
    First row:
    RA1 = RA - P
    Z1 = (RA1 * (IR/100/12))
    T1 = P - Z1
    2nd row
    RA2 = RA1 - T1
    Z2 = (RA2 * (IR/100/12))
    T2 = P - Z2
    and so on until NT has reached.
    It should look like
    NT
    P
    Tn
    Zn
    RAn
    1
    372,17
    262,9
    109,27
    22224,83
    2
    372,17
    264,19
    107,98
    21961,93
    3
    372,17
    265,49
    106,68
    21697,74
    4
    372,17
    266,8
    105,38
    21432,25
    5
    372,17
    268,11
    104,06
    21165,45
    6
    372,17
    269,43
    102,75
    20897,34
    7
    372,17
    270,75
    101,42
    20627,91
    8
    372,17
    272,09
    100,09
    20357,16
    9
    372,17
    273,42
    98,75
    20085,07
    10
    372,17
    274,77
    97,41
    19811,65
    11
    372,17
    276,12
    96,06
    19536,88
    12
    372,17
    277,48
    94,7
    19260,76
    13
    372,17
    278,84
    93,33
    18983,28
    14
    372,17
    280,21
    91,96
    18704,44
    15
    372,17
    281,59
    90,59
    18424,23
    16
    372,17
    282,97
    89,2
    18142,64
    17
    372,17
    284,36
    87,81
    17859,67
    18
    372,17
    285,76
    86,41
    17575,31
    19
    372,17
    287,17
    85,01
    17289,55
    20
    372,17
    288,58
    83,59
    17002,38
    21
    372,17
    290
    82,18
    16713,8
    22
    372,17
    291,42
    80,75
    16423,8
    23
    372,17
    292,86
    79,32
    16132,38
    24
    372,17
    294,3
    77,88
    15839,52
    25
    372,17
    295,74
    76,43
    15545,22
    26
    372,17
    297,2
    74,98
    15249,48
    27
    372,17
    298,66
    73,52
    14952,28
    28
    372,17
    300,13
    72,05
    14653,62
    29
    372,17
    301,6
    70,57
    14353,49
    30
    372,17
    303,09
    69,09
    14051,89
    31
    372,17
    304,58
    67,6
    13748,8
    32
    372,17
    306,07
    66,1
    13444,22
    33
    372,17
    307,58
    64,6
    13138,15
    34
    372,17
    309,09
    63,08
    12830,57
    35
    372,17
    310,61
    61,56
    12521,48
    36
    372,17
    312,14
    60,04
    12210,87
    37
    372,17
    313,67
    58,5
    11898,73
    38
    372,17
    315,21
    56,96
    11585,06
    39
    372,17
    316,76
    55,41
    11269,85
    40
    372,17
    318,32
    53,85
    10953,09
    41
    372,17
    319,89
    52,29
    10634,77
    42
    372,17
    321,46
    50,71
    10314,88
    43
    372,17
    323,04
    49,13
    9993,42
    44
    372,17
    324,63
    47,55
    9670,38
    45
    372,17
    326,22
    45,95
    9345,75
    46
    372,17
    327,83
    44,35
    9019,53
    47
    372,17
    329,44
    42,73
    8691,7
    48
    372,17
    331,06
    41,11
    8362,26
    I would appreciate every help and idea to solve the problem solely with sql.
    Thanks and regards
    Carsten

    It's using Model Clause and / or Recursive With (sometimes maybe both)
    Regards
    Etbin
    with
    rec_proc(nt,i,ra,p,ir,z,t) as
    (select nt,i,ra - p,p,ir,round((ra - p) * 0.01 * ir / 12,2),p - round((ra - p) * 0.01 * ir / 12,2)
       from (select 48 nt,22597 ra,372.17 p,5.9 ir,0 z,0 t,1 i
               from dual
    union all
    select nt,i + 1,ra - t,p,ir,round((ra - t) * 0.01 * ir / 12,2),p - round((ra - t) * 0.01 * ir / 12,2)
       from rec_proc
      where i < nt
    select * from rec_proc
    try to adjust initial values and rounding please
    NT
    I
    RA
    P
    IR
    Z
    T
    48
    1
    22224.83
    372.17
    5.9
    109.27
    262.9
    48
    2
    21961.93
    372.17
    5.9
    107.98
    264.19
    48
    3
    21697.74
    372.17
    5.9
    106.68
    265.49
    48
    4
    21432.25
    372.17
    5.9
    105.38
    266.79
    48
    5
    21165.46
    372.17
    5.9
    104.06
    268.11
    48
    6
    20897.35
    372.17
    5.9
    102.75
    269.42
    48
    7
    20627.93
    372.17
    5.9
    101.42
    270.75
    48
    8
    20357.18
    372.17
    5.9
    100.09
    272.08
    48
    9
    20085.1
    372.17
    5.9
    98.75
    273.42
    48
    10
    19811.68
    372.17
    5.9
    97.41
    274.76
    48
    11
    19536.92
    372.17
    5.9
    96.06
    276.11
    48
    12
    19260.81
    372.17
    5.9
    94.7
    277.47
    48
    13
    18983.34
    372.17
    5.9
    93.33
    278.84
    48
    14
    18704.5
    372.17
    5.9
    91.96
    280.21
    48
    15
    18424.29
    372.17
    5.9
    90.59
    281.58
    48
    16
    18142.71
    372.17
    5.9
    89.2
    282.97
    48
    17
    17859.74
    372.17
    5.9
    87.81
    284.36
    48
    18
    17575.38
    372.17
    5.9
    86.41
    285.76
    48
    19
    17289.62
    372.17
    5.9
    85.01
    287.16
    48
    20
    17002.46
    372.17
    5.9
    83.6
    288.57
    48
    21
    16713.89
    372.17
    5.9
    82.18
    289.99
    48
    22
    16423.9
    372.17
    5.9
    80.75
    291.42
    48
    23
    16132.48
    372.17
    5.9
    79.32
    292.85
    48
    24
    15839.63
    372.17
    5.9
    77.88
    294.29
    48
    25
    15545.34
    372.17
    5.9
    76.43
    295.74
    48
    26
    15249.6
    372.17
    5.9
    74.98
    297.19
    48
    27
    14952.41
    372.17
    5.9
    73.52
    298.65
    48
    28
    14653.76
    372.17
    5.9
    72.05
    300.12
    48
    29
    14353.64
    372.17
    5.9
    70.57
    301.6
    48
    30

  • I need to host a website with a SQL database - Azure pricing details are too confusing

    Hello,
    I need to give a potential client a hosting price for a somewhat simple web application they want me to build. I told them it shouldn't be a problem. After gathering the requirements, I figured I would use the following technology to build and host
    it:
    ASP.NET 4.5
    MVC 5
    1 SQL Database ~ 25GB with options to expand and also with a backup
    SSL certificate needed
    Hosting would be on Azure because I have some experience using Visual Studio 2012 and integrating the Visual Studio Online (TFS) source code and scrum web applications. I've never actually spun up a website with a SQL database using Azure before, but I
    imagined it wasn't too difficult to find a general hosting plan to support the above requirements.
    The use of the website will be very simple and limited to the basic CRUD operations. Will support forms authentication using the Identity 2.0 framework. The web applications main purpose is to fill out a form for new accounts, have a search page for
    those accounts, a page to view a created account and add notes to it. So performance wise, it isn't asking for much. I just want it to be fast and secure.
    So I start looking on the Azure's pricing landing page which is here: (can't put links in here, but search Azure pricing on Bing) and I see this Pricing Calculator, so I click it
    First thing I notice is the Websites tab doesn't mention SQL Database - in fact the Data Management is a separate tab from Websites. And if I made my selections on the Websites tab, the estimated monthly price doesn't stay the same when I go to the Data
    Management tab - so I get the illusion I have to have two separate purchases.
    I'm not exactly sure if the Pay as You Go billing feature would be okay because it's just a bit scary to leave every monthly payment up to chance; somewhat. Would love to know if there is other payment options that I could see for what I described above.
    I want to use Azure to host my asp.net website - it makes sense and the integration with Visual Studio is amazing. I love the publish feature for both MVC 5 Projects and SQL Database Projects.
    Thanks in advance for the help!

    Hello jdevanderson,
    I suggest that you start by looking at the pricing TIERS for the Azure website. This link will give you clarity on different Service TIERS that are availaible:
    http://azure.microsoft.com/en-in/pricing/details/websites/
    You can guage your requirement and choose the Service TIER accordingly.
    And regarding the database, you are right about it. You will be charged seperately for the database. You can refer to this link that will give you clarity on SQL database pricing:
    http://azure.microsoft.com/en-in/pricing/details/sql-database/
    Refer to this link for more information on 'How pricing works':
    http://azure.microsoft.com/en-in/pricing/
    Use the full calculator to add your website and the database to get an estimated cost:
    http://azure.microsoft.com/en-in/pricing/calculator/?scenario=full
    Thanks,
    Syed Irfan Hussain

  • Why do I get a class conflict between the Prepare SQL.vi and the Get Column Name.vi with the SQL Toolkit compatibility vis from the Database Connectivity Toolkit?

    I have done extensive programming with the SQL Toolkit with LabVIEW versions through 6.1. My customer now wants to upgrade to Windows 7, so I am trying to upgrade to LabVIEW 2009 (my latest purchased version) using the Database Connectivity Toolkit, and the SQL Toolkit Compatibility vis. Everything seemed to be going okay with the higher level SQL operations, but I ran into trouble with the Get Column Name.vi. 
    The pictures below show the problem. The original SQL Toolkit connected the Prepare SQL.vi with the Get Column Name.vi with a cluster of two references, one for connection, and one for sql. The new compatibility vis have a class conflict in the wire because the Prepare SQL.vi contains a cluster with connection, and command references, but the Get Column Name.vi expects a cluster with connection and recordset references. 
    How do I resolve this conflict?
    Thank You.
    Dan

    I've never worked with the old version of the toolkit, so I don't know how it did things, but looking inside the SQL prep VI, it only generates a command, and the the column name VI wants a recordset. I'm not super familiar with all the internals of ADO, but my understanding is that is standard - you only have the columns after you execute the command and get the recordset back. What you can apparently do here is insert the Execute Prepared SQL VI in the middle and that will return what you need.
    I'm not sure why it worked before. Maybe the execute was hidden inside the prep VI or maybe you can get the column names out of the command object before execution. In general, I would recommend considering switching to the newer VIs.
    Try to take over the world!

  • Performance for join 9 custom table with native SQL ?

    Hi Expert,
    I need your opinion regarding performance to join 9 tables with native sql. Recently i have to tunning some customize extraction cost  report. This report extract about 10 million cost of material everyday.
    The current program actually, try to populate the condition data and insert into customize table and join all the table to get data using native sql.
    SELECT /*+ ordered use_hash(mst,pg,rg,ps,rs,dpg,drg,dps,drs) */
                mst.werks, ....................................
    FROM
                sapsr3.zab_info mst,
                sapsr3.zab_pc pg,
                sapsr3.zab_rc rg,
                sapsr3.zab_pc ps,
                sapsr3.zab_rc rs,
                sapsr3.zab_g_pc dpg,
                sapsr3.zab_g_rc drg,
                sapsr3.zab_s_pc dps,
                sapsr3.zab_s_rc drs
            WHERE mst.zseq_no = :p_rep_run_id
            AND mst.werks = :p_werks
            AND mst.mandt = rg.mandt(+)
            AND mst.ekorg = rg.ekorg(+)
            AND mst.lifnr = rg.lifnr(+)
            AND mst.matnr = rg.matnr(+)
            ...............................................   unitl all table (9 tables)
            AND ps.mandt = dps.mandt(+)
            AND ps.knumh = dps.knumh(+)
            AND ps.zseq_no = dps.zseq_no(+)
            AND COALESCE (dps.kbetr, drs.kbetr, dpg.kbetr, drg.kbetr) <> 0
    It seems the query ask for database to using hashed table. would that be it will burden the database ? and impacted to others sap process ?
    Please advise
    Thank You and Best Regards

    you can only argue coming from measurements and that is not the case.
    Coming from the code, I see only that you do not understand it at all, so better leave it as it is. It is not a hash table, but a hash join on these table.

  • Interactive Report with PL/SQL Function Source

    Is it possible to create interactive report with PL/SQL function source returing a query? If not, has anyone done any work to simulate the interactive reporting feature for a normal report using API?

    I haven't tried that before but you could:
    1. create a collection from your result set returned by a dynamic query,
    2. create a view on that collection,
    3. use the view in your interactive report.
    The usability of this proposal depends from a question how "dynamic" your query is - does it always have the same number of columns or not.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Building portlets with PL/SQl vs java

    Hi
    We are planing to use oracle 9iAS application server(Enterprise version)to build portal application.
    Can someone suggest me which one should i use, building portlets with j2ee or building portlets with PL/SQL.
    what are the advantages of web providers over database providers?which one is the best way of building portlets.

    Hello
    I've been using Portal for years now, and I'm still developping in PL/SQL. It's very simple and quick to developp. I'm even not using any database providers, I'm just invoking my procedures via their URLs with some Ajax hidden components, and I could developp some screens like employees vacations managements, trombinoscope, portal statistics, etc ...
    I learnt at Oracle how to developp some "true" portlets with DB providers but it's not usefull for me at this time as I don't need portlet customization etc.
    BUT
    if I had to developp a really big project with several developpers I would use DB providers.
    And maybe I would use Java but it takes rather long time to be efficient with this language and it needs to be a realy big project for I start using this language. And as explained above Java offers more compatibility with 3rd party products.
    And last but not least, one has to know what Oracle is more and more dealing with Java, the next 11g version that has just released is much more using Java than 10g does, and that's true for every Oracle products.
    So it's just a matter of skill and time.
    A.

  • Problem with pl/sql

    I am having a parent program which fires the child process.
    I want the parent program to wait until all the child program are completed.
    for this i have written this code.
    from the curosr c1 i am taking all the child processes.
    Now when i am putting the exit condition(EXIT WHEN J = V_COUNT1) in the for loop then
    everything is working fine and parent program completes only after all
    the child processes are completed.
    but when i am not putting this condition the parent program does not complete it remains in the loop
    i dont understand why?
    declare
    cursor c1 is
    SELECT fcr.request_id
              FROM
              fnd_concurrent_programs fcp,
              fnd_concurrent_requests fcr
              WHERE
              fcp.concurrent_program_id = fcr.concurrent_program_id
              AND fcp.concurrent_program_name LIKE 'WSHRDPIK' -- name of the pick slip report
              AND fcr.request_id > (SELECT max(fcr.request_id)
              FROM fnd_concurrent_requests fcr,
                                  fnd_concurrent_programs fcp
                                  WHERE fcp.concurrent_program_id = fcr.concurrent_program_id
                        AND fcp.concurrent_program_name LIKE 'OAI_PROCESS_SHIPMENTS')
              AND phase_code NOT LIKE 'C'
              AND requested_by IN (SELECT user_id
                   FROM fnd_user
                        WHERE user_name LIKE 'MAKANIV');
    BEGIN
    open c1;
    FETCH c1 Bulk Collect into v_count;
    close c1;
    v_count1 := v_count.count;
    for i in v_count.first..v_count.last loop
    v_success := FND_CONCURRENT.GET_REQUEST_STATUS(v_count(i)
                                            ,NULL
                                            ,NULL
                                            ,v_phase
                                            ,v_status
                                            ,v_dev_phase
                                            ,v_dev_status
                                            ,v_message);
         WHILE v_dev_phase != 'COMPLETE'
    LOOP
    v_success:= FND_CONCURRENT.WAIT_FOR_REQUEST(v_count(i)
                                       ,2
                                                 ,10
                                                 ,v_phase
                                                 ,v_status
                                                 ,v_dev_phase
                                                 ,v_dev_status
                                                 ,v_message);
         EXIT WHEN v_dev_phase = 'COMPLETE';
    END LOOP;
    -- J:= J + 1;
    -- EXIT WHEN J = V_COUNT1;
    END loop;
    END;

    Dear Salvatore,
    Have you opened the CURSOR ??
    Try the following :
    =============================================
    declare
    cursor C1 (INPUT_VAR in number) is select column1 from table where column2 =INPUT_VAR ;
    begin
    for I in C1 (1111) Loop --- you can try any number
    dbms_output.put_line(I.ID) ;
    end loop;
    end ;
    =============================================
    Bst Rgds ,
    Franco Lin
    I am new to this forum, and new to PL/SQL. I am writing my first larger project that will be in part implemented with PL/SQL. I have a simple cursor that sound like that:
    CURSOR name
    IS
    SELECT column1
    FROM table
    WHERE column2 = PL/SQL-variable;
    When I run this Function the SELECT returns nothing. When I make the same SELECT from SQL*PLUS I receive 1 row.
    I have checked the variable via dbms_output.put_line, and make the mentioned SELECT with it.
    Has anyone a solution for this?
    Thanks in advance for any help.
    Regards
    Salvatore Cagliari
    null

  • How to develope a XML-RPC client with PL/SQL

    Anyone know how to develop a XML-RPC client with PL/SQL?
    I've oracle 8i.
    Have you some example of code?
    Thanks
    Paolo

    So, you actually want to create the physical directory using JAVA?
    Then see:
    http://www.oracle-base.com/articles/8i/shell-commands-from-plsql.php

  • Create a report with PL/SQL

    Hi,
    I have two pages: the first page contains two text fields and a submit button. In the first text field you can enter a name and in the second field you can enter a number. That means you can search a record by name or by number.
    In the second page the report is generated depending on the used text field of the first page.
    I tried to to define a region source code with PL/SQL for the report, but nothing appears on the report page although the record I was looking for exists in the database.
    begin
    if :ENTERNAME IS NOT NULL then
    FOR item IN (select "TB_PERSON_INSTITUTION"."PI_ID" as "PI_ID",
    "TB_PERSON_INSTITUTION"."PI_NAME" as "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" as "PI_VORNAME",
    from     "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    where      upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:ENTERNAME||'%'))
    loop
    DBMS_OUTPUT.PUT_LINE('First name = ' || item.PI_NAME ||
    ', Last name = ' || item.PI_VORNAME);
    end loop;
    end if;
    end;
    Regards
    Mark

    Hi,
    ok thanks. I tried to use the SQL-Report with type "SQL Query (PL/SQL function body returning SQL-Query)" and made a few changes in the SQL-Statement so that a second table is also included:
    declare My_select varchar2(500);
    begin
    if :TEXTEINGABENAME IS NOT NULL then
    My_select:='SELECT
    "TB_ADRESSE"."A_PLZ" "A_PLZ",
    "TB_ADRESSE"."A_ORT" "A_ORT",
    "TB_ADRESSE"."A_ID" "A_ID",
    "TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
    "TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
    "TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
    FROM
    "TB_ADRESSE" "TB_ADRESSE",
    "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
    AND upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:TEXTEINGABENAME||"%")';
    else
    if :TEXTMITGLIEDSNUMMER is not null then
    My_select:='SELECT
    "TB_ADRESSE"."A_PLZ" "A_PLZ",
    "TB_ADRESSE"."A_ORT" "A_ORT",
    "TB_ADRESSE"."A_ID" "A_ID",
    "TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
    "TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
    "TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
    FROM
    "TB_ADRESSE" "TB_ADRESSE",
    "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
    AND upper("TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER") like upper(:TEXTMITGLIEDSNUMMER||"%")';
    end if;
    end if;
    return My_select;
    end;
    When I try to apply changes an error message occurs:
    "Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. The query can not be parsed, the cursor is not yet open or a function returning a SQL query returned without a value."
    Regards,
    Mark

  • Radio button on a from generated with PL/SQL procedure

    Hi,
    I have a form generated with PL/SQL procedure. This procedure calls another procedure on 'Submit'. If I select value for the radio button, it works fine. But if no value is given to the radio button on the form, it gives error. Is the radio button mandatory field by nature? or do I need to give default value some how? How do I make the radio button optional? so that I can call the next procedure without passing the param.
    Create or Replace PROCEDURE OBM_PROCEDURE
    htp.formOpen(OWA_UTIL.GET_OWA_SERVICE_PATH || 'process_obm');
    htp.Print('Admin ');
    htp.FormRadio('p_access_level','A');
    htp.Print('Doc ');
    htp.FormRadio('p_access_level','D');
    htp.formSubmit(cname=>'p_button', cvalue=> 'Submit');
    =================================================================
    Create or Replace PROCEDURE PROCESS_OBM
    (p_access_level VARCHAR2,
    p_button VARCHAR2)
    htp.Print('p_access_level ');
    Thanks!

    Hi
    The parameters of the called procedure should have defualt values like this
    create or Replace PROCEDURE PROCESS_OBM
    (p_access_level VARCHAR2 default 1,
    p_button VARCHAR2 default null
    htp.Print('p_access_level ');
    Thanks,
    sharmila

Maybe you are looking for

  • Error while trying to insert data on a database through a mediator

    I have build a simple project on 11g TP$, which consists of a mediator, a file adapter, that reads an xml file and a DB adapter that inserts data on a database. The mediator connects the file adapter to the DB adapter and through a routing rule it in

  • IPod corrupt, wont restore properly.

    Hello, I've read through some of the FAQs and the questions posted on the board, but nothing seemed to help my problem. I am using a Fifth generation iPod (photo). A few days ago when i plugged my iPod onto my comp, iTunes recognised it to be corrupt

  • SCREEN PAINTER Layout not working

    Hi, we have SAP Netweaver 7.0 Trial version, we are using SAP GUI 710, when we try to view the SCREEN PAINTER Layout it is not functioning properly.. The screen displays fully in dotted lines. Anybody can help me.. Regards, Sudhakar N

  • How to open image file?

    I used advanced settings "print to file" to copy one slide from a Powerpoint presentation and sent it to My Pictures to use in another document.  The icon looks like a blank sheet of paper with a corner folded forward.  When I try to open it, I get a

  • Java doesn't work on safari

    Since I've installed the latest java version, my browser stop running Java plugin. I cannot access my bank account etc. PS.: I already have unistalled the Java an installed again, twice; I shutted down my computer, I restarted the browser... And, YES