small question I get the error message...
Hi refugees,I am trying to run... but I get this error... where am I wrong in this
to display records in the INDEX BY ename...
{
DECLARE
TYPE emp_typ IS TABLE OF emp.sal%Type INDEX OF emp.ename%TYPE;
emp_arr emp_typ;
CURSOR c_emp IS SELECT ename, sal FROM emp;
r_emp c_emp % ROWTYPE;
v_idx VARCHAR2 (20);
num_total_rows NUMBER;
BEGIN
FOR r_emp IN c_emp
LOOP
emp_arr (r_emp.ename): = r_emp.sal;
num_total_rows: = c_emp % ROWCOUNT;
END LOOP;
DBMS_OUTPUT. Put_line (num_total_rows);
I'm IN emp_arr... FIRST emp_arr LAST.
LOOP
v_idx: = emp_arr first.
DBMS_OUTPUT. Put_line (v_idx |) ',' || To_char (emp_arr (v_idx)));
v_idx: = emp_arr. NEXT (v_idx);
END LOOP;
END;
/
DECLARE
*
ERROR on line 1:
ORA-06502: PL/SQL: digital or value error: character of number conversion error
ORA-06512: at line 18 level
}
Thank you
Published by: SeenuGuddu on September 20, 2009 02:22
Hello
SeenuGuddu wrote:
Thank you Frank Kulash, michaels2
I'm fighting for a long time...
the question is... the code is below... is that ok or any changes I have to do
That is really good!
I have two very minor ideas:
(1) you have probably issued a command like
SET SERVEROUTPUT ON SIZE 50000
otherwise, you don't see any output of dbms_output.
You must include this command in the same script. It makes no sense to run the DECLARE block without it, and it when it is not strictly necessary does not take much time. (This is not a case where the effectiveness is a high priority.)
(2)
Define a PL/SQL table that has only a single column that stores the number with the index as type varchar2.
Store the emp.sal in the PL/SQL table with ename like index.
Define a cursor of emp table.
To loop through the cursor and display the name of the cursor variable and the salary of the collection for each employee.
This looks like a duty. As I read, a LOOP (the cursor loop FOR) was all that was required. You were in the class, I was not: so I could be wrong. In any case, it doesn't hurt to show that you know how to loop through the collection, but also how to loop through the cursor, but you should know that it is possible to read and write in the same loop:
DECLARE
TYPE emp_typ IS TABLE OF emp.sal%Type INDEX BY emp.ename%TYPE;
emp_arr emp_typ;
CURSOR c_emp IS SELECT ename,sal FROM emp;
r_emp c_emp%ROWTYPE;
v_idx VARCHAR2(20);
num_total_rows NUMBER;
BEGIN
FOR r_emp IN c_emp
LOOP
emp_arr(r_emp.ename) := r_emp.sal;
num_total_rows := c_emp%ROWCOUNT ;
-- DBMS_OUTPUT.PUT_LINE( r_emp.ename || ',' || TO_CHAR (emp_arr(r_emp.ename)) ); -- Could display here, and skip the other loop
END LOOP;
DBMS_OUTPUT.PUT_LINE( num_total_rows );
v_idx := emp_arr.FIRST;
WHILE v_idx IS NOT NULL
LOOP
DBMS_OUTPUT.PUT_LINE( v_idx || ',' || TO_CHAR(emp_arr(v_idx)) );
v_idx := emp_arr.NEXT( v_idx );
END LOOP;
END;
/
Nice formatting!
Tags: Database
Similar Questions
-
I recently did some "housekeeping" on my computer and for reasons known only to nini-gods, I delected all my security certificates. Now, when I try to log in to gmail, ebay, my bank accounts or any https:// site, I get a warning message "this connection is Untrusted." I click on the links provided to overcome the safety message, but whenever I return to the site I have to jump through all the hoops again. I see a small box that can be clicked to confirm security exception, but the little box that must be clicked to "make the permanent exception" is always grayed out. I know I'm on the right sites - have been using the links on the personal bar for years without problems. It started right after I deleted the certificates.
I've tried everything. Firefox RELOADED (use 3.6.4) deleted and reloaded the bookmarks, follow the instructions when I get the error message. Nothing works. As soon as I close the browser, and then go back online, I'm back to error messages.
Can anyone help?
COR - el: thanks a lot for this solution. Everything works fine now.
However, I had a problem with deleting the files. I dragged to the trash, and then tried to access the sites in question and received the same message. I restarted the computer and when I checked the files I was dragged to the trash were right where they were before. The only file that are been trashed was the .txt file.
So I renamed them as you suggested and now everything works fine.
Thank you again once - I tried to understand by using the troubleshooting Firefox site, but your explanation was simple and easy to follow.
Val
-
Xbox, I get the error message that my credit card is on as many accounts
Original title: Xbox live gold case
I get the error message that my credit card is on as many accounts as he may be, but I have no other account that uses it on my xbox, my subscription to xbox live was canceled for an unknown reason as well! I need help.
Hello
Your Question is beyond the scope of this community...
I suggest that repost you in the Xbox Forums.
"Xbox a Preview program FAQ.
http://support.Xbox.com/en-us/Xbox-one/system/Xbox-update-preview-FAQ
'Home'
"Xbox forums.
http://forums.Xbox.com/xbox_forums/general_discussion/f/3817.aspx
_________________________________________________
"Xbox Forums directory.
http://www.Xbox.com/en-us/forums
General
Material & Discussion Services
Xbox support
Agent hours: M - F 09:00-17:00 PTLaw enforcement forums
Technical support of Xbox Live rewards
Xbox Live rewards Squad hours: M - F 09:00-17: 00 PSTSee you soon.
-
"socket error".
When I try to log the p2p soulseek site, I get the error message "connection failed: socket error.» change the connection settings. How can I fix it? Is - this type of error called a winsock error? It keeps happening to me on this site. What I've read, it happens when you make changes to a program before concluding that under its weight. Could it happen because I'm deleting files, I don't think that will be completed while the other files are D/Ling? That's what I'm doing wrong? I found a solution to correct an error in Winsock that is to enter the "command prompt" and type "netsh winsock. Will this work? (I'm sorry I have so many questions in this post, but I have had TO KNOW!!)Hello
I suggest you send the question here for best support about the issue.
-
On a windows machine XP after putting in place the machine administrator and when trying to connect as a user, I get the error message "security log is full, only an administrator can log in to solve the problem." I know how to solve this problem by going to the event viewer, by selecting the security log and by setting the journal to "ignore the events as needed", but I would like to create a script that will do this automatically for me.
so far my research revealed that the value of the registry key [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security] "MaxSize" controls this setting and changing the value default DWORD_VALUE to 0 x 01000000 to 0 x 00000000, change is possible. Well, when I did it in regedit, nothing has changed in the security log properties, the default setting of 'remove older items after 7 days' remained the same.
Can someone tell me what registry key, I need to change in order to make this change? Keep in mind im trying to include this in a script.
Thank you
Hi teddorosheff,
Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please ask your question in the following forum.
-
I can't itunes!
I am trying to download itunes 10.2 and get the error message HRESULT:Ox8007054F. ITunes will not download. How can I fix it? I have vista 32 bit. I saw a similar question which has not offered any help. PLEASE SOMEONE HELP ME!
Hello
Follow the information from apple to the link below
Remove and reinstall iTunes, QuickTime, and other software components for Windows Vista or Windows 7
http://support.Apple.com/kb/HT1923
and or ask for their support of itunes
http://www.Apple.com/support/iTunes/
Also try the discussions of apple itunes
-
Hello
I have a fujitsu lifebook p series windows 7 and every now and then especially when I am looking online I get the error message saying: my graphics card is not responding and the laptop stops or gets himself. I challenged tech stores to be looked at, but they were not able to fix it. Does anyone have any suggestions? Thank youOriginal title: help again...I have moved your question to area drivers & hardware.
If your PC uses the Intel chipset, see this: http://communities.intel.com/message/172740#172740
Updated drivers can be made of:
https://Downloadcenter.Intel.com/default.aspx
Best bet may be to contact the vendor of PC.
-steve
-
When I press the button Add card on my phone app here is I get the error message
Hi thanks, my cards have been on my iPhone 6plus for quite awhile. I recently bought an iwatch series 1. Watch and phone software is up to date. My app to watch on my phone recognizes my cards when I press the map button Add on my phone app here is I get the error message.
Hello
To be able to add cards to pay Apple on your watch, it will first the configuration of the area selected (like on your iPhone):
- On your iPhone, in the application of the watch, go to: Watch My > general > language and region - check Format correct region is selected.
- If they are already correct, it can help to select again the two the same Format of the region and also the language of the system itself.
Then follow the instructions here to add cards to the Watch:
More information:
-
Updated macbook pro today for the latest version of el capitan and now will not start. Instead, I get the error message "your computer restarted due to a problem". Someone at - it suggestions on how to solve this problem?
It would be helpful to post what the screen says.
-Try to reset memory NVRAM/PRAM and SMC
MacIntel: Reset of the controller (SMC) system management
https://support.Apple.com/en-us/HT201295
Subject of memory NVRAM and PRAM
https://support.Apple.com/en-us/HT204063
-Try to start safe mode
OS x: what is Safe Boot, Safe Mode?
https://support.Apple.com/en-us/HT201262
-Start to recovery and repair the startup disk
OS X: on OS X Recovery - Apple Support
https://support.Apple.com/en-us/HT201314
-If it is repairable reinstall the OSX
How to reinstall OS X on your Mac - Apple Support
https://support.Apple.com/en-us/HT204904
-If you do not have a backup using disk utility to restore the internal drive to an external drive, so that you can try to recover the data.
-
Everytime I try sending mail through Gmail FF 18.1, I constantly get the error message "you action failed. Please try again ". I have to use the HTML view in Gmail that I really hate. I tried the Mode without failure of Firefox as well but not good. Please fix this for me.
This can be caused by corrupted cookies or cookies that are not sent or otherwise blocked.
Clear the cache and cookies from sites that cause problems.
"Clear the Cache":
- Tools > Options > advanced > network > content caching Web: 'clear now '.
'Delete Cookies' sites causing problems:
- Tools > Options > privacy > Cookies: "show the Cookies".
If clearing cookies doesn't work, then it is possible that the cookies.sqlite file that stores the cookies is corrupted.
Rename (or delete) cookies.sqlite (cookies.sqlite.old) and delete other files to present as cookie cookies.sqlite - journal in the profile folder of Firefox in the case where the cookies.sqlite file has been corrupted.
-
When I run Mozilla Firefox I get the error message "ReferenceError: Globalstorage is not defined." How to solve this problem?
-VinayakGlobalStorage is no longer supported in the current Firefox (removed in Firefox 13), versions so the extension or Web site that uses it needs an update and use localStorage instead.
- bug 687579 - Remove support globalStorage
-
rented a movie and it only downloads courses and now I get the error message
I am trying to download a movie that I rented from iTunes on my iPad and I get the error message to try again later. My money has already been deducted from my account. I want my movie
-
My iCloud and shared calendars has stopped working in MS Outlook today. They worked yesterday. Now, I get the error message "cannot open this series of records. The information store cannot be opened? I tried the fix standard support.
Same thing here. Looks like Windows did an automatic update during the night, and now nothing iCloud associated work (calendars, contacts, etc.)
I also noticed that the error message: "could not load file or Assembly ' MOM." Implementation ' or one of its dependencies. The system cannot find the specified file. "It started after restarting the Windows Update as well. I imagine that the two are related in the same problem to iCloud.
-
Get the Error Message When you try to download and install Vista Service Pack 1
Hello
Update Windows guard neglect when you try to download and install Vista Service Pack 1 and I get the error message 80092004. Please notify.
Thank you
AndyHello
Welcome to the windows vista forums.
1. stop the Windows Update service (make sure that you are logged on as administrator)
Click the Start button | Control Panel | System and Maintenance | Administration tools
Double-click Services.
(Provide the administrator password or a confirmation if prompted to do so.)
Right-click the Windows Update service and click on stop.2. Click Start, type %windir%\System32 in the search box and press ENTER.
Find and rename the folder C:\Windows\SoftwareDistribution.
3. start the Windows Update service
Start button | Control Panel | System and Maintenance | Administration tools
Double-click Services.
(Provide the administrator password or a confirmation if prompted to do so.)
Right-click the Windows Update service and click Start.This procedure will erase your history on the Windows Update Site. Not important.
Don't forget to restart and then try the update again. If there is no corruption in that
folder, it would be gone now.Please, try now to windows update and check if you get the error.
You can also download the stand-alone SP1 package. You can download the windows vista SP1 by clicking on the link below, please follow the instructions in method 3 in the KB article:
http://support.Microsoft.com/kb/935791#Method3
I hope this information is useful.
Please let us know if you need further assistance.
Concerning
Rehman - Microsoft Support -
Help! I get the error message 0 x 80190194 when I try to enable Windows Update in Windows XP Professional
Current solution: download IE8 for XP, run who, follow the Setup Wizard, wait for his failure. Download manually upgrade restart, recommended.
Restart the installation of IE8, wait that he remove previous IE. Reset.
Installation of IE8 restart to restart. Let it run. May need to restart.
Try to run windows update again. IF it works, woot, otherwise download the SP3 of XP service pack from Microsoft. As the Windows update fails, you must not download an installer, but an ISO standard. Burn the ISO to a CD and install (way to go...) or download a free tool like 7Zip and unpack iso and install a go from there.
From there on, the installation of SP3 and hope this works...
Maybe you are looking for
-
SSL certificate not used for Admin Server connections
I have a GoDaddy SSL certificate installed on OS X Server 10.11.4. It works very well for the web server (https). Connection via Server.app off-site, produces a warning SSL and self-signed certificate. There is a related error regularly in newspapers
-
S50-B-15N satellite screen problem
The laptop above is not completely in three months. Yesterday when I tried to turn on the laptop the button turns on but the screen remains black. I removed the power wire, closed the laptop and up computing to study under the search for the battery.
-
What is SM Controller buses?
Whats Controller SM bus? I have not install this driver on my laptop!
-
original title: cannot share internet I shared my internet via ad-hoc, using my wifi in my laptop running vista 64-bit. It just stoped working and now I get a message saying "an error occurred while internet connection sharing was being enabled. th
-
ERRO ntdll.dll alguem pode me help
Data/Hora Carimbo Aplicativo: 4b68bba4 Nome Falhas Modulo: ntdll.dll Versão Falhas Modulo: 6.1.7601.17514 Data/Hora Carimbo Falhas Modulo: 4ce7ba58 Excecao code: c0000005 Ma Excecao: 0002e046 Versão sistema operational: 6.1.7601.2.1.0.256.1 Identific