Could not show multiple records while could show only one record

Hi, all
I have an oracle 10g db running on a Linux E3 server.
I have two tables:
CREATE TABLE "IMMUNODATA"."DEMOGRAPHICS" (
"SUBJECTID" INTEGER NOT NULL,
"WORKID" INTEGER,
"OMRFHISTORYNUMBER" INTEGER,
"OTHERID" INTEGER,
"BARCODE" INTEGER,
"GENDER" VARCHAR2(1),
"DOB" DATE,
"RACEAI" INTEGER,
"RACECAUCASIAN" INTEGER,
"RACEAA" INTEGER,
"RACEASIAN" INTEGER,
"RACEPAC" INTEGER,
"RACEHIS" INTEGER,
"RACEOTHER" VARCHAR2(50),
"SSN" VARCHAR2(11),
PRIMARY KEY("SUBJECTID") VALIDATE
CREATE TABLE "IMMUNODATA"."MEDICATION" (
"ID" INTEGER NOT NULL ,
"THEDATE" DATE ,
"SUBJECTID" INTEGER NOT NULL,
"MED_PAGENOTCOMPLETED" VARCHAR2(500) ,
"MEDICATION_NAME" VARCHAR2(100),
"MEDICATION_CLASSIFICATION" VARCHAR2(100),
"MEDICATION_DOSENUM" VARCHAR2(50),
"MEDICATION_DOSEMEASURE" VARCHAR2(100),
"MEDICATION_ROUTE" VARCHAR2(100),
"MEDICATION_FREQ" VARCHAR2(100),
"MEDICATION_BEGIN" DATE,
"MEDICATION_END" DATE,
"BARCODE" INTEGER,
"DATASOURCE" VARCHAR2(50),
"NOCHANGE" INTEGER,
PRIMARY KEY("ID") VALIDATE,
FOREIGN KEY("SUBJECTID") REFERENCES "IMMUNODATA"."DEMOGRAPHICS" ("SUBJECTID") VALIDATE
I want to show an output to combine all medication records of one person into one, and I created a function.
CREATE OR REPLACE FUNCTION COMMEDICATION(p_subjectid IN immunodata.medication.subjectid%TYPE ) RETURN VARCHAR2 IS
v_medication VARCHAR2(1000);
BEGIN
FOR c IN (SELECT THEDATE, MED_PAGENOTCOMPLETED, MEDICATION_NAME, MEDICATION_CLASSIFICATION, MEDICATION_DOSENUM, MEDICATION_DOSEMEASURE,MEDICATION_ROUTE,MEDICATION_FREQ,MEDICATION_BEGIN,MEDICATION_END,DATASOURCE,NOCHANGE FROM immunodata.medication WHERE subjectid = p_subjectid)
LOOP
IF v_medication IS NULL THEN
v_medication := c.THEDATE||' '||c.MED_PAGENOTCOMPLETED||' '||c.MEDICATION_NAME||' '||c.MEDICATION_CLASSIFICATION||' '||c.MEDICATION_DOSENUM||' '||c.MEDICATION_DOSEMEASURE||' '||c.MEDICATION_ROUTE||' '||c.MEDICATION_FREQ||' '||c.MEDICATION_BEGIN||' '||c.MEDICATION_END||' '||c.DATASOURCE||' '||c.NOCHANGE;
ELSE
v_medication := v_medication||','||c.THEDATE||' '||c.MED_PAGENOTCOMPLETED||' '||c.MEDICATION_NAME||' '||c.MEDICATION_CLASSIFICATION||' '||c.MEDICATION_DOSENUM||' '||c.MEDICATION_DOSEMEASURE||' '||c.MEDICATION_ROUTE||' '||c.MEDICATION_FREQ||' '||c.MEDICATION_BEGIN||' '||c.MEDICATION_END||' '||c.DATASOURCE||' '||c.NOCHANGE;
END IF;
END LOOP;
RETURN v_medication;
END;
and I performed this selection statement:
SQL> select subjectid, barcode, COMmedication(subjectid) from immunodata.demographics where barcode=500135;
SUBJECTID BARCODE
COMMEDICATION(SUBJECTID)
33 500135
15-SEP-00 Cyclophosphamide Immunosuppresant .7 MG IV MONTLY FORM1 ,15-SEP-00 Hydroxychloroquine (Plaquenil) Immunosuppresant 400 MG DAILY FORM1
It is exactly what I need, so I want to show all records in the tables.
SQL> select subjectid, barcode, COMmedication(subjectid) from immunodata.demographics;
ERROR:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.COMMEDICATION", line 9
no rows selected
It seems that one record could be shown, but multiple could not.
Is there anything wrong with my code or other things?
Thanks!
Qian

It seems that one record could be shown, but multiple could not.
Is there anything wrong with my code or other things?
It means that there is at least one subjectid in your table for which the value of v_medication in the function exceeds 1000 characters.
You may want to increase the size of v_medication to 4000, which would be the upper limit for the function's return value.
pratz

Similar Messages

  • Google Ads (adsense) do not show in one of our sites - Firefox 3.6.4

    Hi,
    Google ads do not show in one of our sites (hipogg.info).
    The site shows ads just fine in IE, Chrome, Opera & Safari.
    I have tried just about everything:
    - Cleared Cache and tried - No success
    - Disable addons and tried - No success
    - Open Firefox in Safe Mode and tried - No success
    - uninstalled Firefox and all personal preferences, reinstalled a clean firefox and then tried - No success.
    I would appreciate one of you guys to help me out.
    Thanks
    == Operating system ==
    Windows 7

    Thanks zzxc,
    Firstly I am impressed at the quick and helpful response from Mozilla Forum. I posted the same on Google Ads forum and have not received any response yet.
    I asked a couple of my colleagues (who are outside our network) to check it in their firefoxes. And the result they got was the same as yours.
    In other words the ads work fine with Firefox. The issue could be my pc and/or network. Or the issue could be that since I registered hipogg.info on google adwords using this browser/pc. Google may have registered the browsers/pc's unique/mac id and blocked ads. If so that is good work on Googles part - though communicating the message across to their users would be helpful and time saving.
    Once again thanks for helping me out. I really appreciate it.
    Mozilla rocks.

  • I added a custom ringtone . Then later I tried to add another three set  but now after sync . Am not able to get rid of the first one... It's still there as my custom ringtone. But my iPhone in iTunes shows all four... But the phone shows only one...?

    I added a custom ringtone . Then later I tried to add another three set  but now after sync . Am not able to get rid of the first one... It's still there as my custom ringtone. But my iPhone in iTunes shows all four... But the phone shows only one...?

    Paul--you are a life-saver!! Worked great. I did have to look around to make sure I was getting 4.9 instead of 4.7 (even when the file was named 4.9 at techspot.com), but I finally got the right file, did the install as you suggested, and everything is now fine. One note, though, that I haven't seen mentioned in any of this thread: when I first tried to open up iTunes after getting back to 4.9, the following message appeared: "The file iTunes Library.itl cannot be read because it was created by a newer version of iTunes." I merely went to the old .itl file that was created when I did the update to iTunes 5, renamed it, moved it over to my now new 4.9, and iTunes opened fine. My library was a few days out of date, because of the few days' lag from the time I did the iTunes update, but that was easily taken care of, and everything's now working fine. Thanks again!!!

  • Why can't i send multiple files through airdrop ? , it accepts but shows only one photo

    why can't i send multiple files through airdrop ? , it accepts but shows only one photo

        Hello there Laurengrayce,
    I message all of the time and I want you to do the same, to anyone you would like!  Demmo provided a good suggestion of having this person check their services and ensuring they're setup as a 10-digit number, but I would like to provide some of my own suggestions.
    If they are in fact already setup as a 10-digit number, I would recommend deleting this persons contact from your phone as well as the entire messaging thread (long press and hold on thread to delete).  Readd them to your contact list and try again.
    Please advise if this continues and they've already checked with their provider.
    Thanks,
    MelissaM_VZW
    Follow us on Twitter @vzwsupport

  • When I open up iphoto and click on the events tab then double click on an event, it used to show minis of all the photos in that event.  Now it shows only one photo at a time.  How do I get it back? Can you help?

    When I open up iphoto and click on the events tab then double click on an event, it used to show minis of all the photos in that event.  Now it shows only one photo at a time.  How do I get it back? Can you help?

    On the bottom bar of the window (on the left iPhoto 11, on the right in other versions) note the slider. Drag it left.
    Regards
    TD

  • How do you show only one caller's video display wi...

    How do you show only one caller's video output with four people sharing a video call? i.e. the call originator wants to show a DVD video on a TV screen and the other callers want to view the video on full screen not just one fourth of their screen.

    Thought I'd try this just in case they are stripping out attachments.
    Gary Grow
    6457 Audubon Sq Dr N
    Mobile, AL 36695
    Email: [email protected]
    Cell: (251) 422-8817
    The American Creed by William Tyler Paige
    I believe in the United States of America as a government of the people, by the people, for the people; whose just powers are derived from the consent of the governed, a democracy in a republic, a sovereign Nation of many sovereign States; a perfect union, one and inseparable; established upon those principles of freedom, equality, justice and humanity for which American patriots sacrificed their lives and fortunes. I therefore believe it is my duty to my country to love it, to support its Constitution, to obey its laws, to respect its flag, and to defend it against all enemies.

  • Customize the legend of a pie graph to show only one series

    Is there a way to show only one series in the legend though the pie graph displays more than one series?
    Any help is greatly appreciated
    Thanks
    KK

    Here is an example that changes the scale of a graph. I think it is what you are looking for. Post back if it is not.
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]
    Attachments:
    Update_graph_scale.vi ‏40 KB

  • All my saved layers disappeared. Shows only one locked black layer.with red sripes

    All my saved layers disappeared. Shows only one locked black layer.with red sripes

    Apple changed the save behaviour several times in the past few versions of MacOsX - there is a good article about this:
    http://www.macobserver.com/tmo/article/os-x-mountain-lion-how-apple-rescued-save-as
    The trouble is, you should (I know, not much of a help to you at this point) always create backups AND work with versions. So save many versions (x1, x1a, x2, x2a, etc), because when you work within one master file you run the risk of these type of accidents and there is always a tiny change your file becomes corrupt for some external reason. You never know. Disk space is cheap, losing your work is often a real hassle, and can become very problematic when dealing with clients.
    So, save many versions, and make backups of your work. And never NEVER open your original files in any other software - always use a duplicate. You never know what that software might do to your files.
    Anyway, have you tried searching for the file name on your mac? Maybe, just maybe there is a duplicate lying around somewhere with the layers intact.

  • My iPhone show only one image Conect USB to iTunes (on PC).What i doing??

    My iPhone show only one image: Conect USB to iTunes (on PC), and I do not restart my iPhone.What i doing?

    Hello 2000Skyfall,
    It seems your device may be stuck in recovery mode. At this point your device may need to be restored. Have you created a backup at any point via iCloud or iTunes? The following article provides details on recovery mode:
    If you can't update or restore your iPhone, iPad, or iPod touch - Apple Support
    Get more help
    Learn what to do if you don't see your device in iTunes for OS X, or in iTunes for Windows.
    If you put your device into recovery mode by mistake, restart it. Or you can wait 15 minutes and your device will exit recovery mode by itself.
    Thank you for contributing to Apple Support Communities.
    Cheers,
    Bobby_D

  • How do you select and move more than one bookmark at a time? Shift+Click does not select multiple items that are next to one another in a list because the item

    How do you select and move more than one bookmark at a time?
    Shift+Click does not select multiple items that are next to one another in a list because the items open in firefox before this happens.

    Use the bookmarks library. You may use Shift +Click, and Ctrl + Click to create groupings of selected bookmarks to drag and drop.
    * one method of opening the bookmarks library is keyboard shortcut <br /> Ctrl+Shift+B (Windows)
    *see also [[How to use bookmarks to save and organize your favorite websites]]
    *and [[Use bookmark folders to organize your bookmarks]]

  • How to show only one element in drop list(common VO)

    Hi All,
    I'm using 11g adf jdev.
    I have a common view object VO. In this VO one attribute is dropdown list , which i commonly used in some jsf pages .
    Now in one particular jsf page i want show only one element in the dropdown list .
    how can i handle with out distrib'g the common VO.
    THANKS IN ADVANCE

    BTW, why you want to display only one item in the list.
    If you are sure that the list will be having only one item, why don't you have it as inputText/outputText
    How do you filter out the item to be displayed in the list? If that filtering is done on listdatasource bound to the list, the list will automatically show only one item(i.e, the filtered item)
    HTH
    Sireesha

  • Multiple users shuts down to only one user

    I have multiple users on my IMac.
    Recently when I go to log on the computer instead of show all users, it shows only one user (not me) and I have to log on to that user and log off to see all users again.
    Any ideas how to fix this?

    After migrating your whole user account from another computer you will be left with 2 user acounts on the target computer.
    The best way to keep just the new user account is to log into the account you want to keep, then go into system preferences > users&groups (Accounts if using snow leopard) then delete the other account.
    (Make sure you have a backup of any files you wish to keep on that user account if any)
    If you wanted to just merge particular files from one computer to another instead of creating two user accounts you would be better off using the good old drag and drop method instead of migration assistant.

  • Photos not showing, only gray boxes

    so i opened up my iPhoto, and some of my pics aren't showing. they show when i click on them, but the like thumbnails aren't showing. only gray boxes. like the outline of the box is a dotted gray line.
    help?

    You can add a title to a pic in iPhoto - you do it - and everything else - in the iPhoto Window. However this does not rename the file. If you want to access the pics, the filename is irrelevant:
    There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 Only*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Apple-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and 10.5* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    If yiu want to export a copy of a pic, using the Title as Filename, then use the File -> Export command. It’s one of the options in that dialogue.
    Regards
    TD

  • Calendar items not showing ONLY in list view on iPhone

    Weird: My Calendar items are not showing in the list view only, on iPhone.
    They show when I search, they show in month, they show in Day views--just NOT in list view.
    Ideas?

    I just had the same problem (calendar information--for eight different calendars--OK on laptop and on Mobile me; on the iPhone only 3 of my calendars were displaying in "List" view, but all eight were appearing in "Day" view); first time I've encountered this problem (and immediately after installing the 11-February-2010 iPhone software update, so I'm suspicious that this might have been the cause).
    Solution described in posting immediately above seems to have worked. I.e.,:
    1. shut OFF MobileMe syncing for calendars on the iPhone (from Settings menu);
    2. wait for calendar entries to be removed;
    3. shut off iPhone, and wait 2 minutes;
    4. restart iPhone;
    5. turn ON MobileMe syncing for calendars on the iPhone (again, from Settings menu).
    All eight calendars now appear in List view (and still appear in Day view).

  • Shared tab in left menu column does not show on one of the computers after setting up Home Sharing

    For iTunes 10.3, I have set up home sharing on two computers that run windows 7, I have authorized both computers.  The iTunes Shared link for computer 2 shows up on left column for computer 1(main iTunes computer).  The problem I am having is that the Shared link for computer 1 DOES NOT show up on computer 2.   My network between the both computers is working because I am able to pull/copy music files from computer 1 to computer 2.  Why doesn't the Shared link for Computer 1 show up on Computer 2 Itunes left column?  Any help would be most appreciated. Thank you.

    Nothing had changed when I plugged in my iPod at work today, having changed it to manage manually earlier at home. But after rebooting a few minutes ago, iTunes cranked up and updated the library. The library now appears below DEVICES/iPod on the menu instead of under LIBRARY/Music at the top left, which I'm pretty sure is different from before, but no matter. Also the iPod is still not appearing in My Computer but again, no matter. I am able to play my tunes on the work install of iTunes now and use iDump (which is a helluva lot less trouble than iTunes) to extract them.
    Thanks again for all the help.
    HP Pavilion, Dell Optiplex Windows XP

  • Field description changes not showing on one client only

    Hello!
    I have a network with several clients all running SAP.  I have modified lots of field descriptions (by pressing CTRL double click on the field).
    This is great - except I have one PC where the field descriptions show the original text, rather than my updated descriptions.  This happens even when other SAP users login to this PC.
    Can you explain why one PC is not showing the modified field descriptions?
    Thank you
    Omam-B

    What do you mean?  I have restarted the PC and reinstalled SAP.
    What else is there to restart?
    Thanks

