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 May 7th, 2003, 05:40 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 select into problem !!!

Hi, 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), I hope if anyone knows what I am doing wrong or if there is another way of doing this same kind of idea (saving in a local variable the value of one row of a table)...

dani2003_oracle...

Reply With Quote
  #2  
Old May 7th, 2003, 10:12 PM
markerdave markerdave is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Illinois, USA
Posts: 71 markerdave User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Hi! That is the way that I typically save a value to a local variable. Just to be certain, is there a record with code_client=200 and code-client is a number and not a character? Also, what is your return statement like?
__________________
Oh I wish, I wish I hadn't killed that fish...

Reply With Quote
  #3  
Old May 8th, 2003, 07:55 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
this is what I have...

Actually, I have this code above inside an oracle function, so I ask in return of the function the nick value, and that's when it returns me the null value. Code_client is a number that identifies that client in my company, and I'm sorry but I don't understand what you mean by record, but anyway, this select should only give one value, because there is just one code for each client. Hope you can help me again...

dani2003_oracle

Reply With Quote
  #4  
Old May 8th, 2003, 09:39 AM
markerdave markerdave is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Illinois, USA
Posts: 71 markerdave User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Hi! Sorry if I was clear with the last post. The code that you have posted seems fine to me. My first thoughts were that you would get a null value if there wasn't a record in your "user" table that had a client_code of 200 or that there was no return statement in the code. Is there more code that you could post?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > select into problem !!!


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 1 hosted by Hostway
Stay green...Green IT