How to query cross-database?

I need do a query over a table on the connected database server and another table on another database server. How I can I do it in a easy way?
Can you write you query as easily as:
Select a, b from table 1, table2@server2 where a.c1=b.c1
The other question is:
If you close the database connection but do nothing with statement, will the statement get closed implicitly?
Thanks in advance,
YM

I need do a query over a table on the connected
database server and another table on another database
server. How I can I do it in a easy way?
Can you write you query as easily as:
Select a, b from table 1, table2@server2 where
a.c1=b.c1Some DBMSses have features that allow you to access tables on other databases (maybe on other servers even). The behaviour and the code syntax should be found in the docs.
No standart SQL.
Alternatively: your Java program can do several connections to several databases. So - not by a simple joined select, but by some more logic - you can do your cross-db query.
The other question is:
If you close the database connection but do nothing
with statement, will the statement get closed
implicitly?I think, yes. But you never know what some specific driver for some specific DBMS will do.
It's more clean to close the statement explicitely.
Either use the same statement(s) always, then create it/them directly after connecting and close it/them directly before the connection,
or create a new statement for each task and close it afterwards.

Similar Messages

  • How to Query a database table of a remote system in a program.

    How to Query a database table of a remote system in a program.
    Thanks in adv.
    -Satish

    1.Create an RFC(SE37) in Source (To Where you want to get data)
    IMPORTING MATNR
    EXPORTING : SYS TYPE SY-SYID
                         I_MARA TYPE MARA
    SELECT SINGLE * FROM MARA INTO I_MARA WHERE MATNR EQ MATNR
    2.Copy the same RFC to Target(From Where you want to get data)
    3.Create a RFC destination(SM59.) in Source
    Enter the connection type as 3 and enter the target host  and system number ( may be 00)
    4.Create a program to calling RFC in Source.
    PARAMETERS: p_matnr LIKE mara-matnr.
    PARAMETERS: p_dest LIKE rfcdes-rfcdest DEFAULT 'NONE'.
    DATA: system LIKE sy-sysid.
    DATA :i_mara TYPE mara.
    CALL FUNCTION 'XX_RFC_GET_TEST' DESTINATION p_dest
      EXPORTING
        matnr                 = p_matnr
      IMPORTING
        sys                   = system
        i_mara                = i_mara
    :-Gopeekrishnan

  • How to query a database file on my hard drive?

    Hi,
    I have a filer called "server.dbs" on my hard drive. It is a database file. I use a simple program that allows you to view databases, and it loads up and I can traverse the database and see all the entries as any standard database.
    So I figured that Java's ability to handle SQL would allow me to make a standard SQL statement querying the database, and be able to get the results. The software stores servers in SID fields, and the value is the port the server runs on. I want to make a simple query to select a server by SID, and print the port in which that server is running on.
    So is there any way to, via my java application, load a database from a file (rather than a url) which has no authentication required, and simply make my queries directly to that file? If so, how?
    Thanks!
    -Josh

    Normal database access is via JDBC.
    http://java.sun.com/docs/books/tutorial/jdbc/index.html
    To use that JDBC driver is needed to access the database. Databases in wide usage all have one. It isn't clear from your posting that you have a common database though.

  • How to query the database periodically???

    Hi,
    i would like to do a certain task ( like fetching the database, etc) in a particular interval time. For example, my program has to query the database in every 15 mins and display the record if any new record added in the table.
    Any one please help me in this and if possible, please give me a sample code.

    Hi,
    Yes, the delay is 1000 ms ( 1 sec) but the program runs only 12 secs because the main thread sleep only 12000 ms.
    public static void doMain()
    *throws Exception {*
    Timer t = new Timer(true);
    t.schedule(new Ping("Fixed delay")
    *, 0, 1000);*
    Thread.currentThread().sleep(12000);
    After 12000 ms, the program stops running.
    But my requirement is, my program runs continuously for a particular period of time without stops running. ( for example, if i give a period of time is 2 to 6, the program runs in every 1000 ms delay between 2pm to 6pm without stops running).
    Please help me in this.......

  • How to query the database in an Entity Object (EO)

    I am using JDeveloper 11.1.2.2.0
    I am Forms developer working in a new ADF project and need some help from the ADF gurus, I am just a ADF beginner.
    Maybe hits question has a easy solution, but I don't know how to implement this:
    I have simplified my scenario, but this is what I Need to do:
    One database table DBTABLE with 3 columns (C1,N1,D1) C1-varchar2; N1-Numeric; D1-Date.
    In the DBTABLE I have the following data:
    ONE; 10; 01/10/2012
    ONE; 20; 02/10/2012
    TWO; 15; 02/10/2012
    ONE; 15; 03/10/2012
    I have created an ADF EO for the DBTABLE with all 3 attributes, then I have created another transient numeric attribute T1.
    My requirement is when I create a new record and set attribute C1=ONE the transient attribute T1 should show sum(N1) from DBTABLE where D1>= 01/10/2012 and D1 < 03/10/2012.
    In this case when I create a new record should the shown in T1 a total of 10+20 = 30.
    I know how to use the EOImpl getters and setters, and how to set the T1 attribute when C1 is set. My problem is how to calculate the total T1.
    How can I implement this in ADF? It is possible to implement this in the EO? It is possible to make the query select sum(N1) from DBTABLE where D1>= 01/10/2012 and D1 < 03/10/2012 and return the value to the EO attribute?
    Thank you in advance

    Hi Peter
    Thank you for your suggestions, both of them are interesting but unfortunately they do not solve my problem, or at least I don’t know how.
    I will try to better explain my problem
    I have te table DBTABLE and another related table called DBDATES with colums(C1,DT1,DT2,TARGET) where I record periods of time and desired target. For instance my DBDATES table could have the following records
    ONE; 01/01/2012; 31/01/2012; 100
    ONE; 01/02/2012; 29/02/2012; 90
    ONE; 01/03/2012; 31/03/2012; 95
    TWO; 01/01/2012; 31/01/2012; 140
    Exist a FK between both tables in the C1 column.
    I have created an EO for the table DBTABLE with the tree persistent attributes (C1, N1, D1) an transient attribute (T1). The (C1,D1) is my DB primary key.
    When I create a new record in the DBTABLE and based in the actual date I need to query the DBDATES table to check which is my TARGET and the valid target dates. For Instance if a record for person ONE is created on February 12, my TARGET is 90 from 01/02/2012 to 29/02/2012.
    At the same moment I need to check the total amount of items record to the person ONE during the full target period.
    Select sum(N1)
    From DBTABLE
    Where D1 between V2 and V3
    And C1= V1;
    Bind variables:
    V1 = ‘ONE’;
    V2 = ‘01/10/2012’ – queried from DBDATES
    V3 = ‘03/10/201’ – queried from DBDATES
    In resume, for a determined person when I create a new record in the DBTABLE I need to know their target for the actual period and how much as been record until now.
    I don't know if is possible to solve this without using the View Objects, because I need to query the DBTABLE for a time frame and with bind variables.
    Thank you in advance for your help.

  • How to query non database items

    hi every one
    I have database block has database items and non database items
    i want to make query in that non database items to retrieve data by that non database items and database items
    thinks

    Hi Every one
    I want to use the non databsae item in query to retireve data by it
    Example
    In table emp
    emp_id
    emp_name
    Dept_id
    But in Form
    Emp_name
    Dept_name
    When endtr data open lov to retireve Emp name and emp id
    and when enter department name in table enter dept id but in form user see dept name in form .
    but if he try to use dept name in query he can't because it non database item .
    How can i use this item in my query to retireve data by dept name ?

  • How to query database to retrieve code to create existing objects(nonPLSQL)

    Hi,
    I would like to know how to query the database so I can pull out the SQL required to create objects. I can already get the code for PL/SQL objects such as triggers and procedures by using DBA_SOURCE, however I also need to pull out code for objects like indexes, synonyms, libraries and views that are not stored in DBA_SOURCE. My colleague has suggested creating an index file from a metadata export however I only want code for broken objects and I need it to run automatically across all my databases with a single windows command script. Can anyone help me with this? TOAD manages to get the code for the objects but if it isn't stored in the DB then maybe it's creating it on the fly.
    Thanks
    Adam

    If you run an export with rows=N, you can produce a file with all the scripts.
    Otherwise you might want to look at DBMS_METADATA.
    We would just reference the original scripts in our source control, but hey, we're crazy like that.

  • How to query uncommited transactions

    Hi Does anyone know how to query Oracle database from SQL*Plus to view uncommitted transactions?
    Thanks

    I noticed after I posted that I had used a package I found on the web called list that includes several useful functions. So in case someone wants it, here are the package and body:
    ***PACKAGE***
    CREATE OR REPLACE PACKAGE list AUTHID CURRENT_USER IS
    -- All of these functions and procedures have the following parameters:
    -- list_in - A delimited list to be parsed.
    -- delimiter - The delimiter to be used for parsing the list. Defaults
    -- to a comma.
    -- null_item - What to do with null items in the list. A null item is created
    -- by consecutive occurances of the delimiter. Valid values are
    -- 'KEEP' to allow items in the list to be null, or 'SKIP' to ignore
    -- null items, ie. treat consecutive occurances of delimiters as a
    -- single delimiter. The default is 'KEEP'.
    -- delimiter_use - How the delimiter is to be interpreted. Valid values are
    -- 'ANY' to treat the entire delimiter string as a single occurance
    -- of a delimiter which must be matched exactly, or 'ANY' to treat
    -- the delimiter string as a set of single character delimiters, any
    -- of which is a delimiter. The default is 'ANY'.
    -- Return the first item in a list.
    FUNCTION head(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN VARCHAR2;
    PRAGMA RESTRICT_REFERENCES (head,WNDS,WNPS);
    -- Return the remainder of a list after the first item and its delimiter.
    FUNCTION tail(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN VARCHAR2;
    PRAGMA RESTRICT_REFERENCES (tail,WNDS,WNPS);
    -- Return the nth item in a list.
    -- The parameter, item_num, denotes which item to return.
    FUNCTION item(
    list_in IN VARCHAR2,
    item_num IN INTEGER DEFAULT 1,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN VARCHAR2;
    PRAGMA RESTRICT_REFERENCES (item,WNDS);
    -- Append an item to a list and return the new list.
    -- The parameter, item_in, contains the new item to append.
    FUNCTION append_item(
    list_in IN VARCHAR2,
    item_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',') RETURN VARCHAR2;
    PRAGMA RESTRICT_REFERENCES (append_item,WNDS);
    -- Return the number of items in a list.
    FUNCTION num_items(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN INTEGER;
    PRAGMA RESTRICT_REFERENCES (num_items,WNDS);
    -- Search a list for an item, and give its location in the list,
    -- or zero IF not found.
    -- The parameter, item_in, gives the item to be found in the list.
    FUNCTION in_list(
    list_in IN VARCHAR2,
    item_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN INTEGER;
    PRAGMA RESTRICT_REFERENCES (in_list,WNDS);
    -- Convert an array to a delimited list.
    -- The array to be input is a DBMS_UTILITY.uncl_array so that
    -- the LIST package is compatible with the comma_to_table and
    -- table_to_comma built ins.
    -- In this function, delimiter is always treated as a single
    -- string.
    FUNCTION array_to_list(
    array_in IN DBMS_UTILITY.UNCL_ARRAY,
    arrlen_in IN INTEGER,
    delimiter IN VARCHAR2 DEFAULT ',') RETURN VARCHAR2;
    PRAGMA RESTRICT_REFERENCES (array_to_list,WNDS,WNPS);
    -- Print a list using DBMS_OUTPUT.
    PROCEDURE print_list(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY');
    -- Convert a list to an array and return the array and its size.
    -- This is a procedure because it returns more than one value.
    -- The array to be returned is a DBMS_UTILITY.uncl_array so that
    -- the LIST package is compatible with the comma_to_table and
    -- table_to_comma built ins.
    PROCEDURE list_to_array(
    list_in IN VARCHAR2,
    arrlen OUT BINARY_INTEGER,
    array_out OUT DBMS_UTILITY.uncl_array,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY');
    -- Sort a list
    -- Null items are always skipped when sorting lists, since they would sort
    -- to the end of the list anyway. CMPFNC is the name of a function to compare
    -- two items. The default of '>' sorts in ascending order, '<' in descending order.
    -- If you write your own function to be used for sorting, it must:
    -- 1. Take two parameters of type VARCHAR2
    -- 2. Return an INTEGER
    -- 3. Return a negative number if the first item is to sort lower than
    -- the second, a zero if they are to sort as if equal, or a positive
    -- number if the first item is to sort higher than the second.
    -- 4. Be executable by the user running the sort. Normal naming rules apply.
    FUNCTION sort_list(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    cmpfnc IN VARCHAR2 DEFAULT '>',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN VARCHAR2;
    PRAGMA RESTRICT_REFERENCES (sort_list,WNDS);
    end;
    ***END PACKAGE SPEC***
    ***BEGIN BODY***
    CREATE OR REPLACE PACKAGE BODY list IS
    current_list VARCHAR2(32760) DEFAULT '';
    current_delim VARCHAR2(30) DEFAULT ',';
    TYPE list_array IS TABLE OF VARCHAR2(2000)
    INDEX BY BINARY_INTEGER;
    current_array list_array;
    current_arrlen BINARY_INTEGER DEFAULT 0;
    current_null_item VARCHAR2(4) DEFAULT '';
    current_delimiter_use VARCHAR2(3) DEFAULT '';
    -- Find the first delimiter.
    FUNCTION find_delimiter(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN BINARY_INTEGER IS
    delimiter_loc BINARY_INTEGER;
    BEGIN
    IF upper(delimiter_use) = 'ALL' THEN
    delimiter_loc := INSTR(list_in,delimiter);
    ELSIF upper(delimiter_use) = 'ANY' THEN
    delimiter_loc := INSTR(TRANSLATE(list_in,delimiter,ltrim(RPAD(' ',LENGTH(delimiter)+1,CHR(31)))),CHR(31));
    END IF;
    RETURN delimiter_loc;
    END find_delimiter;
    -- Return the first item in a list.
    FUNCTION head(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN VARCHAR2 IS
    delimiter_loc BINARY_INTEGER;
    BEGIN
    delimiter_loc := find_delimiter(list_in,delimiter,null_item,delimiter_use);
    IF delimiter_loc > 1 THEN
    RETURN SUBSTR(list_in,1,delimiter_loc-1);
    ELSIF delimiter_loc = 1 THEN
    RETURN NULL;
    ELSE
    RETURN list_in;
    END IF;
    END head;
    -- Return the remainder of a list after the first item and its delimiter.
    FUNCTION tail(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN VARCHAR2 IS
    start_ch BINARY_INTEGER;
    BEGIN
    start_ch := find_delimiter(list_in,delimiter,null_item,delimiter_use);
    IF start_ch = 0 THEN
    RETURN NULL;
    ELSE
    IF upper(delimiter_use) = 'ALL' THEN
    start_ch := start_ch + LENGTH(delimiter);
    ELSE
    start_ch := start_ch + 1;
    END IF;
    IF start_ch > LENGTH(list_in) THEN
    RETURN NULL;
    ELSE
    RETURN SUBSTR(list_in,start_ch);
    END IF;
    END IF;
    END tail;
    -- Convert a list to an array.
    PROCEDURE parse_list(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') IS
    list_to_parse VARCHAR2(32760);
    BEGIN
    IF list_in = current_list AND
    delimiter = current_delim AND
    null_item = current_null_item AND
    delimiter_use = current_delimiter_use THEN
    NULL;
    ELSE
    current_list := list_in;
    current_delim := delimiter;
    current_null_item := upper(null_item);
    current_delimiter_use := upper(delimiter_use);
    list_to_parse := list_in;
    current_arrlen := 0;
    WHILE list_to_parse IS NOT NULL LOOP
    IF current_null_item <> 'SKIP' OR
    head(list_to_parse,delimiter,null_item,delimiter_use) IS NOT NULL THEN
    current_arrlen := current_arrlen + 1;
    current_array(current_arrlen) := SUBSTR(head(list_to_parse,delimiter,null_item,delimiter_use),1,2000);
    END IF;
    list_to_parse := tail(list_to_parse, delimiter,null_item,delimiter_use);
    END LOOP;
    END IF;
    END parse_list;
    -- Convert a list to an array and return the array and its size.
    PROCEDURE list_to_array(
    list_in IN VARCHAR2,
    arrlen OUT BINARY_INTEGER,
    array_out OUT DBMS_UTILITY.uncl_array,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') IS
    BEGIN
    parse_list(list_in,delimiter,null_item,delimiter_use);
    arrlen := current_arrlen;
    FOR i IN 1..arrlen LOOP
    array_out(i) := SUBSTR(current_array(i),1,240);
    END LOOP;
    END list_to_array;
    -- Print a list using DBMS_OUTPUT.
    PROCEDURE print_list(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') IS
    BEGIN
    DBMS_OUTPUT.ENABLE(100000);
    parse_list(list_in,delimiter,null_item,delimiter_use);
    FOR i IN 1..current_arrlen LOOP
    dbms_output.put_line(SUBSTR(current_array(i),1,240));
    END LOOP;
    END print_list;
    -- Return the number of items in a list.
    FUNCTION num_items(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN INTEGER is
    BEGIN
    parse_list(list_in,delimiter,null_item,delimiter_use);
    RETURN current_arrlen;
    END num_items;
    -- Return the nth item in a list.
    FUNCTION item(
    list_in IN VARCHAR2,
    item_num IN INTEGER DEFAULT 1,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN VARCHAR2 is
    BEGIN
    parse_list(list_in,delimiter,null_item,delimiter_use);
    IF item_num NOT BETWEEN 1 AND current_arrlen THEN
    RETURN NULL;
    ELSE
    RETURN current_array(item_num);
    END IF;
    END item;
    -- Append an item to a list and return the new list.
    -- The parameter, item_in, contains the new item to append.
    FUNCTION append_item(
    list_in IN VARCHAR2,
    item_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',') RETURN VARCHAR2 IS
    BEGIN
    IF list_in IS NULL THEN
    RETURN item_in;
    ELSE
    RETURN list_in || delimiter || item_in;
    END IF;
    END append_item;
    -- Search a list for an item, and give its location in the list,
    -- or zero IF not found.
    FUNCTION in_list(
    list_in IN VARCHAR2,
    item_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    null_item IN VARCHAR2 DEFAULT 'KEEP',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN INTEGER is
    BEGIN
    parse_list(list_in,delimiter,null_item,delimiter_use);
    FOR item_num IN 1..current_arrlen LOOP
    IF current_array(item_num) = item_in THEN
    RETURN item_num;
    END IF;
    END LOOP;
    RETURN 0;
    END in_list;
    -- Convert an array to a delimited list.
    FUNCTION array_to_list(
    array_in IN DBMS_UTILITY.UNCL_ARRAY,
    arrlen_in IN INTEGER,
    delimiter IN VARCHAR2 DEFAULT ',') RETURN VARCHAR2 IS
    list_out VARCHAR2(32760):= '';
    BEGIN
    FOR item_num IN 1 .. arrlen_in LOOP
    EXIT WHEN LENGTH(list_out) +
    LENGTH(array_in(item_num)) > 32760;
    list_out := list_out||array_in(item_num);
    IF item_num < arrlen_in THEN
    list_out := list_out||delimiter;
    END IF;
    END LOOP;
    RETURN list_out;
    END array_to_list;
    -- Sort a list
    FUNCTION sort_list(
    list_in IN VARCHAR2,
    delimiter IN VARCHAR2 DEFAULT ',',
    cmpFnc IN VARCHAR2 DEFAULT '>',
    delimiter_use IN VARCHAR2 DEFAULT 'ANY') RETURN VARCHAR2 IS
    temp_array list_array;
    temp_len PLS_INTEGER := 0;
    temp_item VARCHAR2(2000);
    list_out VARCHAR2(32760);
    PROCEDURE swap (
    first_item IN OUT VARCHAR2,
    second_item IN OUT VARCHAR2) IS
    temp_item VARCHAR2(2000);
    BEGIN
    temp_item := first_item;
    first_item := second_item;
    second_item := temp_item;
    END swap;
    FUNCTION cmp (
    first_item IN VARCHAR2,
    second_item IN VARCHAR2,
    cmpfnc IN VARCHAR2 DEFAULT '=') RETURN INTEGER IS
    return_value INTEGER;
    BEGIN
    IF cmpfnc = '>' THEN
    IF first_item < second_item THEN
    return_value := -1;
    ELSIF first_item = second_item THEN
    return_value := 0;
    ELSIF first_item > second_item THEN
    return_value := 1;
    END IF;
    ELSIF cmpfnc = '<' THEN
    IF first_item > second_item THEN
    return_value := -1;
    ELSIF first_item = second_item THEN
    return_value := 0;
    ELSIF first_item < second_item THEN
    return_value := 1;
    END IF;
    ELSE
    EXECUTE IMMEDIATE 'BEGIN :I := '||cmpfnc||'(:A,:B); END;'
    USING OUT return_value, IN first_item, IN second_item;
    END IF;
    RETURN return_value;
    END cmp;
    BEGIN
    parse_list(list_in,delimiter,'SKIP',delimiter_use);
    FOR item_num IN 1..current_arrlen LOOP
    temp_item := current_array(item_num);
    FOR i IN 1..temp_len LOOP
    IF cmp(temp_array(i),temp_item,cmpfnc) > 0 THEN
    swap(temp_array(i),temp_item);
    END IF;
    END LOOP;
    temp_len := temp_len + 1;
    temp_array(temp_len) := temp_item;
    END LOOP;
    FOR item_num IN 1..temp_len LOOP
    EXIT WHEN LENGTH(list_out) +
    LENGTH(temp_array(item_num)) > 32760;
    list_out := list_out||temp_array(item_num);
    IF item_num < temp_len THEN
    list_out := list_out||delimiter;
    END IF;
    END LOOP;
    RETURN list_out;
    END sort_list;
    END;
    *** END BODY***
    Carl

  • Query a database block based on a non-database block

    hi everybody
    can anybody help me as how to query a database block based on a non-database block, without a master-detail relationship?
    i have a block : date_input which contains a non-database item: start_date
    another database block (event_block)containing details of an event
    i have to input a date in the start_date and query the event_block
    in wich trigger should i insert the code?
    thanks

    If you are trying to query your database block (event_block) using the value from start_date in your non-database block, then you can set the Where clause in the database block using:
    SET_BLOCK_PROPERTY ('event_block', DEFAULT_WHERE, 'your where clause that includes start_date');
    Place this statement in a trigger that is executed prior to the block being queried.

  • How Can I find SQL Query in Database

    Dear Experts,
    How Can I find SQL Query in Database.

    Hi,
    U mena what query got executed in db? u can try V$SQL for it.
    Regards
    Bharath

  • How to query Database with Parameters  and configure null value response?

    Hi,
    1.When capture attributes from forms & after applying several logics, passing to a DB table using an API, how to get relevant values for a given parameter in another DB table ?
    2.When a DB table is queried, if the value does not exist, how to configure the response message ?
    Thanks.

    Okay, you've provided exactly what John S. asked for - and no more. This is helpful, but not enough. I think we're going to need a use case to understand exactly what you are asking. What should the user see? What does the user do next? What should happen in the database and in the application when the user does this?
    However, I'll try to read between the lines a bit, and get you part of the way there. To query the database with parameters in ADF BC, you need a View Object (VO). The simplest thing to do is create the SELECT command behind the VO with some bind variables and add the bind variables to your VO. At that point, you will get an ExecuteWithParameters operation in the Data Control. You can drag that operation onto a JSF page and it will give you an option to create a parameter form to let the user fill in the parameters to set the bind variables, and a button to execute the query with these values. Any table or form based on that same VO will show the selected data.
    A Trinidad or ADF Rich Faces table will have an attribute to let you define some text to show the user if no data was retrieved by the query. But there are other ways to determine if data was retrieved which you can use to control other ways to display this information. For instance, I have a page that has an outputText component that has a "rendered" attribute to show the text only when there was no data retrieved by a query.

  • How to find last executed query on database and or schema.

    hi,
    how to find last executed query on database and or schema.
    yours sincerely

    Sessionwise if you wanna see means use v$session.. Because it will show execution time also so you can analyze it easily and get sql based on SID and serial number ..
    Try :
    select * from v$session;
    Regards..

  • Help, how to Query database using pagination

    hi,
    how to Query database using pagination for the large data,
    any API to do this?
    thank you in advance!

    Hi,
    You can specify XmlQueryContext::Lazy as your evaluation type, and only call XmlResults::next() as many times as you need results from it.
    John

  • Querying Multiple databases on Azure SQL

    Does anybody know if there is a way to query multiple Azure sql databases in a query?
    I have tested the query on a standard sql server I have setup here and that works fine.
    I believe Azure does not support cross database queries and you have to do an elastic database query.  Any ideas how this works?
    This topic first appeared in the Spiceworks Community

    Hello. We currently have a database cluster that has a WSUS database on it.  We wanted to setup another WSUS server in our environment, is this possible?  I have read some posts saying that there was a 1 to 1 for WSUS DB to SQL Instance
    but those were from 2008 and 2011 and I am wondering if it is possible today.  If not, what would be the recommendation?  Another SQL Instance or just use the Windows Internal Database. 
    There is still a limitation of 1 WSUS to 1 SQL Instance, because the database name is hardcoded to SUSDB. To use multiple WSUS servers on that same cluster will require the installation of an additional instance.
    If that additional server is destined to be a downstream server, though, I would recommend just using the native Windows Internal Database on the local system.
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • How to use Logical database in function module?

    I will create a function module in HR.
    but how to use Logical database  in function module ?  Logical database PNP always show screen.in function (RFC) code , it is a matter.

    You cannot attach the LDB to the main program of the function group.
    - So you may [SUBMIT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=submit&adv=false&sortby=cm_rnd_rankvalue] a report which use the LDB and get back the data (export/import), by default in the syntax of SUBMIT the selection-screen will not be displayed
    - Use [LDB_PROCESS|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=ldb_process&cat=sdn_all], fill a structured table for selection, and get data back in another table
    - Use [HR function modules to read Infotypes|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=hrfunctionmodulestoread+Infotypes&adv=false&sortby=cm_rnd_rankvalue].
    Regards

Maybe you are looking for

  • Just a few questions about DVD Ripping and Final Cut 6

    Ok, Here is my first major concern. I have a wedding that I cut on the Final Cut Studio. After I burnt it to a DVD, I erased the main footage. However, the groom wanted to add something so I went into my backup files to get the information but just s

  • Scheduling PI Interface

    Hi All, We want to schedule PI interface every 1 hour but with a condition that interface should not run between 6:00 PM to 11:59 PM. We were checking ATP for this but were not able to achieve the same. Please suggest how this can be done. Reg, NJ

  • Sun Relax NG converter

    I am trying to use the Sun Relax NG Converter version 20030225 but get some exceptions. C:\Dev\TheWineCellarBook\xml\sunconverter>java -jar rngconv.jar wineXML.xsd > wineXML.rng Exception in thread "main" java.lang.ClassCastException at com.sun.msv.d

  • PXI-6533, Changing frequency without stopping the card?

    Using PXI-6533 and LabVIEW, is it possible to update the frequency (of a defined pattern) without stopping the output of the card?

  • Why do I sometimes get "Safari could not open the page because the server stopped responding" with WiFi but not cellular?

    When my iPad is connected to the internet via WiFi I can pretty much browse without problems. However, there are certain instances where a web page is requested and I get, after a bit of time passes, "Safari could not open the page because the server