Maybe you are looking for

  • Crystal Report 2008 SP3 and BO XI 3.1 conflict

    Hi every body, We have a BOE system: BO XI 3.1 Oracle db 10g All running successful and can create some types of WebI report. But we also want reports with Crystal Report. 1> So we install Crystal Report 2008 SP3 (without knowing the conflict error b

  • Calendar events issue Outlook for Mac: Failure to update or send notification for meetigns

    We are seeing an issues with Outlook for Mac 2011 and calendar events. These events are in the past and Outlook will randomly post errors about the event stating that it has failed to make changes, please contact the original creator. Additionally, s

  • Old Computer Died

    My old computer died. No files were able to be recovered at all; it wouldn't turn on, and now it's been replaced by(and returned to) Dell. I hadn't done anything to use my iPod to "store" music, it was just synched with iTunes on that computer. Now I

  • Dynamic programming user interface question...

    Hi forum: I´m creating radiobuttons dinamically, i saw the next reference, and it´s good but that´s examples suppose that i have a simple type charged with some data enumerated, and also my data are dinamyc beacuse i get it from a XML file. http://he

  • HT201320 I AM UNABLE TO CONFIGURE MY MAIL ACCOUNT IN THE SETUP

    I AM UNABLE TO CONFIGURE MY MAIL ACCOUNT IN THE SETUP