How to get the results fro the Query ??

Hello Everyone,
I'm trying to this query for long time, I cant I already posted the question here twice...Hopefully this time I can explain this time....
I have these tables : COURSE_LIST, JOB_LIST, JOB2COURSES, Employee, COURSE_HISTORY, COURSE_STATUS, TEMP_COURSE_REGISTARTION...
Some Example Data :
COURSE_LIST
CourseID, Name
AB1, Some1
AB2, Some2
AB3, Some3
AB45, Some5
Job_List
JOB_ID, Name
1, Some Job
2, Some Job2
3, Some Job3
JOB2Courses
JOBID, CourseID
1, AB1
1,AB2
2,AB1
2,AB3
3, AB1
3, AB45
Employee
Employee_EMAIL, JOB_ID
dsc,1
awe,1
some,2
sunset,2
spect,3
Course_Status
Status, DESC
1, Completed
2, Approved
3, Declined
4, Register
5, Pending Approval
TEMP_COURSE_REGISTRATION
EMPLOYEE_EMAIL, Course_ID, Date, Status
This is the process, User Logs in to the system and only see courses related to their job...
Example say spect log in , the user should see as a new user
CourseID, Status
AB1,5
AB45,5
Now spect registers course AB1, the entry will be made to TEMP_COURSE_REGISTRATION
This is how table will look like
EMPLOYEE_EMAIL, Course_ID, Date, Status
spect, AB1, 20-MAY-06, 5
Now when someone approves it, the status will be 2
and the user spect logs in will see
CourseID, Status
AB1,2
AB45,5
Now the course gets completed user sees :
CourseID, Status
AB1,1
AB45,5
and entry gets deleted from TEMP_COURSE_REGISTRATION and moved to COURSE_HISTORY
By default user can only register courses related with their job, but their manager can let them take courses from other job...so when that happens the entry goes to TEMP_COURSE_REGISTARTION.....
say somebody registered SPECT for course AB2
NOw when he/she logs in should see something like this
CourseID, Status
AB1,1
AB45,5
AB2, 2
How can I accomplish this complicated query....
Harsimrat

select all the columns required from the tables and finally add the condition
a.employee=user
Wat u can do is create a view like this and grant it to public

