Test procedure

I created a procedure to calculate a discount based on the order total. Plu SQL tells me that the procedure is created successfully, but I don't get any output.

create or replace the go-around procedure is
cursor c1 is
Select order_line.o_id, sum(inv_price*ol_quantity)
the customer, inventory, order_line, orders
where customer.c_id = orders.c_id
and orders.o_id = order_line.o_id
and inventory.inv_id = order_line.inv_id
Customer.c_id group, c_first, c_mi, c_last;
total number;
number of order_id;
number of original_amt;

Start
Open c1;
loop

Fetch c1 into order_id, original_amt;
When exit c1% notfound;

If
original_amt between 100 and 200
then
Total: = original_amt*.9;
ELSIF
original_amt > 200
then
Total: = original_amt*.8;
on the other
original_amt: = original_amt;
end if;
dbms_output.put_line(order_id||) e '|| original_amt | » '|| in total);
end loop;

discount end;
/

The result, I am getting is:

Order number: Original_amt: Total:
1 379,89 303.912
2 15.99 0
3 409,9 327.92
4 119.9 107.91
5 89.9 0
6 349,84 279.872

Published by: MikeCoffey on December 3, 2012 14:35

OK, this implies that the procedure had syntax errors when you create. Are you sure that the procedure has been created successfully? Or do you have a message after creation there are errors? If so, you can type

SQL> show errors;

in SQL * more to get a list of errors.

The query that you use for your cursor seems to be incorrect - you cannot SELECT columns that you are not group by. My guess is that you really wanted to be the query

select order_line.o_id, sum(inv_price*ol_quantity)
  from customer,inventory,order_line,orders
 where customer.c_id=orders.c_id
   and orders.o_id=order_line.o_id
   and inventory.inv_id=order_line.inv_id
 group by order_line.o_id;

Justin

Tags: Database

