Help with quierying a table with varchar as dates

guys need a little help im close but i just can't close the deal.
i have a table that the field is dataytped as varchar2 but it holds a date like such '20100615' todays date.
I know the first thing you guys are going to say is that this should be formatted as a date but it is not my table and i have to deal with this.
any how here is the problem im trying to query for a range of dates and im having one hell of a time doing it.
as you cant tell from my query below im atempting to bring back only 15days worth of data by date.
can someone please point out the obvious. I've been at it for a day now trying to get this to work.
select DISTINCT to_date(fwvitals_date, 'YYYYMMDD') "fwvitals_date"
FROM fwvitals
where fwvitals_date
between (((SELECT MAX(fwvitals_date)FROM FWVITALS)))
AND ((select to_CHAR(sysdate-15, 'YYYYMMDD') from dual))

Hi,
user633029 wrote:
guys need a little help im close but i just can't close the deal.
i have a table that the field is dataytped as varchar2 but it holds a date like such '20100615' todays date.
I know the first thing you guys are going to say is that this should be formatted as a date but it is not my table and i have to deal with this.You're absolutely correct!
any how here is the problem im trying to query for a range of dates and im having one hell of a time doing it.
as you cant tell from my query below im atempting to bring back only 15days worth of data by date.
can someone please point out the obvious. I've been at it for a day now trying to get this to work.
select DISTINCT to_date(fwvitals_date, 'YYYYMMDD') "fwvitals_date"
FROM fwvitals
where fwvitals_date
between (((SELECT MAX(fwvitals_date)FROM FWVITALS)))
AND ((select to_CHAR(sysdate-15, 'YYYYMMDD') from dual))"WHERE x BETWEEN y AND z" is equivalent to
"WHERE x >= y AND x <= z".
If y > z, then no rows will ever qualify, and if y is the gratest value in your table, then (probably) very few rows, perhaps only 1 will satisfy the condition even if z > y.
What exactly are you trying to do?
It helps if you post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data. If the results are conditional, give a couple of examples, e.g,, "If I run the query at any time on June 15, I want ... but if it's June 16, then I want ..."
If you want the most recent 15 days, including today (that is, when run on June 15, you want June 1 through June 15) then:
SELECT DISTINCT 
     fwvitals_date
FROM      fwvitals
WHERE       fwvitals_date     BETWEEN     TO_CHAR (SYSDATE - 14, 'YYYYMMDD')
               AND     TO_CHAR (SYSDATE,      'YYYYMMDD')
;Fortunately, the strings are in a format such that sorting is meaningful, so you don't have to run TO_DATE on each one, and get conversion errors.
Edited by: Frank Kulash on Jun 15, 2010 9:52 PM

