|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Any question relating to Oracle
If any one has any questions relating to Oracle plese let me know so I can be of assistance.
|
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 ![]() |
|
#4
|
|||
|
|||
|
thanks...
thanks... I will try it out...
|
|
#5
|
|||
|
|||
|
Quote:
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. |
|
#6
|
|||
|
|||
|
Quote:
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 |
|
#7
|
|||
|
|||
|
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... |
|
#8
|
|||
|
|||
|
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 ![]() |
|
#9
|
|||
|
|||
|
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 |
|
#10
|
|||
|
|||
|
Awesome ... I'm glad you found the solution. Good luck
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Any question relating to Oracle |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|