Similar Questions

  • Test procedure general flow

    Can anyone recommend a general test procedure to determine the throughput of a data acquisition system.  I use a PCI-6052E on a PC with Windows XP Pro 2.8 GHz P4 2 GB of RAM.  My idea is to use a pulse generator and see when I start to lose samples, but being new to LabVIEW I am confused on how to anlyze the data and to know when this happens effectively.  Also, did the complexity of VI affect flow or is the buffer for LabVIEW big enough that this isn't a matter of concern?  To sum up, I am trying to determine the minimum and maximum of my system flow.  Any help would be greatly appreciated.  Thank you.

    Hi FuzzyLipton-

    You are right that the flow rate depends on the system.  Is the PCI bus bandwidth 132 MB/s theoretical, 110 MB/s typical.  It's a shared bandwidth, all other your system PCI cards will share this 110 MB/s.  With this in mind, you can determine your flow by running all your analog inputs at maximum sampling frequency.  The 6052E has a 16-bit ADC, so each sample take you is 2 bytes (16 bits X (1 byte / 8 bits)).  The maximum sampling rate is 333 Kech. / s, and there are 8 differential channels (asymmetric 16). For example, (2 bytes per sample), X (333000 samples/s) X 16 channels = 10.7 Mbps.  This should be well within the capabilities of your system (I say that without knowing your system completely).  I'm not sure how your computer might behave if it was beyond her capabilities, but I guess you would see irregular behavior.  If you are able to run this rate for a long time (several minutes) without any weird behavior of the computer, then your card cannot max on the speed of your computer.

    I hope this gets you on the right foot.  Have a great day!

  • Name of user and password in a test procedure

    Hello

    Is it possible to test if a name of user and password are valid in a procedure?

    For example:
    -I log in as hr/hr@db1
    -call a procedure with to input a user name and a password and try to connect with the usr/pwd given (as a CONN under sqlplus)?

    Concerning
    Kukin Frane

    >
    The simplest way to implement it would be to generate a hash of the password for the username/password supplied name in and compare that hash with the hash stored password visible in the DBA_USERS view for this user name.
    >
    I prefer to just use a Java stored procedure that attempts to connect using the internal JDBC driver.
    1. no play with hashes
    2. no need to access the view DBA_USERS
    3. no maintenance question
    4. always a security risk to brute force tries to "guess" the password.

  • With nested table test procedure

    Hello by the Expert,

    I have a procedure that accepts an array as an input parameter. Now my problem is how to test this procedure from sqlplus. strugling with passing values using table...

    Details:
    Oracle: Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production.
    Procedure: sp_dl_ins_stg_tab_npi (i_provider_npi_arr IN provider_npi_nt)
    -> provider_npi_nt is a nested table.

    Structure of the table:

    create or replace type provider_identifier_typ as an object
    (
    provider_identifier VARCHAR2 (30),
    identifier_type VARCHAR2 (15)
    )
    create or replace type provider_identifier_nt in the provider_identifier_typ table;

    create or replace type provider_npi_type as object)
    aut_official_nm_suffix VARCHAR2 (10),
    aut_official_credential_txt VARCHAR2 (100),
    provider_identifier_tab provider_identifier_nt
    )

    create or replace type provider_npi_nt in the provider_npi_typ table;


    Note: provider_npi_type Type is nested with provider_identifier_nt

    Appreciate your help
    Concerning

    Hello

    You will need to use an anonymous block to build the table and call the procedure.
    For example:

    DECLARE 
    
     npi_nt provider_npi_nt;
    
    BEGIN
    
     npi_nt := provider_npi_nt(
                  provider_npi_typ('A', 'some text',
                     provider_identifier_nt(
                        provider_identifier_typ('ID-A1','Type1'),
                        provider_identifier_typ('ID-A2','Type2')
                     )
                  ),
                  provider_npi_typ('B', 'some text',
                     provider_identifier_nt(
                        provider_identifier_typ('ID-B1','Type1'),
                        provider_identifier_typ('ID-B2','Type2'),
                        provider_identifier_typ('ID-B2','Type3')
                     )
                  )
               );
    
     SP_DL_INS_STG_TAB_NPI(npi_nt);
    
    END;
    /
    

    Here, I created the object of each manufacturer of nesting. As you can see, it can quickly become a process of 'painful '.
    On the contrary, if your data is in the database tables, the table can be built more easily with a single query.

  • Test my procedure

    Hello

    Test1 is a table with 2 columns,

    musterino, number

    musteriadi, varchar2 (50)

    and my procedure is below,

    procedure readtest1 (number of p_musterino, r_test1 in out nocopy test1% rowtype) is

    cursor c is

    Select *.

    l test1

    where l.musteri_no = p_musterino;

    Start

    Open c;

    extract the c in r_test1;

    close c;

    end um_package;

    now I need my test procedure

    Start

    um_package.readtest1(1008,???);

    end;

    How can I send values for the r_test1 parameter?

    Concerning

    declare

    vResult test1% rowtype;

    Start

    umpackage.readtest1(1008,vResult);

    end;

  • Send a table 1 d of test for MSSQL 2012 data

    Hello. Feel free to answer a number any of the sub questions you can. Thanks in advance!

    (1) being new to MSSQL, I don't know how to send a simple 1 d table of a floating number of type to a table in Microsoft SQL 2012. This is as far as I'm away. I get the message on the left with the VI current and one on the right when I get rid of the concatenation of strings of time and just carry the numbers going to the table name instead.

    2 (a), this is my Guinea pig file, running on a database of Guinea pig. Finally I want to send the data from a test procedure that records a piece of data per millisecond - a table usually end up with approximately 15 000 items, more or less - on the basis of data. Unfortunately, I know the misfortune that Labview can send only on one line at a time. So how the hell do I do a new column for each new piece of data for a test that will run for an indefinite period?

    2 (b) ideally, I would have a table with a column for each test was run, with the title of each column is the time and date at which the test was run. Is there a way to "transpose" the data once it's in MSSQL?

    I used the fixed data because it's a better illustation of how things work.

    If you need to write two items on one line at a time, then you need to group them together.  The error you are getting is because you have wired a double as input but listed two columns.  Notice that my last example wrote a cluster (which can be created with a fiber node) of two elements.  You must use together to create a cluster and time data, then thread this cluster node of your insert.

    A few other comments:

    Generally screws express is a reasonable place to start when you're new to LabVIEW, but you must learn to use shift registers do calendar between the execution of the loop.

    When it is to group the data and time together you need not to turn all this into a table first.  Just put the time in a single entry and your data in the other.  The groups you create are a single line of data.

  • My computer won't let me download a cd of new material. Said hardware has not passed windows logo testing.

    I want to add an adapter usb to my computer to watch movies on my TV. It came with the software, however the download access is denied.

    When you install the hardware in your computer (almost always), you must install a 'pilot', which is just software that tells your operating system (Windows, in your case) how to communicate with the hardware.

    Microsoft has a program she calls 'the logo test' which enables a company to label its products with the Windows logo.  Not every small manufacturer wants to go through the load of this test program, but if a company is trustworthy - and Trendnet is - then the fact that their products have not passed official testing procedures from Microsoft doesn't mean that their products will not work with Windows.  This is why you can usually ignore a message to the effect that a product has not passed Windows logo testing - if you also a pretty good reason to believe that the product will work.

    So just follow the instructions supplied with the adapter installation, put on the CD and install the software.  But the installation of this card is only the first part of your trip.

    Although I've not set my TV to watch streaming video from Netflix or Amazon, as I understand it, you need a TV that can be connected directly to the Internet.  In other words, you cannot download and save a copy of the video complete on your computer and then read it from your computer to the TV.  That's why's called it "streaming" video - you're not supposed to save a copy to your computer, but rather to look at the 'stream '.

    Thus, Amazon said, "the easiest way is to connect your TV to your router or modem broadband (DSL/Cable, for example) with an ethernet cable.»

    A lot of people with a connection broadband has a router, which has generally 4 Ethernet Sockets (and perhaps a point of both wireless access).  If you had one, you would just connect a "vacant" Ethernet between the TV and a cable to your router.  You, unfortunately, have a router with a single Ethernet Jack (I know you thought it as a modem, but it's almost certainly a modem and a router inside a box of Physics).  So, as you acknowledged, you don't connect your TV to the cable modem because it would need to disconnect your computer.

    You have two choices.

    You can buy a cheap Ethernet switch (e.g. this one) which would connect you to port on the back of the modem cable and then connect your computer and TV to two of the other ports on the switch.  This would probably work without having to make adjustments to configuration on your cable modem - but in the past, some customers wanted cable ISPS to pay extra for each computer connected to the modem cable and makes it a little difficult to so add connections on your own.  I don't think that is always the case, but because I don't have cable - especially not the same cable ISP like you - I don't know about you.

    Or you can buy a second Ethernet adapter of your computer (which is what you did) and then set up the "Internet connection sharing" (ICS) on your computer so that the TV can connect to the Internet through your computer.  Because you have already purchased this material, you probably want to set up ICS.

    Although there are many websites that explain how to configure ICS, because XP is becoming obsolete quickly, many of the older sites are more fully functional, including one who should have been better to show your situation (sharing a connection to local network to the Internet with another connection of LAN)

    Use the Network Setup Wizard.  Go to network connections (start > run > ncpa.cpl > OK) and click on "Set up a small business network or home."

    The 3rd screen looks like this--> http://screenshots.modemhelp.net/screenshots/Windows_XP/Network_Setup_Wizard/03_%28directly_connected%29.shtml

    Choose the first choice.  Even if your computer connects 'via a residential gateway"(your cable modem/router) the"other computers"(TV) will connect"through this computer."

    The next screen should look like this--> http://screenshots.modemhelp.net/screenshots/Windows_XP/Network_Setup_Wizard/03_%28directly_connected%29/LAN.shtml

    If you have correctly installed the USB adapter, you should see a line like the one that was highlighted in the image (it's your modem cable connection) and a second line describes your connection to the LAN USB.

    If the wizard does not recognize the USB adapter as a connection to the local network, it will not let you continue (click on the 'Next' button on this screenshot, where there is only one LAN connection, and you'll see what happens).

    Assuming that the wizard allows you to continue to do so.  Your "computer name" is already filled in. Do not change. You can add a description if you wish.  When you get to the screen 'file and printer sharing', you can disable this feature (you're not going to share files between your computer and the TV).

    Confirm on the summary screen that "Internet" is through your "Local network connection" and that the wizard correctly selected your USB adapter as the "connecting to your network" (this screen shot shows that the connection to the Local network is connected to 'your network' because the Dial-Up connection is connected to the Internet)--> http://screenshots.modemhelp.net/screenshots/Windows_XP/Network_Setup_Wizard/03_%28directly_connected%29/Dial-Up/04--2.shtml (click on the scroll bar to) see the screen shot in all)

    When you complete the wizard, you should be able to connect your TV to your USB adapter and it should work (Yes, there is a lot of "desirable"; good luck).

  • ODI procedure

    Hello

    I currently still use ODI 10 g.

    I have interfaces and pacakges that works properly.

    And I created a database procedure.

    Name of the procedure: Test_Procedure

    I want run this procedure of ODI, rather than creating a new post in the database. (Run it after my interfaces are executed successfully)

    If possible can you please get me how to approach.

    I tried this approach:

    1 role "Run" for the user of ODI awarded.

    2. in the project that contains interfaces, modules of knowledge etc...

    There is a procedure - law clicked procedure - insert available 2 options, import procedure.

    Then, click on the Insert procedure.

    Opens a window of the new procedure.

    Name: Test Procedure

    Technology source: undefined

    The target technology: Oracle (as my target database is oracle)

    Add details.

    Opens the new window command.

    Name: Test Procedure

    Log count: undefined

    Log level: 5

    Command on the target:

    Tecnology: Oracle, Context: Global, diagram: logical schema of my target, Transaction: autocommit

    commnad: run Test_Procedure;

    Executed. But displays error - Sql statement invalid.

    I would like to know how to proceed.

    Thank you.

    Hi, GRK,.

    The approach is good, you were near. Unfortunately, Execute is not recognized, you must use a PL/SQL block:

    BEGIN
      <%=odiRef.getSchemaName()%>.MY_STORED_PROC;
    END;
    

    GetSchemaName using is to get the physical schema related to the schema logic you choose, during the execution.

    It will be useful.

    Kind regards

    JeromeFr

  • Calling a procedure of a procedure

    Hello

    I have the procedures and functions in a package, and I would like to run a procedure from an ODI procedure. Note this procedure accepts no argument.

    That's what I wrote:

    BEGIN

    exec dw_wf_process. SET_VDW_REFRESH_STATUS;

    END;

    And I got this error message:

    ODI-1217: TEST Session (3885) fails with return code 6550.

    ODI-1226: Step test fails after 1 attempt.

    ODI-1232: omits the execution of test procedure.

    ODI-1228: the task (procedure) Test fails on ORACLE SND_VDW_MAP_LOC target connection.

    Caused by: java.sql.SQLException: ORA-06550: line 3, column 6:

    PLS-00103: encountered the symbol "DW_WF_PROCESS" during the expected in the following way:

    := . ( @ % ;

    The symbol ': = ' was replaced by 'DW_WF_PROCESS' continue.

    Thanks for you response SaranPantangi.

    I tried it, it gives the error message. Says there is a problem with the arguments, but I don't need any arguments for this procedure.

    ODI-1217: TEST Session (3892) fails with return code 6550.

    ODI-1226: Step test fails after 1 attempt.

    ODI-1232: omits the execution of test procedure.

    ODI-1228: the task (procedure) Test fails on ORACLE SND_VDW_MAP_LOC target connection.

    Caused by: java.sql.SQLException: ORA-06550: line 3, column 1:

    PLS-00306: wrong number or types of arguments in the call to 'SET_VDW_REFRESH_STATUS '.

    ORA-06550: line 3, column 1:

    PL/SQL: Statement ignored

  • Procedure do not return my exception

    Hello

    I try to my test procedure, but it is not returning my exception.

    My procedure:

    Header 1

    create or replace PACKAGE BODY PKG_UNIDADE_EMP_ODS

    AS

    PROCEDURE BUSCAR_UNIDADES)

    VI_COD_EMPRESA IN UNIDADE.ID_INSTITUICAO%TYPE,

    VO_DADOSUNIDADE ON TP_EMPREGABILIDADE_UNI_ODS. TC_DADOSUNIDADE,

    VO_CDERROR NUMBER,

    VO_DSERROR OUT VARCHAR2

    )

    IS

    BEGIN

    VO_CDERROR: = 0;

    VO_DSERROR: = 'success ';

    IF (VI_COD_EMPRESA IS NOT NULL AND LENGTH (VI_COD_EMPRESA) > 1) THEN

    OPEN FOR VO_DADOSUNIDADE

    SELECT

    A SEPARATE. CD_UNIDADE AS CD_UNIDADE,

    UNITED NATIONS. NM_UNIDADE AS NM_UNIDADE,

    UNITED NATIONS. DS_UNIDADE AS DS_UNIDADE,

    UNITED NATIONS. UNIDADE_PORTAL AS UNIDADE_PORTAL

    OF UNIDADE UN

    INNER JOIN INSTITUIÇÃO INS ON (UN.ID_INSTITUICAO = INS.ID_INSTITUICAO)

    WHERE UN.ID_INSTITUICAO = DECODE (VI_COD_EMPRESA, NULL, UN.ID_INSTITUICAO), VI_COD_EMPRESA;

    END IF;

    IF (VI_COD_EMPRESA IS NOTHING) THEN

    OPEN FOR VO_DADOSUNIDADE

    SELECT

    A SEPARATE. CD_UNIDADE AS CD_UNIDADE,

    UNITED NATIONS. NM_UNIDADE AS NM_UNIDADE,

    UNITED NATIONS. DS_UNIDADE AS DS_UNIDADE,

    UNITED NATIONS. UNIDADE_PORTAL AS UNIDADE_PORTAL

    OF UNIDADE UNITED NATIONS;

    END IF;

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    VO_CDERROR: = 2;

    VO_DSERROR: = "no record not found";

    WHILE OTHERS THEN

    VO_CDERROR: = 999;

    VO_DSERROR: = 'unknown error ' | SQLERRM;

    END BUSCAR_UNIDADES;

    END PKG_UNIDADE_EMP_ODS;

    But when I put the parameter that do not exist in the database, do not return my exception:

    VO_CDERRO = 2

    VO_DSERRO = No records were found

    Can someone help me

    Opening of a ref cursor will never give an exception no_data_found. If you want to know that there is no data in the ref cursor, you will need to pick up. But if you look in the procedure as the row won't be available for the application. If you need to know if the cursor has all the data without pick up you will need to do something like this:

    create or replace PACKAGE BODY PKG_UNIDADE_EMP_ODS

    AS

    PROCEDURE BUSCAR_UNIDADES)

    VI_COD_EMPRESA IN UNIDADE.ID_INSTITUICAO%TYPE,

    VO_DADOSUNIDADE ON TP_EMPREGABILIDADE_UNI_ODS. TC_DADOSUNIDADE,

    VO_CDERROR NUMBER,

    VO_DSERROR OUT VARCHAR2

    )

    IS

    v_count pls_integer;

    BEGIN

    VO_CDERROR: = 0;

    VO_DSERROR: = 'success ';

    IF (VI_COD_EMPRESA IS NOT NULL AND LENGTH (VI_COD_EMPRESA) > 1) THEN

    OPEN FOR VO_DADOSUNIDADE

    SELECT

    A SEPARATE. CD_UNIDADE AS CD_UNIDADE,

    UNITED NATIONS. NM_UNIDADE AS NM_UNIDADE,

    UNITED NATIONS. DS_UNIDADE AS DS_UNIDADE,

    UNITED NATIONS. UNIDADE_PORTAL AS UNIDADE_PORTAL

    OF UNIDADE UN

    INNER JOIN INSTITUIÇÃO INS ON (UN.ID_INSTITUICAO = INS.ID_INSTITUICAO)

    WHERE UN.ID_INSTITUICAO = DECODE (VI_COD_EMPRESA, NULL, UN.ID_INSTITUICAO), VI_COD_EMPRESA;

    Select count (*) from v_count

    OF UNIDADE UN

    INNER JOIN INSTITUIÇÃO INS ON (UN.ID_INSTITUICAO = INS.ID_INSTITUICAO)

    WHERE UN.ID_INSTITUICAO = DECODE (VI_COD_EMPRESA, NULL, UN.ID_INSTITUICAO), VI_COD_EMPRESA;

    END IF;

    IF (VI_COD_EMPRESA IS NOTHING) THEN

    OPEN FOR VO_DADOSUNIDADE

    SELECT

    A SEPARATE. CD_UNIDADE AS CD_UNIDADE,

    UNITED NATIONS. NM_UNIDADE AS NM_UNIDADE,

    UNITED NATIONS. DS_UNIDADE AS DS_UNIDADE,

    UNITED NATIONS. UNIDADE_PORTAL AS UNIDADE_PORTAL

    OF UNIDADE UNITED NATIONS;

    Select count (*) from v_count

    OF UNIDADE.

    END IF;

    If v_count = 0 then

    vo_cderror: = 2;

    vo_dserror: not = "no record found where";

    end if;

    EXCEPTION

    WHILE OTHERS THEN

    VO_CDERROR: = 999;

    VO_DSERROR: = 'unknown error ' | SQLERRM;

    END BUSCAR_UNIDADES;

    END PKG_UNIDADE_EMP_ODS;

  • test backup Oracle

    Our DBA team (I'm not an employee of the COMPUTER but I want an expert opinion on this) use a tool third 3rd to backup an oracle database--not RMAN. We examined the test procedures to see if a restore process is running. According to them, the only time where a test of restorations are when the system passes through an upgrade. I don't know enough about the backup/restore process but how regularly you should test a restore of the database, if a restoration works at any given time, why do you need to keep checking it at regular intervals? What happens to have changed between the last test restoration, which could mean that the backup is no longer effectively restores.

    How many times do you do upgrades? Some places call request improvements to level and short do periodically, so that the type of tests of restoration would be good. An upgrade often includes changes to metadata, and those are the ones that can kill a too simple backup plan.

    It makes a difference what type of backup, the 3rd third-party tool made. Many of us have seen some silent on things real dependencies as the SAN that are simply fails. Some of us have seen spectacular fails without correct recovery of trials.

    If things are done right, there will be an official Service Level Agreement document that explains what types of problems are allowed and how should be fast recovery. Do not bother a lot of places, and can also be a recipe for failure. It should also be explanations on validation of backup.

    Details of importance. If the Ribbon is involved, spoil tape drives, tapes go bad, adjusting just a reader can make old unreadable tapes. If the band is not involved, disks and networks have their own problems. Versions of the database may have specific problems with certain characteristics. You cannot deal with every possible thing that can go wrong, but you can plan address the most common issues, a disk controller blown general societal collapse or meteor bombardment throughout the world.

    That is why DBA often said 'it depends', because it is. It is quite possible that something has been quite properly installing, then over time, the procedures are becoming insufficient.

  • Another scenario of test - isolate the recovery Site

    Question for the gurus out there:

    Installation: We have a simple configuration with a single restore site protected and unique. The configuration of the network is stretched VLAN. All the tests to bubble networks works as advertised, and we are very pleased with the solution so far. In addition to virtual infrastructure, there is a certain physical systems that make up the environment, and the goal is to make a complete failure on the test of the site in the coming weeks.

    Test case: the proposed solution is to drop the link between sites protected-recovery and turn the entire failover datacenter in a bubble (only accessible through VPN links). Once the test is completed, we would have back then all the changes on the recovering site, so that it protects once more the main site.

    Question: Would it be possible to rotate part SRM to the test in 'Test' mode only - that she set up the whole environment attached to the VLAN direct (who are now isolated from production by dropping the link of the site) and once finished, reset the recovery by the normal site (i.e. "Test recovery finished, press on continue clean...") ») ? I don't see why it wouldn't work, unless for some reason, the test procedure requires communication between the sites that the effective recovery process does not.

    Thanks for any comments.

    Hello

    Recovery test requires no connection to the protected site as far as I know.

    About the networking part of your question, when you change a recovery plan, on the network management screen you have an option to configure the test networks. These networks is used during the trial instead of bubble networks (default).

    SRM will be cleaning the virtual environment, but how do you cleaning physical servers?

    For how long you plan to run on the recovering site? You have sufficient capacity for snapshots on your storage array?

    Michael.

  • How the parameter of the procedure with the default table type?

    Hello!

    How the parameter of the procedure with the default table type?
    For example:
    type varchar2lType is table of varchar2(50) index by binary_integer;
    create or replace procedure test1
       (
        s1  varchar2(50)
        sa2 Varchar2Type
       )
    as
    begin
       dbms_output.put_line('yyxxyyy!');
    end;
    /
    Published by: bullbil on 16.01.2012 06:35

    If he should really be an associative array for some reason any (can't think why, but just for fun...) you could declare a dummy array in the packet header and specify as the default:

    create or replace package wr_test
    as
       type varchar2ltype is table of varchar2(50) index by pls_integer;
       g_dflt_varchar2l_tab varchar2ltype;
    
       procedure testit
          ( p_testarray varchar2ltype default g_dflt_varchar2l_tab );
    end wr_test;
    
    create or replace package body wr_test
    as
       procedure testit
          ( p_testarray varchar2ltype default g_dflt_varchar2l_tab )
       is
       begin
          dbms_output.put_line('p_testarray contains ' || p_testarray.count || ' elements');
       end testit;
    
    end wr_test;
    

    It is a bit of a hack, because it relies on a global variable that is exposed. A more orderly approach would overload the procedure so that a version does not have the table and another argument:

    create or replace package wr_test
    as
       type varchar2ltype is table of varchar2(50) index by pls_integer;
    
       procedure testit;
    
       procedure testit
          ( p_testarray varchar2ltype );
    
    end wr_test;
    
    create or replace package body wr_test
    as
    
       procedure testit
       is
          v_default_array varchar2ltype;
       begin
          testit(v_default_array);
       end testit;
    
       procedure testit
          ( p_testarray varchar2ltype )
       is
       begin
          dbms_output.put_line('p_testarray contains ' || p_testarray.count || ' elements');
       end testit;
    
    end wr_test;
    
  • SQL Developer 3.0 EA 1 Advanced support for the type of data in the unit tests

    Hello

    According to SQL Developer 3.0 EA 1 New Feature List (http://www.oracle.com/technetwork/developer-tools/sql-developer/rel3-featurelist-ea1-166831.html#ut)
    the EA 1 version 3.0 supported advanced data types in the unit tests. This means support the ANYDATA and RECORD types? I installed version 3.0 of EA 1 to CentOS linux, but it seems that those advanced types are not supported yet. When I try to add a unit test for a function that returns the record type, I get quick error: "the return of PL/SQL RECORD type is not supported. Cannot test (function_name) because 1 arguments have not supported for types". Also if I try to unit test procedure which parameter is of type ANYDATA, I get quick error: "the type UNDEFINED P_DATA argument is not supported. Cannot test (procedure_name) because 1 arguments have not supported for types". Are those advanced data types supported in SQL Developer 3.0 FINAL version?

    Thank you
    Miikka L

    Edited by: user12844253 the 27.10.2010 16:31

    Hi Mikka,

    Only simple PL/SQL records are currently supported i.e. those containing no optional or repeating components and where all components are themselves supported. This restriction is in place, due to the fact that we are using JDBC as a parameter mechanism which does not directly support the passage the PL/SQL record type.

    ANYTYPE and ANYDATA are currently not supported because they have a dynamic value type and must be set programmatically. In the future, it would be possible to support these via the dynamic value and and validation features.

    This will remain for the final version.

    Kind regards
    Richard

  • SQL file with block anonymous (main) and procedure

    Can I have in a sql file? Ideally, I would like to use a procedure in my sql script. How is that possible? Thank you.

    DECLARE

    BEGIN

    END;

    -follow-up of a procedure block


    BLANK test procedure

    IS

    BLANK END;

    How to define a procedure in the block of anonmymous and call it?

    SQL> declare
       procedure blank
       as
       begin
          dbms_output.put_line ('Inside procedure blank');
       end blank;
    begin
       blank;
    end;
    /
    Inside procedure blank
    

Maybe you are looking for

  • Distorted with Hamamatsu Orca HR?

    I use an Orca C4742-95 through machine vision experience.  I put two platforms in place, each of them have the same model camera hung.  Computers also use the same firewire card, a "Texas Instruments TSB82AA2 1394b OHCI-Lynx IEEE 1394 Host Controller

  • Pavilion dv7-6157 can be upgraded for the games?

    I bought my son the Pavilion dv7-6157nr two years ago and he has problems with graphics on the high-end gaming, he plays. They freeze or crash. It has 8 G DDR3 SDRam, 2 generation Intel Core i7 2.2 GHz - 3.10 turbo and a radeon HD 6770Ms graphics car

  • HP 3050 printer all-in-one: printer has stopped printing! HEEELP!

    HI HI! Please can someone help me! My printer can print some time back (5 months ago), but now it won't? The flashes of blue light wireless, but it does not print? I'm lost with her!

  • Create a library in Blackberry JDE

    Learn more and more :-) I want to create a library for a couple of functions.  I can what I have to specify 'Library' in the definitions of the project Several output files are created. To use the library, I guess I should do an import in the class w

  • HP 6515

    I have a new HP cartridges in my 6515. The black cartridge will not print. The alignment will fail. Only of blue ink will be printed on the alignment page. All other cartridges work. I have a cartridge 564XL black and color cartridges 564.