getting bad results with a query

I have a column with the VARCHAR2 data type name (2) into a table and another table with a column named OFFICER_ZONE with the VARCHAR2 data type (1). What I'm trying to do is to compare these data and then insert it in the second table. But before you insert the data, if the AREA is equal to a number in double digits with a zero in front of her, then I need to CUT 0. If the BOX has a number greater than 9, then I have just these values to NULL. With the query below, I get the upper to 9 zones to be null, which is correct, but I also have those who are the two numbers with a zero not significant, which is not correct.

For example:
Area
1
2
5
07
15
19
14
6
02
d
c
e
b

Results:
Bad area: 07
Bad box: 15
Bad area: 19
Bad box: 14
Bad area: 02

      --ZONE BAD DATA
      IF CR.ZONE NOT IN ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u',
          'v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
          '0','1','2','3','4','5','6','7','8','9')
      THEN
          V_OFFICER_ZONE := NULL; 
          DBMS_OUTPUT.PUT_LINE('ZONE NOT VALID:'||CR.LOCCASENUM||CR.ZONE);
          insert into pursuits.pursuit_exception(case_number,table_name,error_message)
          values(cr.loccasenum,'PURSUIT','Bad Zone: '||v_officer_zone||','||cr.zone);
      ELSE
          V_OFFICER_ZONE := TRIM(LEADING 0 FROM CR.ZONE);
      END IF;
with t as (
           select '1' zone from dual union all
           select '2' from dual union all
           select '5' from dual union all
           select '07' from dual union all
           select '15' from dual union all
           select '19' from dual union all
           select '14' from dual union all
           select '6' from dual union all
           select '02' from dual union all
           select '0' from dual union all
           select '00' from dual union all
           select 'd' from dual union all
           select 'c' from dual union all
           select 'e' from dual union all
           select 'b' from dual
          )
select  zone,
        case
          when length(zone) = 1
            then zone
          when zone between '00' and '09'
            then substr(zone,2)
          else null
        end officer_zone
  from  t
/

ZONE OFFICER_ZONE
---- ------------
1    1
2    2
5    5
07   7
15
19
14
6    6
02   2
0    0
00   0

ZONE OFFICER_ZONE
---- ------------
d    d
c    c
e    e
b    b

15 rows selected.

SQL> 

SY.

Tags: Database

