|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
oracle, stored proceedures, PL/sql query question
Hey everybody, i've got a bit of a problem, i'm trying to write an sql statement in pl/sql stored proceedure that gets a variable passed to it from an asp page(that part works). and i'm having trouble figureing out the best way(well really a working way) to write the sql that i need.
i have 2 tables... empl has data like employee_num, Skill_No skills has... skill_no, short_desc, long_desc and what i want to do is select all the rows from skills where the skill_no isnt found in the employee table with the employee_num from the asp page. so if we have data like this empl table 1 | 1 1 | 2 2 | 2 2 | 3 3 | 1 3 | 4 skills table 1 | skill one 2 | skill 2 3 | skill 3 4 | skill 4 and the asp page passes '3' it would give me the info from the skills table for skill 2 and 3. i'm thinking this SHOULD be simple, but it's been a long day and my brain isnt working properly anymore thanks Patricia |
|
#2
|
|||
|
|||
|
i figured it out, i knew it was simple. in case someone else has the same sillly brain lapse.... heres what you gotta do...
strsql := 'select sk.skill_no, sk.short_desc sk.long_desc from skills sk where sk.skill_no not in (select em.skill_no from empl em where em.empl_no = ' || empl_no_in) ; where empl_no_is is the employee number from the asp page. its so simple, i don't know why i didnt think of it. thanks for look ppl ![]() Patricia |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > oracle, stored proceedures, PL/sql query question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|