Similar Messages

  • Help to read a table with data source and convert time stamp

    Hi Gurus,
      I have a req and need to write a ABAP prog. As soon as i excute ABAP program it should ask me enter a data source name, then my ABAP prog has excute teh code, in ABAP code i have to read a table with this data source as key, sort time stamp from table and should display the data source and time stamp as output.
    As follows:
    Enter Data Source Name: 
    Then user enters : 2lis_11_vahdr
    Then out put should be "Data source  :"  10-15-2008.
    The time stamp format in table is 20,050,126,031,520 (YYYYMMDDhhmmss). I have to display as 05-26-2005. Any help would be apprciated.
    Thanks,
    Ram

    Hi Jayanthi Babu Peruri,
    I tried to extract YEAR, MONTH, DAY separately and using
    EDIT MASK written it.
    Definitely there will be some STANDARD CONVERSION ROUTINE will be there. But no idea about it.
    DATA : V_TS      TYPE TIMESTAMP,
           V_TS_T    TYPE CHAR16,
           V_YYYY    TYPE CHAR04,
           V_MM      TYPE CHAR02,
           V_DD      TYPE CHAR02.
    START-OF-SELECTION.
      GET TIME STAMP FIELD V_TS.
      V_TS_T = V_TS.
      CONDENSE V_TS_T.
      V_YYYY = V_TS_T.
      V_MM   = V_TS_T+4(2).
      V_DD   = V_TS_T+6(2).
      V_TS_T(2) = V_MM.
      V_TS_T+2(2) = V_DD.
      V_TS_T+4(4) = V_YYYY.
      SKIP 10.
      WRITE : /10 V_TS," USING EDIT MASK '____-__-________'.
              /10 V_YYYY,
              /10 V_MM,
              /10 V_DD,
              /10 V_TS_T USING EDIT MASK '__-__-__________'.
    If you want DATE alone, just declare the length of V_TS_T as 10.
    Regards,
    R.Nagarajan.
    We can -

  • Help in joining nested table with regular table

    Im creating a nested table codelist as object prtcnpt_info. In a anonymous block im declaring t_code as nested table type codelist.
    Now when i try to join the nested table with the regular oracle DB table and i get error: PL/SQL: ORA-00904: "COLUMN_VALUE": invalid identifier.
    Please help me on this and provide tutorial link pertaining to this concepts..Below is the code i wrote
    --Code Start;
    create or replace type prtcnpt_info as object ( id number
    ,name varchar2(200)
    ,code varchar2(30));
    create type codelist is table of prtcnpt_info;
    declare
    t_code codelist;
    begin
    select prtcnpt_info(b.pid ,b.name ,pt.code) bulk collect into t_code
    from part pt
    ,mc_code b
    where pt.cd in ('AAA','BBB')
    and pt.ptype_id=b.pt_type_id;
    INSERT INTO table ( ID
    ,RUN_ID
    ,DATA
    ,P_ID
    SELECT id
         ,run_id
         ,data
         ,prtct.id ----> 1
    FROM table_2 t2
    ,(select column_value from table(t_code)) prtct
    WHERE prtct.id=t2.P_ID; ------> 2
    end;
    --Code End;
    also from the anonymous block
    1 => is this correct way to get value of id (b.pid) from the nested tablet_code aliased as prtct ?
    2 => is this correct way to join the nested table with regular table? i want to join the column id's in both the tables.
    Edited by: 914912 on Apr 30, 2012 2:11 AM

    When you create a table type without an object, i.e. a single column type like this you will get the column name as COLUMN_VALUE.
    SQL*Plus: Release 10.2.0.5.0 - Production on Mon Apr 30 07:38:32 2012
    Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create or replace type mytbl as table of varchar2(10)
      2  /
    Type created.
    SQL> var rc refcursor
    "afiedt.buf" 11 lines, 162 characters
      1  declare
      2     ltbl mytbl;
      3  begin
      4     select to_char(level) bulk collect into ltbl
      5       from dual
      6    connect by level <= 10;
      7     open :rc for
      8     select * from table(ltbl);
      9* end;
    10  /
    PL/SQL procedure successfully completed.
    SQL> print rc
    COLUMN_VAL
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    10 rows selected.And when you create a table type with object you will get the object column name.
    SQL> drop type mytbl
      2  /
    Type dropped.
    SQL> create type myobj as object (id varchar2(10))
      2  /
    Type created.
    SQL> create type mytbl as table of myobj
      2  /
    Type created.
    SQL> declare
      2     ltbl mytbl;
      3  begin
      4     select myobj(to_char(level)) bulk collect into ltbl
      5       from dual
      6    connect by level <= 10;
      7     open :rc for
      8     select * from table(ltbl);
      9  end;
    10  /
    PL/SQL procedure successfully completed.
    SQL> print rc
    ID
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    10 rows selected.
    SQL>

  • Help to work with 2 internal table with tricky  use

    HI ,
    I have 2 internal table one with new data and one with old data (same structure ) and i want to combine the 2 of them to final table .
    what i need to do here is little bit tricky
    The  table is build like this :
    mandt
    User
    user_data
    valid
    if there is no different from the user data from table old to table new the user data in the final table should look like this
    000
    user1
    userdata1
    X
    000
    user1
    userdata2
    X
    IF there is difference between of them the table entries in final table should like this
    000
    user1
    userdata3
    X
    000
    user1
    userdata4
    X
    000
    user1
    userdata1
    "Valid field is empty -abap false  since the user dont have this data (userdata1) any more
    000
    user1
    userdata2
    "Valid field is empty -abap false  since the user dont have this data (userdata2) any more
    1. alwayes table new is coming with data that is valid field = abap_true
       and should be change the user entries just if there is new entries are diffrent than the old one .
    2. table new can have new users with data so it enter the new users to final table with valid entry = abap_true
    3. if in the new table there is no user which exist in the old table the user in the final table
    should stay with the same entries but the valid entry should be abap false
    What is the best way to do that ?
    Regards
    Chris
    Edited by: Chris Teb on Nov 15, 2009 10:39 AM

    HI
    I have table with entries like that that i read from DB (i call it itab_old)
    old_itab
    mandt     User      user data      timestemp      valid
    0     usr1      User_data1     X     TRUE
    0     usr1      User_data2     X     TRUE
    0     usr1      User_data3     X     TRUE
    0     usr2      User_data1     X     TRUE
    0     usr2      User_data2     X     TRUE
    0     usr2      User_data3     X     TRUE
    0     usr2      User_data4     X     TRUE
    0     usr3     User_data1     X     TRUE
    0     usr3     User_data2     X     TRUE
    0     usr3     User_data3     X     TRUE
    assume the user entry for usr 1 is changing i.e. (new entries in table itab_new) the table should look like this
    new_itab
    mandt     User      user data      timestemp      valid
    0     usr1      User_data4     Y     TRUE
    0     usr1      User_data2     Y     TRUE
    0     usr1      User_data6     Y     TRUE
    0     usr2      User_data1     Y     TRUE
    0     usr2      User_data2     Y     TRUE
    0     usr2      User_data3     Y     TRUE
    0     usr2      User_data4     Y     TRUE
    and the final_itab should look like that
    usr1 old entries are mark as false and new recoreds is enter to the table for him ,
    usr2 have the same entries so it not change
    final_itab
    mandt     User      user data      timestemp      valid
    0     usr1      User_data1     X     FALSE
    0     usr1      User_data2     X     FALSE
    0     usr1      User_data3     X     FALSE
    0     usr2      User_data1     X     TRUE
    0     usr2      User_data2     X     TRUE
    0     usr2      User_data3     X     TRUE
    0     usr2      User_data4     X     TRUE
    0     usr3     User_data1     X     TRUE
    0     usr3     User_data2     X     TRUE
    0     usr3     User_data3     X     TRUE
    0     usr1      User_data4     Y     TRUE
    0     usr1      User_data2     Y     TRUE
    0     usr1      User_data6     Y     TRUE
    0     usr7     User_data1     X     TRUE
    0     usr7     User_data2     X     TRUE
    0     usr7     User_data3     X     TRUE
    last thing there is option that new user will come in table new_itab that is not exist in old table for this user we need to create new entry in final table (like user 7 )
    Thanks in advance
    Chris
    Edited by: Chris Teb on Nov 15, 2009 10:50 PM

  • OID users ( EUS) problem with grant create table with admin

    Hi,
    We activated enterprise users in the OID.
    There is a role APP_ADMIN that has the following grants:
    create user
    drop user
    create table with admin option
    this is for an application that creates BI schemas, so it needs to be able to create other users.
    I have granted these to a local role, and the user has access to the local role, thanks to the OID setup.
    The create and drop user work.
    however, the grant create table to another user does not work.
    Is there an issue with 'with admin option' grants in Enterprise user security?
    Regards,
    Peter

    If I grant
    grant create table to test_role with admin option;
    it does not work
    if I grant
    GRANT GRANT ANY PRIVILEGE to test_role WITH ADMIN OPTION;
    it does work.
    The test command as user with test_role is:
    grant create table to test_usr;
    very strange!
    If the user is a standard user and I create role test_role
    and grant create table to test_role with admin option it works.
    but if I convert the user to an EUS user and the same privilege is given to the role ( role is granted to a global role to an enterprise role)
    it doesnt work
    Edited by: Peter on Dec 7, 2012 2:36 PM

  • Problem with version enabling tables with ric.

    Hello,
    i have the a problem when i want to version enable tables having ref. int. constraits having delete rule cascade or set null.
    Is it possible that i can't version enable the tables because of these constraints? How i could solve this problem if i want to keep the delete rule?
    thanks,
    Orsi Gyulai

    Hi,
    We are internally creating a <table_name>_g procedure that transfers privileges to the necessary users.  If you have a table with that name, it would explain the error.
    When using ignore_last_error, it will skip the statement that is selected from the all_wm_vt_errors view. Sometimes, the statement can be safely skipped, while in other cases it cannot be. This procedure will always eventually complete when it is repeatedly called with ignore_last_error set to true. However in doing so, some required objects or privileges may not exist or be in an invalid state.
    In your case, you most likely had to skip the 3 or so statements that dealt with the <table_name>_g procedure.  Typically, these statements should not be skipped, but you may or may not see a problem with it due to a number of factors.
    The best course of action may be to drop the trigger in a beginDDL/commitDDL session, and then recreate it in a separate session. Of course, only do this after renaming the <table_name>_g table that you have.  Unfortunately, there is currently no way of getting around this naming convention.
    Thanks,
    Ben

  • Help me to update table with condition's

    this table is an alert table which will update when the sql server down , not pinging and drive space low.
    Every 15 mins the monitoring system run. if the any issue came then it will update the information in this table. if  the issue not solved by 15 mins the table will update again with the same details.. 
    I would like update tickeraised = Y  only on first time and  if i got same issue less then 30 min the it should not change to Y..  based on server name , type and message. 
    min >10 and <20 min if any value is there then the table should not update with same value. can any one help me with tsql query...

    In future please post DDL and DML. For now I have created a scenario which will help you understand solution to your own requirement.
    CREATE TABLE Tickets_Log(
    Ticked_ID SMALLINT IDENTITY(1,1) PRIMARY KEY,
    Ticket_Type VARCHAR(20) NOT NULL,
    Log_Date DATETIME2 NOT NULL DEFAULT DATEADD(MINUTE,-15,GETDATE()),
    Machine_Name VARCHAR(50) NOT NULL,
    Message VARCHAR(100) NOT NULL,
    Ticket_Status CHAR(2) NOT NULL DEFAULT 'N',
    Update_Status SMALLINT DEFAULT 0)
    INSERT Tickets_Log(Ticket_Type,Machine_Name,Message)
    SELECT 'Pinging','HOD-400-651','Server Not Pinging' UNION
    SELECT 'Low Drive Space','HOD-400-652','Drive Space Low' UNION
    SELECT 'Connection','HOD-400-653','Unable to Connect to Server'
    UPDATE TL
    SET Log_Date=NewTickets.Log_Date,
    Update_Status=1
    FROM( SELECT 'Pinging' Ticket_Type,'HOD-400-651' Machine_Name,'Server Not Pinging' Message,GETDATE() Log_Date UNION
    SELECT 'Pinging','HOD-400-653','Server Not Pinging',GETDATE() Log_Date) NewTickets
    LEFT JOIN Tickets_Log TL ON NewTickets.Machine_Name=TL.Machine_Name AND NewTickets.Ticket_Type=TL.Ticket_Type
    WHERE TL.Ticket_Type IS NOT NULL AND TL.Machine_Name IS NOT NULL AND DATEDIFF(MINUTE,TL.Log_Date,NewTickets.Log_Date)>=15 AND Update_Status=0
    INSERT Tickets_Log(Ticket_Type,Machine_Name,Message,Log_Date)
    SELECT NewTickets.*
    FROM( SELECT 'Pinging' Ticket_Type,'HOD-400-651' Machine_Name,'Server Not Pinging' Message,GETDATE() Log_Date UNION
    SELECT 'Pinging','HOD-400-653','Server Not Pinging',GETDATE() Log_Date) NewTickets
    LEFT JOIN Tickets_Log TL ON NewTickets.Machine_Name=TL.Machine_Name AND NewTickets.Ticket_Type=TL.Ticket_Type
    WHERE TL.Ticket_Type IS NULL AND TL.Machine_Name IS NULL
    Chaos isn’t a pit. Chaos is a ladder. Many who try to climb it fail and never get to try again. The fall breaks them. And some are given a chance to climb, but they refuse. They cling to the realm, or the gods, or love. Illusions. Only the ladder is real.
    The climb is all there is.

  • Issue with extractvalue from table with XMLTYPE column.

    I'm sure there is a simple answer but I am having problems
    retrieving data from an xmltype column type.
    I have two tables
    descr dab_xmlName
    TABLE of XMLTYPE
    descr dab_testName
    A NUMBER
    AB NUMBER
    DATA CLOB
    DATA2 VARCHAR2(1600)
    MYXML XMLTYPE
    I have inserted the Oracle example XML purchaseOrder.xml into both dab_xml
    and the myxml column in dab_test.
    When I run the following:
    SELECT extractvalue(OBJECT_VALUE, '/PurchaseOrder/Reference')
    FROM dab_xml;
    SBELL-2002100912333601PDT is returned
    When I run this:
    SELECT extractvalue(OBJECT_VALUE, '/PurchaseOrder/Reference')
    FROM (select myxml from dab_test);
    ERROR at line 1:
    ORA-00904: "OBJECT_VALUE": invalid identifier
    Why are the two different?
    Any help will be appreciated.
    Regards,
    David

    In short you want
    SELECT extractvalue(myxml, '/PurchaseOrder/Reference')
    FROM dab_test;This difference is that for dab_xml, there are no columns defined for the table, therefore you are [OBJECT_VALUE|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/pseudocolumns006.htm#sthref830] as an alias for a non existent column.
    With dab_test, you have a column that contains the XML so you need to use that column name instead of OBJECT_VALUE.

  • Problem with Exporting a Table with BLOB data.

    Hello All,
    I get error messages while exporting a table from Oracle8i ( 8.1.7.4.1), containing BLOB data:
    ORA-01555: snapshot too old: rollback segment number with name "" too small
    ORA-22924: snapshot too old
    Metalink says there is a bug in release 8.1.7.4.1 and suggests to create a new tablespace (with manual space management) ant move BLOB object to this TB.
    Can i solve this problem without creating a new tablespace ?
    Maybe somebody's experienced in such problem.
    thank you in advance.

    Maybe you could solve Your problem without creating new tablespace.
    Consider changing the value of MAX_ROLLBACK_SEGMENTS to max value if currently is not at that value and creating new bigger rollback segments.

  • Dealing with User Defined Tables with the DI Server

    I have a general question about the best way of working with the data in user defined tables using the DI Server. It appears from previous posts that it is not possible to use the standard methods such as UpdateObject. Also since update/insert and delete statements or explicitly forbidden using the ExecuteSQL method then how do we interact with the data in the tables?
    Do we need to code our own data access layer for this type of access and is this a good practice?
    Is this type of functionality going to be available in a future release of the DI Server?
    Thanks

    Using SQL for Update/Insert/Delete is not forbidden on UDTs (at least non-UDO UDTs; UDO UDTs are somehow in a gray area since they carry internal fields + e.g. inserts require further manipulation in B1 tables...)...
    I.e. using ExecuteSQL to add data into UDTs is OK for DI Server...
    HTH,
    Frank

  • How to insert with select in table with object types

    I am in the proces of redesigning some tables, as i have upgraded from
    personal oracle 7 to personal oracle 8i.
    I have constructed an object type Address_type, which is one of the columns
    in a table named DestTable.
    The object type is created as follows:
    CREATE OR REPLACE TYPE pub.address_type
    AS OBJECT
    Street1 varchar2(50),
    Street2 varchar2(50),
    ZipCode varchar2(10));
    The table is created as follows:
    CREATE TABLE pub.DestTable
    (id INTEGER PRIMARY KEY,
    LastName varchar2(30),
    FirstName varchar2(25),
    Address pub.address_type);
    Inserting a single row is ok as i use the following syntax:
    Insert into DestTable(1, '******* ', 'Lawrence', pub.address_type(
    '500 Oracle Parkway', 'Box 59510', '95045'));
    When i try to insert values into the table by selecting from another table i
    cannot do it and cannot figure out what is wrong
    I have used the following syntax:
    Insert into DestTable
    id, name, pub.address_type(Street1, Street2, ZipCode))
    select
    id, lastname, firstname, street1, street2, ZipCode
    from SourceTable;
    I have also tried the following syntax:
    Insert into DestTable
    id, name, pub.address_type(Address.Street1, Address.Street2,Address.ZipCode))
    select
    id, lastname, firstname, street1, street2, ZipCode
    from SourceTable;
    What is wrong here ?
    null

    Magnus,
    1. Check out the examples on 'insert with subquery' in http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a85397/state21b.htm#2065648
    2. Correct your syntax that repeated the column definition after "insert into ..."
    Insert into DestTable
    id, name, pub.address_type(Street1, Street2, ZipCode))
    select
    id, lastname, firstname, street1, street2, ZipCode
    from SourceTable;
    Regards,
    Geoff
    null

  • Problem with global temporary table with rows

    Scenario :
    I need to create a table for generating a report in a oracle 10g database. Data population in the table depends on the parameter passed from front end.
    I have created global temporay table to achieve this. But use of same table by another user is not possible.
    I have created the global temporary table as follows:
    ''Create global temporay table xyz (a varchar2(10),b varchar2(10)) on commit preserve rows''

    You have not posted much details.
    But yes, global temporary tables are session specific. So other session won't see anything.
    Amardeep Sidhu
    http://amardeepsidhu.com/blog
    http://oracleadmins.wordpress.com

  • Seibel Query help : -  Joining Order table with Asset or CX_ACTION table.

    Hi Team
    I need help joining the Order table with the Asset table
    or the Order table with CX_ACTION table to
    Can i get reference on this .
    select x.x_msisdn,
    x.x_product_name,
    x.x_action,
    x.x_status_outcome,
    a.recovered_dt,
    x.x_amount,
    x.created,
    x.x_number_retries,
    o.ORDER_NUM "FMW Order No",
    DECODE(FULFLMNT_STATUS_CD , 'Failed','Failed', o.STATUS_CD) "Order Status"
    from
    siebel.cx_action x,
    siebel.s_order o,
    siebel.s_asset a
    where a.row_id = x.x_asset_id
    and x.created > to_date('08/01/2013 08:00:00', 'dd/mm/yyyy hh24:mi:ss')
    and x.created < to_date('09/04/2013 07:50:00', 'dd/mm/yyyy hh24:mi:ss')
    Regards

    I'm not familiar with Seibel or any of these tables but right off the bat I'd suggest you're missing a join predicate to your s_order table. This could give you far more rows than you're expecting.
    Aside from that you haven't told us what problems you are having. An error? Wrong results? Performance?

  • EEWB: Insert New Table with more than one key field  for BP object

    Hi Gurus,
    I want to enhance Business Partner object with a new table with two key fields, one the address number and another a sequence number, because I need to save several entries for each address belonging to a determined business partner. Something as what happens in communication data (i.e fax number)for an address.
    I have run the wizard from EEWB but the only possibility that offers you is to create only one key field for the new custom table. There is something in EEWB to achieve this, two key fields for the new table?
    Another question is the following: which Badi or BAPI must I enhance to populate my table with the corresponding address number to which the data belong to?
    I mean my custom data are filled through a table control that I have allocated within the screen sequence BUA130 (Detail Address). Thus, when a new address is added to a BP and my particular table control is populated within this address I should fill the key fields from my table (address number and sequence number) when the BP were saved. So, I must know beforehand which address number the system will assign to this new address.
    I repeat the question: which Badi or BAPI must I enhance to populate my table with the corresponding address number to which the data belong to?
    Thanks in Advance.
    Regards,
    Rosa Ferrando

    Hi Rosa,
    Please go through the following links. It will help you.
    <a href="http://help.sap.com/saphelp_crm50/helpdata/en/20/a4ffee7e0fcc4ebb7e5466d3903d38/frameset.htm">http://help.sap.com/saphelp_crm50/helpdata/en/20/a4ffee7e0fcc4ebb7e5466d3903d38/frameset.htm</a>
    <b>Reward points if it helps.</b>
    Regards,
    Amit Mishra

  • Populating a temp table with multiple records.

    I want to populate a temp table with a a set of recs. This table will be used for
    crossing/joining with my other tables to pull out data.
    ie:
    Main table (loc)contains these fields -> county,permit,utme,utmn
    Temp table ( tmpid) contains these fields -> countytemp, permittemp
    So I will be doing a statement like this once my temp table is populated.
    Select l.county,l.permit,l.utme,l.utmn from loc l,tmpid t where l.county=t.countytemp and l.permit=t.permittemp;
    So this temp table will basically be a list of ids that can range from a few recs to several hundred.
    I want to know is there is way I can poplulate/repopulate it easily using sqlPlus/other by reading in a Ascii file
    from client PCs. (besides SQL loader).

    HI
    let me explain my requirement first,
    i need to populate my block with the results from the following sql
    SELECT * from contactdet where
    (Month=12 and TrType='MTM' and FinYr='04-05' and Userid='SA009' and Clcode='SB001')
    UNION
    SELECT * from contactdetSUM where (Clcode='SB001' AND CSCODE='AB001')
    Pease note. the where clauses i have put are different in each table and my requirement is
    the constants values i have put in where clause should be variable (ie. i should be able to put variables like :clcode or so)
    I tried us using Query data source type as 'FROM clause query' but it does not allow me to put variables in where clause.
    Is there any way out i can do this ? Please help me
    Regards
    Uday

Maybe you are looking for