collection solution

Hi Master,

I have a collection with two columns Code and status.

status code

-----------          -----------------

A1                        1

A2                         0

A3                         1

A4                         1

A5                         0

IF THE STATUS IS IF THE STATUS IS IF THE STATUS IS

1                                                                         0                                                                                  0

1                                                                         0                                                                                  1

1                                                                         0                                                                                  1

1                                                                         0                                                                                  0

1 I wanted to display the output of 'A' 0 I wanted to display the output 'B' 1 then, I wanted to display the output as 'C '.

Please advise...!

Concerning

AR

Like this...

SET SERVEROUTPUT ON

DECLARE

TYPE rec_type IS RECORD (code VARCHAR2 (2),)

status NUMBER

);

TYPE nt_tab IS TABLE OF THE rec_type;

v_nttab nt_tab: = nt_tab();

NUMBER of v_chkval_1;

NUMBER of v_chkval_0;

BEGIN

v_nttab. EXTEND (5);

v_nttab (1) ethical: = "A1";

v_nttab (1) .status: = 1;

v_nttab (2) ethical: = "A2."

v_nttab (2) .status: = 0;

v_nttab (3) ethical: = "A3."

v_nttab (3) .status: = 1;

v_nttab (4) ethical: = "A4."

v_nttab (4) .status: = 1;

v_nttab (5) ethical: = "A5";

v_nttab (5) .status: = 0;

BECAUSE me IN 1.v_nttab. COUNTY

LOOP

IF v_nttab (i) .status = 1 THEN

v_chkval_1: = 1;

END IF;

IF v_nttab (i) .status = 0 THEN

v_chkval_0: = 0;

END IF;

END LOOP;

IF (v_chkval_1 = 1 AND v_chkval_0 IS NULL) THEN

DBMS_OUTPUT. PUT_LINE ('A');

ELSIF (v_chkval_1 IS NULL AND v_chkval_0 = 0) THEN

DBMS_OUTPUT. PUT_LINE ('B');

ELSIF (v_chkval_1 = 1 AND v_chkval_0 = 0) THEN

DBMS_OUTPUT. PUT_LINE('C');

END IF;

END;

OUTPUT:

=======

SQL > SET SERVEROUTPUT ON

SQL > DECLARE

2 TYPE Rec_type IS RECORD (code VARCHAR2 (2),)

3 status NUMBER

4                            );

5 nt_tab TYPE IS an ARRAY OF rec_type;

6 v_nttab nt_tab: = nt_tab();

NUMBER of v_chkval_1 7;

8 v_chkval_0 NUMBER;

BEGIN 9

v_nttab 10. EXTEND (5);

11 v_nttab (1) ethical: = "A1";

12 v_nttab (1) .status: = 1;

13 v_nttab (2) ethical: = "A2."

14 v_nttab (2) .status: = 0;

15 v_nttab (3) ethical: = "A3."

16 v_nttab (3) .status: = 1;

17 v_nttab (4) ethical: = "A4."

18 v_nttab (4) .status: = 1;

19 v_nttab (5) ethical: = "A5";

20 v_nttab (5) .status: = 0;

21

22 FOR I IN 1.v_nttab. COUNTY

23 LOOP

24 IF v_nttab (i) .status = 1 THEN

25 v_chkval_1: = 1;

26 END IF;

27 IF v_nttab (i) .status = 0 THEN

28 v_chkval_0: = 0;

29 END IF;

30 END LOOP;

31

32 IF (v_chkval_1 = 1 AND v_chkval_0 IS NULL) THEN

33 DBMS_OUTPUT. PUT_LINE ('A');

ELSIF 34 (v_chkval_1 IS NULL AND v_chkval_0 = 0) THEN

35 DBMS_OUTPUT. PUT_LINE ('B');

ELSIF 36 (v_chkval_1 = 1 AND v_chkval_0 = 0) THEN

37 DBMS_OUTPUT. PUT_LINE('C');

38 END IF;

39 END;

40.

C

PL/SQL procedure successfully completed.

Thank you

Ann

Tags: Database

