Pupulating elements of a page from a table using the PK

I am to find a way to fill some of the elements in a page, passing a parameter that hold the PK of a table that contains the values.

I guess I need to use a process page (possibly PL/SQL), but do not know how to do this.

Thank you

Mehr

Automatic line extraction would probably be your best bet.

Each of the elements will have the "column of the database" the "Source Type" value with the value of "Source" is the name of column it represents.

Here is a cheat I used:

Use 'Form on the Table' and delete all the stuff you don't want. (for example the automatic process DML)

Basically it is a wizard that does all the hard work (of the foregoing) for you.

MK

Tags: Database

Similar Questions

  • Excerpt from my table using the loop For

    Hello

    I have this loop to create a 2D array. The result is on the table below. I want that this 2D table should be fully completed and compiled, then it will be sent out of the loop.

    I don't want to extract the value of table 2D is a loop. This is the problem that I am facing.

    My ultimate goal is to extract the individual number of the final table of the 2D table line and be an entry for other functions.

    Please help me. Thank you

    PX

    Hi PX.

    Here's a solution without using screw express

  • How to publish data from a table using the form

    Oracle forms6i

    Hai All

    I have download the data to the table of forms...

    My table T1 columns are in, out, intrinsically, introut, empname, empno


    and another table T2 consist of three columns is empno, date, time

    In table T2 time fields consist of symbol I, o... I mean IN, O OUT

    My Question is when an employee consist of 3 I - the three IN the time


    0815 I, 1200 I, 1415 I and OUT 3 times O 1245, 1445 O, O 1715 and empno is 001

    If there is no record for empno 001 then insert first 0815 I in table T1 in column IN time then

    to update 1200 intrinsically and 1245 update to Introut and 1415 up-to-date addin and 1445 to update addout


    Finally in 1715 to outtime

    If it is possible to do without Hardcoding the moment Pls tell with some good example


    Thanks in advance

    Srikkanth.M

    There now things are clear... whenever I have free I'll post the code u how to do this...

    for now, a few tips can help u

    -create the table to store operations travel so then u can't fix your code

    -Create the cursor on the T1 line through all the records.

    -Control what empno and action i.e. the current cursor (I or O) exists on the same date in T2 or not

    -otherwise exists insert a new record check also the SHIFT is coming in time IF is between MAJ 0815 and 1645 and action is 'I' then insert record and column values accordingly

    s ' there is, then update the record of the place where empno = cur.empno and attendance_date = mydate;

    It may be useful

    Baig,
    [My Oracle Blog | http://baigsorcl.blogspot.com/]

  • Problem: Build a VI to display a string in the table of the lights. Each letter must be posted in a separate table and letters must move from one table to the other in the direction from left to right.

    Hi all

    Problem: Build a VI to display a string in the table of the lights. Each letter must be posted in a separate table and letters must move from one table to the other in the direction from left to right.

    I did program mentioned above but it does not work. Can you tell me what is the problem?

    There is no error is indicated in the program. If someone knows about it please try to find solutions and help me out of this problem.

    I have attached my program with this message.

    Thank you in advance!

    (1) FOR loops are your friend here.  You can make a slight restructuring using loops, and then you will have less mess to deal with, the inner loop through tunnels of autoindexing to make it even simpler.

    (2) I would only treat the numeric values of the characters.  So go terminal of control of the chain, the capital letters and byte array to before the outer loop.  You can use a size of Board over there to tell how many times the outer loop to iterate.

    (3) the Index table is extensible.  So you only need over the index of the first, and it will increment itself, as it develops.

    (4) you need to finish the lookup table (table 3D)

  • Get the 500 error trying to create a table using the REST API

    Hello

    I tried to create a table using the REST API for Business Intelligence Cloud, but I got 500 Internal Server Error for a while now.

    Here are the details that I use to create a table.

    Capture.JPG

    and the json to create the schema that I use is

    [{'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ["ROWID"]}]

    , {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['RELATIONID']},

    {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['ID']}

    , {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['RESPONDEDDATE']},

    {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [255], 'columnName': ['RESPONSE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_CREATEDDATE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['SYS_CREATEDBYID']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_LASTMODIFIEDDATE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['SYS_LASTMODIFIEDBYID']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_SYSTEMMODSTAMP']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [10], 'columnName': ['SYS_ISDELETED']},

    [{'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [50], 'columnName': ['TYPE']}]

    I tried this using postman and code, but I always get the following response error:

    Error 500 - Internal server error

    Of RFC 2068 Hypertext Transfer Protocol - HTTP/1.1:

    10.5.1 500 internal Server Error

    The server encountered an unexpected condition which prevented him from meeting the demand.

    I am able to 'get' existing table schemas, delete the tables, but I'm not able to make put them and post operations. Can someone help me to identify the problem, if there is no fault in my approach.

    Thank you

    Romaric

    I managed to create a table successfully using the API - the only thing I see in your JSON which is different from mine is that you have square brackets around your values JSON where I have not. Here is my CURL request and extract my JSON file (named createtable.txt in the same directory as my CURL executable):

    curl u [email protected]: password UPDATED h x ' X-ID-TENANT-NAME: tenantname ' h ' Content-Type: application/json '-binary data @createtable.txt https://businessintell-tenantname.analytics.us2.oraclecloud.com/dataload/v1/tables/TABLE_TO_CREATE k

    [

    {

    'columnName': 'ID',

    'dataType': 'DECIMAL ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': false

    },

    {

    'columnName': 'NAME',

    'dataType': 'VARCHAR ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    "columnName': 'STATUS."

    'dataType': 'VARCHAR ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    "columnName': 'CREATED_DATE."

    'dataType': 'TIMESTAMP '.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    'columnName': 'UPDATED_DATE ',.

    'dataType': 'TIMESTAMP '.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    }

    ]

  • Update a table using the clause

    Hello

    I want to update a table using the selected values.

    Cases in the sample:


    create table as empsalary)

    Select 1 as empid, 0 in the wages of all the double union

    Select option 2, the double 0);

    Data update are as follows

    with saldata as

    (

    Select 1 as empid, 5000 as wages, 500 as double pf

    Union of all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    I tried the following query but does not work

    updated set of empsalary table (empid, salary) =

    (

    Select * from)

    with saldata as

    (

    Select 1 as empid, salary, 500 5000 as pf Union double all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    ) sl

    where sl.empid = empsalary.empid

    )

    I use oracle 10g.

    Help, please.

    Krishna Devi wrote:

    Hello

    I want to update a table using the selected values.

    Cases in the sample:

    create table as empsalary)

    Select 1 as empid, 0 in the wages of all the double union

    Select option 2, the double 0);

    Data update are as follows

    with saldata as

    (

    Select 1 as empid, 5000 as wages, 500 as double pf

    Union of all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    I tried the following query but does not work

    updated set of empsalary table (empid, salary) =

    (

    Select * from)

    with saldata as

    (

    Select 1 as empid, salary, 500 5000 as pf Union double all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    ) sl

    where sl.empid = empsalary.empid

    )

    I use oracle 10g.

    Help, please.

    Thanks for posting creates table and test data.

    The error message would have helped because it's pretty obvious that this is the problem:

    Update table empsalary

    *

    ERROR on line 1:

    ORA-00903: invalid table name

    Just remove the word "table".

  • Creating external Tables using the EXECUTE IMMEDIATE in PL/SQL

    Hi guys,.

    I am trying to create an external Table using the EXECUTE IMMEDIATE in a procedure and I managed to compile and no errors were generated. But when I try to run it from sql using the exec command I get the following error:

    ------------------------------------------------------------------------
    ERROR on line 5:
    ORA-00911: invalid character
    ORA-06512: at "GEO. TEST_DDL', line 4
    ORA-06512: at line 5

    -------------------------------------------------------------------------

    I tried to check the whole statement to create the external table, but I can't find where is the error. Surprisingly, if I simply run the command table create external on sqlplus it works, but not a procedure.

    If anyone can help with ideas or experience?

    Geoffrey Kossami

    The error means that there is an identifier somewhere that starts with a nonalphanumeric. This is a typical mistake of editing. A procedure compiles correctly is not of course because the underlying dynamic sql running is OK. Which of course only be resolved when you try to run it.

    There is certainly a problem with the text you provide to be run as a piece of dynamic sql code. You should try to watch it with dbms_output and run this code in sqlplus. But your problem is with the code you run as dynamic PL/SQL, it is not itself compilable.

    Jack

  • Next in a table using the nested

    Hi all

    I have a dilemma, and I don't know how to solve. I use a nested table. I loaded the data from a table in the current collection. Now, I want to go to each line of the collection and some operations.
    I used the following statement:

    because me in 1... Tab.Count loop
    / * operations * /.
    end loop;

    The operations section contains a test, some time... loop condition and I need to be able to move to the next line of the collection while staying in this condition as:
    all in tab (i) .field1 = v_var loop
    ...
    Tab.Next;
    end of loop

    I tried to use then, but it doesn't work like that. Any ideas how do I do this?

    Thank you
      idx := tab.next (idx);
    
  • When I try to edit a room photo in photoshop elements 12, I'm not able to use the slider or one of the drop down menus. All I have is a black circle with a line through it.

    When I try to edit a room photo in photoshop elements 12, I'm not able to use the slider or one of the drop down menus. All I have is a black circle with a line through it.

    Most likely, the images are 16-bit/channel.

    Go to Image > Mode and click on 8-bit/channel and see if that solves the problem.

  • How can I move pages from one document to the other without merger of paragraph styles?

    I want to create a singular indesign file of 2 separate documents, which allows me to make an interactive PDF of it.

    However, when you move pages from one to the other, it seems that when each document has a paragraph style with the same name, they merge. The problem is that text is then adjusted if the styles do not match completely.

    Is there a way to merge the documents without any formatting changes?

    Create a Style group in each document and move all styles in this file. Give each document a different name. Do it with all kinds of styles: paragraph, character, objects, tables and Cell Styles. Then you can sort them later in the merged document what you do with these styles.

  • Mark from a table where the column value is a colon-delimited list

    Version: Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    Hello

    This is a new query of a query Frank helped me with: https://community.oracle.com/message/12506306#12506306

    Demand is all users to restrict the report based on a multiple selection on the front-end server (application APEX) filter.

    The filter returns that a colon-delimited list and the data in the table can be saved in a delimited by a colon list too. There may be 1 to n values (up to 4000 characters).

    I need a WHERE clause that will allow a match, if it exists, between the data in the column of the Table and the Mult-selection list filter.

    The abbreviated for this post query would be something like:

    SELECT slt_id, slt_item, slt_owner

    OF slt_dashboard

    WHERE slt_owner IN (colon delimited page list);

    The Create Table and Insert statements:

    CREATE TABLE slt_dashboard
    (
      dashboard_id  NUMBER,
      slt_id        VARCHAR2(10),
      slt_item      VARCHAR2(2500),
      slt_owner     VARCHAR2(4000),
      slt_type      VARCHAR2(25),
      slt_year      NUMBER,
      parent_id     NUMBER
    );
    
    --Insert slt_dashboard
    INSERT INTO slt_dashboard(dashboard_id,slt_id,slt_item,slt_owner,slt_type,slt_year,parent_id)
    VALUES (12,'1.1','Implement revenue enhancement initiatives','E15889:JPARISI:BDUR63','Business Commitment',2014,6);
    
    INSERT INTO slt_dashboard(dashboard_id,slt_id,slt_item,slt_owner,slt_type,slt_year,parent_id)
    VALUES (13,'1.2','Strengthen our Energy position','KVROMAN','Business Commitment',2014,6);
    
    
    

    I have a function to separate the list delimited by two points in a table for the IN clause, but because these values can be saved in a delimited list of Colon in the column of the Table, I have a problem, being able to analyze the data in the column, AND the filter data.

    The function is:

    CREATE OR REPLACE FUNCTION get_list( p_string IN VARCHAR2
                                        ,p_delimiter IN VARCHAR2 DEFAULT ':'
                                       )
        RETURN vc_array_1
        PIPELINED
    IS
        l_string VARCHAR2( 32000 );
        l_array wwv_flow_global.vc_arr2;
    BEGIN
        l_array     :=
            APEX_UTIL.string_to_table( p_string
                                      ,p_delimiter
                                     );
    
        FOR i IN l_array.FIRST .. l_array.LAST
        LOOP
            PIPE ROW ( TRIM( l_array( i ) ) );
        END LOOP;
    
        RETURN;
    END;
    
    
    

    The function called in the query in the form (it's just for reference in case someone wanted to know):

    SELECT ...
    FROM ...
    WHERE slt_owner IN (SELECT * FROM TABLE( get_list( :P115_SLT_OWNER ) ));
    

    But I can't use this approach because the data in the Table can be saved in a delimited list of Colon too.

    Desired output:

    If the Mult-Select list filter contains: E15889:JPARISI then

    1.1 implementation of the E15889 revenue improvement initiatives; JPARISI (it's a semicolon between the names)

    If the multiple-selection list filter contains: KVROMAN then

    1.2 strengthen our position of energy KVROMAN

    If the multiple-selection list filter contains: BDUR63:KVROMAN then

    1.1 implementation of the BDUR63 revenue improvement initiatives

    1.2 strengthen our position of energy KVROMAN

    Please let me know if something is not clear.

    Thank you

    Joe

    I went to approach the Table and the Page works perfectly.

    Thank you to everyone!

    Thank you

    Joe

  • Copy columns from one Table to the other with PL/SQL in Apex

    So my goal long-term is to throw this PL/SQL statement in a trial DMBS_SCHEDULER Apex 4.1 to create historical snapshots of the data a week but I'm hooked on this code:

    declare
    V_DEKIT_ID varchar (255);
    V_NT varchar (255);
    Number to resume;
    Date of V_DDATE;

    Start
    for DEKIT_ID in (select * from DKT_HIST)

    loop

    Select DEKIT. DEKIT_ID in V_DEKIT_ID of DEKIT;
    Select DEKIT. NT in DEKIT V_NT;
    Select DEKIT. QUANTITY back of DEKIT;
    Select CURRENT_DATE in double V_DDATE;

    insert into DKT_HIST (DEKIT_ID, NT, QUANTITY, DDATE)
    values (V_DEKIT_ID, V_NT, V_QUANTITY, V_DDATE);
    end loop;

    end;

    I enter this code in the SQL prompt in the SQL workshop and it is said that she is treated, but when I look at the destination table (DKT_HIST), there is no data. Any help would be appreciated.  In this code I want to copy the three columns of the DEKIT table as well as the current date and copy them to DKT_HIST for each row in the table DEKIT.

    Thank you

    -Steve

    The reason why your code did nothing is probably because your loop, using the history table. And since there no data in the historical table first, there is nothing to loop.

    BUT!

    Good code is the task with the least possible effort. Which in your case should result in a code similar to this:

    begin
       insert into DKT_HIST (DEKIT_ID,NT,QUANTITY,DDATE)
       select DEKIT_ID,NT,QUANTITY, trunc(sysdate)
       from DEKIT;
    end;
    
  • expdp + query option to export from several tables with the same condition

    Hello

    We want to export a subset of data only from databases to another. Both on AIX.

    Source/testdatabase 11.2.0.3 (non partitioned tables)
    Target productiion 11.2.0.3 database (separate tables)

    Tables of same names of columns but diffrenet structures a partitioning index and traget so only want to import content

    Each source datbaase hascolumn seq number table and want only to extract the last months of data.


    TABLES:table1,table2...
    DUMPFILE=dump_dir
    CONTENT=data_only
    QUERY= table1:"WHERE seq_num >100 "
    want to use expdp but not sure how to make sure that all tables have the seq_num WHERE > 100 condition, if let table1: go out and have just
    QUERY = "WHERE seq_num > 100"this condition would apply to all tables that we want."


    I'm assuming that can also use impdp CONTENT = data_only?

    Any ideas/thoughts?

    Thank you

    QUERY = "WHERE seq_num > 100"this condition would apply to all tables that we want."

    Yes, it will work for all tables, but ensure that all exported table must include this column.

    QUERY
    Default: no
    Goal
    Allows you to filter the data that is exported by specifying a clause of a SQL SELECT statement, which is applied to all tables in the work of export or a specific table.

    The query_clause is usually a WHERE clause for the selection of refined lines, but could be any SQL clause. For example, an ORDER BY clause can be used to accelerate a migration from a table in a heap in a table held in index. * If a [schema]. table_name is not provided, the query is applied to (and must be valid for) all tables in the export job.*

    http://docs.Oracle.com/CD/B19306_01/server.102/b14215/dp_export.htm

  • Import from foxpro tables using HS in 11 GR 2

    Hello
    Oracle Version: 11.2.0.1.0
    Windows XP

    I'm following to import foxpro tables (I had two or three DBF FoxPro (database files) for treatment):

    1. create a DSN named dbf system using Microsoft dBase Driver (*.) (DBF) to choose the directory Option i.e. E:\FPD26 (means, I will do everything the dbfs in this folder and this DSN should only focus on this folder)

    2.i created D:\app\Administrator\product\11.2.0\dbhome_1\hs\admin\initdbf.ora

    HS_FDS_CONNECT_INFO = dbf
    HS_FDS_TRACE_LEVEL = 0

    3 here is my listener.ora
    # listener.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = dbf)
          (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
          (PROGRAM = hsodbc)
        )
      )
    
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        )
      )
    
    ADR_BASE_LISTENER = D:\app\Administrator
    4. and it's tnsnames.ora
    # tnsnames.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    
    ORACLR_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
        )
        (CONNECT_DATA =
          (SID = CLRExtProc)
          (PRESENTATION = RO)
        )
      )
    
    ORCL11 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = orcl11)
        )
      )
    
    dbf =
      (DESCRIPTION=
         (ADDRESS= (PROTOCOL=TCP)(HOST=localhost)(PORT=1521))
         (CONNECT_DATA=
            (SID=dbf)
            (HS=OK)
         )
       )
    
    LISTENER_ORCL11 =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    Associated listener...
    C:\Documents and Settings\Administrator>lsnrctl stop
    
    LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 29-NOV-2011 19:36:54
    
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    The command completed successfully
    
    C:\Documents and Settings\Administrator>lsnrctl start
    
    LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 29-NOV-2011 19:37:01
    
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    
    Starting tnslsnr: please wait...
    
    TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
    System parameter file is D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
    Log messages written to d:\app\administrator\diag\tnslsnr\homepc-83810b7f\listener\alert\log.xml
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
    Start Date                29-NOV-2011 19:37:04
    Uptime                    0 days 0 hr. 0 min. 2 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
    Listener Log File         d:\app\administrator\diag\tnslsnr\homepc-83810b7f\listener\alert\log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
    Services Summary...
    Service "dbf" has 1 instance(s).
      Instance "dbf", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    
    C:\Documents and Settings\Administrator>lsnrctl status
    
    LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 29-NOV-2011 19:38:09
    
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
    Start Date                29-NOV-2011 19:37:04
    Uptime                    0 days 0 hr. 1 min. 5 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
    Listener Log File         d:\app\administrator\diag\tnslsnr\homepc-83810b7f\listener\alert\log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
    Services Summary...
    Service "dbf" has 1 instance(s).
      Instance "dbf", status UNKNOWN, has 1 handler(s) for this service...
    Service "orcl11" has 1 instance(s).
      Instance "orcl11", status READY, has 1 handler(s) for this service...
    Service "orcl11XDB" has 1 instance(s).
      Instance "orcl11", status READY, has 1 handler(s) for this service...
    The command completed successfully
    
    C:\Documents and Settings\Administrator>tnsping dbf
    
    TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 29-NOV-2011 19:38:31
    
    Copyright (c) 1997, 2010, Oracle.  All rights reserved.
    
    Used parameter files:
    D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
    
    
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP)(HOST=localhost)(PORT=1521)) (CONNECT_DATA= (SID=dbf) (HS=OK)))
    OK (70 msec)
    
    C:\Documents and Settings\Administrator>sqlplus scott/tiger
    
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Nov 29 19:38:55 2011
    
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> drop database link dbf;
    
    Database link dropped.
    
    SQL> create database link dbf connect to scott identified by tiger using 'dbf';
    
    Database link created.
    
    SQL> create table products as select * from products@dbf;
    create table products as select * from products@dbf
                                                    *
    ERROR at line 1:
    ORA-12518: TNS:listener could not hand off client connection
    There are file in e:\fpd26\products.dbf. I don't know where I am wrong or forgotten. Kindly help me.

    Thank you.

    Hello
    You always use the same listener.ora as in the original post? If so, the problem is because you have-

    (PROGRAM = hsodbc)

    but with 11g, the program is now "dg4odbc" callède then alors change the input to the -.

    (PROGRAM = dg4odbc)

    Then stop and start the receiver and try a select statement.

    Kind regards
    Mike

    Published by: mkirtley on November 29, 2011 15:29

  • How to remove duplicates from a Table using PL/SQL

    I created the following tables with data:

    * Table 1: *.



    Department of CREATE TABLE

    (DEPARTMENT_ID 4 NUMBER PRIMARY KEY,

    DEPARTMENT_NAME VARCHAR2 (20).

    ADDRESS VARCHAR2 (20));







    INSERT INTO Department VALUES (10, 'ACCOUNTING', 'NEW YORK');

    INSERT INTO Department VALUES (20, "SEARCH", "DALLAS");

    INSERT INTO Department VALUES (30, 'SALES', 'CHICAGO');

    INSERT INTO Department VALUES (40, 'OPERATIONS', 'BOSTON');

    COMMIT;



    * 2nd table: *.

    CREATE TABLE employee

    (EMPLOYEE_ID NUMBER 4 PRIMARY KEY,

    EMPLOYEE_NAME VARCHAR2 (20).

    USE VARCHAR2 (20).

    MANAGER_ID NUMBER 4,

    HIRE_DATE DATE,

    NUMBER OF SALARY (9, 2)

    COMMISSION (9, 2) NUMBER,

    Department_id number 4 REFERENCES department (DEPARTMENT_ID));






    INSERT INTO employee

    VALUES (7839, 'KING', 'PRESIDENT', NULL, NOVEMBER 17, 81 ', 5000, NULL, 10);

    INSERT INTO employee

    VALUES (7698, "BLAKE", "MANAGER", 7839, MAY 1, 81 ', 2850, NULL, 30);

    INSERT INTO employee

    VALUES (7782, "CLARK", "MANAGER", 7839, JUNE 9, 81 ', 2450, NULL, 10);

    INSERT INTO employee

    VALUES (7566, "JONES", "MANAGER", 7839, APRIL 2, 81 ', 2975, NULL, 20);

    INSERT INTO employee

    VALUES (7654, 'MARTIN', 'SELLER', 7698, 28-SEP-81', 1250, 1400, 30);

    INSERT INTO employee

    VALUES (7499, 'ALLEN', 'SELLER', 7698, FEBRUARY 20, 81 ', 1600, 300, 30);

    INSERT INTO employee

    VALUES (7844, 'TURNER', 'SELLER', 7698, ' 08-SEP-81', 1500, NULL, 30);

    INSERT INTO employee

    VALUES (7900, 'JAMES', 'CLERKS', 7698, 3 DECEMBER 81', 950, NULL, 30);

    INSERT INTO employee

    VALUES (7521, 'WARD', 'SELLER', 7698, FEBRUARY 22, 81 ', 1 250, 500, 30);

    INSERT INTO employee

    VALUES (7902, "FORD", "ANALYST", 7566, DECEMBER 3, 81 ', 3000, NULL, 20);

    INSERT INTO employee

    VALUES (7369, 'SMITH', 'CLERKS', 7902, DECEMBER 17, 81 ', 800, NULL, 20);

    INSERT INTO employee

    VALUES (7788, 'SCOTT', 'ANALYST', 7566, DECEMBER 9, 82 ', 3000, NULL, 20);

    INSERT INTO employee

    VALUES (7876, ' ADAMS, "CLERK", 7788, 12 JANUARY, 83', 1100, NULL, 20);

    INSERT INTO employee

    VALUES (7934, 'MILLER', 'CLERKS', 7782, JANUARY 22, 82 ', 1300, NULL, 10);

    COMMIT;



    I need to print all Department names, employee and salary. I did this, but how can display the name of each Department only once?





    Here is my code:



    DECLARE

    v_department_name department.department_name%TYPE;

    v_employee_name employee.employee_name%TYPE;

    v_salary employee.salary%TYPE;

    CURSOR dept_cur

    IS

    SELECT employee_name, department_name, Department OF employee salary

    WHERE department.department_id = employee.department_id (+)

    ORDER BY department_name, employee_name;

    BEGIN

    OPEN dept_cur.

    EXTRACT the dept_cur IN v_department_name, v_employee_name, v_salary;

    DBMS_OUTPUT. PUT_LINE ('DEPARTMENT_NAME EMPLOYEE_NAME WAGES');

    DBMS_OUTPUT. PUT_LINE('---------------------------------------------------');

    While dept_cur % FOUND

    LOOP

    DBMS_OUTPUT. Put_line (RPAD (v_department_name, 10) |) ' ' || RPAD (v_employee_name, 10). ' ' || v_salary);

    EXTRACT the dept_cur IN v_department_name, v_employee_name, v_salary;

    END LOOP;

    CLOSE Dept_cur;

    END;

    I would appreciate if you could help me with this. I'm sure it's a quick and easy answer, but I can't do it. I spent so much time already.

    Published by: 831522 on January 26, 2011 11:44

    It is a problem of display/reports rather than a problem of duplication of query data. The answer depends on what tools you use to query and display the data. You can use the clause "break it" I suggested earlier if you use SQL Plus.

    Otherwise, you can try this based on the version of Oracle you are using. Someone else may be able to get the data in a single pass.

    SELECT decode(emp_id, 1, department_name) department_name, employee_name, salary
    FROM(SELECT department_name, employee_name, salary,
           ROW_NUMBER() OVER (PARTITION BY department_name order by department_name, employee_name) AS emp_id
         FROM department
         LEFT OUTER JOIN employee ON (department.department_id = employee.department_id)
    ORDER BY department_name, employee_name, emp_id);
    

Maybe you are looking for