Similar Messages

  • How to get the query result of improvement (Before and After ) using sql de

    how to get the query result of improvement (Before and After ) using sql developer.

    Check
    http://www.oracle.com/technetwork/articles/sql/exploring-sql-developer-1637307.html

  • How to get the Query output to Excel

    Hi ,
    Can you tell me how to get the Query output to excel with out using any third party tool?
    Can you tell me how to write the code in Webservice and call it..
    Please explain it Elaboartly..
    Thanks in Advance!!!
    Mini

    whats your source system?
    you can use Live office, or query as a webservice if you are getting data from universe
    if you're getting data from SAP BI query and you have a java stack on your netweaver then you can get the data directly using sap bi connector in xcelsius.
    good luck

  • How to get the query values from the url in a servlet and pass them to jsp

    ok..this is the situation...
    all applications are routed through a login page...
    so if we have a url like www.abc.com/appA/login?param1=A&param2=B , the query string must be passed onto a servlet(which is invoked before the login page is displayed)..the servlet must process the query string and then should pass all those values(as hidden values) to the login jsp..then user enters username and pswd, then there should be another servlet which takes all the hidden values of jsp and also username and pswd, authenticates the user and sends the control back to that particular application along with the hidden values...
    so i need help on how to parse the query string from the original url in the servlet, pass it out to jsp, and then pass it back to the servlet and back to the original application...damnn...any help would be greatly appreciated...thanks

    ok..this is the situation...Sounds like you have a bad design on your hands.
    You're going to send passwords in a GET request as clear text? Nice security there.
    Why not start with basic security and work your way up?
    %

  • How to get the query name from  portal report name

    Hi Experts ,
    I am given a portal report Name and asked to do changes to the queries of that ,so how do i get the query name ,
    Thanks in Advance
    Nitya

    Hi Nithya,
    You can get the technical name by selecting the role in the portal where the report is enclosed you will generally find the report in description then identify the report you are looking then double click on that you will get a window pop-up in that you will have details tab there click on the details the your Query technical name will be displayed.
    EX : zqry_w001 Then replace W with Q and seach in analyser or Designer.
    Regards
    Amar.

  • How to get the query execution time

    Hi,
    I am new to oracle and I am trying to get the execution time of a query.I tried the command set timing on and executed the query.But,the time it gives me is including the display of results.In my case,I ran a query against 50 million records and it is taking around 5 hours to display all the results.I like to know,how much time it take just to execute the query?Please help.
    Thanks
    Ravi.

    Maybe this way ?
    TEST@db102 SQL> set timing on
    TEST@db102 SQL> set autotrace traceonly
    TEST@db102 SQL> select * from foo;
    332944 rows selected.
    Elapsed: 00:00:29.04
    Execution Plan
    Plan hash value: 1245013993
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |   274K|    46M|  1071   (5)| 00:00:13 |
    |   1 |  TABLE ACCESS FULL| FOO  |   274K|    46M|  1071   (5)| 00:00:13 |
    Note
       - dynamic sampling used for this statement
    Statistics
            288  recursive calls
              0  db block gets
          26570  consistent gets
           4975  physical reads
              0  redo size
       35834383  bytes sent via SQL*Net to client
         244537  bytes received via SQL*Net from client
          22198  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
         332944  rows processed
    TEST@db102 SQL>                                                                               

  • How to get the query design element meaning with the technical name ?

    In BI 7.0 query designer, we got error msg in Transport Connection like:
    Object 41PPHH3DICYQ56L2XJGXDRSMT is already being
    edited by user_id
    Choose 'Display object' or 'Cancel'.
    How to check what design element is for 41PPHH3DICYQ56L2XJGXDRSMT?  And what could cause the above error?
    We will give you reward points!

    You can collect the query and its elements in the transport connection. The under the technical name you will find this and the element.
    Hope this helps.
    Kumar

  • How to get the Query Layout (Rows & Column fields)

    Hi,
    Any idea where in the backend repository the SAP BW query attributes are stored.
    I have created a Query using Query analyzer and i would like to where exactly this query info is stored. is there any BAPI that would give this info if i provide the query name?
    Thanks,
    Ram

    Hi Ram,
       You can see the query details from Metadata repository. againest perticular infoproviders and quiries.
    Hope it Helps
    Srini

  • How to get the query output depending on the current date

    i created a region of type "query",inside it created region using wizard of type "table" . in the query i filter the data depending on the current date (taken from dual table) . but still it showing no output on the page. i run the same query in the toad and its showing the 2-3 rows.
    If anybody know where the problem is then do inform me.
    thanks in advance.

    i got the answer by trying out in OAF

  • How to get the query result !

    Experts !
    i am working on a query. in this query i have a sales for a sales person for a month, and in the 2nd coulmn sales for the previous month. there is a 3rd column which gives (% change ). now i have to show only those records where (% change ) is more / less 34%. how do i get those ? Exceptions ??
    If by using exceptions, then the 3rd column ( % change) is a formula column ( Not the key figure) . can i use exceptions on Formula column ?
    Please help

    HI ,
    You can try this by creating a condition ,
    Create a new condition, in keyfigure you can choose the formula for %, choose  the operator as Greater than , in values give 34
    Regards,
    Sathya

  • How to get the query name in runtime?

    Hi,
    I have a variable which is used in several queries.
    How can I figure out which query is using the variable?
    can anyone help?
    thanks and regards

    HI,
    thanks for your qickly reply.
    Perhaps I should decribe my situation more clearly.
    I m trying to retrict the F4 seach help values depending on the calling query.
    Example: Qurey A and B both have the variable V
    if A is running, the search help should give the values 1,2,3  back
    if B is running, the search help should give the values 4,5,6  back.
    There is a BADI (RSR_VARIABLE_F4_RESTRICT_BADI) that should restrict the search help values, but the button can not call the BADI.
    So I m trying to use the META DATA READ CLASS to restrict the values on the info object level when the varial is used by a query.
    The function modul RRM_SV_VAR_WHERE_USED_LIST_GET can give me the list of qurey name which has the variable, but can not tell me which one is calling the variable at run time.
    My question is actually how  I can figure out which query IS USING  the variable in RUNTIME.
    Thanks and Regards

  • How to get the querystring in jsp

    hi guys
    plz help me,
    how to get the query string in jsp page, is there any methods for getting querstring like getString() getParameter() ?

    C:\Documents and Settings\Administrator\ven\build\generated\src\org\apache\jsp\getcustomer_jsp.java:62: getQueryString() in javax.servlet.http.HttpServletRequest cannot be applied to (java.lang.String)
    i am getting error like this , if i used that method, shall i import any packages?

  • How to get the sql query result?

    Hi,
    Currently I am using LV2012 to connect a Oracle database server. After the installations/settings for Oracle Express and Oracle ODBC driver done.
    I am sucessfully to use the SQL command to query the data through my window command prompt. 
    Now the problem is, how I do the same task in Labview by using the database connectivity toolkits?
    I have build a VI for query as attached, but i have no idea what pallete to use to get the query result.
    Please help me ~~
    Solved!
    Go to Solution.
    Attachments:
    Query.vi ‏9 KB

    Here is a piece of code I use to test SQL commands, you can use the part that retrieves sql results.
    It is also possible to get the column headers back, but that is for next lesson!
    Attachments:
    RunSQLCommand.vi ‏30 KB

  • Af:query - How to get the result rowsets

    Hi,
    I have a requirement where i need to search the db rows on and append the results the adf rich table on each search.
    For this i am using af:query component. And trying to get the result rows for the named criteria.
    String mexpr = "#{bindings.DestinDescVOCriteriaQuery.processQuery}";
    processMethodExpression(mexpr, queryEvent, QueryEvent.class);
    ViewCriteriaManager vcm = getDestinDescViewObj().getViewCriteriaManager();
    ViewCriteria vc = vcm.getViewCriteria("DestinDescVOCriteria");
    getDestinDescViewObj().applyViewCriteria(vc);
    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    adfFacesContext.addPartialTarget(tblDestinDesc);
    However on each click of search the rows searched in the previous attempt are not retained.
    Can anyone let me know how to get the result from named criteria and append it the table?
    Thanks
    Ajay

    Can anyone help?

  • How to get the number of columns in a result set???

    hi everyone..
    i am trying to establish a servlet applet communication....
    my applet send the sql query to the servlet as serialised string and then the servlet executes the query...
    Since i need to pass the result back to the applet, i thaught of passing the whole reult set to the applet..but that seems to be not possible..
    so i thaught of storing my result set data in a vector and then pass the vector,but the first problem that i came across is that how to get the number of colums in a result set....
    so is there a way to get the number of columns in a result set...???
    and also i would like to know if it possible to send my whole result set to the applet bye serialization or by any method...???
    thanx in advance

    You shouldn't do. It expenses resources (you should always close the ResultSet and the Statement as fast as possible). Simply gently process it into a Collection or Map of DTO's. Those are serializable.

  • How to get the execution time of a query

    Hi,
    Environment: 10.2.0.4.0
    Just wondering how I can get the query execution time? I am not interested in the query output nor do I want the statistics, just the execution time?
    Any suggestions will be appreciated
    Thanks in advance
    rogers42

    If you're using SQL*Plus
    SQL> set autotrace traceonly
    SQL> set timing on
    SQL> <<your query here>>SQL*Plus will fetch all the data and then report the query plan, execution statistics, and elapsed time. It will not display the actual data.
    SET TIMING ON alone tells SQL*Plus to display the execution time of each SQL statement-- the problem is that it also displays all the data which can skew the results because you're including the time required by SQL*Plus to pipe a bunch of data to the screen.
    Justin

Maybe you are looking for

  • Pricing condition- Header

    Hi, I have a problem with a pricing condition. It is a the moment both a header and item condition but my customer want it to be only a header condition. I can not get this to work as it is a condition that is an automatic freight condition with diff

  • SAP Script Single Page

    Dear all,   There are two pages defined in standard SAPScript invoice form FIRST and NEXT.  Now i want to maintain only one page in the SAPScript. What is the correct procedure to achieve this?? Does this change require update in the print program??

  • Sharing pics among Users on same computer

    I want to share the pictures on our MacBook between my wife and me. Each of us has a User account on this machine. I have stored the pictures in the Shared Folder, and would like to reference the pictures from each of our User accounts using iPhoto.

  • C210 and C211 - transactions

    Hello All, Anybody know what these two transactions are used for? When I run them, I get '0' records run, in  test or in real mode. Any document/ definition with utility will help. Points will be rewarded. Thanks, Abhi P.

  • Make it easier to use Blue Snowball mic with Logic

    This post is intended for Apple to see. Perhaps this problem is fixed in Logic Pro/Express 7.2. The Blue Snowball was designed for GarageBand and works great with it, right out of the box. But trying to use it with Logic is like pulling teeth or debu