Query in SQL Developer

How do you cross query from one table to the other? To make it simple I have a ROLE_ID which only list IM_NUMBER (Login ID) and not last name. I want to see the names for all ROLE_ID's of 3 (101 items) with having to look up all 101 by login ID.
Any help would be appreciated. I am a beginner so please bear with me.
TIA

What's your two tables looks like?
For example you have two table
tableA
IM_NUMBER
ROLE_ID
tableB
IM_NUMBER
LASTNAME
you can join the two tables to get your result,
select LAST_NAME from tableA, tableB
where tableA.IM_NUMBER=tableB.IM_NUMBER and tableA.ROLE_ID=3

Similar Messages

  • Procedure output like a query in SQL developer?

    Hi!
    How can a PL procedure create output like a query in SQL developer?
    This block
    begin
    for record in (
    select * from my_db
    loop
    dbms_output.put_line(record.name ' ' || record.address)
    end loop;
    end;
    would print a of names and adresses in my_db. However, output sent to a query result window which would be the result of
    select name,address from my_db;
    How could I make the PL block behave the same way as the SQL query, i.e. present its output in a query result window?

    Welcome to the forum!
    Please provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION) wheneve you ask a question.
    Do you mean query a procedure as if it were a table?
    You can do that with a pipelined function. Here is sample code you can test using the SCOTT schema
    -- type to match emp record
    create or replace type emp_scalar_type as object
      (EMPNO NUMBER(4) ,
       ENAME VARCHAR2(10),
       JOB VARCHAR2(9),
       MGR NUMBER(4),
       HIREDATE DATE,
       SAL NUMBER(7, 2),
       COMM NUMBER(7, 2),
       DEPTNO NUMBER(2)
    -- table of emp records
    create or replace type emp_table_type as table of emp_scalar_type
    -- pipelined function
    create or replace function get_emp( p_deptno in number )
      return emp_table_type
      PIPELINED
      as
       TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
        emp_cv EmpCurTyp;
        l_rec  emp%rowtype;
      begin
        open emp_cv for select * from emp where deptno = p_deptno;
        loop
          fetch emp_cv into l_rec;
          exit when (emp_cv%notfound);
          pipe row( emp_scalar_type( l_rec.empno, LOWER(l_rec.ename),
              l_rec.job, l_rec.mgr, l_rec.hiredate, l_rec.sal, l_rec.comm, l_rec.deptno ) );
        end loop;
        return;
      end;
      /Then you can query the function as if it were a table
    select * from table(get_emp(20))Is that what you were looking for?

  • Error while executing query in SQL Developer

    I am getting the following error whenever I login to sql developer.
    SEVERE 56 0 oracle.jdbc Error while registering Oracle JDBC Diagnosability MBean.
    I get below error whenever I execute any query.
    SEVERE 70 53918 oracle.dbtools.worksheet.sqlhistory.SqlHistoryTask oracle.dbtools.worksheet.sqlhistory.db.HistoryDB.readHistory(HistoryDB.java:99)
    I use following versions
    Java(TM) Platform 1.6.0_35
    Oracle IDE 3.2.20.09.87
    Versioning Support 3.2.20.09.87
    I am working on Oracle11gR2.
    Please help me to resolve this and let me know if you need more information.

    Got same issue with :
    Component
    Version
    =========
    =======
    Java(TM) Platform
    1.6.0_41
    Oracle IDE
    3.2.20.09.87
    Versioning Support
    3.2.20.09.87
    Alternate path for SqlHistory directory :
    C:\Users\USER_NAME\AppData\Roaming\SQL Developer
    Best Regards,
    F.L.

  • Query on SQL Developer Connections Tree Does Not Display Objects

    Hi Gurus, Could you please clarify on the below. As per the note ID 1458753.1, SQL Developer Connections Tree Does Not Display Objects to user in order to access database objects outside the owned schema/account. ------------------------- By default, and without granting wide privileges such as DBA, a user will only see his or her own objects in the first level object nodes under their connection.  Objects in other schemas must be accessed via the Other Users node under the connection. This is the intended functionality/display in SQL Developer. ------------------------- Is there any other way we can achieve this? Requirement is very common - user A owns all objects and user B granted read/read-write privileges on user A objects. Now user B wants to Display user A objects in the corresponding objects node of SQL developer. Could any one shed some light here? Thanks Venu

    First off, there is a dedicated SQL Developer forum where lots of the developers hang out. Those folks are way more knowledgable that we are about the tool.
    That said, I have no problem displaying dates. Do you just have a problem with this particular query/ field/ table? Or does it affect all dates? What version of SQL Developer are you using? 1.1 is out now.
    Justin

  • SQL Query works in SQL Developer, but not always in MII

    Hi all,
    I encountered a strange behaviour with a query in MII 12.0.2. Maybe someone has a guess what happens.
    I have created a SQL query which runs against Oracle 10g tables. I have tested the query using SQL Developer, and it throws a couple of lines, depending on the contents of the where clause.
    Next I have copied the query to a MII SQL Query (FixedQuery). However, the output is empty most of the time, without showing any errors. After some testing I got the impression that older data are not displayed, but there is no time or date setting in MII.
    As the SQL Developer always returns rows, I am unsure where to search for the error.
    Regards
    Michael

    Michael,
    I would imagine that you have sub-select statements in your FixedQuery, all which will fall subject to the RowCount property of the query template (SQL defaults to 100), which is issued through the driver and typically honored by the database when returning the data from your request.
    Most of the native database query tools allow you to make unbound query requests with no limit on rows, which would probably account for the difference between SQL Developer and the query template.
    For SQLServer it's ROWCOUNT:  http://msdn.microsoft.com/en-us/library/ms188774.aspx
    For Oracle it's ROWNUM:  http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    So the answer would be not to make the query template row count some rediculous number, but more appropriately refine the way that the database request is issued.
    Regards,
    Jeremy

  • Query returns record in SQL Developer but not in iSQLPlus

    ... back in a minute, I may not have done a commit at the end of the insert.
    The problem I was having was I hadnt commited the record in SQL Developer but the queries where returning records in this environment but not in iSQLPlus or Apex and it was confusing me.
    Message was edited by:
    Benton
    Message was edited by:
    Benton

    Finally got to know the reason why Timezone Abbr woudn't show up in SQL Plus.
    I ran below query in SQL PLUS
    SELECT SESSIONTIMEZONE, CURRENT_TIMESTAMP, systimestamp, LOCALTIMESTAMP FROM DUAL;
    SESSIONTIMEZONE CURRENT_TIMESTAMP SYSTIMESTAMP LOCALTIMESTAMP
    -05:00 08-SEP-12 12.00.31.575228 AM -05:00 08-SEP-12 12.00.31.575223 AM -05:00 08-SEP-12 12.00.31.575228 AM
    Now executed the same query in SQL Developer:
    SESSIONTIMEZONE CURRENT_TIMESTAMP SYSTIMESTAMP LOCALTIMESTAMP
    America/Chicago     08-SEP-12 12.08.32.072424000 AM AMERICA/CHICAGO     08-SEP-12 12.08.32.072420000 AM -05:00     08-SEP-12 12.08.32.072424000 AM
    The difference between the 2 outputs is the way in which time_zones were respresented. In SQL PLUS, it is shown as an offset whereas in SQL Developer as a time zone region name. Now there are many "time sone regions" that follow an offset of -5:00. This confuses Oracle and a "UNK"(Unknown) for a query like the one below when trying to execute in SQL PLUS:
    select extract(timezone_abbr from from_tz(cast(sysdate as timestamp),SESSIONTIMEZONE)) from dual;
    EXTRACT(TI
    UNK
    Therefore we need to specify the exact Time Zone Region(TZR) in order to obtain the corresponding TZD(Daylight Savings Format i.e. CDT or CST). This we do by altering the session environment vaiable time_zone
    alter session set time_zone='America/Chicago';
    Now executing the queries to find the abbreviated time zone( in TZD format) will finally work to return a non-null char value.
    select extract(timezone_abbr from from_tz(cast(sysdate as timestamp),SESSIONTIMEZONE)) from dual;
    EXTRACT(TI
    CDT
    select to_char(CURRENT_TIMESTAMP, 'TZD') from dual;
    TO_CHA
    CDT

  • Simple SQL query SQL developer takes it, The wizzard of XE does not

    Hello everybody
    I wrote this simple query which SQL developer runs fine, but when I try to launch a Report based on this sql query it tells me invalid sql statement. That is true, it may be invalid because this IF clause in there..but SQL developer seems to be very tolerant or understands more...
    the reason I wrote that is because obviously if there are no bosses, ie = 0 then i would get an error when dividing it by 0, so I put that 0 just to select the good ones
    if count (bosses) >0
    select company, postcode,
    sum( bosses/staff)
    from evaluation
    group by company, postcode
    Thank you very much
    Alvaro

    oh yes (blushed in shame as how dumb i looked like) i knew about the denominator 0 and infinite as as result i just didnt notice my zero was on the numerator :(
    however, i run the query and i got this message in sql developer
    Error starting at line 1 in command:
    select company, postcode,
    case when staff != 0 then sum( bosses/staff) end
    from evaluation
    group by company, postcode
    Error at Command Line:2 Column:10
    Error report:
    SQL Error: ORA-00979: not a GROUP BY expression
    00979. 00000 - "not a GROUP BY expression"
    *Cause:   
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Different results on timestamps in SQL developer

    Hi
    I have this table with a TIMESTAMP column in it.
    CREATE TABLE my_table ("TID" TIMESTAMP (6) NOT NULL ENABLE);
    I use this query in SQL developer:
    SELECT tid from my_table;
    There is one row in the table, that has a timestamp in the hour of the change to european summertime.
    The timestamp of this row is displayed differentliy in SQL developer:
    - when the query is run by 'run stamement' (Ctrl+enter) the result is
    11-03-27 03:17:00,000000000
    - when the query is run as a script (F5) the result is
    11-03-27 02:17:00,000000000
    Notice the difference in the hours of the timestamp.
    Why this difference? (It only occurs for timestamps within the hour of 2 am to 3 am on that date - the hour that should'nt exist as the clock advances from 2 am to 3 am that night...)
    What is actually stored in the database? (the 3.17 am or 2.17 am value)
    Is there a conversion taking place when running as a script in SQL developer, but not when just running the single stamement?
    Regards Søren

    Hi Søren,
    This is rather an "edge" condition error, but I have posted an internal bug for it:
    Bug 13088622 - FORUM: RUN SCRIPT/STATEMENT TIMESTAMP VALUE DIFFERS DURING DT/ST CHANGEOVER
    Please provide some version information about your environment: SQL Developer, Java JDK, OS, etc.
    Regards,
    Gary
    SQL Developer Team

  • Publish to APEX in SQL Developer

    Hello:
    I wrote a query in SQL Developer and I want to utilize the Publish to APEX feature.
    In SQL Developer, I right-click and select Publish to APEX.
    I select the workspace, enter an application, select a theme, and enter a page.
    I receive a message stating that it was successful.
    I then go to APEX and login in as myself into my workspace which is the same workspace I designated in SQL Developer for this publish.
    At the login, I enter my username and password.
    I go to Application Builder, select the new application that was published, click Run.
    I'm prompted for a login, so I enter my username and password and I receive Invalid Login Credentials.
    Does anyone know what is causing this issue? I am the developer. I am an administrator. I'm using the same logins I always do when working with APEX. I'm not sure why I'm receiving this message.
    Can someone help me?
    Thanks.

    I don't think Apex is set up to accept this, but as the previous post says once you have the username/password of the underlying Oracle schema you should be able to do this. My particular case was jDeveloper and offline database objects, but the principle is the same. If you have admin access to the database go in as sys and change the password of the underlying Oracle user.

  • SPOOLing in sql developer does not take into consideration SET ECHO OFF

    I'm running SQL Developer 3.1.07.42 on Windows 7 64 bit with java 1.7
    I have the following very simple script just to show the problem:
    SET ECHO OFF;
    SET FEEDBACK OFF;
    SET SERVEROUTPUT ON;
    SET VERIFY OFF;
    SET PAGES 0;
    SET HEAD OFF;
    SPOOL c:\test.sql
    SELECT 1, 2, 3 FROM DUAL;
    SPOOL OFF;
    /if I run it in TOAD 10.6.0.42 it creates the file with
             1          2          3This is as expected (by me)
    if I run the exact same query in SQL Developer 3.1.07.42 , it creates the file with:
    < SELECT 1, 2, 3 FROM DUAL
    1 2 3(the < above is actually ">" but the CODE formatting software is screwing ">")
    but I don't want the ECHOed command to be spooled. For the life of me, I cannot find a way to disable the ECHO from spooling in sql developer.
    Tried the same in 3.0.4 and 2.1.1 with the same (bad) result (plus some warning on some of the unsupported SET commands).
    Am I missing something obvious? Cause like this, the spool command cannot be used in sql developer to generate a CSV file for example, because of the echoed command. And windows doesn't come with SED by default so that is out. (plus that my original script is integrated into a much larger and complex set of scripts and the main script using them is executed from SQL Developer as a company policy (so that everybody uses the same tool and the code runs the same for everybody))
    Any ideas/suggestions are welcome
    Thanks.

    Hi Gary, you seem to have some extensive knowledge. I'd like to follow-up on this thread and try to understand why SQL Developer won't hide the code even though I'm already running the code as a Worksheet (I assume you mean Run Script F5 button in SQL Developer).
    I generally develop in SQL Developer that does a lot of dbms_output to echo data using a Spool command. When I'm in SQL Developer I can't get the code NOT to spool, it typically is echoed directly in the spool file at the top followed by the dbms_output data. If I save the sql file and run in in sqlplus it only outputs the data (good). If I use @C:\xyz_script.sql and hit F5 in SQL Developer it only outputs the data (per your previous answer) -- good.
    So why can't I hit F5 in SQL Developer in the script file and have it only output the data? It just doesn't work no matter how many "SETs" you turn-off.
    Looks like Echo, Term, Feed are supported in SQL Developer, maybe supported means something other than work.
    http://www.oracle.com/technetwork/developer-tools/sql-developer/sql-worksheet-commands-097146.html

  • SQL Developer 1.5.5 version sysasm role not available

    Hi,
    I am trying to use SQL developer 1.5.5 to access 11gR2 ASM instance type. Currently, I don't see the option for the connection role type for sysasm. I think, we may need this to access ASM catalog. Also, we may need the SID type to be ASM to access ASM instance type.
    When I go in as SYSDBA role and try to access any of the tables, synonyms etc, I get the error ORA--01219 saying that the database not open. However, I can access V$asm_disk by running the SQL query through SQL developer.
    Please let me know your thoughts on this.
    Thanks,
    Prem Ramamurthy
    FINRA

    Hi,
    Have you tried the latest SQL Dev 30EA3?
    I think SQL Dev 1.5.5 functionality does not cope up with Oracle 11g new feature.
    Regards,
    Buntoro

  • Since I upgraded SQL Developer to  Version 2.1.1.64 I'm finding that.......

    .........if I double click on a *.SQL file, it launches SQL Developer but the file doesn't open in it.
    This is really irritating.
    The file association appears to be set up correctly.
    Has anyone else experienced this and found a solution?
    Thanks
    Ant

    Hi,
    Correct answered will be passed on only when you post it in the right forum.
    put your query in SQL Developer forum. you cannot find any help in SQL PL/SQL forum page.
    SQL Developer
    HTH,
    Prazy

  • SQL Developer 4.0 EA2 -- Cannot use OpenLDAP with LDAP connect option

    Hi,
    I've got OpenLDAP setup to work with my Oracle clients, to serve up TNS connect strings, in lieu of having tnsnames.ora files scattered about hundreds of servers.
    This is working fine with 10g/11g, both full and instant clients, no problem.
    Now, I'm trying to configure SQL Developer 4.0 EA2 working with it, as well.
    When I attempt to do so, I'm able to select the "LDAP" option in "Connection Type", and the "LDAP Server" drop down list is correctly populated with my LDAP server, from ldap.ora.
    However, when I select it, I get the following error:
    Status : Failure -[LDAP: error code 32 - No Such Object]
    Now, I've done some research, and I monitored the slapd.log file, which shows me the following:
    Sep 18 02:43:35 einstein slapd[2779]: conn=1034 fd=16 ACCEPT from IP=192.168.125.1:63781 (IP=0.0.0.0:389)
    Sep 18 02:43:35 einstein slapd[2779]: conn=1034 op=0 BIND dn="" method=128
    Sep 18 02:43:35 einstein slapd[2779]: conn=1034 op=0 RESULT tag=97 err=0 text=
    Sep 18 02:43:35 einstein slapd[2779]: conn=1034 op=1 SRCH base="" scope=2 deref=0 filter="(objectClass=orclContext)"
    Sep 18 02:43:35 einstein slapd[2779]: conn=1034 op=1 SEARCH RESULT tag=101 err=32 nentries=0 text=
    Sep 18 02:43:35 einstein slapd[2779]: conn=1034 op=2 UNBIND
    Sep 18 02:43:35 einstein slapd[2779]: conn=1034 fd=16 closed
    Which is a lot more detail, but reflects the corresponding error code, (32 - No Such Object).
    After doing some testing with ldapsearch, I've been able to replicate what SQL Developer is doing, and get the exact same error.
    That ldapsearch command is:
    ldapsearch -h einstein -p 389 -c -x -D "" -b "" "(objectClass=orclContext)"
    Looking in the slapd.log file, I find an identical error to what is produced from SQL Developer.
    Further, the query that SQL Developer wants to do can be successfully done with the following ldapsearch:
    ldapsearch -h einstein -p 389 -c -x -D "" -b "dc=proquest,dc=com" "(objectClass=orclContext)"
    So, it seems the problem is with the fact that SQL Developer is not supplying a search base.
    I'm no LDAP expert, and I'm really not sure where to turn next....
    Is there a SQL Developer option that allows me to set that search base?  Is there a configuration I'm missing on the LDAP server configuration?
    Thanks,
    -Mark

    Well, that didn't take long.  I managed to find a solution to the problem.
    It comes down to the fact that SQL Developer doesn't supply a search base, and my LDAP server didn't have a default search base defined.
    When I edited slapd.conf (the OpenLDAP config file) and added a "defaultsearchbase" parameter, and bounced the LDAP server, everything started to work.
    I now have a working configuration with OpenLDAP and SQL Developer.
    I'll mark this discussion as closed.
    -Mark

  • SQL Developer takes 7 minutes to bring back list of packages

    The database is 11g R2 on 64bit Linux.
    Instance has multiple schemas
    SQLDev is v3.1.07 (download with JDK)
    SQL Dev connects without a problem.
    Click the "+" next to Functions, in a few seconds I get the list of functions.
    Click the "+" next to Procedures, in a few seconds I get the list of procedures.
    Click the "+" next to Packages, between 5 and 10 MINUTES later the list will display.
    The exact objects I choose to explore, or the order does not seem to matter.
    After 2 or 3 objects, the next load takes an unacceptable length of time.
    What is going on here?

    You can try to find out if the underlying query, that the sql developer issues against the data dictionary is slow.
    To do so first find the query, then issue the same query inside sql developer and check out the execution time and explain plan from there.
    To find the query you can connect with a DBA account. Use "Tools/Sessions .. " to monitor the sessions. Find the appropriate connection (check for the correct db user, and the module should be SQL Developer). Then start the slow action in the different session. Switch back to the session monitor and refresh it. Check out the SQL that is shown on "Active SQL" Tab.
    If this query is slow, then it is not a problem opf the sql developer but of your database installation. Maybe the dictionary cache is to small or the database did not apply statistics to the system tables. In such a case report the problem to your DBA.
    it could also be a problem of the connection. Do you use an oracle client to open the connection or something like a thin jdbc driver? try with the oracle client if you don't have that already.

  • No more Data to read from socket from SQL Developer

    Hi,
    When I run the below query from SQL Developer, I get "No more data to be read from socket" error. The Oracle trace shows "Address not mapped".
    select LDateDayPrec, LDateMonPrec, LDateOrder, LDateOrder_cd, LDateSep, LDateYearPrec,
    LanguageCode, LanguageCode_cd, NegNumPres, NegNumPres_cd, NullNumPres, NullNumPres_cd,
    NumDecimalChar, NumUnitSep, NumUnits0, NumUnits1, NumUnits2, NumUnits3, NumUnits4,
    NumUnits5, ProfileName, SDateDayPrec, SDateMonPrec, SDateOrder, SDateOrder_cd, SDateSep,
    SDateYearPrec, TimeFlg, WeekDayPres, WeekDayPres_cd, ZeroPres, ZeroPres_cd,Nls_profile_ver
    FROM NLS_PROFILE WHERE NlsProfileId =1"
    When I run the same query on the server through SQL Plus session, the result is getting fetched properly.
    Next thing , when I select only 28 columns from the table in the above query, then also the row is getting fetched. I tried interchanging the columns. In that case also, the result is same. Also, when I do a "select * from NLS_PROFILE " , the row is getting fetched..
    Can somebody help ?

    SQL> SELECT * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE 11.1.0.7.0 Production
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    One more info: This table "NLS_PROFILE" is not on the DB where I am running the query. It is on a remote DB which is accessed via a synonym created over a DB link
    Edited by: 840203 on Feb 28, 2011 9:57 PM

Maybe you are looking for

  • Screen Resolution Problems With Palm Desktop

    I'm running Palm Desktop 6.2.2 and have this problem of it changing my resolution to 640x480 on my laptop running Win 7 whenever I call it up.  How can I keep it at the recommended 1280x800 when I call up Palm desktop? Post relates to: Palm TX

  • RE: type of an attribute

    Hi Pradnesh You have set off an interesting discussion. Here is what I guess must have happened. You have n subclasses of datavalue class that require n+1 th subclass as an attribute. So why not promote that attribute to the super class ? Is it seman

  • Linking two accounts together

    Are you able to link two accounts together.  For example, I have had an account for a long time, but now my husband has one as well as my son.  My son is currently signed in with my account but I would like to give him his own as well as share what I

  • Faulting module name: HsAddin.dll, version: 9.3.8366.0 in Excel

    Hi, Whenever i open Excel 2007 a while later it will Hang and crash. Below information was show on Event Log. Faulting application name: EXCEL.EXE, version: 12.0.6425.1000, time stamp: 0x49d64dd6 Faulting module name: HsAddin.dll, version: 9.3.8366.0

  • ITunes podcast title vs. Feedburner feed name vs. Wordpress Category

    Hello all, I just had my podcast approved and listed on iTunes, yay! Now, my problem is as follows: I have a specific category on my Wordpress site which generates a feed that is then "burned" by Feedburner.  iTunes then links to my Feedburner feed.