Search SQL question

I have install a SQL db in my application and research works really well.  I have the onTextChanged and onTextChanging the value:

datasource.query = "Select * from items where name like searchtext.text"

I'm basically the database load and charging based on the modification of search text.

Issue I'm having is that when the user deletes a search term and that the field is empty or when I put the empty search text when he takes the object textfield visible = false.

After that, every time I try to add or update the database my app hangs.  I tried to define the list of database to refresh / reload on closign the textfield, but that doesn't seem to help.

Any idea what I can do?

Found the issue to be a bit more complicated than just my search query.  It ends up being because my list of the index was out of range.  For more information consult the solution in this thread for how I solved it and answers: http://supportforums.blackberry.com/t5/Native-Development/quot-Index-out-of-range-quot-error-on-sear...

Tags: BlackBerry Developers

Similar Questions

  • the basic sql question

    Hi all I have a basic sql question
    Watch below two querries
    1.  select 1 from dual where 1 in (select 1 from dual union all select null from dual) 
    
    It gives output  as 1
    
    but below one 
    
    2.   select 1 from dual where 1 not in  (select 2 from dual union all select null from dual)
    
    It gives output as no data found 
    I think as operator will not compare with all the values, but not the outcome it will compare with all values... When comparing with the value null, the result is automatically null

    I'm wrong
    Please help me on this

    and why performance wise in operator is more better than no of?

    Thanks to all in advance

    Thanks for posting your explain plan command

    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3249215828
    
    -----------------------------------------------------------------------------
    | Id  | Operation        | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    -----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |          |     2 |     6 |     4   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS    |          |     2 |     6 |     4   (0)| 00:00:01 |
    |   2 |   FAST DUAL      |          |     1 |       |     2   (0)| 00:00:01 |
    |   3 |   VIEW           | VW_NSO_1 |     2 |     6 |     2   (0)| 00:00:01 |
    |   4 |    SORT UNIQUE   |          |     2 |       |     2   (0)| 00:00:01 |
    |   5 |     UNION-ALL    |          |       |       |            |          |
    |   6 |      FAST DUAL   |          |     1 |       |     2   (0)| 00:00:01 |
    |*  7 |      FILTER      |          |       |       |            |          |
    |   8 |       FAST DUAL  |          |     1 |       |     2   (0)| 00:00:01 |
    -----------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       7 - filter(NULL IS NOT NULL)
    
    02:12:54 SQL> select 1 from dual where 1 not in  (select 2 from dual union all select null from dual);
    Elapsed: 00:00:00.01
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3291682568
    
    -----------------------------------------------------------------
    | Id  | Operation        | Name | Rows  | Cost (%CPU)| Time     |
    -----------------------------------------------------------------
    |   0 | SELECT STATEMENT |      |     1 |     4   (0)| 00:00:01 |
    |*  1 |  FILTER          |      |       |            |          |
    |   2 |   FAST DUAL      |      |     1 |     2   (0)| 00:00:01 |
    |   3 |   UNION-ALL      |      |       |            |          |
    |*  4 |    FILTER        |      |       |            |          |
    |   5 |     FAST DUAL    |      |     1 |     2   (0)| 00:00:01 |
    |   6 |    FAST DUAL     |      |     1 |     2   (0)| 00:00:01 |
    -----------------------------------------------------------------
    
  • Apex SQL question - weeks of the month

    I have a sql question.
    I want to create a dynamic list.

    If the user select may2009, then I want a dynamic list of show

    04/27/2009-05/03/2009
    05/04/2009-05/10/2009
    05/11/2009-05/17/2009
    05/18/2009-05/24/2009
    05/25/2009-05/31/2009

    If the user selects Jun 2009, then the list will be
    06/01/2009-06/07/2009
    06/08/2009-06/14/2009
    06/15/2009-06/21/2009
    06/22/2009-06/28/2009
    06/29/2009-07/05/2009

    Thank you.

    Using this SQL statement, you can get this list:

    SELECT w_start || ' - ' || w_end d, w_start r
      FROM (SELECT     (week_start_list + (LEVEL - 1) * 7) + 1 w_start,
                       week_start_list + (LEVEL) * 7 w_end
                  FROM (SELECT TO_CHAR (TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                               'mm'
                                              ),
                                        'IW'
                                       ) week_begin,
                               TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                      'mm'
                                     ) m_begin,
                               TO_CHAR
                                  (TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'), 'mm'),
                                   'd'
                                  ) day_month_begin,
                               TO_CHAR
                                  (TRUNC (ADD_MONTHS (TO_DATE (:my_date,
                                                               'dd.mm.yyyy'
                                                              ),
                                                      1
                                                     ),
                                          'mm'
                                         ),
                                   'IW'
                                  ) week_end,
                               TRUNC (ADD_MONTHS (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                                  1
                                                 ),
                                      'mm'
                                     ) m_end,
                               TO_CHAR
                                  (TRUNC (ADD_MONTHS (TO_DATE (:my_date,
                                                               'dd.mm.yyyy'
                                                              ),
                                                      1
                                                     ),
                                          'mm'
                                         ),
                                   'd'
                                  ) day_month_end,
                                 TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                        'mm'
                                       )
                               - TO_NUMBER
                                          (TO_CHAR (TRUNC (TO_DATE (:my_date,
                                                                    'dd.mm.yyyy'
                                                                   ),
                                                           'mm'
                                                          ),
                                                    'd'
                                                   )
                                          ) week_start_list,
                                 TRUNC
                                    (ADD_MONTHS (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                                 1
                                                ),
                                     'mm'
                                    )
                               + TO_NUMBER
                                    (TO_CHAR
                                        (TRUNC
                                              (ADD_MONTHS (TO_DATE (:my_date,
                                                                    'dd.mm.yyyy'
                                                                   ),
                                                           1
                                                          ),
                                               'mm'
                                              ),
                                         'd'
                                        )
                                    )
                               - 1 week_end_list
                          FROM DUAL)
            CONNECT BY LEVEL <=
                          (SELECT   TO_NUMBER
                                       (TO_CHAR
                                           (TRUNC
                                               (ADD_MONTHS (TO_DATE (:my_date,
                                                                     'dd.mm.yyyy'
                                                                    ),
                                                            1
                                                           ),
                                                'mm'
                                               ),
                                            'IW'
                                           )
                                       )
                                  - TO_NUMBER
                                          (TO_CHAR (TRUNC (TO_DATE (:my_date,
                                                                    'dd.mm.yyyy'
                                                                   ),
                                                           'mm'
                                                          ),
                                                    'IW'
                                                   )
                                          )
                             FROM DUAL))
    

    It is a question of SQL and has nothing to do with the Apex.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • running of SQL question

    Hi expert,


    When I ran after SQL, error message reads "table or view does not exist" pointing to the table "dba_tab_cols" and "dba_all_tables". There is no other question for this statement, because if I changed table "user_tab_cols" and "user_all_tables", it works well.


    declare
    v_old_table DBA_tab_columns.table_name%type;
    v_where Varchar2 (4000);
    Boolean v_first_col: = true;
    type rc is ref cursor;
    c rc;
    v_rowid varchar2 (20);
    Val varchar2 (50): = "Test note";

    Start
    for r in)
    Select
    t.*
    Of
    dba_tab_cols t, dba_all_tables a
    where t.table_name = a.table_name
    and t.data_type like '% CHAR % '.
    and a.owner = 'QA'
    order by t.table_name loop)

    If v_old_table is null then
    v_old_table: = r.table_name;
    end if;

    If v_old_table <>r.table_name then
    v_first_col: = true;

    -dbms_output.put_line ('search' | v_old_table);

    Open c for ' select rowid from ' ' |. ' v_old_table | '" ' || v_where;

    extract the c in v_rowid;
    loop
    When the output c % notfound;
    dbms_output.put_line (' rowid: ' | v_rowid |) "in" | v_old_table);
    extract the c in v_rowid;
    end loop;

    v_old_table: = r.table_name;
    end if;

    If v_first_col then
    v_where: = 'where ' | r.column_name | "as" %' | Val | '%''';
    v_first_col: = false;
    on the other
    v_where: = v_where | "or" | r.column_name | "as" %' | Val | '%''';
    end if;

    end loop;
    end;


    But if I choose these DBA tables in the toad sql Editor, it works well, I am currently using my own credentials, not the administrator credentials. why he get different effects running in these two ways?

    Thank you very much

    >

    Hello

    When I ran after SQL, error message reads "table or view does not exist" pointing to
    Table 'dba_tab_cols' and 'dba_all_tables '. There is no other question for this statement, because

    If I changed table "user_tab_cols" and "user_all_tables", it works well.
    But if I choose these DBA tables in the toad sql Editor, it works well, I am currently using my own
    credentials, not the administrator credentials. why he get different effects running in these two ways?

    You answered your own question - you know that you have the administrator privileges when you
    Open a session under your own credentials - but your id user obviously does TOAD.

    You use SQL * for the query that fails?

    BTW, you do not give us your version of Oracle - you must always tell us what it is

    Please read the forum FAQ and also the thread "sticky" by BluShadow at the top of the list of positions
    on the forum homepage. These forums are an excellent resource - you will get the best out of them if
    you follow the instructions.

    HTH,

    Paul...

    Published by: Paulie July 24, 2012 16:40

  • SQL question on natural joins

    I am a newbie to SQL and I studied the book of Fundamentals SQL Server Oracle OCA 12 c, but a section on natural joins to confuse me.

    Basically, the author says:

    SELECT r.region_name, d.department_name, l.city, c.country_name

    DEPARTMENTS d

    NATURAL JOIN places l, c countries, regions r;

    The natural join between DEPARTMENTS and LOCATIONS creates a provisional result, consisting of 27 lines since they are implicitly attached on the column of location_id. This set is then Cartesian-joined to the table of the COUNTRY as a join condition is not implicitly or explicitly specified. 27 interim lines are attached to 25 lines in the COUNTRY table, which gives a new temp results set with 675 (27 × 25) rows and three columns: DEPARTMENT_NAME, CITY and COUNTRY_NAME. This set is then attached to the REGION table. Once more, a Cartesian join occurs because column REGION_ID is absent from any join condition. The final result set contains rows and four columns (675 × 4) 2700.

    I can understand because you evaluate joins from the left. But then he wrote:

    The JOIN... USE and JOIN... ON the syntaxes are better suited to join multiple tables. The following query joins four tables using the natural join syntax:

    SELECT country_id region_id, c.country_name, l.city, d.department_name

    DEPARTMENTS d

    NATURAL JOIN places l

    NATURAL JOIN country c

    NATURAL JOIN region r;

    This query generates correctly 27 lines in the final results set since the required join columns are listed in the SELECT clause. The following query illustrates how the JOIN... CLAUSE is used to extract the same 27 lines. A join condition can reference columns only in its scope. In the following example, the join of DEPARTMENTS slots can not reference columns in the COUNTRIES or REGIONS of tables, but the join between the COUNTRIES and REGIONS may refer to any column of four tables involved in the query.

    This second method of the part of the natural writing joined confuses me. I don't understand the logic behind the 2nd series of States of Natural Join. For me, it seems that the first series and the 2nd set look alike, but they are apparently not.

    Can someone tell me the differences?

    Thank you!!

    Hello

    The more important thing to learn more about NATURAL JOIN is: never use it.  If you add new columns, joins can get different results.  I've never heard of someone uisng NATURAL JOIN apart from a manual or a question like yours.

    There are a lot of things in Oracle that take the time to learn and are useful.  All the time you spend learning things is better spent on them.

  • SQL * PLUS connects with SQL &gt; question

    People,

    I'm confused on the command. / sqlplus with Oracle database.

    According to my understanding,. / sqlplus connected with SQL > using option 3: sysdba, sysoper, sysasm.

    I connect with SQL > to run the rel853.sql script to create a table PSOPRDEFN but a field "OPERPSWDSALT" did not appear in the table PSOPRDEFN although it is in the Create Table statement.

    I connect with SQL * in the directory/home/user/OracleDB_Home/bin as below:


    $ export SYSTEM_PASS = AccessId/mypass

    $ export ORACLE_HOME = / home/user/OracleDB_Home

    $ export ORACLE_SID = HRCS90

    $. / lsnrctl start LISTENER

    $. / AccessId/mypass sqlplus as sysdba

    SQL > startup

    SQL > @/opt/PT8.53/scripts/rel853.sql

    SQL > select OPERPSWDSALT in the AccessId.PSOPRDEFN;

    It returns: "OPERPSWDSALT": invalid identifier.


    I checked the table PSOPRDEFN that the OPERPSWDSALT field did not appear in the table PSOPRDEFN.

    I tried the sysoper option as below:

    $. / sqlplus AccessId/mypass as sysoper

    SQL > startup

    SQL > @/opt/PT8.53/scripts/rel853.sql

    SQL > select OPERPSWDSALT in the AccessId.PSOPRDEFN;

    It returns: "OPERPSWDSALT": invalid identifier.

    The sysoper error is the same thing with sysdba error.

    I tried the sysasm option as below:

    $. / sqlplus AccessId/mypass as sysasm

    He returned: connection refused.


    Someone told me this connection as SYS causes this error. If not a sysdba, sysoper, or sysasm, use the command. / sqlplus AccessId/mypass cannot connect with SQL >.


    My question is:


    First of all, why is what OPERPSWDSALT did not appear in the PSOPRDEFN table while it is in the CREATE TABLE statement?


    Seocond, if not use SYS which is one of the 3 options, how to run the command. / sqlplus AccessId/mypass to connect with SQL > so that CREATE TABLE PSOPRDEFN correctly?

    Thank you.

    user8860348 wrote:

    People,

    Hello. Thanks much for the reply. I just do the commands below:

    $ export SYSTEM_PASS = AccessId/mypass

    $ export ORACLE_HOME = / home/user/OracleDB_Home

    $ export ORACLE_SID = HRCS90

    $. / lsnrctl start LISTENER

    $. / AccessId/mypass sqlplus as sysdba

    SQL > show user;

    Its release: the USER is "SYS".

    SQL > connect AccessId/mypass

    Its output:

    Error: ORA - 01034:ORACLE not available

    ORA-27101: shared memory realm does not exist

    64 - Linux_x86 error: no such file or directory.

    As we see above, unable to connect to the Oracle database AccessId.

    My question is:

    What to do on AccessId, so that it can connect to the Oracle database?

    Thank you.

    so much for the use that you refuse to actually use COPY it PASTE & so that we can see the whole session.

    In the past, you did

    > SQL > startup

    Maybe the database is out of order & must be started.

    do exactly as below (line by line)

    ID

    sqlplus

    / as sysdba

    startup

    connect AccessId/mypass

    COPY the results from above then PASTE all back here

  • SQL question to get a top customer of the page

    Hi all
    I'm prasanna. I have a question about SQL, to get a customer based on name of the year and the customer. I wrote the request like this. But I got an error.

    Select calendar_year, cust_first_name, max (sum (amount_sold)) in sale, the time the customers where sales.cust_id = customers.cust_id and times.time_id = sales.time_id of the calendar_year group, cust_first_name

    The error is like this:

    * Error from the 1 in the command line:
    Select calendar_year, cust_first_name, max (sum (amount_sold)) in sale, the time the customers where sales.cust_id = customers.cust_id and times.time_id = sales.time_id of the calendar_year group, cust_first_name
    Error in the command line: 1 column: 7
    Error report:
    SQL error: ORA-00937: not a function of simple-group
    00937 00000 - 'not a single-group function. "
    * Cause:
    Action:

    Thank you inadvace
    Kind regards
    Prasanna

    865016 wrote:
    Your response, I had only one top customer with year, name of the client, amount_sold. But I need for each year

    select  calendar_year,
            cust_first_name,
            total_amount_sold max_amount_sold
      from  (
             select  calendar_year,
                     cust_first_name,
                     sum(amount_sold) total_amount_sold,
                     row_number() over(partition by calendar_year order by sum(amount_sold) desc) rn
               from  sales,
                     times,
                     customers
               where sales.cust_id=customers.cust_id
                 and times.time_id=sales.time_id
               group by calendar_year,
                     cust_first_name
            )
      where rn = 1
    / 
    

    I will give you a single customer by calendar_year.

    SY.

  • SQL question for a beginner...

    I have the following structure:

    NUMBER OF PROCESSING_ITEM_ID
    NUMBER OF PROJECT_ITEM_FK
    START_TIME DATE
    END_TIME DATE
    NUMBER OF WORKSTATION_FK

    examples of data

    81,23,10-27-2010 08:00, 27/10/2010 10:00, 3
    42,1,10-27-2010 08:00, 27/10/2010 11:00, 1
    22,23,10-27-2010 13:00, 27/10/2010 17:00, 2
    1,23,10-27-2010 15:00, 27/10/2010 16:00, 1
    23,23,10-27-2010 17:00, 27/10/2010 20:00, 2

    I'm trying to divide the data into lines of an hour. If this line we would be divided into:

    81,23,10-27-2010 08:00, 27/10/2010 09:00, 3
    81,23,10-27-2010 09:00, 27/10/2010 10:00, 3

    third row would be divided into:

    22,23,10-27-2010 13:00, 27/10/2010 14:00, 2
    22,23,10-27-2010 14:00, 27/10/2010 15:00, 2
    22,23,10-27-2010 15:00, 27/10/2010 16:00, 2
    22,23,10-27-2010 16:00, 27/10/2010 17:00, 2

    The statement that is made should display the data in this way...

    John Brewer
    City of Seattle

    Question delicate John, you should ask this in the SQL forums

    This is the query

    with temp AS
         (
          SELECT 81 PROCESSING_ITEM_ID,23 PROJECT_ITEM_FK,TO_DATE('10-27-2010 08:00','MM-DD-YYYY HH24:MI') start_date,TO_DATE('10-27-2010 10:00','MM-DD-YYYY HH24:MI') end_date,3 WORKSTATION_FK from dual
          UNION ALL
          SELECT 22 PROCESSING_ITEM_ID,23 PROJECT_ITEM_FK,TO_DATE('10-27-2010 13:00','MM-DD-YYYY HH24:MI') start_date,TO_DATE('10-27-2010 17:00','MM-DD-YYYY HH24:MI') end_date,2 WORKSTATION_FK from dual
          )
        ,time_span AS
        (
         SELECT MAX( TO_NUMBER(TO_CHAR(end_date,'HH24')) - TO_NUMBER(TO_CHAR(start_date,'HH24')) ) TIME_SPAN
         FROM temp
        )
        ,time_period_rows AS
       (
        SELECT level-1 PERIOD FROM time_span connect by level <= TIME_SPAN
       )
    SELECT T.PROCESSING_ITEM_ID,T.PROJECT_ITEM_FK,TO_CHAR(T.start_date+TR.PERIOD/24,'MM-DD-YYYY HH24:MI') start_time,TO_CHAR(T.start_date+(TR.PERIOD+1)/24,'MM-DD-YYYY HH24:MI') end_time ,T.WORKSTATION_FK
    FROM  temp T
         ,time_period_rows TR
    WHERE PERIOD <= TO_NUMBER(TO_CHAR(end_date,'HH24')) - TO_NUMBER(TO_CHAR(start_date,'HH24'))
    ORDER BY T.PROCESSING_ITEM_ID,TR.PERIOD
    

    Output

    PROCESSING_ITEM_ID     PROJECT_ITEM_FK     START_TIME     END_TIME     WORKSTATION_FK
    22     23     10-27-2010 13:00     10-27-2010 14:00     2
    22     23     10-27-2010 14:00     10-27-2010 15:00     2
    22     23     10-27-2010 15:00     10-27-2010 16:00     2
    22     23     10-27-2010 16:00     10-27-2010 17:00     2
    81     23     10-27-2010 08:00     10-27-2010 09:00     3
    81     23     10-27-2010 09:00     10-27-2010 10:00     3
    81     23     10-27-2010 10:00     10-27-2010 11:00     3
    

    I used a view inline as data source ( temp ), you can change this to your table, name (then remove the display online)

  • Sql question judging

    Sorry guys, didn't know where otherwise put this hope so much he is allowed to post here. I currently have a field in my database that stores the date and time, however, I write a statemenet sql and need to use only the date of the datetime object, which would be the correct syntext to sowould I should use to_char etc.?

    Thank you.

    Not a question of forms, but a database.

    But check this for format masks: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements004.htm

  • PL/SQL question (which is wrong)?

    Hello
    I read a book that has of the following statement

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

    DECLARE
    type instructor_info is MADE
    (name, instructor.first_name%type,
    instructor.last_name%type last_name,
    number of sections);
    rv_instructor instructor_info;
    BEGIN
    Select rtrim (i.first_name),
    RTrim (i.last_name),
    Count (*)
    the instructor,.
    s section
    in rv_instructor -.first_name, rv_instructor.last_name, rv_intructor.sections
    where i.instructor_id = s.instructor_id
    and i.instructor_id = 102
    I.first_name group, i.last_name;
    dbms_output.put_line (' instructor ' | rv_instructor.first_name |') '|| rv_instructor.last_name |', teaches ' | rv_instructor.sections | 'section (s)');

    exception
    When no_data_found then
    dbms_output.put_line ('there no such instructor');

    END;

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

    And the writer asks:

    Explain what is declared in the previous example. Describe what happens to the record and explain how this translates into the output.
    I look at the answers, and he says, that by operating, this example produces the following output:
    Instructor Tom Wojick, teaches 9 item (s).

    My question is that when I execute this example, he produced me the following error.


    ORA-06550: line13, Column2:
    PL/SQL: ORA-00933: SQL not correctly completed command
    ORA-06550: framework8, Column2
    PL/SQL: SQL statement ignored.


    I tried the following:

    Rv_instructor instructor_info % rowtype;

    Or

    In rv_instructor.first_name, rv_instructor.last_name, rv_intructor.sections


    But the same error.

    What's wrong?

    Thank you very much.

    INTO clause would come before FROM clause.

    Pass by ' this doc once...

    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/selectinto_statement.htm#LNPLS01345

    Kind regards
    Prazy

  • What kind of pl sql questions can you expect for a customer technical interview

    Please notify all experienced professionals

    What kind of questions can I expect in the customer facing interview technical I have to a PL SQL Developer with interview of performance tuning. The customer is primarily a financial project.

    Yes of course I would essentially tell me about the projects that you been involved in based on who they ask the questions, basically I'm not very experienced 3 years and my experience involves performance limited tuning, to develop scripts to support front-end web applications.

    What kind of questions (you do not need to enumerate the issues specifically, it would be useful that you could advise the areas where I should look into, all the links where I can read about the region suggest you also face a customer interview).
    Example: Financial transaction processes much as treatment so I have to prepare for any question on the changing Table, blocking.
    Also, I am aware of the Collections, external Tables. These would be discussed.

    Any advice would be very helpful.
    My experience does not imply strongly any financial experience and job specification does not state so I got through the 2 first interview series. It would be a disadvantage if I said that I have had no experience of finanicial, I guess just by hearing from some sources that the customer is finance.
    I would be hired only if the customer agrees, so I need to deepen as much as possible, it's time to prepare for good trying to inform.

    Kind regards.

    Rider wrote:

    My experience does not imply strongly any financial experience and job specification does not state so I got through the 2 first interview series. It would be a disadvantage if I said that I have had no experience of finanicial, I guess just by hearing from some sources that the customer is finance.

    Personally, when I interview candidates PL/SQL, the least important thing for me is real business knowledge. I want to rather a competent PL/SQL Developer who knows his stuff, a person having poor skills of PL/SQL and a good knowledge of the company.

    We will pay that person for PL/SQL capabilities - and not knowledge of business (that of why we have analysts and managers of project and team leaders). Remember that the code ' + financial + "is no different code" + detail + "-the same language is used. The same concepts. The same methods to solve problems. As the problems you are dealing with a level of PL/SQL are technical - where business issues have already been processed by analysts and architects at a higher level.

    I expect, however, that such a developer will resume business over time knowledge. But I don't see it as any kind of precondition.

  • Dynamic SQL question. What are these apostrophes for?

    Here is a solution provided by Boneist in the two questions relating to a so-called simple dynamic SQL thread
    declare
    v_rs date;
    
    begin
    for i in (select table_name from user_tables)
         loop
         execute immediate 'select last_analyzed from user_tables where table_name = ''' || i.table_name||''''  into v_rs;
         dbms_output.put_line(i.table_name ||'----'||v_rs);
    end loop;
    end;
    When a tablename is extracted, it should be in single quotes as "DEPT". My question is about the quotes surrounding i.table_name (three quotes on the left) and 4 quotes on the right of the concatenation
    ''' || i.table_name||''''
    First quote on the left is the final quote from SELECT (' select last_analyzed)

    Second quote from left to right - I think this is the quote from beginning to the name of the table ("DEPT)

    Quote from third starting on the left -?



    I have not understant what 4 quotes on the right of the concatenation of c. I know one of them is the quotation from the end (right) for the name of the table (like DEPT')

    JOE_humble wrote:
    When a tablename is extracted, it should be in single quotes as "DEPT". My question is about the quotes surrounding i.table_name (three quotes on the left) and 4 quotes on the right of the concatenation

    Actually 4 quotes on the left quotation marks and 4 right...

    execute immediate 'select last_analyzed from user_tables where table_name = ''' || i.table_name||''''  into v_rs;
                      ^                                                         ^^^                  ^^^^
                      |                                                         |||                  ||||
                       \________________________________________________________///                  \||/
                                                  |                                                   \|
                                                4 quotes                                            4 quotes
    

    Maybe better if you look at it like this...

    Suppose we use a character # to indicate the beginning and the end of our strings...

    execute immediate #select last_analyzed from user_tables where table_name = ''# || i.table_name||#''#  into v_rs;
    

    Now, you can see that we have two strings concatenated with the variable string representing the table name concatenated together.

    Within each of these channels, we have two single quotes. When the parser crosses the two single quotes like this, in the string, which converts a quotation mark in the resulting string, rather than taking this means the end of the string itself.

  • using 'like' to search for multiple words in the search sql sentence

    HI, at the moment I have a cfquery as follows

    < name cfquery = 'test' datasource = "" #datasource # "cachedwithin =" #CreateTimeSpan (0,1,0,0) #">"
    SELECT * to #tablename # where nom_entree is not null and (nom_entree like ' %#keyword #% ')
    order of sequencename
    < / cfquery >

    If the EntryName fiield is for example 'Shepton Mallett', it will be back if I search 'Shepton' or "Mallett" or 'Shepton Mallett', however if I spell 1 word of the search expression erroneous "i.e Shepton Mallatt", he finds no results. I realize that I have to split the sentence search and search on these two words, but not very well what is the right way to do it. I also wanted to strip of common words (IE, a, etc.) of the expression of research if it does not return loads of results. I prefer to keep if possible in sql (not verity)

    Thank you very much

    Oli

    Thank you, perfect

  • Update sql question back

    When I used the updated syntax, return always seems to be the total number of rows in the table updated (not updated lines):


    create table a18 (identification number, name varchar2 (10));
    create table b18 (identification number, name varchar2 (10));

    Insert in b18 values (1, 'A');
    Insert in b18 values (2, 'B')

    insert into A18 (id) values (1);
    insert into A18 (id) values (11);

    Select * from a18;
    name identity
    1
    11

    Select * from b18.
    name identity
    2B
    2B

    update of a18 set a18.name = (select b18.name from b18 where b18.id = a18.id)

    2 lines update


    Select * from a18
    name identity
    2B
    11

    Question: why it returns "2 rows updated" while it is only a line update?

    I tested with SQL Server 2005/2008 and the behavior is the same (2 rows affected).

    Published by: Modeler on May 19, 2009 16:59

    Published by: Modeler on May 19, 2009 17:02

    Your UPDATE statement has no WHERE clause, then it will update with each row in the table. It is one of the lines is being updated at the same value that it had before the update. But you still incur any overhead due to update the block, writing appropriate UNDO and REDO the vectors, etc. for the line that you update without changing.

    Justin

  • Some SQL questions.

    Hello friends,

    I have a few questions.
    1. what sql statement returns the name and the maximum size of the data file in the database?
    2. how to find the location of the trace files database using the data dictionary?
    3. which database view and column shows the number of validations has done a user session?
    4. How do you change the oracle default database block size, without recreating the database?

    5 What is poorly stated or right, so bad... that is wrong with this query.
    SELECT column1 from tableABC including NOT IN (select Column1 from tableXYZ);

    6. What is the most effective way to write this statement?
    7. How do you determine that the new application is more effective than the original query?

    Hello

    + 1. What sql statement returns the name and the maximum size of the data file in the database? +

    SELECT file_name, bytes
    FROM dba_data_files
    WHERE IN (SELECT MAX (bytes) bytes
    FROM dba_data_files)

    + 2. How to find the location of the trace files database using the data dictionary? +
    With the help of the parameter $ v

    For example, select name, value of the parameter $ v
    WHERE name like ('% dest');

    3. which database view and column shows the number of validations has done a user session?

    + 4. How to change the size of the oracle default database block, without re-creating the database? +

    Database block size is not editable once database created, however depending on your version, do you use
    block of different size avaiable in oracle version db_4k_cache_szie, db_8K_cache_size (not if your default block size is 8K), db_16k_cache_size

    + 6. What is the most effective way to write this statement? +
    7. How do you determine that the new application is more effective than the original query?

    EXPLAIN_PLAN running on query and analysis cost timing. Simply also check how long it took the request to return the result;), the formula gross to discover the effective application

    Concerning

Maybe you are looking for

  • Not touch event timestamp in milliseconds

    Touch horodateurs event seem to be in microseconds instead of milliseconds. The test page prints below touchstart and timestamps touchstart event in the box. http://www.apprisant.com/tab/TS.html

  • Cannot turn off option "sleep and fresh."

    I can't turn off the option "sleep" and fresh. I did not need, and it disrupts the functioning of my scanner. Apparently, we should have two types of USB ports: with the sign 'Flash' (used for the options 'sleep... ") and normal. I have on the left s

  • iTunes gel

    With the help of iTunes 12.3.2.35. OS X El Capitan 10.11.2 This unfortunately persistent problem was in the Bay for several months, but has recently picked up. If iTunes is nothing other than the display of "songs", the program will freeze with the r

  • Acer Aspire M1641 Desktop. Rear audio jacks have a 7.1 surround. I need manual for audio jacks.

    Above is a close-up photo of the audio input/output jacks on the rear panel of my desktop PC Acer Aspire M1641-E3750A. I think that this configuration is a 7:1 surround sound system. When I access the manual Acer Aspire from the PC itself, it does ex

  • My HP laptop with vista does not start.

    Vista will not start. Startup Repair says it cannot start automatically. Stuck in a loop without any difficulty.