Need to resolve this tricky query

Dear friends,
I just come accross a problem which I need to be resolved on high priority. Well I have following table structures for a doctor database.
Table1 : Doctor Master     
Doctor ID...............Doctor Name
1...............................Ali
2...............................Saleem
3...............................Arshad
Table2 : mst_flex_field     
Master_Key_ID.........Master Key Value
1..............................Qualifications
2..............................Specility
3..............................Magazine
4..............................Affiliation
Table3: mst_flex_field_Value     
Flex Field Id...............Master_Key_ID............Flex Field Value
1......................................1..............................BDS     
2......................................1..............................DTCD     
3......................................1..............................FRCOG     
4......................................1..............................MCPS     
5......................................1..............................MD     
6......................................1..............................MBBS     
7......................................1..............................DABM     
8......................................1..............................FRCP     
9......................................1..............................MRC OG     
10....................................2..............................ANST.
11....................................2..............................FOREMED     
12....................................2..............................NEPHROLOGISTS     
13....................................2..............................RHEUMATOLOGIST     
14....................................2..............................CARDIOLOGIST     
15....................................2..............................G.P     
16....................................3..............................PROF MAG     
17....................................3..............................ARTHOPY     
Table4: Doctor Detail Table          
Detail Table Id.......Doctor id.........Flex Field Id
1..............................1.....................6
2..............................1.....................2
3..............................1.....................3
4..............................1.....................16
5..............................1.....................17
6..............................1.....................15
7..............................2.....................10
8..............................     2.....................6
9..............................     2.....................8
10............................3.....................1
11............................3.....................10
12............................3.....................11
13............................3.....................17
Output Required for this structure.
Out Put
Doctor ID....Doc Name........Qualifications.............Specility..........Magazine
1..............Ali.......................MBBS.......................G.P................PROF MAG
1..............Ali.......................DTCD..............................................ARTHOPY
1..............Ali.......................FRCOG
2..............Saleem................MBBS.......................ANST.
2..............Saleem................FRCP
3..............Arshad.................BDS.......................ANST.................ARTHOPY
3..............Arshad..............................................FOREMED
One thing more I would like to make view of that query.
Best Regards,
Shah