Similar Questions

  • BAD RESULTS WITH OUTER JOINS AND TABLES WITH A CHECK CONSTRAINT

    HII All,
    Could any such a me when we encounter this bug? Please help me with a simple example so that I can search for them in my PB.


    Bug:-8447623

    Bug / / Desc: BAD RESULTS WITH OUTER JOINS AND TABLES WITH a CHECK CONSTRAINT


    I ran the outer joins with check queries constraint 11G 11.1.0.7.0 and 10 g 2, but the result is the same. Need to know the scenario where I will face this bug of your experts and people who have already experienced this bug.


    Version: -.
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production

    Why do you not use the description of the bug test case in Metalink (we obviously can't post it here because it would violate the copyright of Metalink)? Your test case is not a candidate for the elimination of the join, so he did not have the bug.

    Have you really read the description of the bug in Metalink rather than just looking at the title of the bug? The bug itself is quite clear that a query plan that involves the elimination of the join is a necessary condition. The title of bug nothing will never tell the whole story.

    If you try to work through a few tens of thousands of bugs in 11.1.0.7, of which many are not published, trying to determine whether your application would be affected by the bug? Wouldn't be order of magnitude easier to upgrade the application to 11.1.0.7 in a test environment and test the application to see what, if anything, breaks? Understand that the vast majority of the problems that people experience during an upgrade are not the result of bugs - they are the result of changes in behaviour documented as changes in query plans. And among those who encounter bugs, a relatively large fraction of the new variety. Even if you have completed the Herculean task of verifying each bug on your code base, which would not significantly easier upgrade. In addition, at the time wherever you actually performed this analysis, Oracle reportedly released 3 or 4 new versions.

    And at this stage would be unwise to consider an upgrade to 11.2?

    Justin

  • Taking a lot of time to get the result of the query

    Hi all

    The query below takes a long time for results

    select vs.task_name, count(*) fallout_count  from provco.view_stage_history vs
     where record_type in ('TASK')
      and task_name like 'Op-%'
      and vs.line_of_business = 'OPTIONLESS'
    --  and vs.task_due_date > ((sysdate - 146)) and vs.task_due_date is not null
    --  and vs.order_due_date > ((sysdate - 146)) and vs.order_due_date is not null
      and vs.fallout_date > ((sysdate - 146)) and vs.fallout_date is not null
    --  and vs.assignment_date > ((sysdate - 146)) and vs.assignment_date is not null
    --  and upper(vs.install_country_code) like 'US%'
      and vs.ban is not null
    --  and vs.task_name not in ('ASR-Assignment', 'SOR-Assignment')
      group by vs.task_name order by fallout_count desc;
    

    Its takes an hour to get the result. You will find the description of the table and the index below

    CREATE TABLE "PROVCO"."VIEW_STAGE_HISTORY" 
       ( "TASK_ID" NUMBER NOT NULL ENABLE, 
      "ASSIGNMENT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
      "LINE_OF_BUSINESS" VARCHAR2(30 BYTE) NOT NULL ENABLE, 
      "ORDER_ID" NUMBER NOT NULL ENABLE, 
      "ORDER_NUMBER" VARCHAR2(128 BYTE) NOT NULL ENABLE, 
      "ORDER_VERSION" VARCHAR2(15 BYTE) NOT NULL ENABLE, 
      "ORDER_TYPE" VARCHAR2(25 BYTE), 
      "TASK_NAME" VARCHAR2(60 BYTE) NOT NULL ENABLE, 
      "FALLOUT_DATE" TIMESTAMP (6), 
      "JEOP_CODE" VARCHAR2(64 BYTE), 
      "ERROR_CODE" VARCHAR2(64 BYTE), 
      "ERROR_DESC" VARCHAR2(1000 BYTE), 
      "WORKGROUP" VARCHAR2(30 BYTE), 
      "WORKPOOL" VARCHAR2(50 BYTE), 
      "USER_ID" VARCHAR2(32 BYTE), 
      "RECORD_TYPE" VARCHAR2(40 BYTE) NOT NULL ENABLE, 
      "ASSIGNMENT_TYPE" VARCHAR2(40 BYTE), 
      "ORDER_DUE_DATE" TIMESTAMP (6), 
      "COMMIT_DATE" TIMESTAMP (6), 
      "TASK_DUE_DATE" TIMESTAMP (6), 
      "SEED" VARCHAR2(255 BYTE), 
      "BAN" VARCHAR2(100 BYTE), 
      "ORDER_STATUS" VARCHAR2(64 BYTE), 
      "PROJECT_ID" VARCHAR2(20 BYTE), 
      "CUSTOMER_NAME" VARCHAR2(128 BYTE), 
      "CIRCUIT_ID" VARCHAR2(53 BYTE), 
      "SENSITIVITY_LVL" VARCHAR2(10 BYTE), 
      "BANDWIDTH" VARCHAR2(8 BYTE), 
      "WORK_STEP" NUMBER, 
      "MARKETING_APPROVAL_DATE" TIMESTAMP (6), 
      "INSERTED" TIMESTAMP (6), 
      "UPDATED" TIMESTAMP (6), 
      "INSTALL_COUNTRY_CODE" VARCHAR2(3 BYTE), 
      "SOLD_COUNTRY_CODE" VARCHAR2(3 BYTE), 
      "UPSTREAM_ORDER_NUMBER" VARCHAR2(15 BYTE), 
      "SAR_ID" VARCHAR2(15 BYTE), 
      "DUE_DATE_TYPE" VARCHAR2(4 BYTE), 
      "HOTCUT_IND" VARCHAR2(3 BYTE), 
      "MARKET_SEGMENT" VARCHAR2(50 BYTE), 
      "CNTL_TERM" VARCHAR2(25 BYTE), 
      "SVC_ORD_TYPE" VARCHAR2(40 BYTE), 
      "BLENDED_IND" VARCHAR2(1 BYTE), 
      "RELATED_ORDERS" VARCHAR2(100 BYTE), 
      "TERM_ID" VARCHAR2(20 BYTE), 
      "SUB_SVC_ORD_TYPE" VARCHAR2(40 BYTE), 
      "LAST_TASK_NAME" VARCHAR2(40 BYTE), 
      "PRE_OA_STATUS" VARCHAR2(40 BYTE), 
      "TSP_CODE" VARCHAR2(12 BYTE), 
      "ORDER_CATEGORY" NUMBER, 
      "CHANGE_CATEGORY" NUMBER, 
      "COUNTRY_CODE" VARCHAR2(2 BYTE), 
      "RESELLER_ID" VARCHAR2(19 BYTE), 
      "STATUS_CODE" VARCHAR2(32 BYTE), 
      "STATUS_CATEGORY" VARCHAR2(32 BYTE), 
      "PROVISIONING_LOCATION" VARCHAR2(32 BYTE), 
      "INSTALLED_LOCATION" VARCHAR2(32 BYTE), 
      "DATE_ORDERED" TIMESTAMP (6), 
      "CUSTOMER_NAME_ABBR" VARCHAR2(8 BYTE), 
      "CPE_IND" VARCHAR2(1 BYTE), 
      "CUSTOMER_PON" VARCHAR2(20 BYTE), 
      "PRODUCT_ID" VARCHAR2(20 BYTE), 
      "ASR_PON" VARCHAR2(16 BYTE), 
      "ASR_PON_VER" VARCHAR2(3 BYTE), 
      "ASR_TYPE" VARCHAR2(3 BYTE), 
      "ASR_TRAN_TYPE" VARCHAR2(1 BYTE), 
      "PARTNER_CARRIER_ID" VARCHAR2(8 BYTE), 
      "PREMISE_SEQUENCE_NUMBER" VARCHAR2(3 BYTE), 
      "EXPEDITE_IND" VARCHAR2(6 BYTE), 
      "ORDER_SOURCE" VARCHAR2(40 BYTE), 
      "SERVICE_REQ_ID" VARCHAR2(40 BYTE), 
      "SUB_ORDER_VALUE" VARCHAR2(50 BYTE), 
      "SUB_ORDER_TYPE" VARCHAR2(15 BYTE), 
      "PROV_OWNER" VARCHAR2(32 BYTE), 
      "TASC_OWNER" VARCHAR2(32 BYTE), 
      "DM_OWNER" VARCHAR2(32 BYTE), 
      "ORDNBR_TYPE" VARCHAR2(128 BYTE), 
      "WORK_ID" NUMBER, 
      "GARM_TYPE" VARCHAR2(50 BYTE), 
      "USER_TASK_DUE_DATE" TIMESTAMP (6), 
      CONSTRAINT "VIEW_STAGE_HISTORY_PKY" PRIMARY KEY ("TASK_ID", "ASSIGNMENT_DATE")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
      STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "TBS_PROVCO_IDX"  ENABLE, 
      SUPPLEMENTAL LOG GROUP "GGS_211360" ("TASK_ID", "ASSIGNMENT_DATE") ALWAYS
       ) SEGMENT CREATION IMMEDIATE 
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
     NOCOMPRESS LOGGING
      STORAGE(INITIAL 524288 NEXT 524288 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "TBS_PROVCO_DAT" ;
    
    
      CREATE INDEX "PROVCO"."VIEW_STAGE_HISTORY_IDX5" ON "PROVCO"."VIEW_STAGE_HISTORY" ("ORDER_NUMBER", "TASK_NAME") 
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
      STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "TBS_PROVCO_IDX" ;
    
    
      CREATE INDEX "PROVCO"."VSH_INSERTED_IDX" ON "PROVCO"."VIEW_STAGE_HISTORY" ("INSERTED") 
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
      STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "TBS_PROVCO_IDX" ;
    
    
      CREATE INDEX "PROVCO"."VSH_LOB_OT_ON_IDX" ON "PROVCO"."VIEW_STAGE_HISTORY" ("LINE_OF_BUSINESS", "ORDER_TYPE", "ORDER_NUMBER") 
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
      STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "TBS_PROVCO_IDX" ;
    
    
      CREATE INDEX "PROVCO"."VSH_LOB_TN_IDX" ON "PROVCO"."VIEW_STAGE_HISTORY" ("LINE_OF_BUSINESS", "TASK_NAME") 
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
      STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "TBS_PROVCO_IDX" ;
    

    Explain the plan of the query is

    SQL> explain plan for
      2  select vs.task_name, count(*) fallout_count  from provco.view_stage_history vs
     where record_type in ('TASK')
      3    4    and task_name like 'Op-%'
      5    and vs.line_of_business = 'OPTIONLESS'
      6  --  and vs.task_due_date > ((sysdate - 146)) and vs.task_due_date is not null
      7  --  and vs.order_due_date > ((sysdate - 146)) and vs.order_due_date is not null
      8    and vs.fallout_date > ((sysdate - 146)) and vs.fallout_date is not null
      9  --  and vs.assignment_date > ((sysdate - 146)) and vs.assignment_date is not null
     10  --  and upper(vs.install_country_code) like 'US%'
     11    and vs.ban is not null
    --  and vs.task_name not in ('ASR-Assignment', 'SOR-Assignment')
     12   13    group by vs.task_name order by fallout_count desc;
    
    
    Explained.
    
    
    SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'typical cost bytes'));
    
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Plan hash value: 3788003769
    
    
    ------------------------------------------------------------------------------------------------------------
    | Id  | Operation                     | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT              |                    |   191 | 10505 |       |   136K  (1)| 00:27:24 |
    |   1 |  SORT ORDER BY                |                    |   191 | 10505 |  1536K|   136K  (1)| 00:27:24 |
    |   2 |   SORT GROUP BY NOSORT        |                    |   191 | 10505 |       |   136K  (1)| 00:27:24 |
    |*  3 |    TABLE ACCESS BY INDEX ROWID| VIEW_STAGE_HISTORY | 21528 |  1156K|       |   136K  (1)| 00:27:21 |
    |*  4 |     INDEX RANGE SCAN          | VSH_LOB_TN_IDX     |   229K|       |       |  1474   (1)| 00:00:18 |
    ------------------------------------------------------------------------------------------------------------
    
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
    
       3 - filter("VS"."BAN" IS NOT NULL AND "RECORD_TYPE"='TASK' AND "VS"."FALLOUT_DATE">SYSDATE@!-146)
       4 - access("VS"."LINE_OF_BUSINESS"='OPTIONLESS' AND "TASK_NAME" LIKE 'Op-%')
           filter("TASK_NAME" LIKE 'Op-%')
    
    
    18 rows selected.
    

    the view_stage_history table has 19504509

    Please let me know somehow that we can speed up the query above.

    Thank you

    Mani

    How much time does it take if you suggest a full table scan?

  • Can I get some results with the SDK sample debugging?

    Debugging a sample project folder in VB2008 Je couldn't get no results. an InDesign plugin Add?

    There is a close the .exe plugins folder, or you create a file PlugInConfig.txt.

    See "se - started.pdf ' (e.g. page 13 version CS6).

  • Get bad data from mysql query

    The database for the site in question, I built, http://www.socalda.org contains meeting information, General info, location, development and contact.  There are different recordsets for different pages.

    I have pages for meetings on the day of the week, time of day and the counties and cities.

    I just entered a new meeting to my database, and it seems that the details come out correctly.

    I thought that it was pulling the wrong coordinates, but I am now convinced that what actually happens is the layout on my pages, for the results, is bad.

    When I test this SQL query in PHPMyAdmin and Dreamweaver, it works very well.  When I go back to the page it shows only 9 entries.

    I shrugged the 20 rehearsal in the server behaviors tab, and it's always the same.

    Here's the code for that page:

    <? php require_once('Connections/connda.php');? >
    <? PHP
    If (! function_exists ("GetSQLValueString")) {}
    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    If (via PHP_VERSION < 6) {}
    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;
    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}
    case 'text ':
    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';
    break;
    case "double":
    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';
    break;
    case "date":
    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
    break;
    case "set":
    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
    break;
    }
    Return $theValue;
    }
    }

    $maxRows_wed_meet = 20;
    $pageNum_wed_meet = 0;
    If (isset($_GET['pageNum_wed_meet'])) {}
    $pageNum_wed_meet = $_GET ['pageNum_wed_meet'];
    }
    $startRow_wed_meet = $pageNum_wed_meet * $maxRows_wed_meet;

    @mysql_select_db ($database_connda, $connda);
    $query_wed_meet = "SELECT mstr_meeting.NAME, mstr_meeting. ROOM_NAME, TIME_FORMAT(mstr_meeting.start_time,'%l:%i %p') AS TIME, mstr_meeting. DURATION, mstr_meeting. DAY_OF_WEEK, mstr_meeting. MEETING_NOTES, mstr_location. BUILDING_NAME, mstr_location. Adresse_rue, mstr_location. CITY, mstr_location. Zip_code, mstr_location. SPEC_DIRECTIONS, mstr_location. MAP_URL, mstr_contact. CNCT_FNAME, mstr_contact. CNCT_PHONE, group_concat (mstr_feature. DESCR) AS DESCR

    OF (((mstr_meeting INNER JOIN mstr_location ON mstr_meeting.)) LID = mstr_location. COVER)

    LEFT JOIN mstr_meeting_contact ON mstr_meeting. MID = mstr_meeting_contact. (MID)

    LEFT JOIN mstr_contact ON mstr_meeting_contact. CID = mstr_contact. CID)

    LEFT JOIN mstr_meeting_feature ON mstr_meeting. MID = mstr_meeting_feature. (MID)

    LEFT JOIN mstr_feature ON mstr_meeting_feature. FID = mstr_feature. DIF)

    LEFT JOIN mstr_days ON mstr_meeting. DAY_OF_WEEK = mstr_days. DAY

    WHERE mstr_meeting. DAY_OF_WEEK = '' WE. ''

    Mstr_meeting.NAME GROUP, mstr_meeting. ROOM_NAME, mstr_meeting.start_time, mstr_meeting. DURATION, mstr_meeting. DAY_OF_WEEK, mstr_meeting. MEETING_NOTES, mstr_location. BUILDING_NAME, mstr_location. Adresse_rue, mstr_location. CITY, mstr_location. Zip_code, mstr_location. SPEC_DIRECTIONS, mstr_location. MAP_URL, mstr_contact. CNCT_FNAME, mstr_contact. CNCT_PHONE ORDER BY mstr_days.NO, mstr_meeting.start_time, mstr_meeting.NAME ';


    $query_limit_wed_meet = sprintf ("%s LIMIT %d, %d", $query_wed_meet, $startRow_wed_meet, $maxRows_wed_meet);
    $wed_meet = mysql_query ($query_limit_wed_meet, $connda) or die (mysql_error ());
    $row_wed_meet = mysql_fetch_assoc ($wed_meet);

    If (isset($_GET['totalRows_wed_meet'])) {}
    $totalRows_wed_meet = $_GET ['totalRows_wed_meet'];
    } else {}
    $all_wed_meet = mysql_query ($query_wed_meet);
    $totalRows_wed_meet = mysql_num_rows ($all_wed_meet);
    }
    $totalPages_wed_meet = ceil($totalRows_wed_meet/$maxRows_wed_meet)-1;
    ? >
    <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""
    "< html xmlns ="http://www.w3.org/1999/xhtml">".
    < head >
    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"
    < title > meetings DA Wednesday < /title >
    < link href = "styles/daone.css" rel = "stylesheet" type = "text/css" / > "
    < script src = "SpryAssets/SpryMenuBar.js" type = "text/javascript" > < / script > "
    < link href = "SpryAssets/SpryMenuBarHorizontal.css" rel = "stylesheet" type = "text/css" / > "
    < style type = "text/css" >
    <!--
    / * Give a width to the menu bar and set the margins to 'auto '.
    * so that the browser doesn't balance.
    */

    UL. MenuBarHorizontal {}
    Width: 50.2em;
    margin: auto;
    }
    / * Centering the text in all the links menu item.
    */

    UL. MenuBarHorizontal a {}
    text-align: center;
    background-color: #FC9;
    }

    / * Set the alignment to the left for everything
    * links to menu item located in a submenu.
    */

    UL. MenuBarHorizontal ul a {}
    text-align: left;
    }
    ->
    a: link {}
    text-decoration: none;
    }
    a: visited {}
    text-decoration: none;
    }
    a: hover {}
    text-decoration: none;
    }
    a: active {}
    text-decoration: none;
    }
    < / style >

    < / head >

    < body >


    < div id = "container" >
    < div id = "banner" > < img src = "images/newheadercb2.png" alt = "socalda" width = "1101" height = "180" / > < / div > "
    < div id = 'main_image' >
    <? PHP include("includes/menu.php");? >

    < / div > < br / > < br / > < br / >
    < div id = "meeta_col" > < h2 align = "center" > meeting lists < / h2 >
    <? PHP include("includes/menu2.php");? >
    < / div >
    < div id = "meetb_col" > < h2 align = "center" > meetings Wednesday < / h2 >
    < table class = "myTable" >
    < b >
    < th > NAME < /th >
    < th > ROOM < /th >
    < th > TIME < /th >
    < th > LENGTH < /th >
    < th > DAY < /th >
    < th > NOTE < /th >
    < th > BUILDING < /th >
    < th > ADDRESS < /th >
    < th > CITY < /th >
    < th > ZIP < /th >
    < th > DIRECTIONS < /th >
    < th > card < /th >
    < th > CONTACT < /th >
    < th > PHONE < /th >
    < th > DESCR < /th >
    < /tr >
    <? PHP {? >}
    < b >
    < td > <? PHP echo $row_wed_meet ['NAME'];? > < table >
    < td > <? PHP echo $row_wed_meet ["ROOM_NAME"];? > < table >
    < td > <? PHP echo $row_wed_meet ['TIME'];? > < table >
    < td > <? PHP echo $row_wed_meet ['TIME'];? > < table >
    < td > <? PHP echo $row_wed_meet ['DAY_OF_WEEK'];? > < table >
    < td > <? PHP echo $row_wed_meet ["MEETING_NOTES"];? > < table >
    < td > <? PHP echo $row_wed_meet ["BUILDING_NAME"];? > < table >
    < td > <? PHP echo $row_wed_meet ["adresse_rue"];? > < table >
    < td > <? PHP echo $row_wed_meet ['CITY'];? > < table >
    < td > <? PHP echo $row_wed_meet ["zip_code"];? > < table >
    < td > <? PHP echo $row_wed_meet ["SPEC_DIRECTIONS"];? > < table >
    < td > <? PHP echo $row_wed_meet ["MAP_URL"];? > < table >
    < td > <? PHP echo $row_wed_meet ["CNCT_FNAME"];? > < table >
    < td > <? PHP echo $row_wed_meet ["CNCT_PHONE"];? > < table >
    < td > <? PHP echo $row_wed_meet ['DESCR'];? > < table >
    < /tr >
    <? PHP} while ($row_wed_meet = mysql_fetch_assoc ($wed_meet));? >
    < /table >
    < br / > < br / >
    < hr / >
    < / div >
    < / div >


    < / body >

    < / html >
    <? PHP
    mysql_free_result ($wed_meet);
    ? >

    I should actually have 10 lines for meetings Wednesday but still only get nine.

    The funny part is the folder that appears in the test of Dreamweaver and PHPMyAdmin below the newly inserted record has contact appears in the info of the meeting comes to be inserted, but that meeting is not displayed.  It keeps things to nine records.

    If the lines in the browser are overlapped for some reason any?

    I deleted the new entries and reinserted them does not.  It shows more than 9 lines.  I actually had the lines value all records and played with it, but he did nothing.

    If anyone has pointers to where I can get some info on this issue, I would appreciate it.

    Thank you.

    OK, sounds like something in the data to interfere with HTML code. Can you view the page in a browser and then after the source of the browser on the subject code?

  • To get the result of the query as the column format delimited

    Hi all

    I'm running under query to get database information using an automation tool. The output of the query we receive does not come with the defined value. Is there a way I can change the query to output delimited?

    Please provide your valuable contributions

    SELECT * FROM THE USER. DROP_DOWN_VALUE

    WHERE (SELEC_ID IN (SELECT ID FROM THE USER. PLACE WHERE FIELD_NAME = 'TABLE_NAME'))

    AND DEPENDENT_FIELD = 'XXXXXXX '.


    The query output:


    43202TRANSFORMERTRANSFORMERXXXXXXX


    Expected results:


    43202, TRANSFORMER, TRANSFORMER, XXXXXXX


    Thanks and greetings

    Riyas Hussain

    I'm running under query to get database information using an automation tool. The output of the query we receive does not come with the defined value. Is there a way I can change the query to output delimited?

    Just add / * csv * / in front of the query.

    See examples of different formats in this article by Sql Dev PM Jeff Smith (a frequent contributor of forum):

    http://www.thatjeffsmith.com/archive/2012/05/formatting-query-results-to-CSV-in-Oracle-SQL-Developer/

    SELECT / * csv * / * FROM scott.emp;

    SELECT / * xml * / * FROM scott.emp;

    SELECT / * html * / * FROM scott.emp;

    SELECT / * delimited * / * FROM scott.emp;

    SELECT / * INSERT * / * FROM scott.emp;

    SELECT / * charger * / * FROM scott.emp;

    SELECT / * fixed * / * FROM scott.emp;

    SELECT / * text * / * FROM scott.emp;

  • How to get the result of the query?

    I'm looking to get output something like this...

    If a profile exists on the Pb, I need Exists in the colum

    PROFILE_A EXISTS

    PROFILE_B DOES NOT EXIST

    PROFILE_C EXISTS

    Select distinct profile

    decode (profile, "PASSWORD_PROFILE", "EXISTS", 'THERE is NO') 'STATUS '.

    of dba_profiles;

    How to get the above result? Anyone?

    In the first query, you can add any profile you want to check, and then try the below

    WITH qry1 AS (SELECT profile 'PROFILE_A' FROM dual

    UNION ALL

    SELECT "PROFILE_B" FROM double

    UNION ALL

    SELECT 'DEFAULT' double)

    SELECT the profile

    CASE WHEN EXISTS (SELECT 1 FROM dba_profiles dp

    WHERE dp.profile = q1.profile)

    THEN "EXISTS."

    OTHERWISE "NOT EXIST".

    The END as status

    OF qry1 q1;

    OUTPUT:-

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

    SQL > WITH qry1 AS (SELECT profile 'PROFILE_A' FROM dual

    2. ANY TRADE UNION

    3. SELECT 'PROFILE_B' FROM dual

    4 UNION ALL

    5. SELECT 'DEFAULT' double)

    6. SELECT profile,

    7 CASE WHEN EXISTS (SELECT 1 FROM dba_profiles dp

    8 WHERE dp.profile = q1.profile)

    9 THEN 'EXISTS '.

    10. OTHERWISE "NOT EXIST".

    11 FINISSENT AS status

    Qry1 q1 12;

    PROFILE STATUS

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

    PROFILE_A DOES NOT EXIST

    PROFILE_B DOES NOT EXIST

    DEFAULT VALUE IS

  • Randomly do not get the results of the query

    Sometimes, when I run a query, I won't be back no results... not 0 lines... but no result. When I execute the same query as an instruction, I get the expected results in the output of the script. After a minute or two, he goes and I restarted, query results will begin to display again.

    This happens sporadically, and I am not able to reproduce. Someone else knows that with version 2.1?

    Helped the stack trace.
    There were bugs around INTERVAL of TIMESTAMP/DATE/DAY being NULL in resultset causing the grid to disappear.

    These have been set after the production version.

    -Rambeau

  • How to get the result using this query?

    Hi using iam under query,

    WITH CTE (SNO, ID, PNT)

    AS

    (SELECT ROWNUM as SNO, TRANS_ID, VCN_NO OF)

    SELECT V.TRANS_ID, V.VCN_NO IN VSL_MOVES V

    WHERE V.END_TIME > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24')) AND V.END_TIME < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24'))

    AND V.MOVEMENT_TYPE_CODE NOT IN ORDER ("ATA") OF V.VCN_NO, V.END_TIME))

    SELECT ROWNUM as SNO, TAB. VESSEL_NAME, TAB. FLAG, TAB. IMO_NO, TAB. ARRIVED_DATE, TAB. F_ROM,

    NVL ((SELECT CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT TO_CHAR (NBV. ATD, "DD/MM/YYYY HH24") OF PNTS WHERE NBV. DOC_NO = TAB. VCN_NO AND ROWNUM < = 1) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT TO_CHAR (VBU. BRTH_ALL_FAST, "DD/MM/YYYY HH24") OF VSL_BERTH_UNBERTH VBU WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. (T_ID),'-') Sailed_Date,.

    NVL ((SELECT CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT P.PORT_NAME OF RRS, PORT_MASTER P WHERE P.PORT_CODE = PNT. VSL_NXT_PRT_CALL AND PNT. DOC_NO = TAB. VCN_NO) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT CASE WHEN VBU. BERTH_CODE LIKE "% VOPK" AND THEN "VOPAK" WHAT VBU. BERTH_CODE AS "VSPM %" THEN "VOPAK" ELSE "POF" VBU VSL_BERTH_UNBERTH END WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. (T_ID), "-") DESTINATION

    DE)

    SELECT

    VM. TRANS_ID,

    VM. VCN_NO,

    VM. MOVEMENT_TYPE_CODE,

    (SELECT PNT. VSL_NAME OF PNTS WHERE NBV. DOC_NO = VM. VCN_NO AND ROWNUM < = 1) VESSEL_NAME;

    (SELECT C.COUNTRY_NAME OF COUNTRY C, VESSEL_MASTER M WHERE C.COUNTRY_CODE = M.FLAG AND M.VSL_CODE = VM. VSL_CODE AND ROWNUM < = 1) AS FLAG,.

    (SELECT M.VSL_IMO_NO FROM VESSEL_MASTER M WHERE M.VSL_CODE = VM. VSL_CODE AND ROWNUM < = 1) IMO_NO;

    TO_CHAR (VM. END_TIME, "DD/MM/YYYY HH24") ARRIVED_DATE,.

    WHEN VM BOX. MOVEMENT_TYPE_CODE = 'STA' THEN (SELECT P.PORT_NAME FROM RRS, PORT_MASTER P WHERE P.PORT_CODE = PNT. LST_PORT_CALL AND PNT. DOC_NO = VM. VCN_NO AND ROWNUM < = 1) WHEN VM. MOVEMENT_TYPE_CODE = 'UTA' THEN (SELECT VB. VSL_BERTH_UNBERTH VB BERTH_CODE WHERE VB. UNBERTH_TRANS_ID = VM. TRANS_ID AND ROWNUM < = 1) END F_ROM.

    --(SELECT T2.ID DELE DE CTE T1 JOIN CTE T2 SUR T1.) SNO = T2. SNO + 1 WHERE T1.ID = VM. TRANS_ID AND T1. NBV = VM. VCN_NO AND T2. NBV = VM. ATD VCN_NO)

    (SELECT T1.ID CTE T1 WHERE SNO = (SELECT T2. SNO + 1 ETC T2 WHERE T2.ID = VM. TRANS_ID AND T2. NBV = VM. T_ID VCN_NO))

    OF VSL_MOVES VM

    WHERE (VM. End_time > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24')) AND VM. End_time < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24')) or

    ((CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT TO_CHAR (NBV. ATD, "DD/MM/YYYY HH24") OF PNTS WHERE NBV. DOC_NO = TAB. VCN_NO AND ROWNUM < = 1) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT TO_CHAR (VBU. BRTH_ALL_FAST, "DD/MM/YYYY HH24") OF VSL_BERTH_UNBERTH VBU WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. Saileddate T_ID)) > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24')) and

    (CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'ATS' THEN (SELECT TO_CHAR (NBV. ATD, "DD/MM/YYYY HH24") OF PNTS WHERE NBV. DOC_NO = TAB. VCN_NO AND ROWNUM < = 1) WHEN VMS. MOVEMENT_TYPE_CODE = 'ATB' THEN (SELECT TO_CHAR (VBU. BRTH_ALL_FAST, "DD/MM/YYYY HH24") OF VSL_BERTH_UNBERTH VBU WHERE VBU. BERTH_TRANS_ID = VMS. TRANS_ID AND ROWNUM < = 1) END ELSE NULL VSL_MOVES VMS WHERE VMS. TRANS_ID = TAB. T_ID) saileddate) < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24')))

    --(Sailed_Date > = TRUNC (TO_DATE (: pStartDate, ' dd/MM/yy HH24 ')) AND Sailed_Date < = TRUNC (TO_DATE (: pEndDate, ' dd/MM/yy HH24')))

    AND VM. MOVEMENT_TYPE_CODE IN ('STA', "UTA")

    ) TAB

    now my Question is should I include Sailed date also starttime and endtime (ex: date range of pStartDate and pEndDate I need to display the date sailed respected records)

    I mean the problem is solved, I found the solution

    docks of pof-

    WITH CTE (SL, VCN_NO, VESSEL_NAME, FLAG, IMO_NO, ARRIVED, FROM_, MOVEMENT_TYPE_, NEXT_MOVE, SAILED_DATE, DESTINATION, FID, TID)

    AS

    (SELECT T1.*,

    WHEN T1 BOX. FROM_ = 'POF' THEN 1 OTHER 2 END FID,

    WHEN T1 BOX. DESTINATION = "POF" THEN 1 OTHER 2 END TID

    Of

    (

    SELECT ROW_NUMBER() OVER (PARTITION OF VM. VCN_NO ORDER BY VB. (SL BRTH_ALL_FAST),

    VM. VCN_NO,

    (SELECT M.VSL_NAME FROM VESSEL_MASTER M WHERE M.VSL_CODE = VM. VESSEL_NAME VSL_CODE),

    (SELECT C.COUNTRY_NAME OF COUNTRY C, VESSEL_MASTER M WHERE C.COUNTRY_CODE = M.FLAG AND M.VSL_CODE = VM. VSL_CODE AND ROWNUM< =1="" )="" as="">

    (SELECT M.VSL_IMO_NO FROM VESSEL_MASTER M WHERE M.VSL_CODE = VM. IMO_NO VSL_CODE),

    VB. BRTH_ALL_FAST HAS ARRIVED,

    (CASE WHEN VM. MOVEMENT_TYPE_CODE = 'ATB' THEN 'ANCHORAGE' WHAT VM. MOVEMENT_TYPE_CODE = "LTB" THEN 'LAND' WHEN VM. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. UNBERTH_TRANS_ID = VB. BERTH_TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE NOT IN ("VOPAK", "SPM")) THEN 'POF' WHEN VM. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. UNBERTH_TRANS_ID = VB. BERTH_TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE IN ("VOPAK", "SPM")) THEN "VOPAK" OTHER (SELECT P.PORT_NAME FROM RRS, P PORT_MASTER WHERE P.PORT_CODE = PNT. LST_PORT_CALL AND PNT. DOC_NO = VM. FROM_ VCN_NO END)).

    VM. MOVEMENT_TYPE_CODE,

    (SELECT THE VIRTUAL COMPUTERS. VSL_MOVES VMS MOVEMENT_TYPE_CODE WHERE VMS. TRANS_ID = VB. NEXT_MOVE UNBERTH_TRANS_ID),

    VB. UB_LST_LNE_CASTOFF SAILED_DATE,

    NVL ((SELECT CASE WHEN VMS. MOVEMENT_TYPE_CODE = 'UTA' THEN 'ANCHORAGE' WHAT VMS. MOVEMENT_TYPE_CODE = 'BTL' THEN 'LAND' WHEN VMS. MOVEMENT_TYPE_CODE = "UTS" THEN (SELECT P.PORT_NAME FROM RRS, PORT_MASTER P WHERE P.PORT_CODE = PNT. VSL_NXT_PRT_CALL AND PNT. DOC_NO = VMS. VCN_NO) WHEN VMS. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. BERTH_TRANS_ID = VMS. TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE NOT IN ("VOPAK", "SPM")) THEN 'POF' WHEN VMS. MOVEMENT_TYPE_CODE = "BTB" AND (SELECT TT1. VSL_MOVES TT, VSL_BERTH_UNBERTH TT1 BERTH_CODE WHERE TT. TRANS_ID = TT1. BERTH_TRANS_ID AND TT. VCN_NO = VM. VCN_NO AND TT1. BERTH_TRANS_ID = VMS. TRANS_ID) (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE IN ("VOPAK", "SPM")) THEN "VOPAK" OTHERWISE NULL END VSL_MOVES VMS WHERE VB. UNBERTH_TRANS_ID = VMS. (TRANS_ID), "-") DESTINATION

    OF VM, VSL_BERTH_UNBERTH VB VSL_MOVES WHERE (VM. TRANS_ID = VB. BERTH_TRANS_ID)

    AND VM. MOVEMENT_TYPE_CODE LIKE '% TB '.

    AND ((VB. BRTH_ALL_FAST > = TO_TIMESTAMP(:pStartDate,'DD/MM/YYYY HH24:MI') AND VB. BRTH_ALL_FAST<= to_timestamp(:penddate,'dd/mm/yyyy="">

    OR (VB. UB_LST_LNE_CASTOFF > = TO_TIMESTAMP(:pStartDate,'DD/MM/YYYY HH24:MI') AND VB. UB_LST_LNE_CASTOFF<= to_timestamp(:penddate,'dd/mm/yyyy="" hh24:mi'))="">

    AND VB. BERTH_CODE (SELECT WB. BERTH_MASTER BM BERTH_CODE WHERE BM. QUAY_CODE NOT IN ("VOPAK", "SPM"))

    - AND VM. VCN_NO = 201510336

    ORDER OF VB. BRTH_ALL_FAST

    ) T1

    )

    Select rownum AS SNO, tab2.* of)

    SELECT

    TAB1. VCN_NO, TAB1. VESSEL_NAME, TAB1. FLAG, TAB1. IMO_NO,

    NVL (BOX WHEN TAB1. HAS ARRIVED< to_timestamp(:pstartdate,'dd/mm/yyyy="" hh24:mi')="" then="" '----------'="" else="" to_char(tab1.arrived,'dd/mm/yyyy="" hh24:mi')="" end,'----------')="">

    NVL (BOX WHEN TAB1. HAS ARRIVED< to_timestamp(:pstartdate,'dd/mm/yyyy="" hh24:mi')="" then="" '----------'="" else="" (select="" t2.from_="" from="" cte="" t2="" where="" t2.sl="TAB1.FROM_" and="" t2.vcn_no="TAB1.VCN_NO)" end,'----------'="">

    NVL (CASE WHEN (SELECT T2. DESTINATION OF THE CTE T2 WHERE T2.SL = TAB1. DEST AND T2. VCN_NO = TAB1. VCN_NO) = 'POF' THEN '-' ANOTHER BOX WHEN TAB1. SAILED_DATE > TO_TIMESTAMP (: pEndDate, ' DD/MM/YYYY HH24') THEN '-' ELSE TO_CHAR (TAB1. (SAILED_DATE, "DD/MM/YYYY HH24") A PIECE,'-') SAILED_DATE,.

    NVL (BOX WHEN TAB1. SAILED_DATE > TO_TIMESTAMP (: pEndDate, ' DD/MM/YYYY HH24') THEN '-' ELSE (SELECT CASE WHEN T2. DESTINATION = 'POF' THEN '-' ANOTHER T2. THE END OF THE DESTINATION OF THE CTE T2 WHERE T2.SL = TAB1. DEST AND T2. VCN_NO = TAB1. (END OF VCN_NO), "-") DESTINATION

    DE)

    SELECT THE TAB. VCN_NO, TAB. VESSEL_NAME, TAB. FLAG, TAB. IMO_NO,

    MIN (TAB. HAPPENED) ARRIVED,

    MIN (TAB.SL) FROM_,

    MAX (TAB. SAILED_DATE SAILED_DATE),

    MAX (TAB.SL) DEST,

    TAB. SNO

    DE)

    SELECT T1.*,

    WHEN T1 BOX. FID = 2 AND T1. TID = 1 THEN 1 WHEN T1. FID = 1 AND T1. TID = 2 THEN 1 WHEN T1. FID = 1 AND T1. TID = 1 THEN 0

    WHEN T1. FID = 2 AND T1. TID = ROWNUM THEN 2 + 1 END OF ANOTHER 3 SNO

    T1 ETC

    ) GROUP OF TABS BY TABS. VCN_NO, TAB. VESSEL_NAME, TAB. FLAG, TAB. IMO_NO, TAB. SNO

    ) TAB1 WHERE TAB1. SNO<>0

    ) tab2

  • How to get every month with SQL query?

    Hello world
    I want to display every month (Jan-Dec) in the 1st column and their leaders in the 2nd column, but that there is no record in JAN, Feb and March, while they do not come to the top.
    Can someone please help me get JAN, FEB etc with leaders like 0?

    I know it's possible with the NVL function, but I don't know where to put it.
    I'm really grateful for help you.
    Thanks in advance.
    I use oracle 10g on Windows XP.

    [code]

    SELECT ".

    CASE

    WHEN b.mon = '01' THEN 'JAN' WHEN b.mon = '02' THEN 'FEB' WHEN b.mon = '03' AND 'MAR '.

    WHEN b.mon = '04' THEN "APR" b.mon = WHEN '05' CAN '' MAY '' WHEN b.mon = '06' THEN 'JUN '.

    WHEN b.mon = '07' THEN 'JUL' WHEN b.mon = '08' and THEN 'AUG' WHEN b.mon = '09' AND 'MS '.

    WHEN b.mon = '10' and 'OCT', THEN WHEN b.mon = '11' and THEN 'NOV' WHEN b.mon = '12' AND 'DEC '.

    END of month

    count (*) NTC

    Of

    (Con.fst_name SELECT first_name, con.last_name, usr.login, USER_ID,)

    App.appl_src_cd Registration_Source, to_date(usr.created,'DD-MON-YY') Created_Date,

    To_char(usr.created,'MM') Lun

    of usr, con siebel.s_contact siebel.s_user, siebel. S_PER_PRTNRAPPL app

    where con.par_row_id = usr.row_id

    and app.row_id = con.row_id

    and app.appl_src_cd = 'Siebel eService.

    AND TO_CHAR (usr.created, 'YYYY') =: P415_YEAR

    ) b

    B.mon group

    order by 3 desc

    [/ code]

    Now get the output voltage...

    MONTHCNT
    APR4818
    JUL4543
    JUN4295
    MAY4190
    AUG541
    MAR20

    What Jan, Feb, March etc in there too with the County under the name of 0.

    SELECT TO_CHAR (TO_DATE (b.mon, 'mm'), 'MY') month.

    Count ()) - 1 cnt

    DE)

    Con.fst_name SELECT first_name,

    con.last_name,

    usr. Login, USER_ID,

    App.appl_src_cd Registration_Source,

    to_date(usr.created,'DD-mon-YY') Created_Date,

    To_char(usr.created,'MM') Lun

    OF siebel.s_user usr.

    Con Siebel.S_CONTACT,

    Siebel. S_PER_PRTNRAPPL app

    WHERE con.par_row_id = usr.row_id

    AND app.row_id = con.row_id

    AND app.appl_src_cd = 'Siebel eService.

    AND TO_CHAR (usr.created, 'YYYY') =: P415_YEAR

    UNION ALL

    SELECT null,

    NULL,

    NULL,

    NULL,

    NULL,

    LPAD(Level,2,'0')

    OF the double

    CONNECT BY level<=>

    ) b

    GROUP BY b.mon

    ORDER BY DESC 3

    SY.

  • Get-clusters. Get-view resulting with the argument cannot be null or empty

    Recently, one of my faithful scripts stopped working - all the words of wisdom and advice are welcome.

    SCRIPT:

    $clusters = get-Cluster | Get-opinion

    foreach ($cluster in $clusters)

    {

    $1stESXinCluster = Get-VIObjectByVIView - MORef $cluster. Host [0]

    }

    RESULT:

    The argument cannot be null or empty.

    In: line tank: 5:46

    + $1stESXinCluster = Get-VIObjectByVIView - MORef < < < < $cluster. Host [0]

    It would be possible, one of the pole which is located in $cluster is without a host.

    You can add the conditional operator in the present.

    $clusters = Get-Cluster | get-view
    foreach ($cluster in $clusters)
    {
    if ($cluster.Host[0]-ne $null){
    $1stESXinCluster = Get-VIObjectByVIView -MORef $cluster.Host[0]
         }
    }
    

    Hope this helps

  • Incorrect result with SQL query

    Dear all,

    When I run the following query, it should return 55 but returning 24 instead of 55.

    Select TO_CHAR (TO_DATE (April 25, 2009 ',' MON-DD-YYYY'), 'JJ')
    -TO_CHAR (TO_DATE ('01 - MAR - 2009 "," DD-MON-YYYY '), 'DD') DAYS OF DOUBLE;

    Can help any one on this?

    Thank you

    As you use the wrong data type for arithmatic operations.

    SQL> select TO_DATE('25-APR-2009', 'DD-MON-YYYY') - TO_DATE('01-MAR-2009', 'DD-MON-YYYY')  DAYS FROM DUAL;
    
          DAYS
    ----------
            55
    

    Never compare strings as dates.

  • bad results for the search for context on the empty element tags

    I use Oracle DBMS 11.1 and 11.2 and created an index on an XML column context (article group: PATH_SECTION_GROUP).
    When you enter a query like

    SELECT count (*) FROM my_table t WHERE contains (t.co_xml,'hasPath(/tag1/tag2)') > 0

    I get bad results if tag2 is an empty element tag (< tag2 / >) that appears somewhere in the
    XML instance, but is NOT directly under tag1.

    For example, the following XML instance is (but shouldn't!):

    < a >
    blah blah < tag3 > < tag1 > < / tag3 > < / tag1 >
    blah < tag4 > < tag2 / > < / tag4 >
    < /a >

    This seems to happen only for the empty element tags. Is this a known bug and does anyone know of a workaround?

    Thank you in advance for your help!
    Roman

    Like you, I've been looking in the wrong places, bug of thought, rather than documented behavior. Finally, I came across the following excerpt from the next section of the documentation on haspath in Oracle text reference.

    http://download.Oracle.com/docs/CD/B28359_01/text.111/b28304/cqoper.htm#i997393

    Limits

    Because of the way in which XML data section are saved, false match may appear with XML sections that are completely empty as follows:

    
    

    A query of HASPATH(A/B/E) or HASPATH(A/D/C) falsely corresponds to this document. This type of fake correspondent can be avoided by inserting some text between the empty tags.

  • Get different results even script according to what VM it hits?

    Hello.

    IM starting to Powershell and PowerCLI, so you will know at what level it is on =)

    I get different results depending on what VM my script hits (whetever they may or may not have more than one drive). I do not understand how I can fix this...

    For example, I created 4 new virtual machines.

    TestVMfirst1 have only a single drive

    TestVM02 have 2 drives

    TestVM03 have 3 discs

    TestVM04 have only a single drive

    My goal is to get a CSV with all disks included. I want the name, the data store and SizeGB, this info I get from Get-hard drive.

    When I run my script to select all 4 virtual machines:

    $VMs = get-cluster-name kluster01 : get-vm-name TestVM *

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

    $VMs = get-cluster-name kluster01 | Get-vm-name TestVM *.

    $Results = @)

    {foreach ($VM to $VMs)

    $Result = new-object PSObject

    $Result | Add-Member - membertype NoteProperty-name 'Name' - value $VM. Name

    $VMDiskCount = 1

    Get-$VM hard drive | {foreach}

    $disk = $_

    $Result | Add-Member-'Disc ($VMDiskCount) name' name-value $disk. Name - membertype NoteProperty

    $Result | Add-Member-name '($VMDiskCount) Datastore disk' - value $disk. Filename.Split(']') [0]. TrimStart('[') - membertype NoteProperty

    $Result | Add-Member-name 'Disk ($VMDiskCount) SizeGB' - value ([math]: round ($disk.) CapacityKB / 1 MB))-membertype NoteProperty

    $VMDiskCount ++

    }

    $Results += $Result

    }

    $Results | Select-object * | format-table

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

    I get the result with max 1 disc:

    Name(1) name of discDisk data store (1)SizeGB disc (1)
    --------------------------------------------
    TestVMfirst1Hard drive 1DS-20140
    TestVM02Hard drive 1DS-20140
    TestVM03Hard drive 1DS-20140

    But if I run the same thing but with TestVM0 * (selects 4-2 VMs):

    $VMs = get-cluster-name kluster01 | Get-vm-name TestVM0 *.

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

    $VMs = get-cluster-name kluster01 | Get-vm-name TestVM0 *.

    $Results = @)

    {foreach ($VM to $VMs)

    $Result = new-object PSObject

    $Result | Add-Member - membertype NoteProperty-name 'Name' - value $VM. Name

    $VMDiskCount = 1

    Get-$VM hard drive | {foreach}

    $disk = $_

    $Result | Add-Member-'Disc ($VMDiskCount) name' name-value $disk. Name - membertype NoteProperty

    $Result | Add-Member-name '($VMDiskCount) Datastore disk' - value $disk. Filename.Split(']') [0]. TrimStart('[') - membertype NoteProperty

    $Result | Add-Member-name 'Disk ($VMDiskCount) SizeGB' - value ([math]: round ($disk.) CapacityKB / 1 MB))-membertype NoteProperty

    $VMDiskCount ++

    }

    $Results += $Result

    }

    $Results | Select-object * | format-table

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

    I get this result:

    Name(1) name of discDisk data store (1)(1) name of the disc SizeGB disc (2).Disk data store (2)SizeGB disc (2)
    -------------------------------------------- ----------------------------------------
    TestVM02Hard drive 1DS-201Hard 40 2 discDS-20110
    TestVM03Hard drive 1DS-201Hard 40 2 discDS-20210
    TestVM04Hard drive 1DS-20140

    I miss all my disks on TestVM03, I seems that the first VM sets the limit on how many records can be issued in the table... A dirty solution is to create a model on the first target VM disks, but it seems the wrong way to solve my problem.

    Thanks in advance

    You're conclusion is correct, I'm afraid, the first line determines how many properties, you will see.

    Alternatively, you can sort the lines on the number of properties in descending order.

    Something like that

    $Result | Tri-objet-property {($_ |)} Get - Member). {Count of}-descending | Format-Table

  • HO to get the result of the script with query of 11 g

    Hello

    While doing tasks of refreshment as you need to run some select query. am so lazy to check each application one by one, so I've placed all querys in a script and I ran
    I was fine but it does not show only the result of the query, but it shows no query. Can we get the query and put query via the script out.

    Ex: one.sql
    have the script below the querys

    Select the name of database v$.
    Select count (*) from v$ datafile;
    Select count (*) from dba_db_links;
    Select the owner, db_link dba_db_links;

    can someone help me on this...

    Concerning

    Published by: 889571 on 19 may 2013 14:59
    [oracle@localhost samples]$ cat sample.sql
    set term on echo on
    select name from v$database;
    select count(*) from v$datafile;
    select count(*) from dba_db_links;
    select owner,db_link from dba_db_links;
    [oracle@localhost samples]$ sqlplus user1/user1 @sample.sql
    
    SQL*Plus: Release 11.2.0.2.0 Production on Sun May 19 16:06:20 2013
    
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select name from v$database;
    
    NAME
    ---------
    ORCL
    
    SQL> select count(*) from v$datafile;
    
      COUNT(*)
    ----------
             6
    
    SQL> select count(*) from dba_db_links;
    
      COUNT(*)
    ----------
             0
    
    SQL> select owner,db_link from dba_db_links;
    
    no rows selected
    
    SQL> 
    

Maybe you are looking for