Best way to query on a non-table item?

Hi,
I have a form that has customer_name (non-table item) and customer_id (table item). Customer_id is not visible to the user. We need to be able to query on the customer_name. I have tried using the pre-query trigger but I get an error ORA-01422. Any suggestions would be appreciated. I am a non-technical person, so the simpler, the better.
Thanks in advance.
Trish

Hi ,
I know two alternatives:
1) Use the POST-QUERY trigger not the PRE-QUERY... But, you would have the same problem because i think that the customer_id column is not unique. So you should select a combination of columns which guarantee the uniqueness of the selected column...
2)Other design. Read the doc at :
http://www.oracle.com/technology/products/forms/pdf/BlockOnAJoin.pdf
Using this way you should not use the trigger POST-QUERY....
Regards,
Simon

Similar Messages

  • Best way to import data to multiple tables in oracle d.b from sql server

    HI All am newbie to Oracle,
    What is the Best way to import data to multiple tables in Oracle Data base from sql server?
    1)linked server?
    2)ssis ?
    If possible share me the query to done this task using Linked server?
    Regards,
    KoteRavindra.

    check:
    http://www.mssqltips.com/sqlservertip/2011/export-sql-server-data-to-oracle-using-ssis/
          koteravindra     
    Handle:      koteravindra 
    Status Level:      Newbie
    Registered:      Jan 9, 2013
    Total Posts:      4
    Total Questions:      3 (3 unresolved)
    why so many unresolved questions? Remember to close your threads marking them as answered.

  • What is the best way to query planned orders or work orders for make items and identify the buy component that is short for supply and vice versa?

    What is the best way to query planned orders or work orders for make items and identify the buy component that is short for supply and vice versa?

    What is the best way to query planned orders or work orders for make items and identify the buy component that is short for supply and vice versa?

  • Contacts Sync - I have my contacts on iphone5 and MacBook Pro 2012.  I just purchased a MacBook Air 2013 and want the same contacts on that device.  What is the best way to do this?  Non-techie.  Thanks

    I have my contacts on iphone5 and MacBook Pro 2012.  I just purchased a MacBook Air 2013 and want the same contacts on that device.  What is the best way to do this?  Non-techie.  Thanks

    Follow the instructions for enabling your iCloud account on the MBAir here >  Apple - iCloud - Learn how to set up iCloud on all your devices.

  • Best way to declare and use internal table

    Hi all,
    As per my knoledge there are various techeniques (Methods) to declare and use the internal tables.
    Please Suggest me the Best way to declaring and using internal table ( WITH EXAMPLE ).
    Please Give the reason as well how the particular method is good ?
    What are benefits of particular method ?
    Thanks in advance.
    Regards
    Raj

    Hello Raj Ahir,
    There are so many methods to declare an internal table.
    Mainly I would like to explain 2 of them mostly used.
    1. Using Work Area and
    2. With header line.
    This with header line concept is not suggestable, because, when we shift the code to oops concept.. it doesn't work... Because OOPS doesn't support the Headerline concept...
    But it all depends on the situation.
    If you are sure that your program doen't make use of the OOPs concept, you can use HEADER LINE concept. If it invols OOPs use WORK AREA concept.
    Now I'l explain these two methods with an example each...
    1. Using Work area.
    TABLES: sflight.
    DATA: it_sflight TYPE TABLE OF sflight.
    DATA: wa_sflight LIKE LINE OF it_sflight.
    SELECT *
      FROM sflight
      INTO it_sflight
      WHERE <condition>.
      LOOP AT it_sflight INTO wa_sflight.
        WRITE / wa_sflight.
      ENDLOOP.
      In this case we have to transfer data into work area wa_sflight.
    We can't access the data from the internal table direclty without work
    area.
    *<===============================================
    2. Using Header line.
      DATA: BEGIN OF it_sflight OCCURS 0,
              carrid LIKE sflight-carrid,
              connid LIKE sflight-connid,
              fldate LIKE sflight-fldate,
            END OF it_sflight.
      SELECT *
        FROM sflight
        INTO it_sflight
        WHERE <condition>.
        LOOP AT it_sflight INTO wa_sflight.
          WRITE / wa_sflight.
        ENDLOOP.
    In this case we can directly access the data from the internal table.
    Here the internal table name represents the header. for each and every
    interation the header line will get filled with new data. If you want to
    represnent the internal table body you can use it_sflight[].
    *<======================================================
    TYPES: BEGIN OF st_sflight,
             carrid LIKE sflight-carrid,
             connid LIKE sflight-connid,
             fldate LIKE sflight-fldate,
           END OF st_sflight.
    DATA: it_sflight TYPE TABLE OF st_sflight,
          wa_sflight LIKE LINE OF it_sflight.
    This is using with work area.
    DATA: it_sflight LIKE sflight OCCURS 0 WITH HEADER LINE.
    This is using header line.
    <b>REWARD THE POINTS IF IT IS HELPFUL.</b>
    Regards
    Sasidhar Reddy Matli.
    Message was edited by: Sasidhar Reddy Matli
            Sasidhar Reddy Matli

  • Best way of partitioning the huge size table in oracle 11gr2

    hi,
    OS: linux
    DB: oracle 11gR2
    table size is about 2T and single table space with multiple dbf files in ASM,
    table partition with dbms.redefinition is running past 2 days (range partition).. its running but not that fast..
    note: exchange partition is too slow.. hence not used..
    what is the best way of doing the huge size table partition. please suggest, thanks.

    >
    what is the best way of doing the huge size table partition
    >
    A few questions
    1. Is that an OLTP or OLAP table?
    2. Is all of the data still needed online or is some of it archivable?
    3. What type of partitiioning are you doing? RANGE? LIST? COMPOSITE?
    4. Why do you you say 'exchange partition is too slow' - did you do a test?
    For example if data will be partitioned by create date then one stragety is to initially put all existing data into the root partition of a range partitioned table. Then you can start using new partitions for new incoming data and take your time to partition the current data.

  • How to value non-table items in Forms

    Portal 3.0.7.6.2 on NT
    I am trying to display non-table items on a Form. I want to do things like: Display the Credit Card Type (non-table item) based on the Credit Card Number (table column). Use a foreigh key (table column) to retrieve related data for display/information only on the Form. The doesn't appear to be p_session variables for these 'added' Form items so I can't use the p_session functions. Any ideas??? I'd prefer a PL/SQL solution.

    Hi Michael,
    As Dmitry said that values for non table form field cannot be displayed completely using pl/sql, u can use some pl/sql and some javascript to achieve this .
    Say, take the example of the Emp table where I would like to display the department name for the deptno. Here I'll use pl/sql to retrieve the value of department name using the deptno and use javascript to display the results in the new field added to the form.
    Steps :
    1> Create a form say, on the emp table
    2> In the field formatting section, add a new item of the type text box and add a javascript event onFocus and give the foll javascript function call for the same :-
    javascript:getval(this)
    3> In the additional pl/sql section, for the "after displaying page ..." part we'll add the following pl/sql code :-
    declare
    l_dno number(4) default null;
    l_desc varchar2(100);
    begin
    l_dno := p_session.get_value_as_NUMBER
    (p_block_name => 'DEFAULT',
    p_attribute_name => 'A_DEPTNO',
    p_index => 1);
    if l_dno is not null then
    begin
    select dname into l_desc
    from scott.dept
    where deptno = l_dno;
    exception
    when others then
    null;
    end ;
    end if;
    htp.p('<script>');
    htp.p('function getval(ele){'&#0124; &#0124;chr(10)&#0124; &#0124;
    'ele.value = "'&#0124; &#0124;nvl(l_desc,' ')&#0124; &#0124;'";}');
    htp.p('</script>');
    end;
    4> Run the form and perform a query. Place the cursor on the desc field after the page reloads with results. The department name would come up.
    Hope this helps.

  • Lov in non-tables-items

    I have a problem.
    i need a LOV in a non-table-items.
    Is this possible in Designer 2.1.1 using Headstart?
    Using forms its very simple.
    How i do this using Headstart?
    Thanks
    null

    In a pre-query trigger alter the where clause of the main block to query the main table based on non-database values...
    Use the set_block_property procedure and the 'DEFAULT_WHERE' clause or the 'ONETIME_WHERE' property...
    example...
    set_block_property('MYBLOCK', ONETIME_WHERE,
    'where main_table.id in (
    select id from my_non_db_block_table where mycol = :my_non_db_field)');
    To accept wild cards you will probably have to change the = to a "like" above..
    You will have to build your where clause by adding a "and" condition for each non-db field.
    Message was edited by:
    Mark Reichman

  • What is the best way is to create a web app item collection which will contain only the listings where addressstate="ABC".

    What is the best way is to create a web app item collection which will contain only the listings where addressstate="ABC".

    How many systems have you used Robert?
    This is the only system you can not have all item data at least in JSON format and all of it. Big commerce has a lower limit and as I have said in every post related to a limit - I understand the function, but you can still make the requests as just one example (front and back)
    Same with API Robert.
    Firstly - the SOAP API request on say products gets you ALL the products, if you do something through a REST API request you can  make the requests to get all the items to complete your process of what your doing - You have to otherwise the API is pointless.
    Ok if the normal modules can not iterate through if there is a module_data solution, and web apps will get there hopefully sooner then later and you do have the sql query (where) for your filter which is great BUT, if you want to implement a solution across everything you cant do that with the liquid implementation.
    This also flows through to the JSON everywhere in concept which is fundamentally flawed for the same reason... And again referring other like services where a hard API has a limit but the JSON request returns everything.
    How those work varies from the method of request, some will only update every day, xxx time (Depending on cost of the plan) so its a cached version of data, to the ones that limit that request to x number of times per set time/day.
    That is how the actual rest of the world works, varied solutions but they are solutions. BC know they have a few limitations, there clearly is the need for things, there are a varied set of options... It is just a matter of engaging in it and offering up a solution for it, silence just creates frustration.

  • How to set_value for non-table items.

    I have a form, based on scott.emp, with a button and three fields, empno, ename and xxx. The empno and ename fields are based on the scott.emp table, whereas the xxx field is a non-table based field.
    Setting xxx text type to either a text area or text box makes no difference.
    The following code in the buttons PL/SQL Button Event Handler, Custom section results in a (WWV-00000) error.
    begin
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_XXX',
    p_value => 'Hello');
    end;
    However, if I change the p_value to ename, a table based item, the code works as expected.
    I ran across a post that had the following link
    Re: transactions
    Regarding setting values for non-table items. Unfortunately, the post was made prior to the latest discussion forum reorganization, so it's no longer valid.
    I would appreciate any help on the problem.
    Thanks, Larry

    Hi,
    Try using set_value_as_string
    begin
    p_session.set_value_as_string(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_XXX',
    p_value => 'Hello');
    end;
    Thanks,
    Sharmila

  • Best way to give tablename in create table statement

    hi all,
    what's the best way to give table name while "create statement" in case of performance.. 
    for eg:
    create table tablename(id int,name varchar(20))
    a.) tablename
    b.) [tablename]
    c.) (tablename)
    d.) "tablename"
    pls its urgent..
    thanks in advance..
    lucky

    >b.) [tablename]
    As Naomi pointed it out, the above is dangerous because unintentionally special characters or space can be included and accepted by SQL Server.
    Once you introduce special characters in the table name, you have to use [....] forever.
    Related QUOTENAME:
    http://technet.microsoft.com/en-us/library/ms176114.aspx
    a is the best choice.
    Kalman Toth Database & OLAP Architect
    SELECT Video Tutorials 4 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Best way to set up a custom table using dates ytd, quarters, months

    Hello-
    I did post this on the crystal forum however it really involves setting up a good structured table in order to get the data to report on which I think we need to change which is why I'm posting here.
    I am not a dba but I work with crystal reports and we are working together to get data in tables that we can report on.  We are in the process of creating a data warehouse, which will mainly be summarized data we are exporting out of our legacy system and importing into a mysql database.  Most of this data will be summarized by month, quarter and year.  We will have multiple years of data.  A lot of the reports we will be creating will be in a comparison manner such as 2009 vs 2008 or Jan this year compared to Jan last year or list out sales by month Jan-Dec 2009.  I would like this data to be easily displayed on a report in a side by side manner.  To get this result, what is the best way to structure the data in the tables on a monthly, quarterly and yearly basis?  Right now weu2019ve got one field in the table called date (which is a string) which is listed like:
    Date
    2008YTD
    2009YTD
    2009Jan
    2008Jan
    Is it best to break out the date information so that on the report side it will be easier to work with?  Also should this be set up in the table as a date instead of a string?  If so how do you account for a YTD date?  Are we going to need 2 dates, a start and end date to achieve ytd or qtd information?  Do you recommend creating just a date table and if so how would that be structured?
    So for reporting purposes, using crystal reports, I would like to display comparison data on a report side by side, for this example this year goals compared to last years goals by goal code A-Z (which is a credit code, goals are for the # of credits by code for the year).  The end result I would like is to look like this:
    code   2009 goal   2008 goal
    A        25              20
    B        50              60
    C        10              15
    However the data looks like this (displaying all of the 2009 data first then the 2008 data, not side by side which is how it is in the table):
    code   2009 goal   2008 goal
    A        25
    B        50
    C        10
    etc to Z
    A                          20
    B                          60
    C                          15
    Right now the data is structured in the table like:
    Code  Goal  Date (this is currently a string in the db)
    A        25     YTD 2009
    B        50     YTD 2009
    etc. A-Z for 2009 then:
    A        20      YTD 2008
    B        60      YTD 2008
    Any thoughts on strucuting a table would be appreciated.  thanks.

    Jennifer,
    Most of the DW examples I've seen use a dimDateTime table in the database. That table has multiple columns related to the specific time... For example, here are the columns that are in the, SQL Server sample database, "AdventureWorkdDW"... "DimTime" table
    COLUMN_NAME             COLUMN_INFO
    TimeKey               (int, not null)
    FullDateAlternateKey     (datetime, null)
    DayNumberOfWeek          (tinyint, null)
    EnglishDayNameOfWeek     (nvarchar(10), null)
    SpanishDayNameOfWeek    (nvarchar(10), null)
    FrenchDayNameOfWeek     (nvarchar(10), null)
    DayNumberOfMonth     (tinyint, null)
    DayNumberOfYear          (smallint, null)
    WeekNumberOfYear     (tinyint, null)
    EnglishMonthName     (nvarchar(10), null)
    SpanishMonthName     (nvarchar(10), null)
    FrenchMonthName          (nvarchar(10), null)
    MonthNumberOfYear     (tinyint, null)
    CalendarQuarter          (tinyint, null)
    CalendarYear          (char(4), null)
    CalendarSemester     (tinyint, null)
    FiscalQuarter          tinyint, null)
    FiscalYear          (char(4), null)
    FiscalSemester          (tinyint, null)
    Then all of the fact table receive their date stamps by linking back to this table, using the TimeKey as a foreign key.
    HTH,
    Jason

  • What is the best way to connect MBP 13" - (non retina) to HDMI TV input

    What is the best way to connect MBP 13" late 2012 - (non retina) to HDMI TV input
    ...To get Video and Audio? With one cable ...
    I'm seeing that the "rocketfish" adapter is not handling the job (from these forums).
    I enjoy watching youtube videos, hulu, etc on the big screen through my laptop. The other Windows laptops I'ved had from Sony, HP, Dell, all had HDMI and was easy peasy.
    I don't have the patience to buy and return 10 different types of adaters (nor would Best Buy appreciate that)
    Thank you!

    Look for something like this:
    http://www.amazon.com/Cable-Matters-Premium-DisplayPort-Thunderbolt/dp/B004CADY9 I/ref=sr_1_6?ie=UTF8&qid=1356715728&sr=8-6&keywords=cable+displayport+to+hdmi
    Ciao.

  • Best way to compare data of 2 tables present on 2 different servers

    Hi,
    We are doing data migration and I wil like to compare data between 2 tables which are present on 2 different server. I know to find the difference i can go for minus or full outer join and by creating the database link.
    But my problem is the volume of the data. The tables under consideration has approximately 40-60 columns and number of rows in each tables are around 60-70 million. Also both the tables are on 2 diffferent servers.
    I would like to know
    1] What will be the best way to compare the data and print the difference from performance perepective? I know that if I am going for DB links then its will definitely impact the performance as the tables are across 2 different servers.
    2] Is it advisable to go for using SQL - PL/SQL for this kind of senario or dump the data in flat files and use C or C++ code to find the difference.
    Regards,
    Amol

    Check this at asktom.oracle.com. Search for "Marco Stefanetti" and follow the few posts between Marco and Tom. As far as your tables being on separate servers, you could consider dumping the data to file and using external table or using CTAS ( create table as select ) to get both tables locally.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2151582681236

  • Best way to get data from multiple table

    hi
    i would like to know which is the best way of getting the data in the final table from multiple read statements which are inside loop.
    for exm
    loop at itab.
    read ....
    read....
    read....
    read ....
    data into final_itab
    endloop.
    thanx
    manoj

    Hi.....
    Say we are having two data base tables.. ZMODEL1 and ZMODEL2...
    Now decalre intrenal tables and work areas and before that structures for these two and also declare one final output table for display the data...
    >types: begin of ty_model1,
    >       za(10),
    >       zb type netwr,
    >       zc(10),
    >       zd(10),
    >       ze(10),
    >       zf(10),
    >       end of ty_model1,
    >       begin of ty_model2,
    >       za1(10),
    >       zb1(10),
    >       zc1(10),
    >       zd1(10),
    >       za(10),
    >       end of ty_model2,
    >       begin of ty_output,
    >       za(10),
    >       zb type netwr,
    >       zc(10),
    >       zd(10),
    >       ze(10),
    >       zf(10),
    >       za1(10),
    >       zb1(10),
    >       zc1(10),
    >       zd1(10),
    >       end of ty_output.
    >
    >data: t_model1 type standard table of ty_model1 initial size 0,
    >      t_model2 type standard table of ty_model2 initial size 0,
    >      t_output type standard table of ty_output initial size 0,
    >      w_model1 type ty_model1,
    >      w_model2 type ty_model2,
    >      w_output type ty_output.
    Now in the start of selection.. event...
    >select <field names in the same order as in database table> from zmodel1 into table t_model1 where za in s_comp. (s_comp is select-option for that field)>
    >if sy-subrc = 0.
    >select <field names in the same order as in database table> from zmodel2 into table t_model2 for all entries in t_model1 where za = >t_model1-za.
    >endif.
    After that now fill the final output table...
    >loop at t_model1 into w_model1.
    >  w_output-za = w_model1-za.
    >  w_output-zb = w_model1-zb.
    >  w_output-zc = w_model1-zc.
    >  w_output-zd = w_model1-zd.
    >  w_output-ze = w_model1-ze.
    >  w_output-zf = w_model1-zf.
    >
    >read table t_model2 into w_model2 with key za = w_model1-za.
    >if sy-subrc = 0.
    >  w_output-za1 = w_model2-za1.
    >  w_output-zb1 = w_model2-zb1.
    >  w_output-zc1 = w_model2-zc1.
    >  w_output-zd1 = w_model2-zd1.
    >endif.
    > append w_output to t_output.
    > clear w_output.
    > end loop.
    and now display the final out table...
    This is the best way..
    Thanks,
    Naveen.I

Maybe you are looking for

  • Where are iPoto modified files stored on my computer?

    When I go to Music/iTunes/, I can find a subfolder that includes many subfolders of Albums, Artist names, and the songs I put into iTunes. Same thing with email files. When I go to Pictures/: I can see an iPhoto Library icon (but no /subfolders) whic

  • Speed of mouse double click controls also finder

    I was wondering why my new macbook pro responded slower than my imac. Then I came across this: When I single-click on a folder that I haven't opened for weeks. The time that it takes the finder to show the content of a folder is affected by the setti

  • Some quick feedback on Flex 3

    This is my second day with Flex 3 (a first-time user of Flex), and this is my second day of trying out Flex 3, so, bear with me if I don't seem to know what I'm talking about. Because I'm particularyly interested in data interaction I picked the "Wor

  • My new virus program loaded into internet explorer, how do I get on my Mozilla too?

    I have Explorer and Mozilla on my computer. When I loaded a new virus program it went to the explorer and not Mozilla. I use Mozilla and only use Explorer as a back up if Mozilla is down. If I can not have the virus program on both how do I move it t

  • Whiteness of background in iOS 8

    is anyone else experiencing problems with the whiteness of the background in iOS 8?