Similar Questions

  • DVD won't play in Windows 7 64 bit Home Premium Media Center.

    I tried many DVDs in my Windows 7, 64-bit Home Premium system, and none of them will play in the Media Center, with the exception of a 1955 film that plays without problem. I guess it was a good year. In the lower right corner of the Media Center, a window says: "Play DVD - Windows Media Center cannot detect a video DVD in the DVD - Rom drive. Insert a video DVD in the drive." Apparently, the DVD is not detected. What is a missing codec problem? I read about downloading the Codec of the user, only to cause more problems, and I did a lot of searching for an answer to this and found a countless number of users having problems with DVD in Media Center and no collective solution. How can it be this difficult? What is the problem with Windows 7? Why can I play a DVD of a film of 1955 (Mr. Roberts) and not of today's movies? The only solution that I come up with to this day, even after checking with the maufacturer of my optical drive, should consider buying the codec itself, if that is what is lacking, or a DVD player to possibly of Roxio. But after the piece of hugh of money I paid for my software Windows 7, I would not have bought anything others of another company. I wouldn't think to go back to XP, but I've had far fewer problems. Any help would be appreciated. Don

    Hi Mary - thank you very much for your answer. My PC is a Dell Inspiron 530 desktop computer. I just got the phone is turned off after a few hours of troubleshooting with Dell hardware and software services. Dell is sending a technician to replace my optical drive. They hope that clears the problem, but if not, they say that I might have to reinstall Windows 7. This is happening due to your pointing me in the right direction with your post, and troubleshooting I could do before, I called Dell. I had different problems for a while, and maybe they'll finally get fixed. Thanks again, Don Don

  • Quick overview of a collection in a digital publishing Solution

    IIS, it is possible to get a quick overview of a collection of articles on my iPad? There was the content viewer In Digital Publishing Suite. I don't want to create a app development. How can I manage that, similar and easy as the content viewer?

    Moved to the forum of Digital Publishing Solution.

    Right now, creating the app is the only way to see the preview.

  • Re-installing upgrade CS5.5 Master collection on the new drive. Workaround solutions?

    My hard drive fried, I re downloaded my version of CS5.5 Master collection and put the serial number, but since it's an upgrade, he wants to see the old files before installing. Backup failed. I'm using After Effects since COSA is out with a beta version. You can see my work going on youtube and looking for a reel Baron Sarto. How can I fix it?

    Instead of having the old version installed, you can just slect it in a list and then provide the serial number so that he can prove that you are eligible to use the upgrade.

    Error "this serial number is not for a product calling it" | CS6, CS5.5, CS5

    http://helpx.Adobe.com/Creative-Suite/KB/error-serial-number-qualifying-product.html

  • Workaround solution for use af:foreach with collection

    Hello

    I have a n to m relationship between the two tables to TRANSFER and the USER. I've implemented this n m relationship with a third table, called USR_ASS_REL.

    I have a page detailedUser.jspx which gives me detailed information on all users. If I drag the DataControls USR_ASS_REL field on the screen, I create an array with all of the responsibilities of the user. But this isn't what I want. Instead, I want to print all the assignments on the screen, just separated by a semicolon (by example, assignment1; assignment2;...). I tried to use af:foreach, but that doesn't support the collections. Will there be a chance to do this in a different way? It would probably work if I create a new query asking for assignments to a user, but I don't want to create an additional query for cases like this.

    Thank you
    Brahim

    Hi John, try instead of foreach and it should work. Recent have been prety much more simply in one of my pages:

    
      
      
    
    

    Kind regards

    ~ Simon

  • Creative solutions for collection DVD CS3 Suites

    In short, I can't find the Setup.exe in any of the DVD (disc 1: content;) (Disk2 - 3).

    The story begins like this:

    ADOBE® CREATIVE SUITE® 3 PRODUCTION PREMIUM WIN version of the student (I work in a University), I bought a year ago and loaded to my computer Dell XPS 720. The operating system is Vista Home Premium (32 bit). Three weeks ago the computer's graphics display problems. Dell support impossible to locate the problem real suite to try of new GPU drivers, run Dell Diagnostics etc. and finally asked me to install the original image, which was actually a system reinstallation using the backup partition on the hard drive, most of the applications on the hard drive with the exception of programs pre-installed Dell-free. The key can lay here: before going to the original image, I do not disable the Creative Suite or I didn't it is a must to disable the Creative Suite.

    When the computer problem was fixed by changing the graphics cards, I successfully installed Win7 Ultimum (also 32-bit) to the computer. Applications such as Office 2007, Adobe acrobat 9 etc provided in place successfully and ran OK so far on the new OS. But when I took out the creative Suite DVD, I found that I couldn't not find the Setup.exe. In 'Options records', choose 'show hidden files and folders' did not help. In DOS, I couldn't find the Setup.exe or the other.

    Any ideas or suggestions on this subject? Thank you very much.

    Double-click a file in the folder root of the CS3 Application1 called autoplay.exe dvd.

  • I have a large collection of big slideshows in iPhoto, created over the years with captions from the titles of the photos. How can I keep these slide shows subtitled in Photos?

    I have a large collection of big slideshows in iPhoto, created over the years with captions from the titles of the photos. How can I keep these slide shows subtitled in Photos?

    You can't keep slideshows as captioned photos.  Slide shows get migrated in the form of albums for the Group of photos is maintained.  But Photos don't have the ability to add descriptions to the slide show so that they would have to be manually added to each slide automatically.

    However, a possible solution would be to export every slide show in iPhoto as a Quicktime movie file. Which will keep the titles and descriptions on each slide.  The resulting QT files can be imported into the iPhoto library before migration or photo library after.

  • Satellite Pro U400 - 13 k - can not connect on Vista - SOLUTION

    Setting of the Romanian regional components at installation time makes you unable to log into vista: Runtime LogonUI.exe error

    Model: Satellite Pro u400 - 13 k.

    No problem:

    Installation of vista start preinstalled, idir a u400 - 13 k,.
    When prompt change to Romanian locale

    Result: after completing the installation of vista program, LogonUI.exe crashes with Microsoft C++ Runtime exception dialog box.

    _Solution: _

    * Restart in mode safe then burn collection amovible.*
    * Restrat configuration then do not change the regional settings *.

    Hope this helps other customers until it is resolved.

    * For Toshiba QA Team *: I spent almost 4 hours to work around your untested product. Please at least fix this bug for other clients, as the time is important to everyone. I guess this can be linked to the logon request is not properly located or crush fingerprints.

    Kind regards.
    sandi_ro.

    US Forum: http://laptopforums.toshiba.com/tshb/board/message?board.id=brd_SatPro&message.id=180

    Hi Sandi

    Thanks for this solution.
    This could be useful for all users who are looking for such a solution here in the forum.

    Greetings

  • Best way to collect information on the bios of HP Desktop

    Whe have several HP Elite 8300 desktop computers. We don't have accurate information how many of them protected by password of bios.  What would be the best method to collect this information from all the computers of HP desktop and export, for example in the csv file?

    Kriimsilmm, welcome to the forum.

    I think that you will get more responses to your question if you start a thread here.  They are the members who know more on your computers.

    Please click on the Thumbs up button '+' if I helped you and click on "Accept as Solution" If your problem is resolved.

  • What info Skype collects on our PC/laptop?

    What info Skype collects on our PC/laptop? I mean a technique.
    I am particularly interested if he gets the serial number of our laptop that we used to connect.

    Yana_mv wrote:

    What info Skype collects on our PC/laptop? I mean a technique.
    I am particularly interested if he gets the serial number of our laptop that we used to connect.

    Hello

    Skype does not collect any technical information. If a is needed to help solve a problem, you we ask you to do this. Once the issue is resolved the information provided is not retained.

    TIME ZONE - US EAST. LOCATION - PHILADELPHIA, PA, USA.

    I recommend that you always run the latest version of Skype: Windows & Mac

    If my advice helped to solve your problem, please mark it as a solution to help others.
    Please note that I usually do not respond to unsolicited private Messages. Thank you.

  • Collect and display data from several workstations

    Currently, the data in the CSV format locally on several workstations running Labview and the format of the recorded data is the same for each workstation. Data are recorded roughly every 2 minutes at each station and at different times.

    Computers of these stations are connected network but no saves a copy of their files CSV to the server that I know is not ideal, but a part of memory original.  What is now there that a computer on the network brings together these data by workstations and then the poster showing trends in workstations etc. in graphic format and possibly Excel.

    What I'm looking for is some advice on the best way forward.

    I looked at shared variables as a possible solution, but it is work stations send their respective data to the 'central' PC or this PC "questions" workstations that seems inefficient.

    Another thought was using Active X workstations to write in an Excel file running on the "central" PC

    Finally thought that workstations have record their findings to a server and then 'central' PC to access that data, it brings together and then displays the results combined.

    There are several things that remains to be clarified.

    • All LabVIEW programs, individual data record data in the same format and the same number of data points?
    • Record all programs of LabVIEW at exactly the samerate?
    • Are all data on a be saved in a single file of the Machine, or each reading (at intervals of 2 minutes) in a separate file?
    • You are trying to combine data from different machines such that it is collected or after the entire collection was done, and all files have been written?
    • Another that the timestamp of the data file, is there a "time stamp" in (all) the individual data files?
    • If you assume that the data of different machines are more synchronized, you have in mind a way to combine the different readings of the time?  What happens if they are sufficiently different that, say, the Machine has 20 readings more (because it started much earlier) than other PCs?
    • If the machines are not saving at the same rate, how will handle you that?

    A single method, you might consider is to write a program that works on any network connected PC, including a no participate in the recording of data.  For simplicity, assume that each machine "participatant" starts at around the same time, saves exactly at the same rate, written a single data file and has already closed.  If the program "Combining" knows where all data files (because he knows the name of each machine and the location of the file on each machine), it can open all the files, collect all the data and treat it but want to (including a 'combined Excel workbook"writing with a spreadsheet separate for each PC, or combining them all on one sheet).  Just decide what you want to do in the context of the issues raised above.

    Bob Schor

  • Strange behavior when using Labview to collect data from Tektronix oscilloscope tds8200

    I hit a wall in trying to understand this one. The problem I have is that my application will not start the oscilloscope when it should.

    I use an oscilloscope Tektronix TDS8200. My goal is to collect data from the oscilloscope using Labview waveform. First of all, my program initializes and configures the oscilloscope; This part of the program works very well.

    The second part of the program begins the acquisition of data with the function 'Tktds8k Start or Stop Aquisitions.vi', which is to press the button run on the scope. The function "tktds8k to Waveform.vi" is used and should ideally return data, which I connected to a waveform playback graph.

    When I run my program, the first part runs without a problem, but as soon as the program comes to the service get the waveform, the run button in the scope, which is green when running, turns off; the program then expires, and no data is collected.

    Here is where it gets weird. I went through the debugging to try to understand this point, and I put breakpoints on the beginning and get shape wave functions so that I could scroll through the last part of the program. The program continues with the departure function, and the button run in scope is green. The breakpoint for the function get the waveform is reached and when I press on continue, turns the Run button and turns it off then back on almost immediately. data are collected, the waveform graph appears and the program ends without error.

    I thought that the timetable could be the problem, so I did the program wait as long as five seconds between the functions of start and get the waveform and that did not work. I also tried to move the start function to before the configuration functions and remove start completely; no method worked.

    is there any ideas on why, the program works when I enabled breakpoints and isn't when breakpoints are disabled? I'm sure there is an easy solution, but I was not able to find a solution.

    I have attached a pdf that contains information about the functions of the Oscilloscope (tktds8k.pdf), and I have also attached my program.


  • best practices in data collection

    Hello

    I am trying to find the best way to collect about 5 seconds of data a DAQmx Read vi to 1000 samples per second.  I want to be able to get the average, min and max of this collection.  I didn't know that the best way would be all at once.  The best solution that I have proposed is in the JPEG below.

    I've also heard the expression, "data trample ' and told me that's what I'm looking for.  Any thoughts would be appreciated.

    Thanks in advance for your help.

    P.S. I realize concatenate the output of the table is not the best method due to the reallocation of memory of array to each loop.  I couldn't find a better method that served the same purpose.

    Hello

    Thank you for your message.  Since you buy you data on a specific period of time, you want to make an acquisition over instead of using a while loop with your Read DAQmx.  I've attached a screenshot of what looks like your block diagram.  In addition, using the table Max & Min, add the elements table and the size of the array elements, you can find the maximum, minimum and average your table values.  Please let me know if you have any questions!

    Kind regards

    Todd v.

  • Spectrum of HP X 2 - HID SENSOR COLLECTION driver problem

    Hello

    I just bougt garage a Ultrabook of spectrum HP X 2/tablet.

    Since I already have a Windows 8 N Pro license I installed it on my spectrum X 2.

    The question I am now face is that the dirver HID SENSOR COLLECTION is not woking and I can't use my sensors such as: rotation (accelerometer), light sensor, the screen...

    I can see this error in Device Manager by double-clicking on the HID COLLECTION of SENSOR:

    "

    This device cannot start (Code 10).

    The process hosting the driver for this device was completed.

    "

    I have installed all drivers HP of my spectrum HP X 2 page drivers and I also installed all Windows updates.

    Can someone please?

    Thank you

    Mircea

    I found a solution for the problem of driver HID sensor Collection.

    It seems that the driver uses something Windows Media Framework and because it can not find it on my spectrum X 2 it fails.

    This driver problem will happen on all the HP spectrum X 2 who have installed Windows 8.1 Pro N (N is the European version) because there is no Media Feature Pack installed by default.

    To fix the driver HID Collection sensor problem, I installed the Media Feature Pack for N and KN here 8.1 Windows versions:

    http://www.Microsoft.com/en-US/Download/details.aspx?ID=40744

    After the instalation just sensors begin to work.

    It is a BIG PROBLEM and HP needs to do something about it!

    A big thank you to Wiab of Lenovo Comunity forum for us to share the solution:

    http://forums.Lenovo.com/T5/idea-Windows-based-tablets-and/yoga-13-hid-sensor-collection-Auto-rotate-functionality/TD-p/997095

    Kind regards

    Mircea

  • How can I change the color of the plots (lines, points) in the collection Scattergraph plot

    For example, I go through a foreach loop and draw two points. How to distinguish this set of plots of the yet to come? How can I change the style, color and have separate lines (instead of on the line connecting everything) for each of my plots? I don't know how to set everything up, but it still does what he wants to do. TIA.

    Hello

    The problem you see occurs because of the following lines of code:

    The _data and _data2 scatterPlot3 value

    _data = scatterPlot3

    _data2 = scatterPlot3

    When you do this, you define _data as _data2 to reference an object of the simple concession - scatterPlot3.  Yes, even if you have (from the code you have posted at least) three slots in your collection, they are all pointing to the same object of point cloud.  So when you change the color for one, it changes the color for them all.  However, I think that you have fallen on the right solution in your last sentence.  If you want to have multiple locations on your ScatterGraph, each with its own color and style, they should each be separate and unique plots in the collection plot of your ScatterGraph.  Based on the code you posted, you'll see this if you comment just the two lines shown above.

    Please let me know if something is still uncertain.

    NickB

    National Instruments

Maybe you are looking for

  • Double click on the Bookmarks button to open the library window directly ("Show all bookmarks" feature)

    I have a number of folders in the bookmarks, and I frequently change it by clicking on "Show all bookmarks" and by opening a library.Earlier, after you click the Bookmarks button, "show all bookmarks" appeared on the top of the list, and now he's dow

  • IPad cannot sync photo after ios 9.3

    After having updated my Ipad to air 2(64G) to version 9.3 and Itune on my PC version 12.3.3 I can't synchronize my PC (Win7) on my Ipad photo. Before update I can sync without any problems. I try many ways -Restart the PC/Ipad 2 -Uncheck the sync - r

  • How can I change the setting to ignore updates to language?

    I really don't have to remember every day that there are 34 language updates which are not relevant for me... Why can't it be a capacity 'Ignore' so that we can concentrate on the important updates.

  • Status unknown heath ESXi

    Hello. I use Dell openmanage essentials to manage our servers, ESXi included. However, for our ESXi servers (which are all 5.1.0 build 914609) I am unable to get the State of health. Servers appear under the folder/umbrella "VMware ESX Servers" in th

  • TextSize ajust to let her enter a label

    Hello! I have a label, height 400px and width 600px and I want a text (random length Word) scale to fit exactly to the width of 600px. I want to avoid that the text gets blurred, but shorter words can be displayed words compared to adults. Any ideas?