Dear guys,
I finally got the solution of my problem.
Below is the solution.
select doctor_id,
coalesce( rn1, rn2, rn5 , rn6 , rn7 ) rn,
max(Qualification) "Qualification",
max(Speciality) "Speciality",
max(Personal_Hobbies) "Personal_Hobbies",
max(Professional_Interest) "Professional_Interest",
max(Designation) "Designation"
from (
select t.doctor_id,
decode (t.mst_key_id , 1 , t.rn , null) rn1,
decode (t.mst_key_id , 1 , t.flex_field_value_id) Qualification,
decode (t.mst_key_id , 2 , t.rn , null) rn2,
decode (t.mst_key_id , 2 , t.flex_field_value_id) Speciality,
decode (t.mst_key_id , 5 , t.rn , null) rn5,
decode (t.mst_key_id , 5 , t.flex_field_value_id) Personal_Hobbies,
decode (t.mst_key_id , 6 , t.rn , null) rn6,
decode (t.mst_key_id , 6 , t.flex_field_value_id) Professional_Interest,
decode (t.mst_key_id , 7 , t.rn , null) rn7,
decode (t.mst_key_id , 7 , t.flex_field_value_id) Designation
from (
select d.doctor_id , v.mst_key_id , v.flex_field_value_id,
row_number() over ( partition by d.doctor_id, v.mst_key_id
order by v.mst_key_id ) rn
from mst_doctor_other_info d,
mst_flex_field_values v
where d.flex_field_value_id = v.flex_field_value_id
-- and d.doctor_id in ( 1 , 2 , 3)
) t
group by doctor_id,
coalesce( rn1, rn2, rn5 , rn6 , rn7 )
order by 1, 2
Thanks everybody for the generous help.
Best Regards,
Shah

Similar Messages

  • Adobe Creative Cloud is needed to resolve this problem. However, it is missing or damaged

    Creative Cloud will not run without throwing up a window "Adobe Creative Cloud is needed to resolve this problem. However, it is missing or damaged. Please download and install a new copy of the Creative Cloud". I download the app and run the installer, and it simply throws up the same window over again... "Adobe Creative Cloud is needed to resolve this problem. However, it is missing or damaged. Please download and install a new copy of the Creative Cloud". I'm stuck in a loop! Can someone help me urgently please? I'm on system 10.9.5

    Hi tiff_meek,
    You can try the steps:
    For Mac
    Go to Applications-->Utilities-->Adobe Installers.
    Uninstall Adobe Creative Cloud.
    ** If it says application is running in the background then open Activity Monitor and close the process of Creative cloud.
    Once the creative cloud is uninstalled then follow the below mentioned steps:
    Please go to Library
        1. Click on Finder then Click on Go and Go to folder
        2. Type /Library and click on Go
        3. Go to Application Support and Adobe and then delete OOBE folder.
        4. Redo Step 1
        5. Type ~/Library and click on Go
        6. Go to Application Support and Adobe and then delete OOBE folder.
        7. Go to https://creative.adobe.com/products/creative-cloud?promoid=KLYVF
    Download Adobe Creative cloud, Install it.
    If the above steps do not work. Try enabling root user account and then try to open Adobe Creative cloud.
    Enable root user: Enabling and using the "root" user in Mac OS X
    Thanks,
    Nikhil Gupta

  • When I tried to open PS CC2014, it flashed a bit then quit, same with DW and INDD ... I also got this error message: Adobe creative cloud is needed to resolve this problem. However, it is missing or damaged. Please download and install a new copy of the C

    This morning when I tried to open my CC2014 Photoshop, it started to open, then quit suddenly. Same with Dreamweaver and InDesign. I am a professional and do not have the time to screw around with this. When I tried to run CC app, I get an error that says "Adobe creative cloud is needed to resolve this problem. However, it is missing or damaged. Please download and install a new copy of the Creative Cloud from 'http://www.adobe.com/go/adobecreativecloudapp'." I did so and tried to run the app and got the same error. I tried the cleaner and it removed all of my apps, then I tried to install again, and got the same error. I am getting desperate now, I have clients waiting for their projects. I need help, please.

    Allisonf55952352 have you utilized the steps listed in Error: "Failed to install" | Creative Cloud Desktop to resolve the current error?  If not do you have any questions regarding the steps listed with the document?

  • I am having trouble sending text messages. They aren't always going through. And sometimes I'm not receiving text messages.  I also have voicemails that I didn't receive until late at night that were left early in the day. I need to resolve this issue ASA

    I am having trouble sending text messages. They aren't always going through. And sometimes I'm not receiving text messages.  I also have voicemails that I didn't receive until late at night that were left early in the day. I need to resolve this issue ASAP!

    julie@remax,
    I know that this would concern me just the same and we want to make sure that your device is connected and receiving these notifications when available. How long have you been having this issue? Are you receiving a specific error message when sending a message? Are you aware if this happens in one location specifically or everywhere you go? Does the issue with messaging occur with all numbers? Share some details, so that we may assist.
    AdamG_VZW
    Follow us on Twitter @VZWSupport

  • I need to resolve this quicktime problem

    This problem was very irritating. So what happened was that I tried to go on itunes one day and a pop up came out saying," Some of your quicktime is out of date. You can fix this problem by updating the latest version." I clicked ok and then this was the result, "Quicktime is not properly installed please reinstall Quicktime". I then reinstalled quicktime again and again and again, etc. but it always says those two exact messages when I do. And when I tried to enter quicktime. Again same thing. Again and again. I want to know why, and how to resolve this. Please help. Something happened to my ipod and I need to restore it as soon as possible but I can't access iunest because of quicktime.

    I think we'd better see if some other application (other than QuickTime itself) has dropped old QuickTime componentry in the system files on the PC. (If there's a version mismatch between the old componentry and the "QuickTime proper" componentry, that can create those symptoms.)
    So we'll go looking for the older QuickTime componentry in the most common locations for it to be stashed.
    First we'll need to change some view options on the PC.
    1. Open My Computer from the desktop or Start menu.
    2. In the Tools menu, click Folder Options.
    3. Click the View tab.
    4. In the "Advanced settings" pane under "Hidden files and folders" make sure that the "Show hidden files and folders" option is selected, and the "Hide extensions for known file types" option is unchecked.
    5. Click OK.
    Now in My Computer, open your C drive.
    Open the "Windows" folder.
    Open the "system32" folder.
    What files and/or folders can you see in there with QuickTime in the file/folder name? (In a standard installation of QuickTime, you should see precisely two files ... QuickTime.qts and QuickTimeVR.qtx ... and no QuickTime folders whatsoever.)

  • Need help solving this tricky connect paths problem!

    I need to convert a bunch of separate paths  in particular way so they create one single continuos path as shown in the attached PNG file.
    It has me stumped. Does anyone know of a way to do this via scripting?

    How often do you need to do this? I think that a script which would work properly may be more work than is worth the time.
    I'm sure something like this could be done, but the real problem would be what would the next group of lines that you run the script on look like? Would a script that works for this circumstance work properly for another shape?
    Here's some parameters to think about:
    How do you determine which line segments (or endpoints) in the document need to be connected? All points in the document, or will you be working with a selection?
    Once you determine the points (eliminating all that are already connected), how do you want them connected, and which point do you start with? Connect to the closest available point would seem what you want, but depending on how you determine which point to start with could give you different results.
    You might want to loop through all eligible points, and save the distance to every other point into an array. Then, loop through connecting the 2 closest available points until you've connected every point.

  • Please need help on this SQL query ..

    hi peers,
    here is my situation :
    Field1 Field2 Field3
    xa group1 req_id1
    xb group2 req_id2
    xc group3 req_id3
    xa group4 req_id4
    xb group5 req_id5
    i need to pull only the group3 record that comes right away after group2. Req_id's are in chronological order and groupx are texts
    : i.e : req_id1 < req_id2 < req_id3 <.....
    in other terms, i need the record that comes after the re cord flagged by group2..knowing that req_id3 is right after req_id2.
    any thoughts ?
    thanks

    Hi,
    Use the analytic LAG function to get a value from an earlier row:
    WITH     got_prev_field2     AS
         SELECT     field1, field2, field3
         ,     LAG (field2) OVER (ORDER BY  field3)     AS prev_field2
         FROM     my_situation
    SELECT     field1, field2, field3
    FROM     got_prev_field2
    WHERE     prev_field2     = 'group2'
    ;Like all analytic functions, LAG is computed after the WHERE clause is applied. To use the value returned by LAG in a WHERE clause, we have to compute it in a sub-query.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.

  • Need help in this sql query to use Case Statement

    hi All,
    I have the below query -
    SELECT DISTINCT OFFC.PROV_ID
    ,OFFC.WK_DAY
    ,CASE
    WHEN OFFC.WK_DAY ='MONDAY' THEN 1
    WHEN OFFC.WK_DAY ='TUESDAY' THEN 2
    WHEN OFFC.WK_DAY ='WEDNESDAY' THEN 3
    WHEN OFFC.WK_DAY ='THURSDAY' THEN 4
    WHEN OFFC.WK_DAY ='FRIDAY' THEN 5
    WHEN OFFC.WK_DAY ='SATURDAY' THEN 6
    WHEN OFFC.WK_DAY ='SUNDAY' THEN 7
    END AS DOW
    ,OFFC.OFFC_OPENG_TIME
    ,OFFC.OFFC_CLSNG_TIME
    FROM GGDD.PROV_OFFC_HR OFFC
    WHERE OFFC.PROV_ID='0000600'
    WITH UR;
    this query is bringing results in 6 differnt rows with opening and closing time for each day separately. I want to generate the data in one row with each day having opening and closing time, so for 7 days, total 14 columns with opening and closing time. But i am not able to do that using case statement.
    can somebody help me in achieving that.
    thanks,
    iamhere

    Hi,
    Welcome to the forum!
    That's called a Pivot .
    Instead of having 1CASE expression, have 14, one for the opening and one for the closing time each day, and do GROUP BY to combine them onto one row.
    SELECT       OFFC.PROV_ID
    ,       MIN (CASE WHEN OFFC.WK_DAY ='MONDAY'    THEN OFFC.OFFC_OPENG_TIME END)     AS mon_opn
    ,       MIN (CASE WHEN OFFC.WK_DAY ='MONDAY'    THEN OFFC.OFFC_CLSNG_TIME END)     AS mon_cls
    ,       MIN (CASE WHEN OFFC.WK_DAY ='TUESDAY'   THEN OFFC.OFFC_OPENG_TIME END)     AS tue_opn
    ,       MIN (CASE WHEN OFFC.WK_DAY ='TUESDAY'   THEN OFFC.OFFC_CLSNG_TIME END)     AS tue_cls
    FROM        GGDD.PROV_OFFC_HR OFFC
    WHERE       OFFC.PROV_ID     = '0000600'
    GROUP BY  offc.prov_id
    ;This assumes there is (at most) only one row in the table for each distinct prov_id and weekday. If not, what do you want to do? Post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
    The staement above works in Oracle 8.1 and up, but there's a better way (SELECT ... PIVOT) available in Oracle 11. What version are you using? (It's always a good idea to include this when you post a question.)
    Edited by: Frank Kulash on Jan 6, 2011 8:22 PM

  • Need help with this sql query

    the following query returns me the correct no of rows:
    select col1 from tab1 where
    col1 like '%'||chr(32)||'%';
    but i need to use my query in the following form and it doesn't return any row:
    select col1 from tab1 where
    col1 IN ('%'||chr(32)||'%');
    what am I doing worng?
    thanks in advance.

    Or in 10g (just recycling another example):
    WITH t AS (SELECT 'OPTI1457' || CHR(32) col1
                 FROM dual
                UNION
               SELECT 'OPT123' || CHR(9)
                 FROM dual
                UNION
               SELECT 'OPTIM12345'
                 FROM dual
    SELECT t.*
      FROM t
    WHERE REGEXP_LIKE(t.col1, CHR(32) || '|' || CHR(9))
    ;       C.

  • Suggest the query to this tricky query please

    Hi people,
    I just got a query which is a brain tease for me (not all).
    that is
    sql> select * from mytab;
    sql> no name
    1 asuri
    1 prasanth
    2 brian
    2 lara
    the above is query is returned by the sql;
    here 1 and 2 are duplicated values;
    now output required is
    sql>no name
    1 asuri prasanth
    2 brain lara
    Is this possible with a single sql query;
    please tell me solution
    regards
    prasanth

    How do find that it should be brian lara not lara brian..
    But any way the following will do ...SQL> select * from mytab;
    A NAME
    1 asuri
    1 prasanth
    2 brian
    2 lara
    SQL> select a,name||' '||name2 name from
    2 (
    3 select a,name,lead(name) over (partition by a order by a) name2 from mytab)
    4 where name2 is not null;
    A NAME
    1 asuri prasanth
    2 brian lara
    The names by above query can be returned as 'lara brian' and 'prasanth asuri' as there is no way telling which one is a surname..

  • I need help whit this tricky problem:)

    Hi guys!
    I'm working with a webshop where i receive a tons of pictures from another company. Unfortunately they send me other pictures what i don't need. So i made a list from the files (like a list.txt) what i don't need and i want to write a script to move these files to another folder. How should i do this?
    Thx for your help!

    Prefi wrote:
    So i made a list from the files (like a list.txt) what i don't need and i want to write a script to move these files to another folder.
    So far I believe you have a bunch of photos (in a folder?) and you want to take specifically titled photos and move them to another folder?
    Alright so you have a folder that as an example contains:
    hello.jpeg
    welcome.jpeg
    goodbye.jpeg
    yes.jpeg
    no.jpeg
    Now you want to move welcome.jpeg and goodbye.jpeg to a new folder?
    Is this along the lines of what you want to do?

  • Need to tune this oracle query

    Hi gurus,
    this query is taking 1 min to execute and i have to reduce its execution time...Any suggesstions to improve is appreciated
    SELECT SUM(TotalCount) As NoOfRecordsToTranslate
    From
      SELECT Count(*) as TotalCount
      FROM Function_ Fn
      INNER JOIN Function_Translation Ft
      ON Ft.Functionid = Fn.Id
      AND Ft.Active    =1
      AND Fn.Active    =1
      INNER JOIN Text_Translation TT
      ON TT.Textid      = Ft.Textid
      AND TT.Active     =1
      AND (TT.Short    <> 'Null'
      OR TT.Medium     <> 'Null'
      OR TT.Extended   <> 'Null')
      INNER JOIN Function_Type Fnty
      ON Fn.Functiontype=Fnty.Functiontype
      AND Fnty.Active   =1
      INNER JOIN Operation_Step_Function Osf
      ON (Osf.Functionid=Fn.Id)
      AND Osf.Active    =1
      INNER JOIN Operation_Step Os
      ON Os.Id     =Osf.Operationstepid
      AND Os.Active=1
      INNER JOIN Operation Op
      ON Op.Id                     = Os.Operationid
        AND op.defaultoperationrevision = 1
      AND Op.Active                =1
      And Op.Revisionstatusid Not In (2) -- 2 means Operation Staus =Cancelled
      WHERE TT.Languageid =:Langid-- {IMES_ENV} {SQL} {FilterSQL}
      UNION
      SELECT Count(*) as TotalCount
      FROM Function_Output Fo
      INNER JOIN Function_Output_Routing Forout
      ON Forout.Functionoutputid = Fo.Id
      INNER JOIN Text_Translation TT
      ON TT.Textid      = Forout.PromptTextid
      AND (TT.Short    <> 'Null'
      OR TT.Medium     <> 'Null'
      OR TT.Extended   <> 'Null')
      INNER JOIN Function_Output_Routing_Type Fort
      ON Fort.Id=Forout.Outputroutingtypeid
      INNER JOIN Text_Translation Ttdt
      ON Ttdt.Textid           = Fort.Textid
      AND Ttdt.Languageid      =:Langid
      AND Upper(Ttdt.Extended) = Upper('User')
      INNER JOIN Function_ Fn
      ON Fn.Id = Fo.Functionid
      INNER JOIN Function_Type Fnty
      ON Fn.Functiontype=Fnty.Functiontype
      INNER JOIN Operation_Step_Function Osf
      ON (Osf.Functionid=Fn.Id)
      INNER JOIN Operation_Step Os
      ON Os.Id=Osf.Operationstepid
      INNER JOIN Operation Op
      ON Op.Id                     = Os.Operationid
        AND op.defaultoperationrevision = 1
      And Op.Revisionstatusid Not In (2) -- 2 means Operation Staus =Cancelled
      WHERE   TT.Languageid =:Langid --{IMES_ENV} {SQL} {FilterSQL}
      UNION
      SELECT Count(*) as TotalCount
      FROM Function_Input Fi
      INNER JOIN Text_Translation TT
      ON ( TT.Textid    = Fi.Prompttextid
      AND TT.Active     =1)
      AND (TT.Short    <> 'Null'
      OR TT.Medium     <> 'Null'
      OR TT.Extended   <> 'Null')
      INNER JOIN Function_Input_Source_Type Fist
      ON Fist.Id     = Fi.Inputsourcetypeid
      AND Fist.Active=1
      INNER JOIN Text_Translation Ttdt
      ON Ttdt.Textid           = Fist.Textid
      AND Ttdt.Active          =1
      AND Ttdt.Languageid      = :Langid
      AND Upper(Ttdt.Extended) = Upper('User')
      INNER JOIN Function_ Fn
      ON Fn.Id     = Fi.Functionid
      AND Fn.Active=1
      INNER JOIN Function_Type Fnty
      ON Fn.Functiontype=Fnty.Functiontype
      AND Fnty.Active   =1
      INNER JOIN Operation_Step_Function Osf
      ON Osf.Functionid=Fn.Id
      AND Osf.Active   =1
      INNER JOIN Operation_Step Os
      ON Os.Id     =Osf.Operationstepid
      AND Os.Active=1
      INNER JOIN Operation Op
      ON Op.Id                     = Os.Operationid
        AND op.defaultoperationrevision = 1
      AND Op.Active                =1
      And Op.Revisionstatusid Not In (2) -- 2 means Operation Staus =Cancelled
      WHERE TT.Languageid = :Langid --{IMES_ENV} {SQL} {FilterSQL}
      UNION
      SELECT Count(*) as TotalCount
       FROM Function_Input_value Fiv
      INNER JOIN function_input fi
      ON fi.id=fiv.functioninputid
      INNER JOIN Text_Translation TT
      ON ( TT.Textid    = Fiv.textid
      AND TT.Active     =1)
      AND (TT.Short    <> 'Null'
      OR TT.Medium     <> 'Null'
      OR TT.Extended   <> 'Null')
      INNER JOIN Function_Input_Source_Type Fist
      ON Fist.Id     = Fi.Inputsourcetypeid
      AND Fist.Active=1
      INNER JOIN Text_Translation Ttdt
      ON Ttdt.Textid           = Fist.Textid
      AND Ttdt.Active          =1
      AND Ttdt.Languageid      = :Langid
      AND Upper(Ttdt.Extended) = Upper('User')
      INNER JOIN Function_ Fn
      ON Fn.Id     = Fi.Functionid
      AND Fn.Active=1
      INNER JOIN Function_Type Fnty
      ON Fn.Functiontype=Fnty.Functiontype
      AND Fnty.Active   =1
      INNER JOIN Operation_Step_Function Osf
      ON Osf.Functionid=Fn.Id
      AND Osf.Active   =1
      INNER JOIN Operation_Step Os
      ON Os.Id     =Osf.Operationstepid
      AND Os.Active=1
      INNER JOIN Operation Op
      ON Op.Id                     = Os.Operationid
        AND op.defaultoperationrevision = 1
      AND Op.Active                =1
      And Op.Revisionstatusid Not In (2) -- 2 means Operation Staus =Cancelled
      WHERE TT.Languageid = :Langid --{IMES_ENV} {SQL} {FilterSQL}
       UNION
    SELECT Count(*) as TotalCount
        from cob_t_ngmes_master_data ctnmt
        inner join text_translation tt
        on tt.textid = ctnmt.textid
        where
        tt.languageid =:Langid-- {SQL} {IMES_ENV_1} {FilterSQL}
    UNION
    SELECT Count(*) as TotalCount
      FROM Reason_Code RC
        INNER JOIN Reason_Type RT
        on RT.ReasonType = RC.ReasonType
        INNER JOIN text_translation TT1 ON TT1.textid= RT.textid AND RT.ACTIVE =1 AND TT1.ACTIVE=1
      AND (TT1.Short    <> 'Null'
      OR TT1.Medium     <> 'Null'
      OR TT1.Extended   <> 'Null')
      INNER JOIN text_translation TT ON TT.textid= RC.textid AND RC.ACTIVE =1 AND TT.ACTIVE=1
      AND (TT.Short    <> 'Null'
      OR TT.Medium     <> 'Null'
      OR TT.Extended   <> 'Null')
        WHERE TT1.Languageid = :Langid
    AND TT.Languageid = :Langid
    -- {SQL} {IMES_ENV_2} {FilterSQL}
    UNION
    SELECT Count(*) as TotalCount
    FROM NSPT_T_Event_Type ET
        INNER JOIN  text_translation TT1
        ON TT1.TextID = ET.TextID
    INNER JOIN Text_Translation TT
    ON TT.TextID = TT1.TextID
        WHERE TT1.ACTIVE=1
      AND (TT1.Short    <> 'Null'
      OR TT1.Medium     <> 'Null'
      OR TT1.Extended   <> 'Null')
        AND TT1.Languageid = :Langid   --{SQL} {IMES_ENV_2} {FilterSQL}
      )Edited by: 964145 on Oct 16, 2012 6:50 AM

    Please read the forum FAQ
    {thread:id=2174552}
    {message:id=9360002}
    {message:id=9360003}

  • Adobe application manager is needed to resolve this problem. However it is missing or damaged. please download and install a new copy of the application manager from

    Hello guys... i get this message up. please help!!!

    Hi Willie,
    Please download and install the Adobe application manager from the link below:
    MAC: http://www.adobe.com/support/downloads/detail.jsp?ftpID=4774
    WIN: Adobe - Adobe Application Manager : For Windows : Adobe Application Manager
    Regards,
    Sheena

  • Hellp needed to resolve this Error

    Hi all
    Inside my pakage i have some procedures and funtions, will executing its
    saying the error as : PLS-00707: unsupported construct or internal error [2603]
    i have higlighted the line in the below code, Can some help me to correct this error.
    thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I think you may want to get rid of
      CLOSE r_flat_fees_cur; [pre]
    You are trying to close a cursor record, which makes no sense.                                                                                                                                                                                                                                                                               

  • AIR-LAP1242AG-K9 could not join a 2106 WLC: i ma getting ready for a deployment, how can i resolve this?

    Hi,
    I setup a mini wireless LAN network lab with a not for resale 2106 wireless lan controller and a sales  air-lap1242ag access point. I do not have a DHCP and DNS in my lab environment. I have configured the WLC with the basic configuration using the CLI wizard, i also configured the WLC as a DHCP server for clients that will be connecting to the APs associated to the controller.
    I powered up the AP and connect the ethernet port directly to the controller, the controller issued an IP address to the AP, the AP downloaded a new operating system from the controller but failed to join the controller.
    I check both debug message on the controller console and the trap messages on the controller's GUI  and it say the AP could not download a configuration from the controller and it is beacuse of invalid license. Below is the trap message:
    Configuration Phase Statistics
    Requests Received
    Responses Sent
    Unsuccessful Request Processed
    Reason For Last Unsuccessful Attempt
    Last Successful Attempt Time
    Last Unsuccessful Attempt Time
    Last Error Summary
    Last AP Message Decryption Failure
    Last AP Connection Failure
    Last Error Occurred
    Last Error Occurred Reason
    Last Join Error Timestamp
    Also, I tried to log into the GUI of the AP using the both the username and password  ''Cisco'' but I cannot get into the device. I can only get in through the CLI. In the CLI, almost all the commands I enter gives an error the it is disabled. I don't know what to do any more, I want to know if the access point is faulty or i am not doing the right thing.
    PLEASE HELP!!!!!!!!!!!!!!!!!!!

    Thank you for the quick response.
    The controller is running firmware version:
    Software Version                 6.0.199.4
    Emergency Image Version 6.0.199.4
    The AP can ping the Management IP address of the controller successfully via console. I have also entered in the AP the WLC's Management IP address information and it is still the same. Below is the message I'm getting on the console of the AP it self:
    *Jul  9 13:06:09.803: %CAPWAP-3-ERRORLOG: Go join a capwap controller
    *Jul  9 13:06:10.000: %CAPWAP-5-DTLSREQSEND: DTLS connection request sent peer_ip:
    192.168.50.246 peer_port: 5246
    *Jul  9 13:06:10.001: %CAPWAP-5-CHANGED: CAPWAP changed state to
    *Jul  9 13:06:11.636: %CAPWAP-5-DTLSREQSUCC: DTLS connection created sucessfully
    peer_ip: 192.168.50.246 peer_port: 5246
    *Jul  9 13:06:11.638: %CAPWAP-5-SENDJOIN: sending Join Request to 192.168.50.246
    *Jul  9 13:06:11.638: %CAPWAP-5-CHANGED: CAPWAP changed state to JOIN
    *Jul  9 13:06:11.724: %CAPWAP-5-CHANGED: CAPWAP changed state to CFG
    *Jul  9 13:06:11.726: %DTLS-5-ALERT: Received WARNING : Close notify alert from
    192.168.50.246
    *Jul  9 13:06:11.727: %DTLS-5-PEER_DISCONNECT: Peer 192.168.50.246 has closed conne
    ction.
    *Jul  9 13:06:11.727: %DTLS-5-SEND_ALERT: Send WARNING : Close notify Alert to 1
    92.168.50.246:5246
    *Jul  9 13:06:11.772: %CAPWAP-5-CHANGED: CAPWAP changed state to DISCOVERY
    *Jul  9 13:06:11.772: %CAPWAP-5-CHANGED: CAPWAP changed state to DISCOVERY
    I will also like to know if AIR-LAP1242AG is compatible with WLC 2106 controller.
    Any help will be greatly appreciated, i really need to resolve this issue in my LAB now so that I don't go to my customer site to fumble.
    thanks in advance.

Maybe you are looking for