ORA-00936 error select * statement

Hi all

I am a newbie in Oracle and used Sybase (7,0) front. The following SELECT statement is worked on Sybase, but has not worked on Oracle. Oracle has shown an error ORA-00936.

SELECT column1 * From Table1;

Could someone tell me how to edit?

Thank you very much.

Michael

Try this:

SELECT column1, Table1.* From Table1;

Tags: Database

Similar Questions

  • ERROR: ORACLE prepare error: ORA-00936: lack of expression

    Hello

    I am required to run the 'pass-through' Oracle SQL, to extract data from tables in the SAS for processing and handling. My code (attached) reads and writes (runs) but with zero records to test first. I can't get beyond the error to prepare.

    The request is just like other queries that seem to work, but I can't get past this prepare error. I have no other access to individauls with an adequate knowledge of the PL SQL and as a last stop hoped others in the forum could quickly identify the source of the error.

    Thank you very much in advance for any help.

    Jeff
    _______________________________________

    1; *'; * « ; * / ; Quit; execution risk;
    2 OPTIONS NUMPAGE = MIN;
    3% LET _CLIENTTASKLABEL = % NRBQUOTE (rx_biplr_v3_2);
    4% LET _EGTASKLABEL = % NRBQUOTE (rx_biplr_v3_2);
    5% LET _CLIENTPROJECTNAME = %NRBQUOTE();
    6% LET _SASPROGRAMFILE =;
    7
    8 ODS CLOSE SUBJECT;
    NOTE: Some of your options or statements will not be managed with the Activex or Java Series devices. Chart by default for these
    drivers may be different from other SAS/GRAPH device drivers. For more information, please contact Technical Support.
    9 OPTIONS DEV = ACTIVEX;
    10 EGHTML TEMP FILE NAME;
    NOTE: Writing, body HTML (EGHTML) file: EGHTML
    11 ODS HTML(ID=EGHTML) FILE = EGHTML ENCODING = 'utf - 8' STYLE = EGDefault.
    11. STYLESHEET=(URL="file:///C:/program%20Files/SAS/shared%20Files/BIClientStyles/EGDefault.CSS")
    11. ATTRIBUTES = ("http://www2.sas.com/codebase/graph/v91/sasgraph.exe"="CODE") NOGTITLE NOGFOOTNOTE GPATH = & sasworklocation
    11.
    12
    gaccessible 13%;
    14 /********************************************************/
    15 * RX_BIPLR_V3. SAS;
    16 /********************************************************/
    17
    18 dm 'journal clearly out; delete ";
    19 linesize options = 120;
    20 option obs = 0 NoReplace;
    21
    22 ****************************************************************************************;
    23 * date reviewed programmer in WHICH WAS MADE;
    24 *----- -------------- ------------ -----------------------------------------;
    25 * 2005 creation of David Boyd program to the test population;
    26 *;
    27 * 06/02/2006 Ivon Jones changed to include the whole of the population;
    28 *;
    29 * 20/07/2006 Ivon Jones identified the holdout data elements;
    30 * or inclusion in the consolidation with;
    31 * Robin report;
    32 *;
    33 * 18/08/2006 Ivon Jones updated specific therapeutic Classes.
    34 * 10 - 2009 J Shaf - changed to extract actual or potential of UBH bipolar Dx and medical claims.
    35 ****************************************************************************************;
    36
    37
    38
    39 * % let allclmorgn = (', 'A'); / * claims origin code * /.
    40% would let begdate ='01 SEP 2009;
    41% let enddate = 30 SEP 2009 would be;
    42% let q = %str(%');
    43
    44
    45 data _null_;
    46. call symput ("fdos", put (intnx ('month' ' and begdate "d,-27," starts"), date9.));
    47 call symput ('ldos', put (intnx ('months', ' and enddate "d-0, 'end'" "), date9.));
    48, run;

    NOTE: DATA statement used (total duration of processes):
    time real 0.01 seconds
    2 the system SAS 11:44 Friday, October 30, 2009

    time CPU 0.01 seconds


    49
    50
    51
    52 **************************************************************;
    53 *? Data _null_ stage allows to create a macro variable to;
    54 * year and month, based on the macro ldos variable in the data;
    55 * step up? ;
    56 **************************************************************;
    57
    58
    59 data _null_;
    If 60 months ("& ldos" d) < 10
    61, then call symput ("yr_mo", compress (year ("& ldos" d) |)) '0' || months ("& ldos" d)));
    62 other call symput ("yr_mo", compress (year ("& ldos" d) | months ("& ldos" d)));
    63 to run;

    NOTE: The numeric values were converted to character values in the locations given by: (Line): (Column).
    61:39 61:64 62:39 62:57
    NOTE: DATA statement used (total duration of processes):
    time real 0.01 seconds
    time processor 0.01 seconds


    64
    65 * make % & biplr_dx;
    position 66% & begdate;
    ' 01 SEP 2009 would be
    67% put & enddate;
    30 SEP 2009 would be
    68% put & fdos;
    JUNE 1, 2007
    69% put & ldos;
    SEPTEMBER 30, 2009
    70% put & q;
    '
    71
    72
    73 libname biplr ' / home/jshafi01/projects/adhoc/biplr_dprsn/data ';
    NOTE: Libref BIPLR has been awarded with success as follows:
    Engine: V9
    Physical name: / home/jshafi01/projects/adhoc/biplr_dprsn/data
    74 rosdwp libname = oracle user "& oracle_user." pass = "& oracle_pass." ' buffsize = 32767 path = "rosdwp"; "
    NOTE: Libref ROSDWP has been awarded with success as follows:
    Engine: ORACLE
    Physical name: rosdwp
    75
    work.biplr_up_v1 76 data;
    mbr_id length 77 attrib = $ 26;
    78 the value biplr.biplr_ubh_med_v1;
    79 to be performed;

    NOTE: There were 0 read comments from the BIPLR data set. BIPLR_UBH_MED_V1.
    NOTE: All data WORK. BIPLR_UP_V1 has 0 comments and variables 1.
    NOTE: DATA statement used (total duration of processes):
    time real 0.01 seconds
    3 the system SAS 11:44 Friday, October 30, 2009

    time processor 0.01 seconds


    80
    81 proc content;
    82 to be performed;

    NOTE: PROCEDURE used CONTENT (total duration of processes):
    time real 0.03 seconds
    time CPU 0.03 seconds


    83
    84 proc datasets
    85 = rosdwp nolist library.
    86. delete biplr_up_v1;
    87 of quitting;

    NOTE: The removal of ROSDWP. BIPLR_UP_V1 (memtype = DATA).
    NOTE: PROCEDURE used DATASETS (time Total of processes):
    time real 3.74 seconds
    time CPU 0.03 seconds


    88
    89 proc datasets
    90 = work nolist library.
    copy 91 = rosdwp move;
    92 select biplr_up_v1;
    93 of quitting;

    NOTE: Move WORK. BIPLR_UP_V1 to ROSDWP. BIPLR_UP_V1 (memtype = DATA).
    NOTE: Variable labels SAS, formats and lengths are not written to the DBMS tables.
    NOTE: There were 0 read comments from the WORKING data set. BIPLR_UP_V1.
    NOTE: All the data ROSDWP. BIPLR_UP_V1 has 0 comments and variables 1.
    NOTE: PROCEDURE used DATASETS (time Total of processes):
    real 0.32 seconds
    time CPU 0.04 seconds


    94
    95
    96
    97 *****************************************************************************;
    98
    99 * execute (commit) by rosdwp
    100 ******************************************************************************;
    101
    102
    103 proc SQL noprint.
    104, connect to oracle as rosdwp (user = "" & oracle_user. "password =" "& oracle_pass ' buffsize = 32767 path ="rosdwp")
    104. preserve_comments);
    run 105 (alter session set nls_date_format = 'ddmonyyyy') by rosdwp;
    CREATE table biplr_rx like 106
    107 SELECT
    mrb_id 108,
    pcp_spc 109,
    rx_date 110,
    4 the system SAS 11:44 Friday, October 30, 2009

    Mark 111,
    generic, 112
    113 ahfs_cd
    ahfs_dsc 114,
    lbl 115,
    strngth 116,
    UNT 117,
    spc_tx_cls_cd 118,
    119 spc_tx_cls_dsc,
    GCN 120,
    rx_num 121,
    rx_ingrd 122,
    rx_paid 123,
    rx_cnt 124,
    rx_qty 125,
    rx_day 126
    127 rosdwp CONNECTION
    128 (SELECT
    129, middle of the year. UNIQ_MBR_ID as mrb_id,
    130 DB. PRVDR_SPCLTY_DESC as pcp_spc,
    FCP 131. LAST_SRVC_DT as rx_date,
    132 JJ. BRAND_NAME as mark,
    133 JJ. GNRC_NAME as generic,
    134 JJ. AHFS_THRPTC_CLS_CD as ahfs_cd,
    DD 135. AHFS_THRPTC_CLS_DESC as ahfs_dsc,
    136 JJ. LABEL_NAME as lbl,
    137 JJ. STRNGTH_NUM as strngth
    138 JJ. STRNGTH_UNIT_DESC as unt,
    139 JJ. SPECF_THRPTC_CLS_CD as spc_tx_cls_cd,
    140 DD. SPECF_THRPTC_CLS_DESC as spc_tx_cls_dsc,
    141 JJ. GCN_NUM as gcn,
    FCP 142. PRSCRPTN_NUM as rx_num,
    SUM of 143 (FCP. INGRDNT_AMT) as rx_ingrd,
    SUM of 144 (FCP. PD_AMT) as rx_paid,
    $ 145 (FCP. UNIT_SRVC_CNT) as rx_cnt,
    SUM of 146 (FCP. DSPNSD_QTY) as rx_qty,
    SUM of 147 (FCP. DAY_SUPLY_CNT) as rx_day
    148
    149 PHRMCY_CLM_FACT pcf,
    150 MBR_ID_DMNSN environment,
    151 DRUG_DMNSN dd,
    152 PRVDR_DMNSN pd,
    153 biplr_up_v1
    154. WHERE THE
    (155)
    156 (biplr_up_v1.mbr_id = MBR_ID_DMNSN. UNIQ_MBR_ID) and
    157 (PHRMCY_CLM_FACT. FINL_CLM_KEY = PHRMCY_FINL_CLM_DMNSN. FINL_CLM_KEY) AND
    158 (PHRMCY_CLM_FACT. MBR_KEY = MBR_ID_DMNSN. MBR_KEY) and
    159 (PHRMCY_CLM_FACT. BNFT_KEY = MBR_BNFT_DMNSN. BNFT_KEY) and
    160 (PHRMCY_CLM_FACT. DRUG_KEY = DRUG_DMNSN. DRUG_KEY) and
    161 (PHRMCY_FINL_CLM_DMNSN. CLM_ORGN_CD IN (', 'A')) AND
    162 (PHRMCY_CLM_FACT. LAST_SRVC_DT BETWEEN q. & fdos. & q and & q. & ldos. & q)
    163)
    164 Group By
    165 mi. UNIQ_MBR_ID,
    166 pd. PRVDR_SPCLTY_DESC,
    FCP 167. LAST_SRVC_DT,
    168 JJ. BRAND_NAME,
    5 the system SAS 11:44 Friday, October 30, 2009

    169 JJ. GNRC_NAME,
    170 JJ. AHFS_THRPTC_CLS_CD,
    171 JJ. AHFS_THRPTC_CLS_DESC,
    172 JJ. LABEL_NAME,
    173 JJ. STRNGTH_NUM,
    174 JJ. STRNGTH_UNIT_DESC,
    175 JJ. SPECF_THRPTC_CLS_CD,
    176 JJ. SPECF_THRPTC_CLS_DESC,
    177 JJ. GCN_NUM,
    FCP 178. PRSCRPTN_NUM
    179);
    ERROR: ORACLE prepare error: ORA-00936: lack of expression. SQL statement: SELECT middle. UNIQ_MBR_ID as mrb_id,
    RDL PRVDR_SPCLTY_DESC like pcp_spc, FCP. LAST_SRVC_DT as rx_date, JJ. BRAND_NAME as brand, JJ. GNRC_NAME as generic,
    DD. AHFS_THRPTC_CLS_CD like ahfs_cd, JJ. AHFS_THRPTC_CLS_DESC as ahfs_dsc, JJ. LABEL_NAME as lbl, JJ. STRNGTH_NUM as
    strngth, JJ. STRNGTH_UNIT_DESC as unt, JJ. SPECF_THRPTC_CLS_CD as spc_tx_cls_cd, JJ. SPECF_THRPTC_CLS_DESC as
    spc_tx_cls_dsc, JJ. GCN_NUM as gcn, FCP. PRSCRPTN_NUM as rx_num, SUM (FCP. INGRDNT_AMT) as rx_ingrd, SUM (FCP. PD_AMT)
    as rx_paid, SUM (FCP. UNIT_SRVC_CNT) as rx_cnt, SUM (FCP. DSPNSD_QTY) as rx_qty, SUM (FCP. DAY_SUPLY_CNT) as rx_day
    OF PHRMCY_CLM_FACT pcf, MBR_ID_DMNSN mi, DRUG_DMNSN JJ, pd of the PRVDR_DMNSN, biplr_up_v1 () WHERE the
    (biplr_up_v1.mbr_id = MBR_ID_DMNSN. UNIQ_MBR_ID) and (PHRMCY_CLM_FACT. FINL_CLM_KEY =
    PHRMCY_FINL_CLM_DMNSN. FINL_CLM_KEY) AND (PHRMCY_CLM_FACT. MBR_KEY = MBR_ID_DMNSN. MBR_KEY) and
    (PHRMCY_CLM_FACT. BNFT_KEY = MBR_BNFT_DMNSN. BNFT_KEY) and (PHRMCY_CLM_FACT. DRUG_KEY = DRUG_DMNSN. DRUG_KEY) and
    (PHRMCY_FINL_CLM_DMNSN. CLM_ORGN_CD IN (', 'A')) AND (PHRMCY_CLM_FACT. LAST_SRVC_DT BETWEEN ' 01 JUN 2007"
    and 30 SEP 2009') Group By mi. UNIQ_MBR_ID, pd. PRVDR_SPCLTY_DESC, FCP. LAST_SRVC_DT, JJ. BRAND_NAME,
    DD GNRC_NAME, JJ. AHFS_THRPTC_CLS_CD, JJ. AHFS_THRPTC_CLS_DESC, JJ. LABEL_NAME, JJ. STRNGTH_NUM,
    DD STRNGTH_UNIT_DESC, JJ. SPECF_THRPTC_CLS_CD, JJ. SPECF_THRPTC_CLS_DESC, JJ. GCN_NUM, FCP. PRSCRPTN_NUM.
    NOTE: PROC SQL set NOEXEC option and will continue to check the syntax of the instructions.
    180 run (drop table biplr_up_v1) in rosdwp;
    NOTE: Statement is not executed because the NOEXEC option.
    181 disconnect of rosdwp;
    NOTE: Statement is not executed because the NOEXEC option.
    182 of quitting;
    NOTE: The SAS system is stopped at this stage of processing errors.
    NOTE: PROCEDURE used SQL (total duration of processes):
    time real 0.14 seconds
    time CPU 0.03 seconds

    183
    184

    (1) assuming that LAST_SRVC_DT is a column of PHRMCY_CLM_FACT, to precede the table alias "FCP" rather than the full table name. If a table alias is specified in the FROM clause, it should be used rather than the full table name when you reference the columns.
    2) there are two tables in the WHERE clause that do not appear in the FROM clause:

    PHRMCY_FINL_CLM_DMNSN
    MBR_BNFT_DMNSN

    user12142482 wrote:
    Hello again,

    Wish Oracle was a bit more informative. Uses an Institute of SAS product called Enterprise Guide. A "hot fix" has been installed to solve a problem that the product appears unable to save the latest version of the revised code changes (hence "BETWEEN between" remaining even after an earlier edition). In any case, with the change, now get this error:

    «ERROR: ORACLE prepare error: ORA-00904: "PHRMCY_CLM_FACT".» ' LAST_SRVC_DT': invalid identifier. (The log file is displayed below)

    -The-Les restes remains of the error, no matter if code "pass" is used to move the date range to Oracle (which seems correct to the log output below that I believe), or if I hard code the date range in the query SQL PL itself.

    -L' preparation error always appears at the end of the internal SELECTION.
    -L' error of preparation remain, with or without the GROUP BY clause.

    Is there something else I'm missing? Someone suggested a reserve word - but other versions of the ANSI SQL standard, I don't see that is the case. I went to Support SAS and SAS list serve to the University of Georgia, but nothing definite from these sources. Have requested either able to run Oracle directly, outside this SAS Institute product - process.

    Any suggestions are greatly appreciated. Thank you to all the world very much.

    Jeff
    150 OF
    151 PHRMCY_CLM_FACT pcf,


    152 MBR_ID_DMNSN environment,
    153 DRUG_DMNSN dd,
    154 PRVDR_DMNSN pd,
    155 BIPLR_UP_V1 BLPR2
    156. WHERE THE
    157 (BIPLR_UP_V1.mbr_id = MBR_ID_DMNSN. UNIQ_MBR_ID) and
    158 (PHRMCY_CLM_FACT. FINL_CLM_KEY = PHRMCY_FINL_CLM_DMNSN. FINL_CLM_KEY) AND
    159 (PHRMCY_CLM_FACT. MBR_KEY = MBR_ID_DMNSN. MBR_KEY) and
    160 (PHRMCY_CLM_FACT. BNFT_KEY = MBR_BNFT_DMNSN. BNFT_KEY) and
    161 (PHRMCY_CLM_FACT. DRUG_KEY = DRUG_DMNSN. DRUG_KEY) and
    162 (PHRMCY_FINL_CLM_DMNSN. CLM_ORGN_CD IN (', 'A')) AND
    163 (PHRMCY_CLM_FACT. BETWEEN LAST_SRVC_DT & q. & fdos. & q and q & ldos. & q)
    (164);
    ERROR: ORACLE prepare error: ORA-00904: "PHRMCY_CLM_FACT." "' LAST_SRVC_DT ': invalid identifier. SQL statement:

  • Snapshot too old ORA-01555 select statement (Discoverer)?

    Hi all

    Am I losing the plot... but we have a select statement run from discoverer, which causes the error of too old famous cliché.

    My understanding is that undo is generated from select/insert/update.

    So why is the following discoverer Select statement causing the error?
    from alert
    ORA-01555 caused by SQL statement below (SQL ID: gk0wxgqmx66sh, Query Duration=3866 sec, SCN: 0x001e.089cf3f9):

    SELECT  ( ROUND(( TO_DATE(SYSDATE)-o101038.HIRE_DATE )/365,2) ) as

      "  bla bla

    ORDER BY o101020.SUB_ORGANIZATION_NAME ASC

     

    Thanks in Advance

    Hi, find that the problem is due to "select causing again because of the BLOCK DRAIN plug.

    This link explains it well

    Thanks fr all your comments

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:44798632736844

  • I'm getting "ORA-00900: invalid SQL statement" error. ?

    I installed oracle 11 GR 2. and 'DBMS_METADATA_DIFF.COMPARE_ALTER ('TABLE', 'TBL_A', 'TBL_A','USER1 ','USER2 ')"to see the result as below, but I'm" ORA-00900: invalid SQL statement "error.   Any idea?



    I use:


    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

    PL/SQL Release 11.2.0.1.0 - Production

    CORE 11.2.0.1.0 Production

    AMT for 32-bit Windows: Version 11.2.0.1.0 - Production

    NLSRTL Version 11.2.0.1.0 - Production




    SQL > desc user1.tbl_a
    Name                                      Null?    Type
    ----------------------------------------- -------- ----------------------------
    FIELD_A1 NOT NULL NUMBER
    FIELD_A2 VARCHAR2 (20)
    FIELD_A4 NOT NULL NUMBER (5.2)
    FIELD_A5 VARCHAR2 (10)
    FIELD_A6 NOT NULL NUMBER (2)

    SQL > desc user2.tbl_a
    Name                                      Null?    Type
    ----------------------------------------- -------- ----------------------------
    FIELD_A1 NOT NULL NUMBER
    FIELD_A2 VARCHAR2 (50)
    FIELD_A3                                           DATE
    FIELD_A4 NUMBER (5.2)
    FIELD_A5 NOT NULL VARCHAR2 (10)




    SQL > select dbms_metadata_diff.compare_alter ('TABLE', 'TBL_A', 'TBL_A', 'USER1', 'USER2') of double

    expected result:

    DBMS_METADATA_DIFF.COMPARE_ALTER ('TABLE', 'TBL_A', 'TBL_A', 'U1', 'U2')
    --------------------------------------------------------------------------------
    ALTER TABLE 'U1 '. "" ADD TBL_A "(DATE OF THE"FIELD_A3")
    ALTER TABLE 'U1 '. "" TBL_A "DROP ("FIELD_A6")
    ALTER TABLE 'U1 '. "" CHANGE TBL_A ' ("FIELD_A2' VARCHAR2 (50))
    ALTER TABLE 'U1 '. "" TBL_A ' CHANGE ("FIELD_A4" NUMBER (5.2) DEFAULT 0)
    ALTER TABLE 'U1 '. "" CHANGE TBL_A ' ('FIELD_A4' NULL)
    ALTER TABLE 'U1 '. "" CHANGE TBL_A ' ('FIELD_A5' ACTIVATE NOT NULL)

    Thanks for the reply rp,

    I got the result using "select dbms_metadata_diff.compare_alter ('TABLE', 'TBL_A', 'TBL_A', 'USER1', 'USER2') from dual"

  • error SQL ORA-00900: invalid SQL statement

    Hi all

    I'm new to sql and I'm trying to solve this problem, I have here.

    When I run this query (1) I get this message: ORA-00900: invalid SQL statement

    Query: 1


    WITH t1
    AS (SELECT CID,
    TYPE,
    TO_CHAR)
    TO_DATE (' 00:00:00 ', 'HH24:MI:SS')
    + (lg_end_time - lg_start_time).
    Call_time 'HH24:MI:SS'),
    ROW_NUMBER)
    COURSES (SORTING CID CID NULLS FIRST PARTITION)
    AS call_id1
    OF test_1
    )
    SELECT SUM (call_time)
    FROM t1;
    output:
    I get the error: ORA-01722: invalid number




    table structure:

    Select * form test_1;

    CID TYPE LG_END_TIME LG_START_TIME
    1508643 expedition 2012/12/03 14:05 2012/12/03 14:02
    1508643 treatment 2012/12/03 14:00 03/12/2012 14:00
    1508643 initiation 2012/12/03 14:00 03/12/2012 14:00
    1508662 expedition 2012/12/03 14:18 2012/12/03 14:16
    1508662 initiation 2012/12/03 14:01 03/12/2012 14:01
    1508662 treatment 2012/12/03 14:02 03/12/2012 14:01
    1508643 expedition 2012/12/03 14:02 03/12/2012 14:00
    1508662 expedition 2012/12/03 14:16 2012/12/03 14:02

    Thanks for your help

    I think this example might help.

    SQL> select decode(call_id1,99,null,cid)        cid,
      2         decode(call_id1,99,null,type)       type,
      3         decode(call_id1,99,null,to_char(call_time,'hh24:mi:ss'))  call_time,
      4         decode(call_id1,99,null,substr(call_id1,1,5))   call_id1,
      5         total_time
      6    from (select cid,
      7                 type,
      8                 call_time,
      9                 call_id1,
     10                 total_time
     11            from (select cid,
     12                         type,
     13                         call_time,
     14                         call_id1,
     15                         null total_time
     16                    from (SELECT CID ,
     17                                 TYPE,
     18                                 to_date(TO_CHAR (TO_DATE ('00:00:00', 'HH24:MI:SS') +
     19                                        (lg_end_time - lg_start_time),'HH24:MI:SS'),'HH24:MI:SS') call_time,
     20                                 ROW_NUMBER () OVER (PARTITION BY CID ORDER BY CID NULLS FIRST) AS call_id1
     21                            FROM test_1 ) t1
     22                  union all
     23                  select cid,
     24                         null type,
     25                         null call_time,
     26                         99   call_id1,
     27                         lpad(hours,2,'0')||':'||lpad(minutes,2,'0')||':'||lpad(seconds,2,'0') total_time
     28                    from (select cid,
     29                                 sum(to_number(to_char(call_time,'hh24'))) +
     30                                     trunc((sum(to_number(to_char(call_time,'mi'))) +
     31                                     (trunc(sum(to_number(to_char(call_time,'ss')))/60)))/24) hours,
     32                                 sum(to_number(to_char(call_time,'mi'))) +
     33                                    (trunc(sum(to_number(to_char(call_time,'ss')))/60)) minutes,
     34                                 (sum(to_number(to_char(call_time,'ss'))) -
     35                                     ((trunc(sum(to_number(to_char(call_time,'ss')))/60)) * 60)) seconds
     36                            from (SELECT CID ,
     37                                         TYPE,
     38                                         to_date(TO_CHAR (TO_DATE ('00:00:00', 'HH24:MI:SS') +
     39                                                (lg_end_time - lg_start_time),'HH24:MI:SS'),'HH24:MI:SS') call_time,
     40                                         ROW_NUMBER () OVER (PARTITION BY CID ORDER BY CID NULLS FIRST) AS call_id1
     41                                    FROM test_1 ) t1
     42                          group by cid) )
     43          order by cid, call_id1 );
    
    CID                                      TYPE                 CALL_TIME CALL_ID1 TOTAL_TIME
    ---------------------------------------- -------------------- --------- -------- ----------
    1508643                                  Dispatching          00:02:06  1
    1508643                                  Initiation           00:00:00  2
    1508643                                  Treatment            00:00:39  3
    1508643                                  Dispatching          00:02:50  4
                                                                                     00:05:35
    1508662                                  Treatment            00:01:03  1
    1508662                                  Initiation           00:00:00  2
    1508662                                  Dispatching          00:13:17  3
    1508662                                  Dispatching          00:02:43  4
                                                                                     00:17:03
    
    10 rows selected
    
    SQL> 
    
  • ERROR WITH IMMEDIATE EXECUTION (ORA-00936)

    Hello

    I am trying to implement this statement but I get this error message (ORA-00936)

    RUN IMMEDIATELY 'REMOVE'. V_TABLE_DETAIL_NAME | ' WHERE ' | V_COLUMN_DETAIL_NAME |' = ' | TO_CHAR (P_DEL_VAL);



    Kind regards

    Hello

    I assume you are using below in the database. Try this...

    EXECUTE IMMEDIATE 'DELETE FROM '||V_TABLE_DETAIL_NAME||' WHERE '||V_COLUMN_DETAIL_NAME ||' = '''||TO_CHAR(P_DEL_VAL)||'''';
    

    -Clément

  • SELECT... PIVOT... ORA-00936

    Oracle database: 11.2.0.2.0

    I'm trying to pivot a query that returns the names/values of the parameters of a specific key in a line that lists the keys, then a column for each pair where the parameter name becomes the name of column. The 11g SQL reference indicates that the pivot_in_clause can take a subquery. While I was trying to use the subquery to avoid hard-coding the names of columns, nothing helps.

    In light of...

    PVALUE PNAME KEYS
    P1 V1 10
    10 P2 V2
    10 P3 V3

    I would like to request to return...

    KEY P1 P2 P3
    10 V1 V2 V3

    I can do this with the following query...

    WITH pivot_data AS (SELECT * pnosko_pivot-KEY WHERE = 10 ORDER BY pname)
    SELECT *.
    OF pivot_data
    PIVOT (MAX (pvalue)
    FOR pname
    IN ('P1' as p1, 'P2' as 'P3' as p3, p2));

    But if I try to use a subquery as follows (to allow new lines of parameters to handle dynamically), I get an ORA-00936.

    WITH pivot_data AS (SELECT * pnosko_pivot-KEY WHERE = 10 ORDER BY pname)
    SELECT *.
    OF pivot_data
    PIVOT (MAX (pvalue)
    FOR pname
    IN (SELECT DISTINCT pname FROM pnosko_pivot WHERE key = 10 ORDER BY 1));

    Could someone point to my problem, interpretation or otherwise? Thank you.

    Hello

    See the first thing under the subquery "pivot article topic" SQL 11.2 language Manual:
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/statements_10002.htm#sthref6785

    subquery
    A subquery is used only in conjunction with the XML keyword. ...

    You do not use the keyword XML. The only way you can avoid Hardcoding the values is to get XML output.
    If you don't want to output XML, you must use dynamic SQL statements to get a variable number of columns, or columns that take their names from values in the table.

  • error ORA-4068:-l' current state of the package is invalidated

    Hai friends,

    Please see this link

    Problem we faced, it is ' error ora-4068:-l' current state of the package is disabled "in the application.initiallly of customer, we migrated to oracle 9i and 10g 10.2.0.4.0

    We have discussed and obtained the solution as the timestamp of the objects may be different. (we expect the access rights of the table sys.obj$) pls see the link

    Re: oracle error-4068

    But now we are informed senior as below

    (1) error ora-4068 will come only when recompile us the view. is this true?

    (2) 6136074 bug is fixed in 10.2.0.4.0. is it?

    Gurus of give your valuable suggestions

    S

    Packages tend to fail because of their 'package '. A package has a 'State' when it contains the package variable and constant level etc. and the package is called. On the first calling package, the 'State' is created in memory to hold the values of these variables, etc. If an object including the package depends on for example a table is changed somehow example deleted and recreated due to data dependencies, the package then takes a State not VALID. When you do then appealed to the package, Oracle examines the status and see that it is not valid, then determines that the package has a "State". Because something changed the package depended on, the State is taken as being obsolete and is ignored, which causes the error "State package has been abandoned" message.

    If a package has no variables of level package etc. i.e. the 'State' and then, taking the same example above, the whole takes an INVALID state, but when you make then a call to the package, Oracle considers as invalid, but knows that there is no 'State' attached to it and is therefore able to recompile the package automatically and then continue execution without causing error messages. The only exception here is if the thing that the package was dependent on a change of such kind that the package may not compile, in which case you will get an invalid error package type.

    And if you want to know how we prevent Jetty package States...

    Move all variables and constants in a stand-alone package specification and to refer to those of your original package. So when the status of your original packing is invlidated for some reason, it has no State package and can be recompiled automatically, however the packaging containing the vars/const is not cancelled because it has no dependencies, so the State that is in memory for this package will remain and may continue to be used.

    As for package-level sliders, you will need to make these premises to the procedures/functions using them as you won't be able of sliders reference in all of packages like that (not sure on the use of the REF CURSOR but... exists for me to study!)

    This first example shows the State being disabled by adding a new column on the table and causing to give a 'Package State scrapped' error...

    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  / 
    
    Table created.
    
    SQL>
    SQL> insert into dependonme values (5)
      2  / 
    
    1 row created.
    
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package body mypkg is
      2    v_statevar number := 5; -- this means my package has a state
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
     10
     11      myval := myval * v_statevar;
     12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
     13    end;
     14  end mypkg;
     15  / 
    
    Package body created.
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    
    SQL>
    SQL>
    SQL> alter table dependonme add (y number)
      2  / 
    
    Table altered.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    BEGIN mypkg.myproc; END;
    
    *
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "SCOTT.MYPKG" has been invalidated
    ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.MYPKG"
    ORA-06512: at line 1
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    

    And the following example shows how to get the package in their own specifications of package variables, allows the package to automatically recompile when it is called even if it has become invalid by the action to add a column to the table.

    SQL> drop table dependonme
      2  / 
    
    Table dropped.
    
    SQL>
    SQL> drop package mypkg
      2  / 
    
    Package dropped.
    
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  / 
    
    Table created.
    
    SQL>
    SQL> insert into dependonme values (5)
      2  / 
    
    1 row created.
    
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package mypkg_state is
      2    v_statevar number := 5; -- package state in seperate package spec
      3  end mypkg_state;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package body mypkg is
      2    -- this package has no state area
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
     10
     11      myval := myval * mypkg_state.v_statevar;  -- note: references the mypkg_state package
     12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
     13    end;
     14  end mypkg;
     15  / 
    
    Package body created.
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    
    SQL>
    SQL> alter table dependonme add (y number)
      2  / 
    
    Table altered.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
  • to DECLARE * ERROR at line 1: ORA-00900: invalid SQL statement

    This works fine when I use the System user to create a schema and then run this script.
    When I create another user with grant connect, resources, create view permissions I get this error:

    DECLARE
    *

    ERROR on line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at...


    DECLARE
    ID MY_TABLE.ID%TYPE;
    tNom my_table. % TABLENAME TYPE;
    PName MY_TABLE_TWO. PROPERTYNAME % TYPE;
    CURSOR c1 IS
    SELECT distinct evt.id, evt. TABLENAME, vid.propertyname
    FROM my_table evt, vid MY_TABLE_TWO
    WHERE the evt. COL_1 = 1
    AND evt. COL_2 = vid. COL_2
    and not exists (select facts FROM MY_TABLE_THREE 1)
    where evt.id = facts.eventid and facts.displayname = vid.propertyname);
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1 INTO id, tNom, pname;
    OUTPUT WHEN c1% NOTFOUND;
    INSERT INTO MY_TABLE_THREE (ID, COLUMNLENGTH)
    VALUES (S_ANALYTICS_SEQUENCE.nextval, 255);
    RUN IMMEDIATELY 'ALTER TABLE ' | tNom | 'Add ' | PName | ' _ NVARCHAR2 (255);
    END LOOP;
    CLOSE c1;
    END;

    Hello

    Maybe missing a privilege. If I were you, I'll try this first:

    DECLARE
       id    MY_TABLE.ID%TYPE;
       tname MY_TABLE.TABLENAME%TYPE;
       pname MY_TABLE_TWO.PROPERTYNAME%TYPE;
       CURSOR c1 IS
          SELECT DISTINCT evt.id,
                          evt.TABLENAME,
                          vid.propertyname
            FROM MY_TABLE     evt,
                 MY_TABLE_TWO vid
           WHERE evt.COL_1 = 1
             AND evt.COL_2 = vid.COL_2
             AND NOT EXISTS (SELECT 1
                    FROM MY_TABLE_THREE facts
                   WHERE evt.id = facts.eventid
                     AND facts.displayname = vid.propertyname);
    BEGIN
       OPEN c1;
       LOOP
          FETCH c1
             INTO id, tname, pname;
          EXIT WHEN c1%NOTFOUND;
          INSERT INTO MY_TABLE_THREE
             (ID,
              COLUMNLENGTH)
          VALUES
             (S_ANALYTICS_SEQUENCE.NEXTVAL,
              255);
          DBMS_OUTPUT.put_line('ALTER TABLE ' || tname || ' add ' || pname ||
                               '_ NVARCHAR2(255)');
          --EXECUTE IMMEDIATE 'ALTER TABLE ' || tname || ' add ' || pname || '_ NVARCHAR2(255)';
       END LOOP;
       CLOSE c1;
    EXCEPTION
       WHEN OTHERS THEN
          DBMS_OUTPUT.put_line(SQLERRM);
    END;
    /
    

    Using this approach, you can see the sentences to run without run, I also added an exception block.

    Kind regards

  • Error PLS-00428: an INTO clause in this SELECT statement

    Dear Experts,

    I'm new to PL/SQL programming

    I try to run the following query, I get the error message.

    Please help me solve the error.

    declare

    var_cd number (20);

    Start

    If: P1_TYP_CAT is not null then

    SELECT max (CAT_cd + 1) as var_cd from IM_AST_CAT by CAT_cd;

    insert into IM_AST_CAT (CAT_NM, CAT_CD) values ((upper (:P1_TYP_CAT)),(:var_cd));

    on the other

    RAISE_APPLICATION_ERROR ('-20001,' both Department and location must be provided ");

    end if;

    end;

    In PL/SQL, must be used IN the clause when using SELECT statements.

    SELECT max (CAT_cd + 1) as var_cd

    in variable - it is missing in your code

    from IM_AST_CAT by CAT_cd;

    Your code should be

    declare

    var_cd number (20);

    Start

    If: P1_TYP_CAT is not null then

    SELECT max (CAT_cd + 1).
        in var_cd
    of IM_AST_CAT
    order of CAT_cd;

    insert into IM_AST_CAT (CAT_NM, CAT_CD) values (upper(:P1_TYP_CAT), var_cd);

    on the other

    RAISE_APPLICATION_ERROR ('-20001,' both Department and location must be provided ");

    end if;

    end;

    For example:

    DECLARE

    l_first_name varchar2 (100);

    BEGIN

    Select first_name

    in l_first_name

    employees

    where employee_id = 100;

    END;

    Post edited by: Suri

  • ORA-01445 error: cannot select ROWID from where sample, a join without a view

    Hi all

    I get an error when I created a VO based EO with standard Table (forced) jtf_notes_vl
    It gives me the error ORA-01445: cannot select ROWID from where sample, a join without key preserved table view

    the Table has the ROW_ID as Primery key


    Thanks in advance

    Hello

    Creation of an EO-based the rowid as primary key is usually the cause of this error as is not recommended to use the rowid as the primary key. Try to use jtf_note_id as the primary key.

    Furthermore, why are you using NAV it is seen for the creation of EO. If I remember correctly, there is a JTF_NOTES_B and JTF_NOTES_TL table that you can use.

    Thank you
    AJ

  • SQL error: ORA-00936: lack of expression

    Hi all

    Sorry I can't speak English very well

    I would like to know what is the problem on my code
    CREATE TABLE MOB (MOBILE VARCHAR2(20));
    Insert into EXPORT_TABLE (MOBILE) values ('0124873214');
    Insert into EXPORT_TABLE (MOBILE) values ('0184873214');
    Insert into EXPORT_TABLE (MOBILE) values ('0174873214');
    Insert into EXPORT_TABLE (MOBILE) values ('0120141115');
    Insert into EXPORT_TABLE (MOBILE) values ('0104873214');
    Insert into EXPORT_TABLE (MOBILE) values ('0164873214');
    Insert into EXPORT_TABLE (MOBILE) values ('0194873214');
    Insert into EXPORT_TABLE (MOBILE) values ('0114873214');
    Insert into EXPORT_TABLE (MOBILE) values ('0144873214');
    Insert into EXPORT_TABLE (MOBILE) values ('0122257278');
    My select statement works fine but I have problem with update
    SELECT CASE (SUBSTR(MOBILE,1,3))
           WHEN '012' THEN '0122'||SUBSTR(MOBILE,4,10) 
           WHEN '018' THEN '0128'||SUBSTR(MOBILE,4,10)
           WHEN '017' THEN '0127'||SUBSTR(MOBILE,4,10)
           WHEN '010' THEN '0100'||SUBSTR(MOBILE,4,10)
           WHEN '016' THEN '0106'||SUBSTR(MOBILE,4,10)
           WHEN '019' THEN '0109'||SUBSTR(MOBILE,4,10)
           WHEN '011' THEN '0111'||SUBSTR(MOBILE,4,10)
           WHEN '014' THEN '0114'||SUBSTR(MOBILE,4,10)
           END "NEW MOB"
    FROM   MOB
    
    RESULT
    
    NEW MOB      
    --------------
    01224873214    
    01284873214    
    01274873214    
    01220141115    
    01004873214    
    01064873214    
    01094873214    
    01114873214    
    01144873214    
    01222257278    
    
     10 rows selected 
    I have a problem with the update
    UPDATE MOB 
    SET    MOBILE = ANY( CASE (SUBSTR(MOBILE,1,3))
           WHEN '012' THEN '0122'||SUBSTR(MOBILE,4,10) 
           WHEN '018' THEN '0128'||SUBSTR(MOBILE,4,10)
           WHEN '017' THEN '0127'||SUBSTR(MOBILE,4,10)
           WHEN '010' THEN '0100'||SUBSTR(MOBILE,4,10)
           WHEN '016' THEN '0106'||SUBSTR(MOBILE,4,10)
           WHEN '019' THEN '0109'||SUBSTR(MOBILE,4,10)
           WHEN '011' THEN '0111'||SUBSTR(MOBILE,4,10)
           WHEN '014' THEN '0114'||SUBSTR(MOBILE,4,10)
           END "NEW MOB";
           --FROM   MOB);
    COMMIT;
    I thank all

    What exactly is the problem?

    UPDATE MOB
    SET    MOBILE = CASE SUBSTR(MOBILE,1,3)
           WHEN '012' THEN '0122'||SUBSTR(MOBILE,4,10)
           WHEN '018' THEN '0128'||SUBSTR(MOBILE,4,10)
           WHEN '017' THEN '0127'||SUBSTR(MOBILE,4,10)
           WHEN '010' THEN '0100'||SUBSTR(MOBILE,4,10)
           WHEN '016' THEN '0106'||SUBSTR(MOBILE,4,10)
           WHEN '019' THEN '0109'||SUBSTR(MOBILE,4,10)
           WHEN '011' THEN '0111'||SUBSTR(MOBILE,4,10)
           WHEN '014' THEN '0114'||SUBSTR(MOBILE,4,10)
           ELSE MOBILE
           END;
    
  • ORA-00936: lack of Interface STEP expression for update flag lines

    Hello world!

    We have an interface that retrieves data of essbase and the load into a table target Oracle.

    We use the Modules (KM) following Knowledge:

    LKM Hyperion Essbase DATA SQL

    IKM SQL incremental update

    When we run the interface, at the stage of 'flag to update lines', we get the following error

    Stage: 'make update'

    Error: ORA-00936: lack of expression

    This is definition message tab:

    ODI-1228: Exportar Presupuesto General (integration) task fails on ORACLE ODI_STAGE connection target.

    Caused by: java.sql.SQLSyntaxErrorException: ORA-00936: lack of expression

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)

    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)

    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)

    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)

    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)

    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)

    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1115)

    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1488)

    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)

    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3954)

    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1539)

    at oracle.odi.runtime.agent.execution.sql.SQLCommand.execute(SQLCommand.java:163)

    at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)

    at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:1)

    at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468)

    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ 2.doAction(StartSessRequestProcessor.java:366)

    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)

    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$ 0 (StartSessRequestProcessor.java:292)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ StartSessTask.doExecute (StartSessRequestProcessor.java:855)

    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)

    to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)

    at java.lang.Thread.run(Thread.java:662)

    This is CODE tab:


    Update HYP_INT. I _TRG_PRESUPUESTO_ESS_GENERAL $

    Set IND_UPDATE = 'U '.

    When there is)

    Select 'X '.

    of HYP_INT. TRG_PRESUPUESTO_ESS_GENERAL T

    where

    )

    We do not know why query created the interface has some missing statements when the sql is created. Do you think that a lack or settings or just something worng or a bug?

    The ODI client version is ODI_11.1.1.7.0_GENERIC_130128.1205


    You give us any suggestions to fix this?

    Any suggestions would be very helpful!


    Thank you


    Ivan Lemus

    Since you're using IKM of SQL incremental update, you must mark a logical key on the fields of your target.

    This key allows the comparison for insert and update.

  • ORA-00936: missing expression when adding virtual column

    I am having this error when you add virtual column am in database 11 g

    having error

    ORA-00936: lack of expression

    in select superior

    My sql is

    Employees ALTER TABLE ADD (user name (select upper (substr (first_name, 1, 1)) | initcap (last_name) user name of employees));

    http://docs.Oracle.com/CD/E11882_01/server.112/e41084/statements_3001.htm#sthref3374

    Adding a column of Table virtual: example, the following statement adds a copy of the hr.employees table a column named income , which is a combination of salary more commission. Wages and the commission are NUMBER columns, so the database creates the virtual column as a NUMBER same column if the data type is not specified in the statement:

    CREATE TABLE emp2 AS SELECT * FROM employees; ALTER TABLE emp2 ADD (income AS (salary + (salary*commission_pct)));
    

    ALTER TABLE ADD employees (AS username (upper (substr (first_name, 1, 1)) | initcap (last_name)));

    Concerning

    Etbin

  • What is the problem in this simple scritp? ORA-00936

    Hello

    I created this simple script (for Oracle 10g process request Express) where I'm trying to copy a row in table EMPRESAS_ORGANISMOS in the EMPRESAS_REVISADAS table. Both tables have the same fields. ': P15_ID_EMP ' is the text field that contains the ID of the line I want to copy. I get the following errors:

    ORA-06550: line 19, column 9: PL/SQL: ORA-00936: expression lack ORA-06550: line 3, column 1: PL/SQL: statement ignored



    BEGIN
    INSERT INTO EMPRESAS_REVISADAS
    (ID,
    ID_FUENTE,
    COMPILADOR,
    SECTOR_BURSATIL,
    PAGE,.
    ADDRESS,
    CP,
    ANO_FUNDACION,
    CAPITAL_NOMINAL,
    CAPITAL_DESEMBOLSADO,
    OBLIGACIONES,
    IMPORTE_CUENTAS_PENDIENTES,
    OBSERVACIONES,
    APALANCAMIENTO,
    NUMBER,
    NOMBRE_MUNICIPIO)
    VALUES
    SELECT 'EMPRESAS_ORGANISMOS '. "" IDENTITY CARD. "
    'EMPRESAS_ORGANISMOS '. "" ID_FUENTE, "
    'EMPRESAS_ORGANISMOS '. "" COMPILADOR.
    'EMPRESAS_ORGANISMOS '. "" SECTOR_BURSATIL, "
    'EMPRESAS_ORGANISMOS '. "" PAGE. "
    'EMPRESAS_ORGANISMOS '. "" ADDRESS. "
    'EMPRESAS_ORGANISMOS '. "" CP. "
    'EMPRESAS_ORGANISMOS '. "" ANO_FUNDACION, "
    'EMPRESAS_ORGANISMOS '. "" CAPITAL_NOMINAL, "
    'EMPRESAS_ORGANISMOS '. "" CAPITAL_DESEMBOLSADO, "
    'EMPRESAS_ORGANISMOS '. "" OBLIGACIONES ",.
    'EMPRESAS_ORGANISMOS '. "" IMPORTE_CUENTAS_PENDIENTES, "
    'EMPRESAS_ORGANISMOS '. "" OBSERVACIONES ",.
    'EMPRESAS_ORGANISMOS '. "" APALANCAMIENTO. "
    'EMPRESAS_ORGANISMOS '. "" NUMBER. "
    'EMPRESAS_ORGANISMOS '. "" NOMBRE_MUNICIPIO ".
    DE 'EMPRESAS_ORGANISMOS '.
    'EMPRESAS_ORGANISMOS '. "" ID "=: P15_ID_EMP;
    END;

    Thanks in advance.

    Get rid of the word VALUES. You use not VALUES when you insert data based on a SELECT statement

Maybe you are looking for

  • iPhone update problem

    I tried to upgrade my iPhone to version 10. Now it tells me to connect to iTunes. I can't do anything with it. It is just frozen. What should I do? I tried to restart. Just get same message.

  • Satellite C855 1QQ started working when I open the screen

    When I turned off my pc and also close my screen. Then, when I open my pc my screen starts to work automatically. How can I close this property?

  • Error 0 x 80070005

      HKLM\software\Microsoft\Windows\CurrentVersion\Component Servicing\Retry Agent of base HKLM\software\Microsoft\Windows\CurrentVersion\Component base Servicing\Sqm HKLM\software\Microsoft\Windows\CurrentVersion\Component base Servicing\Sqm\Package_f

  • dead laptop

    last week, my laptop (hp g60-530us) started suspended during the shutdown, I have to press the power button for more than 5 seconds to stop completely.   I didn't think much, I patched ubuntu earlier for a similar problem, so I thought that an update

  • Jabber 9.2.6 windows certificate (u: cluster)

    Hello We have an implementation of the 2 CIMP 9.1.1 node and start to upgrade our jabber for client windows to 9.2.6 Aware of the cert for 9.2.5 requirements go, we had tomcat CERT and internal Cup-xmpp signed by our CA. When you https for the cimp s