Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011
    Posts
    6

    Unanswered: PLS-00103: Encountered the symbol "V_ST1" when expecting one of the following

    I worte following code:

    Code:
    Declare 
    
    
    p_Query varchar2(1000);
    var_v varchar2(20);
    
    
    V_ST1 varchar2(10):='EDCS001';
    V_ST2 varchar2(10):='EDCS002_L2VLL';
    V_ST3 varchar2(10):='EDCS002_L3VPN';
    V_ST4 varchar2(10):='EICS002';
    V_ST5 varchar2(10):='ELVS003';
    V_ST6 varchar2(10):='EIPLC01';
    V_ST7 varchar2(10):='RIC_VSFC';
    V_ST8 varchar2(10):='EDCS001_AGGR';
    V_ST9 varchar2(10):='EDCS002_L2TLS';
    
    
    V_WO_STATUS varchar2(10):='CANCELLED';
    
    V_WO_GROUP1 varchar2(10):='A3';
    V_WO_GROUP2 varchar2(10):='SOMG';
    V_WO_GROUP3 varchar2(10):='ASOMG';
    V_WO_GROUP4 varchar2(10):='SOMG_ILD';
    V_WO_GROUP5 varchar2(10):='SOMG_DATA';
    V_WO_GROUP6 varchar2(10):='ASOMG_DATA';
    V_WO_GROUP7 varchar2(10):='ILTSWC_NLD';
    V_WO_GROUP8 varchar2(10):='SOMG_ENG_DLC';
    V_WO_GROUP9 varchar2(10):='SOMG_ENG_MEN';
    V_WO_GROUP10 varchar2(10):='SOMG_ENG_LMDS';
    V_WO_GROUP11 varchar2(10):='SOMG_ENG-TX_OPT';
    V_WO_GROUP12 varchar2(10):='SOMG_SW_ACCESS';
    V_WO_GROUP13 varchar2(10):='SOMG_ENG-TX_ENT';
    V_WO_GROUP14 varchar2(10):='ASOMG_ACCESS';
    V_WO_GROUP15 varchar2(10):='SOMG_ENG_TX_PRI';
    V_WO_GROUP16 varchar2(10):='SOMG_ENG-TX_DATA';
    V_WO_GROUP17 varchar2(10):='SOMG_NW_OPTIMISATION';
    V_WO_GROUP18 varchar2(10):='SOMG_ENG-TX_ACCESS';
    
    
    Begin
    p_Query:='select SO_NO"||","||"WO_NO"||","||"MANAGERNAME"||","||"SERVICE_TYPE"||","||"WO_TYPE"||","||"WO_GROUP"||","||"WO_CREATED_DATE"||","||"WO_STATUS"||","||"WO_STATUS_DATE"||","||"WO_ALLOCATED_TO"||","||"ALLOCATION_DATE"||","||"ALLOCATION_COMMENTS"||","||"STATE"||","||"WO_TASK"||","||"SO_TYPE"||","||"WO_LAST_COMMENT"||","||"WO_PENDING_SINCE"||","||"CUSTOMER" from dual'||
    'union all'||
    'Select SO_NO||","||WO_NO||","||MANAGERNAME||","||SERVICE_TYPE||","||WO_TYPE||","||WO_GROUP||","||WO_CREATED_DATE||","||WO_STATUS||","||WO_STATUS_DATE||","||WO_ALLOCATED_TO||","||ALLOCATION_DATE||","||ALLOCATION_COMMENTS||","||STATE||","||WO_TASK||","||SO_TYPE||","||WO_LAST_COMMENT||","||WO_PENDING_SINCE||","||CUSTOMER'||
    'from somg_clarity_data_new where SERVICE_TYPE in('V_ST1','||
    V_ST2','V_ST3','V_ST4','V_ST5','||
    V_ST6','V_ST7','V_ST8','V_ST9') and WO_STATUS<>'V_WO_STATUS' and'||
     '(WO_GROUP='V_WO_GROUP1' or WO_GROUP='V_WO_GROUP2' or WO_GROUP='V_WO_GROUP3||
     ' or WO_GROUP='V_WO_GROUP4'  or WO_GROUP='V_WO_GROUP5'  or WO_GROUP='V_WO_GROUP6||
     ' or WO_GROUP='V_WO_GROUP7' or WO_GROUP='V_WO_GROUP8' or WO_GROUP='V_WO_GROUP9|| 
    ' or WO_GROUP='V_WO_GROUP10' or  WO_GROUP='V_WO_GROUP11' or  WO_GROUP='V_WO_GROUP12 ||
    ' or WO_GROUP='V_WO_GROUP13' or WO_GROUP='V_WO_GROUP14'   or WO_GROUP='V_WO_GROUP15 ||
    ' or WO_GROUP='V_WO_GROUP16' or WO_GROUP='V_WO_GROUP17' or WO_GROUP='V_WO_GROUP18')';
    
    end;
    It cave following error:

    The following error has occurred:

    ORA-06550: line 45, column 52:

    . ( * @ % & = - + ; < / > at in is mod not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like
    between ||
    Pls let me know the reason for the error

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    You are using double quotes for the string literal:

    this:
    Code:
    p_Query:='select SO_NO"||","||"WO_NO"||","||
    should be:
    Code:
    p_Query:='select SO_NO'||','||'WO_NO'||','
    So just replace all double quotes with single quotes and you should be fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •