General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 3rd, 2003, 11:11 PM
benos benos is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 233 benos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Any question relating to Oracle

If any one has any questions relating to Oracle plese let me know so I can be of assistance.

Reply With Quote
  #2  
Old May 1st, 2003, 02:43 PM
dani2003_oracle dani2003_oracle is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 dani2003_oracle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation small help, BIG favor !!!

hi, i hope you can help me out. I have just started to use Oracle, so I am kind of new user of oracle, but i am not a new user of database programs. I have this procedure and in oracle it returns as INVALID, this is the code.

DECLARE
ab integer;
ac integer;
BEGIN
ab := 1;
ac := 3;
for i in ab..ac loop
if i=3 then
insert into zona(code_zona, number_zona) values (4,4);
end if;
end loop;
END;

this is a simple code, but I don't know why it returns invalid, the error display doesn't show anything... please, helpe me out if you can...

dani2003_oracle

Reply With Quote
  #3  
Old May 1st, 2003, 07:48 PM
benos benos is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 233 benos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
It all depends on the error code returned. Could you please tell me the error code.

The function can be rewirtten as follows:

DECLARE
ab INTEGER;
ac INTEGER;
BEGIN
ab := 1;
ac := 3;
FOR (i > ab && i < ac) LOOP
IF (i = 3) THEN
INSERT INTO zona(code_zona, number_zona) VALUES (4, 4);
END IF;
END LOOP;
END;
/

This is simply removing the ab..ac array from the if statement. Apart from this, it looks correct. Once you tell me the error code I can be of more use to you.

Ofcourse, "for i in ab..ac loop " should work, so I'd check the error message

Reply With Quote
  #4  
Old May 2nd, 2003, 07:09 AM
dani2003_oracle dani2003_oracle is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 dani2003_oracle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks...

thanks... I will try it out...

Reply With Quote
  #5  
Old May 2nd, 2003, 06:54 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 6
Quote:
Any question relating to Oracle

I have a question - What is Oracle? j/k
__________________
~ Joe Penn

We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set?

Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you.




Reply With Quote
  #6  
Old May 4th, 2003, 12:53 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Quote:
Originally posted by jpenn

I have a question - What is Oracle? j/k


Hahaha... Only you Joe... Only you!
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #7  
Old May 7th, 2003, 05:48 PM
dani2003_oracle dani2003_oracle is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 dani2003_oracle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
me again...

Hi benos... it's me again, but now I have another question, oh, by the way, I have work out that code that I ask you before, thanks for the help...
this is my problem, in the PL/SQL program type I have this..

nick char(15);
begin
select name_client into nick from user where code_client = 200;
end;

of course, name_client is a char type also, but when I ask for variable NICK in return, gives me always nothing (a null value), when it should give me the name_client value. Well, that's it, if you know what I am doing wrong or if there is another way of getting that variable, the thing is that I have this code inside an oracle function, so like I told you before, the function gives me nothing in return, no error, just nothing... ...

dani2003_oracle...

Reply With Quote
  #8  
Old May 8th, 2003, 09:52 PM
benos benos is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 233 benos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Hey dani .... Since there is no error message I believe that the datatypes are consistant. The problems could be as follows:

- There is no 200 in code_client attribute, this will result in the display on "no rows selected".

- If there was rows selected then prehaps the value inside name_client is null for 200 in code_client.

The code you have written is correct and therefore it should not return a error message.

It could also be that the function is not returning a value. To change this we would type the following:

FUNCTION returnOfNick (
twoHundredSay NUMBER
) RETURN CHAR(15) IS nick CHAR(15);

BEGIN
SELECT name_client INTO nick
FROM user
WHERE code_client = 200;

IF nick IS NULL THEN
nick := 'No Result';

RETURN nick;

END returnOfNick;

Let me know how this goes. Note, the variable is being passed into the function.

I hope this hopes

Reply With Quote
  #9  
Old May 9th, 2003, 07:26 AM
dani2003_oracle dani2003_oracle is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 dani2003_oracle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking I got it !!!

I have got it... the thing is that I have to use the exception code, because when it didn't find the name of the client, it return no value, so that's when the exception comes in... thanks for your help..

dani2003_oracle

Reply With Quote
  #10  
Old May 15th, 2003, 08:31 PM
benos benos is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 233 benos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Awesome ... I'm glad you found the solution. Good luck

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Any question relating to Oracle


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway