Syntax within the from Clause

In the following SQL SELECT statement, what does the
px-granule(0, block_range, dynamic) in the FROM clause reference.
This select statement was copied from the sql analyze tool within
OEM 2.2.
SELECT /*+ Q524000 NO_EXPAND ROWID(A1) */ A1."PROCESSING_DATE"
C0,
A1."PRCSNG_SEQUENCE_NR_IDENTIFIER" C1,
A1."TUI_ID" C2,NVL(A1."RECORD_TYPE_CODE",' ') C3,
NVL(A1."CONDITION_CODE",' ') C4,
NVL(A1."PURPOSE_CODE",' ') C5,
NVL(A1."DOCUMENT_IDENTIFIER",' ') C6,
NVL(A1."NIIN_IDENTIFIER",' ') C7,
NVL(RTRIM(A1."DOCUMENT_NUMBER_IDENTIFIER"),' ') C8,
NVL(A1."SUFFIX_CODE",' ') C9,
NVL(A1."UNIT_OF_ISSUE_CODE",' ') C10,
NVL(A1."PLUS_MINUS_CODE",' ') C11,
NVL(A1."TRANSACTION_QUANTITY_CHAR_TEXT",' ') C12,
NVL(A1."TRANSACTION_REVERSAL_CODE",' ') C13,
NVL(A1."ON_HAND_QUANTITY_CHAR_TEXT",' ') C14,
NVL(A1."SITE_CODE",' ') C15,
A1."RECORD_TYPE_CODE" C16,
NVL(TO_CHAR(TRUNC(A1."REPAIR_SEQUENCE_NR_IDENTIFIER")),' ') C17,
NVL(A1."COGNIZANCE_SYMBOL",' ') C18,
NVL(A1."FSC_CODE",' ') C19
FROM "OPS$DWTLOD"."TLOD_UNION_ITEMS" PX_GRANULE(0, BLOCK_RANGE,
DYNAMIC) A1
WHERE A1."REGION_IDENTIFIER_CODE"=5 AND
A1."PROCESSING_DATE"<=:B1 AND
NVL(A1."NIIN_IDENTIFIER",' ') LIKE '000457162' AND
NVL(RTRIM(A1."DOCUMENT_NUMBER_IDENTIFIER"),' ') LIKE '%'
AND A1."PROCESSING_DATE">=:B2 AND A1."PROCESSING_DATE"<=:B3 AND
NVL(A1."NIIN_IDENTIFIER",' ') LIKE '000457162' AND
NVL(RTRIM(A1."DOCUMENT_NUMBER_IDENTIFIER"),' ') LIKE '%'
Thanks,
Gil

DECLARE
       highestlid locations.location_id%TYPE;
BEGIN
       SELECT
            max(location_id)
       INTO
            highestlid
       FROM
            locations;
       highestlid:=highestlid+1;
       ADDLOCATION(highestlid,'Lucan');
END;
/

Similar Messages

  • Exception: DBD, [Microsoft][ODBC Excel Driver] Syntax error in FROM clause.

    Dear experts,
    I'm trying to create an universe linked to an Excel File.
    I've created the ODBc connection and the DNS Data Source and inserted the table (table name RAC$) in the Universe. however, when I try to map each table field in the universe's Objects I'm getting this error message:
    "Exception: DBD, [ODBC Excel Driver] Syntax error in FROM clause.State:37000".
    I've tried to rename the table, inserting square brackects and also add new parameters to the universe («Transactional Available = "Yes"» and «Delimited Identifier = "Yes"») but still no solution to my problem.
    Any advice, tip or trick?
    Thank you. My best regards.
    Inês Santos

    Hi Ines,
    Thanks for sharing how you resolved this! I will bookmark this so that I can find it when I will likely need it!
    Bill
    Sorry I don't know how to make the accent circumflex! Or is that what you call it? On top of the e?
    Edited by: wavery on Jun 11, 2010 12:07 AM
    Edited by: wavery on Jun 11, 2010 12:09 AM

  • Stupid question: whats wrong here? -- Syntax Error in FROM clause

    i keep getting the error: Syntax Error in FROM clause.
    here is the code:
    <%@ page import="java.sql.*" %>
    <HTML>
    <HEAD>
         <TITLE>User Application Area</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:fypproject","","");
    Statement st = con.createStatement();
    String email = (String)session.getAttribute("email");
    String levelStatus = (String)session.getAttribute("levelStatus");
    String details = "SELECT PD.Forename, PD.Surname, L.Level_Name FROM PD Personal_Details AND LD Login_Details AND L Level WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND Level_ID = '" + levelStatus + "'";
    ResultSet rsDet = st.executeQuery(details);
    if(rsDet.next()) {
    String forename = rsDet.getString("Forename");
    String surname = rsDet.getString("Surname");
    String level_name = rsDet.getString("Level_Name");
    %>
    <DIV ALIGN="center"><H1>User Application Arena</H1></DIV>
    <BR>
    <H4>Welcome back <% out.println(forename + " " + surname); %> </H4>
    <BR>
    <%
    out.println(level_name);
    else {
    out.println("NOT FOUND ANYTHING");
    st.close();
    con.close();
    %>
    </BODY>
    </HTML>
    the strange thing is when i write a query that doesn't involve the 'Level' table it works fine.
    for example if i just want to display the forename and surname from 'Personal_Details' where the Email_Address = email it works fine...as soon as i involve the 'Level' table i get this error.
    i basically have 'Level_ID' in the 'Login_Details' table which is found out in the preceding jsp and passed through to this page and i can print out the Level_ID
    but....what i want to do is use this Level_ID and find the respective Level_Name in the Level table.
    my Level table looks like this:
    Level_ID Level_Name
    0 Pending
    1 Interview
    2 Rejection
    Thanks :o)

    Perhaps this is your issue ...
    The column Level_ID is in both the Login_Details and Level tables. Therefore, in your WHERE clause, you must specify a table alias for each reference to Level_ID
    WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND Level_ID = '" + levelStatus + "'";
    should be
    WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND L.Level_ID = '" + levelStatus + "'"; //ADDED "L." before Level_ID
    Level_ID would have been unique until you added the Level table.
    Good luck.
    -Mark

  • Syntax error in From clause from Access

    I am trying to migrate a database from Access 2000, and all of the tables except one migrate correctly. The one problem table gives me the following error message:
    Unable to migrate table data: NWQ_TANC.PARAMETERS; [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
    Does anyone know how to fix this? I have found the error in the help Appendix, but it just lists it as a QUERY type error, #3131, and gives no explanation or clues on how to fix it.
    Thanks, Jessica

    Hi Jessica
    Just wondering if you ever managed to find a solution to this problem, as I am getting a very similar error - only I don't just get it for one table, I get it for every single table in the database!
    Would be very interested to hear if you managed to sort it or not
    Cheers
    Ed

  • Is there a way to use dynamic built string in the "from" clause

    Hi all, im having one problem and now, im not sure how to solve it easily at all... :) Is there someone that would be so kind and put a eye on it? ..thx
    I have plsql proc, in which i have a list of table_names. For each of that table i need to run a query that will retrieve me a list of values and for each of that value i need to do something.
    If i can be more specific about the problem -> each of that table is built as key_column, value_columns, day,starttime. For a key per table there are 4 records per hour - every quarter. Im truncating those quarters to full-quarter (minutes => 0->14 = 0min; 15->29 = 15min, 30->44 = 30, 45->59=45)
    example
    i get for one key and specific hour four records at 15:01;15:16;15:31;15:46 => i truncate em to 15:00;15:15;15:30;15:45..Sometimes there is a problem with the tool that is generating those data for me, and one quarter could be moved a little - so i get data like 15:01;15:16;15:29;15:46 => after i truncate the times i get duplicates in second quarter. It also can happen like this : 23:00; 23:14; 23:29; 23:44; 23:59 => totaly bad => cos the last one supposed to be as 0:00 next day, ..and 23:14 as 23:15...So...that was a problem - and solution -> i wanted to create plsql that will find those hours in each table i ve defined, and for each problem hour i make some fixes - update the bad time ...
    ..and i have problem - can i put an dynamic built table_name in the "from" clause?
    example how i wanted to do that:
    declare
         type t_objectName     is table of varchar2(030) index     by pls_integer;
         l_tableName              t_objectName;
    begin
    l_tableName(1) := 'tmphlrgl';
    l_tableName(2) := 'tmprcfgl';
    l_tableName(3) := 'tmprcfbs';
    l_tableName(4) := 'tmpvlrgl';
    for i in (select evtime from (select day,trunc_quarter(evtime) evtime,m_id from l_tableName(i) group by day,trunc_quarter(evtime),m_id having count(*)>1) order by evtime) loop
    --some other conditions and the update...
    end loop;
    end;
    /I cannot use the l_tableName(i) for FROM ...get an error...I was thinking to build it as dynamic sql and execute immediate into some kind of object that can store mutliple lines, from which i would in the FOR cycle get the data...But im not sure if this could be done in plsql...
    thanks for your time and help..
    d.

    declare
    c sys_refcursor;
    begin
    for i in 1..4 loop
    open c for 'day,trunc_quarter(evtime) evtime,m_id
    from ' || l_tableName(i) ||
    'group by day,trunc_quarter(evtime),m_id having
    count(*)>1) order by evtime';Just to high light SELECT is missing that all
    OPEN c FOR ' SELECT day,trunc_quarter(evtime) evtime,m_id
              FROM' || l_tableName(i) ||
    'GROUP BY day,trunc_quarter(evtime),m_id  HAVING  count(*)>1)   ORDER BY evtime';

  • Is it possible to create a view where table in the From clause changes name

    is it possible to create a view from a from a table like this
    create view my_view as select id, col1, col2, result from <<my_latest_cacahe_table>>;
    the table in the from clause changes the name .
    I have another table which indicates the the latest name of my cache tables. Always there are two records there. The latest one and previous one.
    select * from cache_table_def
    table_name cache_table_name refresh_date
    my_table cache_table245 1/23/2012
    my_table cache_table235 1/22/2012
    create table cache_table_def (table_name varchar2(25), cache_table_name varchar2(25), refresh_date date);
    insert into cache_table_def values( 'my_table','cache_table245','23-jan-2012');
    insert into cache_table_def values ( 'my_table','cache_table546','22-jan-2012');
    create table cache_table245 (id number, col1 varchar2(50), col2 varchar2(20), result number);
    insert into cache_table245 values(1, 'test123', 'test345',12.12);
    insert into cache_table245 values (2, 'test223', 'test245',112.12);
    create table cache_table235 (id number, col1 varchar2(50), col2 varchar2(20), result number);
    insert into cache_table235 values (1, 'test123', 'test345',92.12);
    insert into cache_table235 values (2, 'test223', 'test245',222.12);
    what I need to do is find the latest cache_table name for my_table and use that in my view defintion
    When user select from the the view it always reurns the data from the latest cache_table
    is it possible to do something like this in oracle 11g?
    I have no control on the cache tables names. that is why I need to use the latest name from the table.
    Any ideas really appreciated.

    I've worked up an example that does what you ask. It uses the SCOTT schema EMP table. Make two copies of the EMP table, EMP1 and EMP2. I deleted dept 20 from emp1 and deleted dept 30 from emp2 so I could see that the result set really came from a different table.
    -- create a context to hold an environment variable - this will be the table name we want the view to query from
    create or replace context VIEW_CTX using SET_VIEW_FLAG;
    -- create the procedure specified for the context
    - we will pass in the name of the table to query from
    create or replace procedure SET_VIEW_FLAG ( p_table_name in varchar2 default 'EMP')
      as
      begin
          dbms_session.set_context( 'VIEW_CTX', 'TABLE_NAME', upper(p_table_name));
      end;
    -- these are the three queries - one for each table - none of them will return data until you set the context variable.
    select * from emp where 'EMP' = sys_context( 'VIEW_CTX', 'TABLE_NAME' );
    select * from emp1 where 'EMP1' = sys_context( 'VIEW_CTX', 'TABLE_NAME' );
    select * from emp2 where 'EMP2' =  sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    -- this is how you set the context variable depending on the table you want the view to query
    exec set_view_flag( p_table_name => 'EMP' );
    exec set_view_flag( p_table_name => 'EMP1' );
    exec set_view_flag( p_table_name => 'EMP2');
    -- this will show you the current value of the context variable
    SELECT sys_context( 'VIEW_CTX', 'TABLE_NAME' ) FROM DUAL
    -- this is the view definition - it does a UNION ALL of the three queries but only one will actually return data
    CREATE VIEW THREE_TABLE_EMP_VIEW AS
    select * from emp where 'EMP' = sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    union all
    select * from emp1 where 'EMP1' = sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    union all
    select * from emp2 where 'EMP2' =  sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    -- first time - no data since context variable hasn't been set yet
    SELECT * FROM THREE_TABLE_EMP_VIEW
    -- get data from the EMP table
    exec set_view_flag( p_table_name => 'EMP' );
    SELECT * FROM THREE_TABLE_EMP_VIEW
    -- get data from the EMP2 table
    exec set_view_flag( p_table_name => 'EMP2');
    SELECT * FROM THREE_TABLE_EMP_VIEW
    For your use case you just have to call the context procedure whenever you want to switch tables. You can union all as many queries as you want and can even put WHERE clause conditions based on other filtering criteria if you want. I have used this approach with report views so that one view can be used to roll up report data different ways or for different regions, report periods (weekly, quarterly, etc). I usually use this in a stored procedure that returns a REF CURSOR to the client. The client requests a weekly report and provides a date, the procedure calculates the START/END date based on the one date provided and sets context variables that the view uses in the WHERE clause for filtering.
    For reporting it works great!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • CAN I PASS A TABLE NAME AS A VARIABLE IN THE FROM CLAUSE?

    For some reason, I am trying to use a variable name containing the actual table name in the from clause and it won't allow me. I keep getting the error saying I need to declare the variable I'm using eventhough I've used it in another statement that is not the FROM clause.
    Example
    SELECT count(col1), sum(col2)
    FROM v_table_name;
    v_table_name was declared as:
    v_tablename VARCHAR2(20);
    v_tablename := real_table_name;
    Is it not allowed to use variables in the FROM clause or am I missing something here?

    You can use the Forms "From Clause Query" as the datasource for the data block. Then you can change the QUERY_DATA_SOURCE_NAME using set_block_property, so you can use any SQL statement you like. Of course you must name/alias the columns in a consistent manner so that the number of database items on the block matches those being queried.

  • CASE in the FROM clause ?

    Hello, I need to query a table which (unfortunately) its name is depended on the date. (Year, Month, and every 15 days (Fortnight FN)
    My tables is STAT_VEHICLES_YY_MM and if it refers to the fortnight report it becomes STAT_VEHICLES_YY_MM15
    For example this fortnight (15 of July report) will be STAT_VEHICLES_09_0815 and the 1st of this month report was on STAT_VEHICLES_09_08 table.
    My query so far is:
    ACCEPT YY prompt 'Please enter current year in YY format:'
    ACCEPT MM prompt 'Please enter current month in the MM format:'
    SELECT COUNT(*) "STAT VEH. NEW LIC."
    FROM STAT_VEHICLES_&YY._&MM
    WHERE NR=3;
    I tried using something like
    ACCEPT FN prompt 'Is this a fortnight report? (Y/N): '
    SELECT…
    FROM
    CASE
    WHEN &FN = Y THEN STAT_VEHICLES_&YY._&MM.15
    WHEN &FN = y THEN STAT_VEHICLES_&YY._&MM.15
    WHEN &FN = N THEN STAT_VEHICLES_&YY._&MM
    WHEN &FN = n THEN STAT_VEHICLES_&YY._&MM
    END
    WHERE…
    But I don’t think that CASE will work in the FROM clause
    My next though is OUTER JOIN and here is where I need your help people.
    Thank you

    Obviously this is extreemly poor design, and it should have been implemented by partitioning 1 table.
    In that case Oracle would have automatically choosen the right partition!!!
    What you can do is
    column table_name new_value tablename
    ACCEPT YY prompt 'Please enter current year in YY format:'
    ACCEPT MM prompt 'Please enter current month in the MM format:'
    select stat_vehicles_&YY._&MM table_name
    from dual;
    select count(*)
    from &_table_name
    where nr=3;
    You would need to use &_table_name everywhere.
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • I want to use a dynamic schema name in the from clause but its not working.

    DECLARE
         vblQueryName VARCHAR2(20);
         vblSchemaName VARCHAR2(20);
    BEGIN
         SELECT CurrentSchemaName INTO vblSchemaName FROM HR_989_SCHEMA;
         vblQueryName:='060_525_020';
         INSERT /*+ APPEND(HP_ELIGIBILITIES,4) */ INTO HP_ELIGIBILITIES
              LVL1ID,
              LVL1Desc,
              LVL2ID,
              LVL2Desc,
              LVL3ID,
              LVL3Desc,
              LVL4ID,
              LVL4Desc
         SELECT /*+ PARALLEL(a,4) */
              LVL1ID,
              LVL1Desc,
              LVL2ID,
              LVL2Desc,
              LVL3ID,
              LVL3Desc,
              LVL4ID,
              LVL4Desc
         FROM
         bold     vblSchemaName.HP_ELIGIBILITIES a
         WHERE
              UPPER(LVL2ID) = 'XX' ;
         COMMIT;
    DBMS_OUTPUT.PUT_LINE( 'Query Executed: ' || vblqueryName);
    INSERT INTO HP_QUERYEXECLOG(QueryName) VALUES(vblQueryName);
    EXCEPTION WHEN NO_DATA_FOUND THEN NULL;
    END;
    I want to create a rules table so that the schema name in front of the table name in the from clause can be controlled by a separate table that is maintained but its not working . Help and your valuable inputs needed for this issue

    I want to use a dynamic schema name in the from clauseyou can alternatively set the current schema as e.g. in:
    declare
       vblqueryname    varchar2 (20);
       vblschemaname   varchar2 (20);
    begin
       select currentschemaname into vblschemaname from hr_989_schema;
       vblqueryname := '060_525_020';
       execute immediate 'alter session set current_schema=' || vblschemaname;
       insert /*+ APPEND(HP_ELIGIBILITIES,4) */
             into hp_eligibilities (lvl1id,
                                    lvl1desc,
                                    lvl2id,
                                    lvl2desc,
                                    lvl3id,
                                    lvl3desc,
                                    lvl4id,
                                    lvl4desc
          select /*+ PARALLEL(a,4) */
                lvl1id,
                 lvl1desc,
                 lvl2id,
                 lvl2desc,
                 lvl3id,
                 lvl3desc,
                 lvl4id,
                 lvl4desc
            from hp_eligibilities a
           where upper (lvl2id) = 'XX';
       commit;
       dbms_output.put_line ('Query Executed: ' || vblqueryname);
       insert into hp_queryexeclog (queryname)
       values (vblqueryname);
    exception
       when no_data_found
       then
          null;
    end;

  • Subquery in the From Clause

    I have a query the contains a subquery in the from clause. The problem is how to join one of the tables in the subquery to one of the main tables. If I hard a value, the query runs, but using a table.column produced an "invalid column name" error.
    Examples of both are below.
    This one works
    SELECT a.pay_rate, a.bill_rate, a.frequency, c.value
    FROM SYSADM.ps_pb_wkord_sq_rte a, SYSADM.ps_md_erncd_action b,
    SELECT DISTINCT z.value
    FROM SYSADM.ps_md_erncd_action z
    WHERE z.md_action = 'CALC_BURD' AND
    z.system_id = 'PB' AND
    z.erncd = 'REG' AND **This is the line in question**
    z.effdt = (
    SELECT MAX(z_ed.effdt)
    FROM SYSADM.ps_md_erncd_action z_ed
    WHERE z.setid = z_ed.setid AND
    z.erncd = z_ed.erncd AND
    z.effdt = z_ed.effdt AND
    z.system_id = z_ed.system_id AND
    z.md_action = z_ed.md_action AND
    z_ed.effdt <= TO_DATE('04/01/2001','MM/DD/YYYY'))) c
    WHERE a.erncd = b.erncd AND
    b.effdt = (
    SELECT MAX(b_ed.effdt)
    FROM SYSADM.ps_md_erncd_action b_ed
    WHERE b.setid = b_ed.setid AND
    b.erncd = b_ed.erncd AND
    b.effdt = b_ed.effdt AND
    b.system_id = b_ed.system_id AND
    b.md_action = b_ed.md_action AND
    b_ed.effdt <= TO_DATE('04/01/2001','MM/DD/YYYY')) AND
    a.group_id = 'PSD01' AND
    a.workorder_no = 'H00034758' AND
    a.assignment_no = 'H00034758-001' AND
    b.system_id = 'PB' AND
    b.md_action = 'EARN_TYPE' AND
    b.value = 'R';
    This one produces the error
    SELECT a.pay_rate, a.bill_rate, a.frequency, c.value
    FROM SYSADM.ps_pb_wkord_sq_rte a, SYSADM.ps_md_erncd_action b,
    SELECT DISTINCT z.value
    FROM SYSADM.ps_md_erncd_action z
    WHERE z.md_action = 'CALC_BURD' AND
    z.system_id = 'PB' AND
    z.erncd = a.erncd AND **This is line in question**
    z.effdt = (
    SELECT MAX(z_ed.effdt)
    FROM SYSADM.ps_md_erncd_action z_ed
    WHERE z.setid = z_ed.setid AND
    z.erncd = z_ed.erncd AND
    z.effdt = z_ed.effdt AND
    z.system_id = z_ed.system_id AND
    z.md_action = z_ed.md_action AND
    z_ed.effdt <= TO_DATE('04/01/2001','MM/DD/YYYY'))) c
    WHERE a.erncd = b.erncd AND
    b.effdt = (
    SELECT MAX(b_ed.effdt)
    FROM SYSADM.ps_md_erncd_action b_ed
    WHERE b.setid = b_ed.setid AND
    b.erncd = b_ed.erncd AND
    b.effdt = b_ed.effdt AND
    b.system_id = b_ed.system_id AND
    b.md_action = b_ed.md_action AND
    b_ed.effdt <= TO_DATE('04/01/2001','MM/DD/YYYY')) AND
    a.group_id = 'PSD01' AND
    a.workorder_no = 'H00034758' AND
    a.assignment_no = 'H00034758-001' AND
    b.system_id = 'PB' AND
    b.md_action = 'EARN_TYPE' AND
    b.value = 'R';
    Any help is greatly appreciated.
    Thanks,
    JD Lippard

    Hi JD,
    your code is very difficult to read to i will give you some general information.
    SELECT t1.c1,t1.c2
    FROM table t1
    , (SELECT t2.col1 alias1
    , t2.col2 alias2
    , a.s.o.
    FROM anytable t2
    ) tablealias
    WHERE t1.c1 = tablealias.alias1
    You can select any columns inside this 'dynamic view' whichever you need for a join. Independent if you print them or not.
    But you cannot join INSIDE this dynamic view to outer tables like
    SELECT t1.c1,t1.c2
    FROM table t1
    , (SELECT t2.col1 alias1
    , t2.col2 alias2
    , a.s.o.
    FROM anytable t2
    WHERE t1.c2 = t2.col2
    ) tablealias
    WHERE bla
    Maybe it helps a bit.
    Cheers,
    Udo

  • 10g Form - Can i invoke ms word within the from?

    Hi everybody, I would appreciate if someone out there can help me with it......
    On the form i have an ID Field.
    I have a master MS Word file on the network drive.
    Firstly
    I have a button on the form. When pressed it should be able to create a New Folder on the network drive with the name of the folder same as ID Field. At the sametime it should copy the Master MS Word file and put it in the newly created folder.
    Secondly
    I want to open this Ms word file in the newly created folder within the 10g form and not run outside the form.
    Kindly help........
    irfi

    Hi Francoise, Thank you for your reply.
    The MS Word file resides on a shared folder on the server and doesnt get stored in the database (Independent of the database).
    What i actually need is to be able to do 4 actions with a trigger on the button: meaning when the button is clicked it should:-
    1- Create a new folder on the server
    2- Copy the Original Master File to newly created folder.
    3- The name of the folder to be the same as the ID Filed which is binded to a table.
    4- To open the Ms Word file from the newly created folder within the oracle form and not like i have done in vb (Shell to open outside).
    I have done this similar project in vb6 (Kindly have a look)
    ServerFolderPath = "\\servername\foldername"
    Private Sub Cmdsave_Click()
    Dim Qry As String
    Dim Re As New Recordset
    Qry = "select * From IDRegistration where IDNo = '" & TxtIDNo.Text & "'" '(SQL Table)
    If EditID = False Then
    Re.Open Qry, DB, adOpenDynamic, adLockOptimistic
    If Re.RecordCount > 0 Then
    MsgBox "File with same ID Exists", vbInformation
    Else
    fso.CreateFolder ServerFolderPath & IDNo
    fso.CopyFile ServerFolderPath & "one.doc", ServerFolderPath & IDNo & "\" & IDNo & ".Doc" '(one.doc is the master file)
    Shell "c:\Program Files\Microsoft Office\Office11\winword.exe " & ServerFolderPath & IDNo & "\" & IDNo & ".doc", vbMaximizedFocus
    End If
    Please advice Thanks for your time!
    irfi

  • Using a Procedure in the FROM clause of a query

    Is it possible to use a Procedure that accepts multiple parameters and returns multiple parameters in the FROM section of a query?
    I have a Procedure that formats a postal address from BS7666 format into an Oracle Apps friendly format.
    I'd like to be able to select the data from the source, feed it through this procedure and output it as part of a Materialised View.
    PROCEDURE Format_llpg_Address
    In_Loc IN VARCHAR2,
    In_Description IN VARCHAR2,
    In_County IN VARCHAR2,
    In_Town IN VARCHAR2,
    In_PostTown IN VARCHAR2,
    In_Saon_Start_num IN NUMBER,
    In_Saon_Start_Suffix IN VARCHAR2,
    In_Saon_End_num IN NUMBER,
    In_Saon_End_Suffix IN VARCHAR2,
    In_Saon_Text IN VARCHAR2,
    In_Paon_Start_num IN NUMBER,
    In_Paon_Start_Suffix IN VARCHAR2,
    In_Paon_End_num IN NUMBER,
    In_Paon_End_Suffix IN VARCHAR2,
    In_Paon_Text IN VARCHAR2,
    In_PostCode IN VARCHAR2,
    Out_Address1 OUT NOCOPY VARCHAR2,
    Out_Address2 OUT NOCOPY VARCHAR2,
    Out_Address3 OUT NOCOPY VARCHAR2,
    Out_Town OUT NOCOPY VARCHAR2,
    Out_County OUT NOCOPY VARCHAR2,
    Out_PostCode OUT NOCOPY VARCHAR2)
    Many Thanks,
    Jason.

    You should look at [pipelined functions|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/tuning.htm#i52954]
    Adrian Billington has a number of excellent articles on pipelined functions.
    Here's a [link to one of them|http://www.oracle-developer.net/display.php?id=207]
    Edited by: dombrooks on Oct 12, 2009 4:45 PM

  • Two variables in the name of a table in the FROM clause.

    Hello,
    I ve got a problem making this work:
    SELECT *
    FROM tablename_YY_MM
    (This is part of the script I need to use YY and MM in various tables)
    I need to find a way so the script will ask me every time about the YY and MM
    For example the current table name is "tablename_09_08" next month it will be "tablename_09_09"
    It looks simple but I can't make it work. It seems to be a problem with concatanation || and the underscore _
    Looks like it should be done with PL/SQL ?
    If anyone can help it will be much appreciated.
    Thank you.
    Edited by: user1067236 on Aug 11, 2009 2:21 AM
    Edited by: user1067236 on Aug 11, 2009 2:23 AM

    Hi,
    That's easy to do using substitution variables in SQL*Plus:
    SELECT  *
    FROM    tablename_&year_num._&month_num;Note the . after &year_num; it is necessary to indicate that the next _ is not part of the preceding name.
    You can also use the SQL*Plus ACCEPT command to prompt the user for values, with a detailed message.
    ACCEPT  year_num  PROMPT "Please enter year number (2 digits only, such as 09): "Edited by: Frank Kulash on Aug 11, 2009 5:29 AM

  • How to do where clause within the where clause?

    Hello.
    I have had a look in the previous postings, OWB help and user guide - and can't seem to find how to do the following in OWB:
    insert into table A (col1, col2, etc)
    (select col1, col2 etc from table B where col2 is (select col3 from table C where col3 = 'I'));
    Filter doesn't want to cope with this. Key lookup - doesn't want to cope with this either.
    If you know how to do it - please help. It is a vry simple query ( i always seem to be struggling with simple stuff and all the fancy stuff works fine!) :) but i don't know how to do it in OWB. Double-filter somehow? Is there some wonderful operator somewhere that i am not using to a full potential?
    Thank you very much for all your help and support
    Warmest Regards
    Vix

    insert into table A (col1, col2, etc)
    (select col1, col2 etc from table B where col2 = 'I');
    Hi Arnab :)
    If only!
    The query looks like this:
    insert into table A (col1,col2)
    select (col1,col2) from table B
    where col2 in (select col3 from table C where col3 = 'I'));
    hope it makes sense. It should only insert records into table A from table B if records have corresonding entry in table C and this one ofthe attrubutes of this entry = 'I'.
    I am trying to convince here that we should be using more views so hopefully i would be able to; joiner is too cluncky and not as fast. As for now i solved it with:
    function that check if col2 has corresponding rec in table C then passed either value or null into filter. Filter then compares the two and if value is not null - it will insert this record from table A into table B. Phew!
    BTW - i am now trying to get an answer to this misterious java.lang.exeption (my other topic) as soon as i hear anything - will keep you posted.
    Thank you very much for all your help and understanding.

  • SELECT statement in FROM clause - syntax help

    Hi,
    I want to have a SELECT statement in the FROM clause. I get syntax error when doing this and since I am new to ABAP I need som help.
    I want to do the following, (and if anyone has any SELECT statement from their own system which you know there is no syntax error in please post it here so I can analyze the syntax):
    *I leave the INTO itab clause out, since I only want to demonstrate the functionality
    I am trying to get.
    <b>SELECT</b> tableOne~someField
    <b>FROM</b> tab <b>AS</b> tableOne (<b>SELECT</b> someField
                                         <b>FROM</b> tab
                                         <b>WHERE</b> someFiled > 1) <b>AS</b> tableTwo
    <b>WHERE</b> tableOnesomeField > tableTwosomeField
    like I said, the problem is that the select statement in the parenthesis in the from clause seems to be incorrect because I get "wrong expression" when trying to compile. Is this because I cannot have a select statement in the from clause or is it because of a minor syntax error, such as I forgot a dot, or some other sign?
    thanks and regards
    Baran

    sorry i am not enough familiar with sub queries but some error i can see which i will state here.
    1> you have to use sub queries i.e. select in ( ) after where clause because here you are fulfilling a where clause by another select statement.
    like this
    SELECT * FROM SFLIGHT
        INTO WA
        WHERE SEATSOCC = ( SELECT MAX( SEATSOCC ) FROM SFLIGHT ).
    2> you cannot specify field name without into clause either you have to use
    select *  or select f1 into tab-f1  like this...
    but if you are using select * without into you have to define
    tables : dbtab.
    selec * from dbtab. like that.
    regards
    shiba dutta

Maybe you are looking for