ORA-00936: Missing Expression? please help

i just created the following function. I am passing the parameter, which is a varchar2 datatype. The result i am trying to get from this function is also a varchar2, which makes sense since the table is a table that only has varchar2 datatypes. . .so i guess i need to convert the result to a number. How do i do this? I don't quite know the syntax.
when i try and run what i have i get the following error:
ORA-00936: missing expression
ORA-06512: at "SMSRPT.GET_NUMBER", line 8
ORA-06512: at line 7
create or replace FUNCTION get_number(p_name VARCHAR2) return NUMBER as
--DECLARE
v_value varchar2(100);
v_result varchar2(100);
     BEGIN
          v_value:='select value from config_params where name='||p_name;
          execute immediate v_value into v_result;
return v_result;
END;

How about this (updating polasa's response)
CREATE OR REPLACE FUNCTION new_number(p_name VARCHAR2) RETURN NUMBER AS
v_value VARCHAR2(1000);
v_result NUMBER;
BEGIN
v_value :=('select value from config_param where name = :1');
EXECUTE IMMEDIATE v_value
INTO v_result USING p_name;
RETURN v_result;
END new_number;or this
CREATE OR REPLACE FUNCTION get_number(p_name VARCHAR2) RETURN NUMBER AS
   v_value VARCHAR2(1000);
   v_result NUMBER;
   TYPE rct_cursor IS REF CURSOR; --REF CURSOR for dynamic Cursors.
   d_sql        rct_cursor;
BEGIN
  v_value := 'select value from config_param where name = :1';
  OPEN d_sql
  FOR v_value
    USING p_name;
  FETCH d_sql INTO v_result;
  IF d_sql%NOTFOUND THEN
     v_result := NULL;
  END IF;
  CLOSE d_sql;
  RETURN v_result;
END get_number; so the answer is "yes it can be done in dynamic SQL". The question is why do you want to given the advantages of static SQL over dynamic SQL?

Similar Messages

  • Need help with ORA-00936: missing expression

    11.2.0.3
    desc killsessionlog
    Name                                                  Null?    Type
    KILLTIME                                              NOT NULL DATE
    USERNAME                                              NOT NULL VARCHAR2(30)
    SID                                                   NOT NULL NUMBER
    SERIAL#                                               NOT NULL NUMBER
    CTIME                                                 NOT NULL NUMBER
    MACHINE                                                        VARCHAR2(64)
    TERMINAL                                                       VARCHAR2(30)
    PROGRAM                                                        VARCHAR2(48)
    ACTION                                                         VARCHAR2(64)
    MODULE                                                         VARCHAR2(64)want to test the code to kill the blocker
    SQL> create or replace procedure killblocker
      2  is
      3  stmt varchar2(1000);
      4  cursor c1 is
      5  select  s1.SQL_EXEC_START+l1.ctime killtime, s1.username,s1.sid,s1.serial#,l1.ctime ,s1.machine
    ,s1.TERMINAL, s1.PROGRAM,s1.ACTION,s1.MODULE
      6      from v$lock l1, v$session s1, v$lock l2, v$session s2
      7      where s1.sid=l1.sid and s2.sid=l2.sid
      8      and l1.BLOCK=1 and l2.request > 0
      9      and l1.id1 = l2.id1
    10      and l2.id2 = l2.id2
    11      and l1.ctime >0;
    12  begin
    13  for i in c1 loop
    14  EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION ''' || i.sid || ',' || i.serial# || '''';
    15  stmt := 'insert into killsessionlog values ('||i.killtime||','|| i.username||','||i.sid||','||i
    .serial#||','||i.ctime||','||i.machine||','||i.TERMINAL||','|| i.PROGRAM||','||i.ACTION||','||i.MODU
    LE||')'
    16  ;
    17  EXECUTE IMMEDIATE stmt;
    18  dbms_output.put_line('SID '||i.sid ||' with serial# '||i.serial#||' was killed');
    19    END LOOP;
    20  END;
    21  /
    Procedure created.created the blocker and blocked sessions.
    SQL> exec killblocker
    BEGIN killblocker; END;
    ERROR at line 1:
    ORA-00936: missing expression
    ORA-06512: at "NN.KILLBLOCKER", line 17
    ORA-06512: at line 1the first EXECUTE IMMEDIATE for killing the session worked, but the 2nd EXECUTE IMMEDIATE for the insert failed as above. Not able to figure the problem.
    TIA

    SQL> create or replace procedure killblocker
      2  is
      3  stmt varchar2(1000);
      4  cursor c1 is
      5  select  s1.SQL_EXEC_START+l1.ctime killtime, s1.username,s1.sid,s1.serial#,l1.ctime ,s1.machine
    ,s1.TERMINAL, s1.PROGRAM,s1.ACTION,s1.MODULE
      6      from v$lock l1, v$session s1, v$lock l2, v$session s2
      7      where s1.sid=l1.sid and s2.sid=l2.sid
      8      and l1.BLOCK=1 and l2.request > 0
      9      and l1.id1 = l2.id1
    10      and l2.id2 = l2.id2
    11      and l1.ctime >0;
    12  begin
    13  for i in c1 loop
    14  EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION ''' || i.sid || ',' || i.serial# || '''';
    15  stmt := 'insert into killsessionlog values (:killtime, :username, :sid, :serial#, :ctime, :machine, :TERMINAL, :PROGRAM, :ACTION, :MODULE)'
    16  ;
    17  EXECUTE IMMEDIATE stmt using i.killtime, i.username, i.sid, i.serial#, i.ctime, i.machine, i.TERMINAL, i.PROGRAM, i.ACTION, i.MODULE;
    18  dbms_output.put_line('SID '||i.sid ||' with serial# '||i.serial#||' was killed');
    19    END LOOP;
    20  END;
    21  / Gerard

  • PL/SQL ORA-00936 missing expression

    Hello all,
    I'm having an issues and need help with this script... Please help, thanks.
    error:
    ====
    31 32 /
    AST_UPDATED_BY,LAST_UPDATE_LOGIN) values(i,'ERROR_LOG_ID'||i, 'PROCEDURE_NAME'||i||, 'REQUEST_ID' |i||, 'PROCESS_NAME' ||i||, 'ERROR_TYPE'|i|, 'MESSAGE_DETAILS' ||i||, 'ERROR_TIMESTAMP' |i|, 'STATUS' ||i||, 'CREATED_BY' ||i||, 'CREATION_DATE' ||i||, "to_char(last_update_date, 'dd-Mon-yyyy hh:mi:ss')" |i|, 'LAST_UPDATED_BY' ||i||, 'LAST_UPDATE_LOGIN');
    ERROR at line 28:
    ORA-06550: line 28, column 84:
    PL/SQL: ORA-00936: missing expression
    ORA-06550: line 27, column 1:
    PL/SQL: SQL Statement ignored
    script.
    ====
    declare
    CURSOR c_iostats IS
    SELECT * from XXFRO.XXFRO_ERRORS;
    ERROR_LOG_ID NUMBER;
    PROCESS_NAME VARCHAR2(50);
    ERROR_TYPE VARCHAR2(20);
    STATUS VARCHAR2(20);
    MESSAGE_DETAILS VARCHAR2(2000);
    ERROR_LOG_ID NUMBER;
    PROCEDURE_NAME VARCHAR2(50);
    REQUEST_ID NUMBER;
    PROCESS_NAME VARCHAR2(50);
    ERROR_TYPE VARCHAR2(20);
    MESSAGE_DETAILS VARCHAR2(2000);
    ERROR_TIMESTAMP DATE;
    STATUS VARCHAR2(20);
    CREATED_BY NUMBER;
    CREATION_DATE DATE;
    LAST_UPDATE_DATE DATE;
    LAST_UPDATED_BY NUMBER;
    LAST_UPDATE_LOGIN NUMBER;
    Begin
    for i in 1..1000000 LOOP
    insert into IO_TEST(ERROR_LOG_ID
    ,PROCEDURE_NAME
    ,REQUEST_ID
    ,PROCESS_NAME
    ,ERROR_TYPE
    ,MESSAGE_DETAILS
    ,ERROR_TIMESTAMP
    ,STATUS,CREATED_BY
    ,CREATION_DATE
    ,LAST_UPDATE_DATE
    ,LAST_UPDATED_BY
    ,LAST_UPDATE_LOGIN)
    values(i,'ERROR_LOG_ID'||i, 'PROCEDURE_NAME'||i||, 'REQUEST_ID' |i||, 'PROCESS_NAME' ||i||, 'ERROR_TYPE'|i|, 'MESSAGE_DETAILS' ||i||, 'ERROR_TIMESTAMP' |i|, 'STATUS' ||i||, 'CREATED_BY' ||i||, 'CREATION_DATE' ||i||,'LAST_UPDATE_DATE' ||i||, 'LAST_UPDATED_BY' ||i||, 'LAST_UPDATE_LOGIN');
    END LOOP;
    end;
    Thanks,
    HCDBA

    Hi,
    Why are you using the concat(||) Symbol after i in the expression String 'CREATED_BY' ||i||. When you are padding between
    two text we use so.
    Ex: If you want to concat 'i' between String we use
    DBMS_OUTPUT.PUT_LINE('Five is between '|| i || 'and Six');The Insert Statement should be re-written as
    INSERT INTO io_test
                (error_log_id, procedure_name, request_id,
                 process_name, ERROR_TYPE, message_details,
                 error_timestamp, status, created_by,
                 creation_date, last_update_date,
                 last_updated_by, last_update_login
         VALUES (i, 'ERROR_LOG_ID' || i, 'PROCEDURE_NAME' || i,
                  'REQUEST_ID' || i, 'PROCESS_NAME' || i, 'ERROR_TYPE' || i,
                  'MESSAGE_DETAILS'
                  || i, 'ERROR_TIMESTAMP' || i, 'STATUS' || i,
                  'CREATED_BY' || i, 'CREATION_DATE' || i,
                  'LAST_UPDATE_DATE' || i, 'LAST_UPDATED_BY' || i,
                 'LAST_UPDATE_LOGIN'
                );Thanks,
    Shankar

  • IR Report Search - ORA-20001: get_dbms_sql_cursor error ORA-00936: missing expression

    Hi All,
      I had created a IR report based on a table and it was working with no issues.  But after few days, when I try searching using the IR search bar it shows "ORA-20001: get_dbms_sql_cursor error ORA-00936: missing expression" error message. I don't see any debug messages or errors in the debug window. The Finder drop down is empty too, there are no columns displayed to filter.
    When I recreate the IR report(new page) based on the same table, It works fine and there are no issues with the search.  But the old IR report search doesnt work. I have not modified the any thing in the old report after initial creation. Report uses Primary key based on a sequence.
    What might have caused this issue?
    Is there a way to intercept the search query from IR report?
    Apex version - 4.2.3.00.08.
    Any help on this appreciated.
    Thanks,
    Jagan

    Hi MK, as I had mentioned in my post, I don't see any logs in the debug window, query tab.
    Can you please guide me how to check the query logs on search?
    Thanks,
    Jagan

  • Selective (Conditional) export failing with ORA-00936: missing expression

    HI Experts,
    I was doing selective (Conditional) export of one table. But the export is failing with the following error.
    ORA-00936: missing expression
    I have been trying for the past 2 hours on this to resolve. But not.
    Could anybody please how can i export the data..
    Oracle Version : 10.2.0.5
    OS : SOLARIS 10 SPARC
    exp E3DAIUSR/E3DAIUSR@ORCL statistics=none file=exp_TABLE.dmp log=exp_Conditional.log TABLES=PGTB_IFDATA query=\'where CRE_DT=\''20120513\'
    The error is as follows
    ==============
    About to export specified tables via Conventional Path ...
    . . exporting table PGTB_IFDATA
    EXP-00056: ORACLE error 936 encountered
    ORA-00936: missing expression
    Export terminated successfully with warnings.
    Please help me on this..

    Hi ,
    Now i am using the query like below. But still getting the error.
    exp E3DAIUSR/E3DAIUSR@ORCL statistics=none file=exp_TD17870_1_TABLE.dmp log=exp_TD17870_1_TABLE_Conditional.log TABLES=PGTB_IFDATA query=\"where CRE_DT=\'20120513\'"
    Error
    ====
    LRM-00111: no closing quote for value 'where CRE_'
    EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
    EXP-00000: Export terminated unsuccessfully
    This is Solaris OS
    Please provide me correct query if possible

  • Java.sql.SQLException: ORA-00936: missing expression

    Hi I am write a sql query in the entity bean and have edit the session bean so as this method of querying all the line from the table trp_stime_reports. But i am getting this error.
    javax.ejb.EJBException: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00936: missing expression
    Error Code: 936
    Call:SELECT TRP_ID, PROJECT_ID, TASK_ID, DATE, COMMENTS, WEEK_NUMBER, DURATION, EMPLOYEE_ID FROM TRP_STIME_REPORTS WHERE (EMPLOYEE_ID = ?)
         bind => [1]
    Query:ReportQuery(org.trp.persistence.TrpStimeReports); nested exception is:
         Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00936: missing expression
    Error Code: 936
    Call:SELECT TRP_ID, PROJECT_ID, TASK_ID, DATE, COMMENTS, WEEK_NUMBER, DURATION, EMPLOYEE_ID FROM TRP_STIME_REPORTS WHERE (EMPLOYEE_ID = ?)
         bind => [1]
    Query:ReportQuery(org.trp.persistence.TrpStimeReports); nested exception is: oracle.oc4j.rmi.OracleRemoteException: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00936: missing expression
    Error Code: 936
    Call:SELECT TRP_ID, PROJECT_ID, TASK_ID, DATE, COMMENTS, WEEK_NUMBER, DURATION, EMPLOYEE_ID FROM TRP_STIME_REPORTS WHERE (EMPLOYEE_ID = ?)
         bind => [1]
    Query:ReportQuery(org.trp.persistence.TrpStimeReports); nested exception is:
         Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00936: missing expression
    Error Code: 936
    oracle.oc4j.rmi.OracleRemoteException: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00936: missing expression
    Error Code: 936
    Call:SELECT TRP_ID, PROJECT_ID, TASK_ID, DATE, COMMENTS, WEEK_NUMBER, DURATION, EMPLOYEE_ID FROM TRP_STIME_REPORTS WHERE (EMPLOYEE_ID = ?)
         bind => [1]
    Query:ReportQuery(org.trp.persistence.TrpStimeReports)
         at com.evermind.server.ejb.EJBUtils.getUserException(EJBUtils.java:346)
         at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:69)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at SessionEJB_RemoteProxy_56ok9jj.getEmpTrp(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    What is wrong with my sql query and please help me.
    Regards
    Lutchumaya

    Hi Lutchumaya,
    Just a litlle advice: use the SQL Worksheet (Jdev menus: Tools-> SQL Worksheet) in order to test your query, you immediatly know if the error is coming from the sql or from your code (maybe the "?" is not correctly replaced at runtime?)
    Regards,
    Tif

  • ERROR: ORACLE prepare error: ORA-00936: missing expression

    Hello,
    I am required to run "pass-through" Oracle SQL, to extract data from tables into SAS for processing and manipulation. My code (attached) reads and writes (executes) but with zero records to test first. I cannot get past the Prepare Error.
    The query is very much like other queries that seem to work, but I cannot get past this prepare error. I have no other access to individauls with adequate knowledge of PL SQL, and as a last stop hoped others in the forum could quickly spot the source of errror.
    Thanks very much in advance for any assistance.
    Jeff
    1 ;*';*";*/;quit;run;
    2 OPTIONS PAGENO=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 _ALL_ CLOSE;
    NOTE: Some of your options or statements may not be supported with the Activex or Java series of devices. Graph defaults for these
    drivers may be different from other SAS/GRAPH device drivers. For further information, please contact Technical Support.
    9 OPTIONS DEV=ACTIVEX;
    10 FILENAME EGHTML TEMP;
    NOTE: Writing HTML(EGHTML) Body 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=("CODEBASE"="http://www2.sas.com/codebase/graph/v91/sasgraph.exe") NOGTITLE NOGFOOTNOTE GPATH=&sasworklocation
    11 ! ;
    12
    13 %gaccessible;
    14 /********************************************************/
    15 * RX_BIPLR_V3.SAS ;
    16 /********************************************************/
    17
    18 dm 'log;clear;out;clear';
    19 options linesize =120;
    20 Option obs=0 NoReplace;
    21
    22 ****************************************************************************************;
    23 *Date Programmer Reviewed By WHAT WAS DONE;
    24 *----- -------------- ------------ -----------------------------------------;
    25 *2005 David Boyd Program creation for test population;
    26 *;
    27 *02/06/2006 Ivon Jones Modified to include total population;
    28 *;
    29 *07/20/2006 Ivon Jones Identified data elements for exclusion;
    30 * or inclusion for consolidation with ;
    31 * Robin's report;
    32 *;
    33 *08/18/2006 Ivon Jones Updated the Specific Therapeutic Classes;
    34 * 10-2009 J Shaf - modified to extract actual or potential Bipolar Dx from UBH and Medical Claims;
    35 ****************************************************************************************;
    36
    37
    38
    39 *%let allclmorgn = ('M','A') ; /* all claims origin code */
    40 %let begdate='01SEP2009'd;
    41 %let enddate='30SEP2009'd;
    42 %let q = %str(%') ;
    43
    44
    45 data _null_ ;
    46 call symput('fdos',put(intnx('month',"&begdate"d,-27,'beginning'), date9.) ) ;
    47 call symput('ldos',put(intnx('month',"&enddate"d,-0,'ending'), date9.) ) ;
    48 run ;
    NOTE: DATA statement used (Total process time):
    real time 0.00 seconds
    2 The SAS System 11:44 Friday, October 30, 2009
    cpu time 0.01 seconds
    49
    50
    51
    52 **************************************************************;
    53 * ??Use the data _null_ step to create a macro variable for the ;
    54 * year and month based on the ldos macro variable in the data ;
    55 * step above?? ;
    56 **************************************************************;
    57
    58
    59 data _null_ ;
    60 if month("&ldos"d) < 10
    61 then call symput('yr_mo',compress(year("&ldos"d) || '0' || month("&ldos"d) ) ) ;
    62 else call symput('yr_mo',compress(year("&ldos"d) || month("&ldos"d) ) ) ;
    63 run ;
    NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
    61:39 61:64 62:39 62:57
    NOTE: DATA statement used (Total process time):
    real time 0.00 seconds
    cpu time 0.00 seconds
    64
    65 *%put &biplr_dx;
    66 %put &begdate ;
    '01SEP2009'd
    67 %put &enddate ;
    '30SEP2009'd
    68 %put &fdos ;
    01JUN2007
    69 %put &ldos ;
    30SEP2009
    70 %put &q ;
    71
    72
    73 libname biplr'/home/jshafi01/projects/adhoc/biplr_dprsn/data';
    NOTE: Libref BIPLR was successfully assigned as follows:
    Engine: V9
    Physical Name: /home/jshafi01/projects/adhoc/biplr_dprsn/data
    74 libname rosdwp oracle user="&oracle_user." pass="&oracle_pass." buffsize=32767 path='rosdwp';
    NOTE: Libref ROSDWP was successfully assigned as follows:
    Engine: ORACLE
    Physical Name: rosdwp
    75
    76 data work.biplr_up_v1;
    77 attrib mbr_id length=$26;
    78 set biplr.biplr_ubh_med_v1;
    79 run;
    NOTE: There were 0 observations read from the data set BIPLR.BIPLR_UBH_MED_V1.
    NOTE: The data set WORK.BIPLR_UP_V1 has 0 observations and 1 variables.
    NOTE: DATA statement used (Total process time):
    real time 0.01 seconds
    3 The SAS System 11:44 Friday, October 30, 2009
    cpu time 0.00 seconds
    80
    81 proc contents;
    82 run;
    NOTE: PROCEDURE CONTENTS used (Total process time):
    real time 0.03 seconds
    cpu time 0.03 seconds
    83
    84 proc datasets
    85      library = rosdwp nolist;
    86      delete biplr_up_v1;
    87 quit;
    NOTE: Deleting ROSDWP.BIPLR_UP_V1 (memtype=DATA).
    NOTE: PROCEDURE DATASETS used (Total process time):
    real time 3.74 seconds
    cpu time 0.03 seconds
    88
    89 proc datasets
    90      library=work nolist;
    91      copy out = rosdwp move;
    92      select biplr_up_v1 ;
    93 quit;
    NOTE: Moving WORK.BIPLR_UP_V1 to ROSDWP.BIPLR_UP_V1 (memtype=DATA).
    NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.
    NOTE: There were 0 observations read from the data set WORK.BIPLR_UP_V1.
    NOTE: The data set ROSDWP.BIPLR_UP_V1 has 0 observations and 1 variables.
    NOTE: PROCEDURE DATASETS used (Total process time):
    real time 0.32 seconds
    cpu time 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);
    105      execute(alter session set nls_date_format = 'ddmonyyyy') by rosdwp;
    106 CREATE table biplr_rx as
    107 SELECT
    108 mrb_id,
    109 pcp_spc,
    110 rx_date,
    4 The SAS System 11:44 Friday, October 30, 2009
    111 brand,
    112 generic,
    113 ahfs_cd,
    114 ahfs_dsc,
    115 lbl,
    116 strngth,
    117 unt,
    118 spc_tx_cls_cd,
    119 spc_tx_cls_dsc,
    120 gcn,
    121 rx_num,
    122 rx_ingrd,
    123 rx_paid,
    124 rx_cnt,
    125 rx_qty,
    126 rx_day
    127 FROM connection to rosdwp
    128 (SELECT
    129 mid.UNIQ_MBR_ID as mrb_id,
    130 pd.PRVDR_SPCLTY_DESC as pcp_spc,
    131 pcf.LAST_SRVC_DT as rx_date,
    132 dd.BRAND_NAME as brand,
    133 dd.GNRC_NAME as generic,
    134 dd.AHFS_THRPTC_CLS_CD as ahfs_cd,
    135 dd.AHFS_THRPTC_CLS_DESC as ahfs_dsc,
    136 dd.LABEL_NAME as lbl,
    137 dd.STRNGTH_NUM as strngth,
    138 dd.STRNGTH_UNIT_DESC as unt,
    139 dd.SPECF_THRPTC_CLS_CD as spc_tx_cls_cd,
    140 dd.SPECF_THRPTC_CLS_DESC as spc_tx_cls_dsc,
    141 dd.GCN_NUM as gcn,
    142 pcf.PRSCRPTN_NUM as rx_num,
    143 SUM(pcf.INGRDNT_AMT) as rx_ingrd,
    144 SUM(pcf.PD_AMT) as rx_paid,
    145 SUM(pcf.UNIT_SRVC_CNT) as rx_cnt,
    146 SUM(pcf.DSPNSD_QTY) as rx_qty,
    147 SUM(pcf.DAY_SUPLY_CNT) as rx_day
    148 FROM
    149 PHRMCY_CLM_FACT pcf,
    150 MBR_ID_DMNSN mid,
    151 DRUG_DMNSN dd,
    152 PRVDR_DMNSN pd,
    153           biplr_up_v1
    154 WHERE
    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 ('M','A')) AND
    162 (PHRMCY_CLM_FACT.LAST_SRVC_DT BETWEEN between &q.&fdos.&q and &q.&ldos.&q)
    163      )
    164 Group By
    165 mid.UNIQ_MBR_ID ,
    166 pd.PRVDR_SPCLTY_DESC ,
    167 pcf.LAST_SRVC_DT ,
    168 dd.BRAND_NAME ,
    5 The SAS System 11:44 Friday, October 30, 2009
    169 dd.GNRC_NAME ,
    170 dd.AHFS_THRPTC_CLS_CD ,
    171 dd.AHFS_THRPTC_CLS_DESC ,
    172 dd.LABEL_NAME ,
    173 dd.STRNGTH_NUM ,
    174 dd.STRNGTH_UNIT_DESC ,
    175 dd.SPECF_THRPTC_CLS_CD ,
    176 dd.SPECF_THRPTC_CLS_DESC ,
    177 dd.GCN_NUM ,
    178 pcf.PRSCRPTN_NUM
    179 );
    ERROR: ORACLE prepare error: ORA-00936: missing expression. SQL statement: SELECT mid.UNIQ_MBR_ID as mrb_id,
    pd.PRVDR_SPCLTY_DESC as pcp_spc, pcf.LAST_SRVC_DT as rx_date, dd.BRAND_NAME as brand, dd.GNRC_NAME as generic,
    dd.AHFS_THRPTC_CLS_CD as ahfs_cd, dd.AHFS_THRPTC_CLS_DESC as ahfs_dsc, dd.LABEL_NAME as lbl, dd.STRNGTH_NUM as
    strngth, dd.STRNGTH_UNIT_DESC as unt, dd.SPECF_THRPTC_CLS_CD as spc_tx_cls_cd, dd.SPECF_THRPTC_CLS_DESC as
    spc_tx_cls_dsc, dd.GCN_NUM as gcn, pcf.PRSCRPTN_NUM as rx_num, SUM(pcf.INGRDNT_AMT) as rx_ingrd, SUM(pcf.PD_AMT)
    as rx_paid, SUM(pcf.UNIT_SRVC_CNT) as rx_cnt, SUM(pcf.DSPNSD_QTY) as rx_qty, SUM(pcf.DAY_SUPLY_CNT) as rx_day
    FROM PHRMCY_CLM_FACT pcf, MBR_ID_DMNSN mid, DRUG_DMNSN dd, PRVDR_DMNSN pd, biplr_up_v1 WHERE (
    (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 ('M','A')) AND (PHRMCY_CLM_FACT.LAST_SRVC_DT BETWEEN between '01JUN2007'
    and '30SEP2009') ) Group By mid.UNIQ_MBR_ID , pd.PRVDR_SPCLTY_DESC , pcf.LAST_SRVC_DT , dd.BRAND_NAME ,
    dd.GNRC_NAME , dd.AHFS_THRPTC_CLS_CD , dd.AHFS_THRPTC_CLS_DESC , dd.LABEL_NAME , dd.STRNGTH_NUM ,
    dd.STRNGTH_UNIT_DESC , dd.SPECF_THRPTC_CLS_CD , dd.SPECF_THRPTC_CLS_DESC , dd.GCN_NUM , pcf.PRSCRPTN_NUM.
    NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
    180 execute (drop table biplr_up_v1) by rosdwp;
    NOTE: Statement not executed due to NOEXEC option.
    181 disconnect from rosdwp;
    NOTE: Statement not executed due to NOEXEC option.
    182 quit;
    NOTE: The SAS System stopped processing this step because of errors.
    NOTE: PROCEDURE SQL used (Total process time):
    real time 0.14 seconds
    cpu time 0.03 seconds
    183
    184

    Hello Again ,
    Wish Oracle was a bit more informative. Am using a SAS Institute Product called Enterprise Guide. A "hot fix" was installed to address an issue that the product appears unable to save the latest version of edited code changes (hence " BETWEEN between" remaining even after a prior edit). In any case, with the change, am now receiving this error:
    " ERROR: ORACLE prepare error: ORA-00904: "PHRMCY_CLM_FACT"."LAST_SRVC_DT": invalid identifier". (Log file appears below)
    -The error remains, regardless of whether one uses "pass through" code to pass the date range to Oracle (which looks ok from the log output below I believe), or if I hard code the date range into the PL SQL query itself.
    -The Prepare error always appears at end of the inner SELECT.
    -The Prepare error remains, with or without the GROUP BY clause.
    Is there anything else here I am missing? Someone suggested a reserve word - but from other ANSI SQL versions, I do not see that is the case. I have consulted SAS Tech Support and SAS List Serve at University of GA. but nothing definitive from these sources. Have requested facility to be able to run Oracle directly, outside this SAS Institute product - in process.
    Any suggestions are greatly appreciated. Thanks to everyone very much.
    Jeff
    14 /********************************************************/
    15 * RX_BIPLR_V3.SAS ;
    16 /********************************************************/
    17
    18 dm 'log;clear;out;clear';
    19 options linesize =120;
    20 Option obs=0 NoReplace;
    21
    22 ****************************************************************************************;
    23 *Date       Programmer         Reviewed By     WHAT WAS DONE;
    24 *-----      --------------     ------------    -----------------------------------------;
    25 *2005 D. Boyd Program creation for test population;
    26 *;
    27 *02/06/2006 I. Jones Modified to include total population;
    28 *;
    29 *07/20/2006 I. Jones Identified data elements for exclusion;
    30 * or inclusion for consolidation with ;
    31 * Robin's report;
    32 *;
    33 *08/18/2006 I Jones Updated the Specific Therapeutic Classes;
    34 * 10-2009 J Shaf - modified to extract actual or potential Bipolar Dx from UBH and Medical Claims;
    35 ****************************************************************************************;
    36
    37
    38
    39 *%let allclmorgn = ('M','A') ; /* all claims origin code */
    40 %let begdate='01SEP2009'd;
    41 %let enddate='30SEP2009'd;
    42 %let q = %str(%') ;
    43
    44
    45 data null ;
    46 call symput('fdos',put(intnx('month',"&begdate"d,-27,'beginning'), date9.) ) ;
    47 call symput('ldos',put(intnx('month',"&enddate"d,-0,'ending'), date9.) ) ;
    48 run ;
    2 The SAS System 12:46 Monday, November 2, 2009
    NOTE: DATA statement used (Total process time):
    real time 0.00 seconds
    cpu time 0.00 seconds
    49
    50
    51
    52 **************************************************************;
    53 * ??Use the data null step to create a macro variable for the ;
    54 * year and month based on the ldos macro variable in the data ;
    55 * step above?? ;
    56 **************************************************************;
    57
    58
    59 data null ;
    60 if month("&ldos"d) < 10
    61 then call symput('yr_mo',compress(year("&ldos"d) || '0' || month("&ldos"d) ) ) ;
    62 else call symput('yr_mo',compress(year("&ldos"d) || month("&ldos"d) ) ) ;
    63 run ;
    NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
    61:39 61:64 62:39 62:57
    NOTE: DATA statement used (Total process time):
    real time 0.00 seconds
    cpu time 0.01 seconds
    64
    65 *%put &biplr_dx;
    66 %put &begdate ;
    '01SEP2009'd
    67 %put &enddate ;
    '30SEP2009'd
    68 %put &fdos ;
    01JUN2007
    69 %put &ldos ;
    30SEP2009
    70 %put &q ;
    71
    72
    73 libname biplr'/home/jshafi01/projects/adhoc/biplr_dprsn/data';
    NOTE: Libref BIPLR was successfully assigned as follows:
    Engine: V9
    Physical Name: /home/jshafi01/projects/adhoc/biplr_dprsn/data
    74 libname rosdwp oracle user="&oracle_user." pass="&oracle_pass." buffsize=32767 path='rosdwp';
    NOTE: Libref ROSDWP was successfully assigned as follows:
    Engine: ORACLE
    Physical Name: rosdwp
    75
    76 data work.biplr_up_v1;
    77 attrib mbr_id length=$26;
    78 set biplr.biplr_ubh_med_v1;
    79 run;
    NOTE: There were 0 observations read from the data set BIPLR.BIPLR_UBH_MED_V1.
    NOTE: The data set WORK.BIPLR_UP_V1 has 0 observations and 1 variables.
    NOTE: DATA statement used (Total process time):
    real time 0.00 seconds
    cpu time 0.01 seconds
    80
    81 proc contents;
    82 run;
    NOTE: PROCEDURE CONTENTS used (Total process time):
    real time 0.02 seconds
    cpu time 0.02 seconds
    83
    84 proc datasets
    85      library = rosdwp nolist;
    86      delete biplr_up_v1;
    87 quit;
    NOTE: Deleting ROSDWP.BIPLR_UP_V1 (memtype=DATA).
    NOTE: PROCEDURE DATASETS used (Total process time):
    real time 0.61 seconds
    cpu time 0.01 seconds
    88
    89 proc datasets
    90      library=work nolist;
    91      copy out = rosdwp move;
    92      select biplr_up_v1 ;
    93 quit;
    NOTE: Moving WORK.BIPLR_UP_V1 to ROSDWP.BIPLR_UP_V1 (memtype=DATA).
    NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.
    NOTE: There were 0 observations read from the data set WORK.BIPLR_UP_V1.
    NOTE: The data set ROSDWP.BIPLR_UP_V1 has 0 observations and 1 variables.
    NOTE: PROCEDURE DATASETS used (Total process time):
    real time 0.15 seconds
    cpu time 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);
    105      execute(alter session set nls_date_format = 'ddmonyyyy') by rosdwp;
    106 CREATE table biplr_rx as
    107 SELECT
    108 mrb_id,
    109 uniq_mbr_id,
    110 pcp_spc,
    111 rx_date,
    112 brand,
    113 generic,
    114 ahfs_cd,
    115 ahfs_dsc,
    116 lbl,
    117 strngth,
    118 unt,
    119 spc_tx_cls_cd,
    120 spc_tx_cls_dsc,
    121 gcn,
    122 rx_num,
    123 rx_ingrd,
    124 rx_paid,
    125 rx_cnt,
    126 rx_qty,
    127 rx_day
    128 FROM connection to rosdwp
    129 (SELECT
    130 mid.UNIQ_MBR_ID as uniq_mrb_id,
    131 blpr.mrb_id.mbr_id,
    132 pd.PRVDR_SPCLTY_DESC as pcp_spc,
    133 pcf.LAST_SRVC_DT as rx_date,
    134 dd.BRAND_NAME as brand,
    135 dd.GNRC_NAME as generic,
    136 dd.AHFS_THRPTC_CLS_CD as ahfs_cd,
    137 dd.AHFS_THRPTC_CLS_DESC as ahfs_dsc,
    138 dd.LABEL_NAME as lbl,
    139 dd.STRNGTH_NUM as strngth,
    140 dd.STRNGTH_UNIT_DESC as unt,
    141 dd.SPECF_THRPTC_CLS_CD as spc_tx_cls_cd,
    142 dd.SPECF_THRPTC_CLS_DESC as spc_tx_cls_dsc,
    143 dd.GCN_NUM as gcn,
    144 pcf.PRSCRPTN_NUM as rx_num,
    145 SUM(pcf.INGRDNT_AMT) as rx_ingrd,
    146 SUM(pcf.PD_AMT) as rx_paid,
    147 SUM(pcf.UNIT_SRVC_CNT) as rx_cnt,
    148 SUM(pcf.DSPNSD_QTY) as rx_qty,
    149 SUM(pcf.DAY_SUPLY_CNT) as rx_day
    150 FROM
    151 PHRMCY_CLM_FACT pcf,
    152 MBR_ID_DMNSN mid,
    153 DRUG_DMNSN dd,
    154 PRVDR_DMNSN pd,
    155      BIPLR_UP_V1 blpr
    156 WHERE
    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 ('M','A')) AND
    163 (PHRMCY_CLM_FACT.LAST_SRVC_DT BETWEEN &q.&fdos.&q and &q.&ldos.&q)
    164 );
    ERROR: ORACLE prepare error: ORA-00904: "PHRMCY_CLM_FACT"."LAST_SRVC_DT": invalid identifier. SQL statement: SELECT
    mid.UNIQ_MBR_ID as uniq_mrb_id, blpr.mrb_id.mbr_id, pd.PRVDR_SPCLTY_DESC as pcp_spc, pcf.LAST_SRVC_DT as
    rx_date, dd.BRAND_NAME as brand, dd.GNRC_NAME as generic, dd.AHFS_THRPTC_CLS_CD as ahfs_cd,
    dd.AHFS_THRPTC_CLS_DESC as ahfs_dsc, dd.LABEL_NAME as lbl, dd.STRNGTH_NUM as strngth, dd.STRNGTH_UNIT_DESC as
    unt, dd.SPECF_THRPTC_CLS_CD as spc_tx_cls_cd, dd.SPECF_THRPTC_CLS_DESC as spc_tx_cls_dsc, dd.GCN_NUM as gcn,
    pcf.PRSCRPTN_NUM as rx_num, SUM(pcf.INGRDNT_AMT) as rx_ingrd, SUM(pcf.PD_AMT) as rx_paid, SUM(pcf.UNIT_SRVC_CNT)
    as rx_cnt, SUM(pcf.DSPNSD_QTY) as rx_qty, SUM(pcf.DAY_SUPLY_CNT) as rx_day FROM PHRMCY_CLM_FACT pcf,
    MBR_ID_DMNSN mid, DRUG_DMNSN dd, PRVDR_DMNSN pd, BIPLR_UP_V1 blpr WHERE (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 ('M','A')) AND
    (PHRMCY_CLM_FACT.LAST_SRVC_DT BETWEEN '01JUN2007' and '30SEP2009').
    NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
    165 execute (drop table biplr_up_v1) by rosdwp;
    NOTE: Statement not executed due to NOEXEC option.
    166 disconnect from rosdwp;
    NOTE: Statement not executed due to NOEXEC option.
    167 quit;
    NOTE: The SAS System stopped processing this step because of errors.
    NOTE: PROCEDURE SQL used (Total process time):
    real time 0.24 seconds
    cpu time 0.02 seconds
    168
    Edited by: user12142482 on Nov 2, 2009 4:02 PM

  • Error while loading Flat file to the table (ORA-00936: missing expression)

    lat file Hi Gurus
    Receiving the following error while trying to load of flat file to the database :
    ODI-1228: Task test_file_load (Integration) fails on the target ORACLE connection DEMO_STAGE.
    Caused By: java.sql.SQLSyntaxErrorException: ORA-00936: missing expression
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1079)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1466)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3937)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1535)
         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:2906)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:537)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:338)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:272)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:263)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:822)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:123)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:662)
    The file which I have tried to load is : SRC_SALES_PERSON and teh table structure is
    CREATE table "TRG_SALES_PERSON"(
    "SALES_PERSON_ID" NUMBER(8,0) NOT NULL,
    "FIRST_NAME" VARCHAR2(80),
    "LAST_NAME" VARCHAR2(80),
    "DATE_HIRED" VARCHAR2(80),
    "DATE_UPDATED" DATE NOT NULL)
    Knowledge module used are
    LKM File to SQL
    IKM SQL Incremental Update
    We rae using ODI 11g R2 ...
    Thanks and reallty appreciate any help in thsi regard.

    HI there,
    I am facing the same issue while loading data from SRC_SALES_PERSON(flat file) to TRG_CUSTOMER.
    I dont see any errors in the steps however the data is not laoded finally. Here are the sql commands
    **On source**
    select     ID     C11_ID,
         LASTNAME     C9_LASTNAME
    from      TABLE
    /*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=SRC_SALES_PERSONSNP$CRLOAD_FILE=D:\Pratima\Softwares\ODI\ofm_odi_companion_generic_11.1.1.5.1_disk1_1of1[1]\demo\oracledi-demo\oracledi\demo\file/SRC_SALES_PERSON.txtSNP$CRFILE_FORMAT=FSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=IDSNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLINE_OFFSET=1SNP$CRLENGTH=11SNP$CRPRECISION=11SNP$CRACTION_ON_ERROR=0SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=FIRSTNAMESNP$CRTYPE_NAME=STRINGSNP$CRLINE_OFFSET=12SNP$CRLENGTH=50SNP$CRPRECISION=50SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=LASTNAMESNP$CRTYPE_NAME=STRINGSNP$CRLINE_OFFSET=62SNP$CRLENGTH=50SNP$CRPRECISION=50SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=DATE1SNP$CRTYPE_NAME=STRINGSNP$CRLINE_OFFSET=112SNP$CRLENGTH=20SNP$CRPRECISION=20SNP$CR$$SNPS_END_KEY*/
    On Target
    insert into STAGING.C$_0TRG_CUSTOMER
         C11_ID,
         C9_LASTNAME
    values
         :C11_ID,
         :C9_LASTNAME
    The actual code at source fails however the step is in green.
    Thanks in Advance,
    Pratima

  • ORA-00936: Missing Expression when using a claculation as a condition item

    Hi
    I created a calculation below to create a subtotal on each row of a group of selected items.
    SUM(Invoice Amount)OVER(PARTITION BY Supplier Num ORDER BY Payment Currency Code)
    This worked fine - but then I wanted to create a condition based on this calculation and when I used the calculation as a condition item and reran the report I received the 'ORA-00936: Missing Expression' error. So not too sure why it is fine as a calculation but not as part of a condition.
    We use Discoverer version 4.1
    Am I missing something or is this a bug?
    Any help would be very appreciated
    Thanks
    Marcus

    Thanks for your reply, Rod
    We are using the 9.2.0.5 version of the database
    I am not a SQL expert, by any means, but below is the line that refers to the condition in the sql inspector
    WHERE ( ( E_152 )/2 > 50)
    presuambly that means E_152 is the calculation, I think this may be refering to this at the beginning of the report:
    SELECT DISTINCT E316344 as E316344,E316372 as E316372,E316411 as E316411,E316425 as E316425,E316496 as E316496,E316497 as E316497,E316498 as E316498,E316510 as E316510,E316511 as E316511,E316512 as E316512,E316515 as E316515,E316517 as E316517,E316519 as E316519,E316520 as E316520,E_24 as E_24,E_21 as E_21,E_18 as E_18,E_16 as E_16,E_13 as E_13,E_11 as E_11,E316501 as E316501 FROM ( SELECT E_152 as E_152,DISTINCT E316344 as E316344,E316372 as E316372,E316411 as E316411,E316425 as E316425,E316496 as E316496,E316497 as E316497,E316498 as E316498,E316510 as E316510,E316511 as E316511,E316512 as E316512,E316515 as E316515,E316517 as E316517,E316519 as E316519,E316520 as E316520,E_24 as E_24,E_21 as E_21,E_18 as E_18,E_16 as E_16,E_13 as E_13,E_11 as E_11,E316501 as E316501 FROM ( SELECT DISTINCT i316344 as E316344,i316372 as E316372,i316411 as E316411,i316425 as E316425,i316496 as E316496,i316497 as E316497,i316498 as E316498,i316510 as E316510,i316511 as E316511,i316512 as E316512,i316515 as E316515,i316517 as E316517,i316519 as E316519,i316520 as E316520,SUM(i316501) OVER(PARTITION BY i316345 ORDER BY i316520 )/2 as E_24,( i316501-( NVL(i316502,0) ) )*( NVL(i316522,1) ) as E_21,i316501-( NVL(i316502,0) ) as E_18,NVL(i316502,0) as E_16,i316501*( NVL(i316522,1) ) as E_13,NVL(i316522,1) as E_11,i316501 as E316501,SUM(i316501) OVER(PARTITION BY i316345 ORDER BY i316520 ) as E_152
    Apologies if this info is not that helpful
    Would it have anything to do with the fact that the row calculation is based on several rows (i.e. a subtotal) and if a single row is excluded it would change the value of the other rows within that subtotal group. Maybe it causes some sort of circular issue?
    Anyway, thanks again for your help - hopefully we can resolve it
    Marcus

  • Dynamic table in Oracle report data model using laxical parameter is giving error Ora-00936: missing expression

    Hi ,
    I am using Oracle report 10G
    And trying to create report with dynamic table
    SELECT &COL1, &COL2
    FROM &TAB
    If I put this on data model it gives below error
    ORA-00936: missing expression
    ==> from
    Can anybody advise to solve this issue.
    Regards,
    Brajesh

    Look in the Reports Builder Help:
    If you want to use lexical references in your SELECT clause, you should create a separate lexical reference for each column you will substitute. In addition, you should assign an alias to each lexical reference.
    Does adding the column alias solve the problem?

  • ORA-00936: missing expression in HTMLDB

    Hello,
    I have created a report based on a table
    Initially this page comes up fine
    When I do "Insert another record" and come back to this report page using "back" button, I get the message
    failed to parse SQL query:
    ORA-00936: missing expression
    Clicking the Reset button displays the page as expected
    Is there any way by which I can reset the report page each time before redering
    So that the end-user doesnt have to click the Reset button
    I dont see any SQL error in this as "Reset" brings things to normal
    Please let me know the way to get rid of this unpleasant message
    Thanks

    Since you have not posted the output from "show errors;", my initial guess about the error would be for the "date" variable that you have declared. Try renaming that column to say date1.

  • ORA-00936 Missing expression - error in composite statement

    I'm using the following statement to call a function which uses a number retrieved from a table i.e.
    SELECT GETNEXTBUSINESSDATE(TO_DATE('28/08/2003','dd/mm/yyyy'), TO_NUMBER(SELECT VALUE1 FROM PARAMETERS WHERE PARCODE = 'CCR1' AND ATTRIBUTE1 = 'CCRNRQST1')) FROM DUAL;
    The function adds the value store in the value1 field to a date to get the next buisness date. The above statement is giving me an ORA-00936 Missing expression error message.
    Can anybody help ?

    We can't pass a query as a parameter.
    You'll have to write a function that accepts PARCODE and ATTRIBUTE1 as parameters, or figure some other way of getting the value.
    As I typed that, it occurred to me that this might work:
    SELECT GETNEXTBUSINESSDATE(TO_DATE('28/08/2003','dd/mm/yyyy')
          , x.val1)
    FROM ( SELECT TO_NUMBER(VALUE1) as val1
           FROM   PARAMETERS
           WHERE PARCODE = 'CCR1'
           AND ATTRIBUTE1 = 'CCRNRQST1') x;I'm not guaranteeing anything as I've never tried running a function from an in-line view.
    Cheers, APC

  • JDBC receiver - "ORA-00936:missing expression" error at sync.select command

    Hi again,
    questions, questions....
    This is my select on the JDBC rec.connection:
    I think this is a select with an AND (two criteria).
    How does it look for an OR ?
    At the moment we have another error:
    Error when executing statement for table/stored proc. 'IRIS.T_ST_MAINDRIVER' (structure 'STATEMENT'): java.sql.SQLException: ORA-00936: missing expression
    Hello experts,
    what is this? I don´t think that a select calls a stored procedure which is the only result for threads when searching in this forum!
    regards
    Dirk

    Hi,
    Are you trying to execute a Stored Procedure?
    You can't get the result from an Oracle SP with JDBC. The problem is about the cursor return from SP, that couldn't bre understood by JDBC adapter.
    You can, make a .NET wrapper to it. Make a .NET web service that gets the parameters from XI and runs the SP with them, get the oracle cursor return, transform it into a XML message and return it to the XI SOAP adapter. I've tryied and it works fine - and as I could see is the only way to perform calls to Oracle SPs with cursor return in XI.
    hope this helps!
    roberti
    Message was edited by:
            Waldemar Roberti

  • Java.sql.SQLSyntaxErrorException: ORA-00936: missing expression

    Hi,
    I got this error ..i am not figured out where the error lies .please resolve will be great appriciation ....
    XDO Data Engine Version No: 5.6.3
    Resp: 50697
    Org ID : null
    Request ID: 1425152
    All Parameters: P_ORG_ID=111:P_FROM_DATE="2013/01/01 00:00:00":P_TO_DATE="2013/08/31 00:00:00":P_VENDOR_NAME=1235
    Data Template Code: TECREMDET
    Data Template Application Short Name: SQLAP
    Debug Flag: N
    {P_VENDOR_NAME=1041, P_TO_DATE=2013/08/31 00:00:00, P_FROM_DATE=2013/01/01 00:00:00, P_ORG_ID=101}
    Calling XDO Data Engine...
    --SQLException
    java.sql.SQLSyntaxErrorException: ORA-00936: missing expression
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
    at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1189)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
    at oracle.apps.xdo.dataengine.XMLPGEN.processQuery(XMLPGEN.java:1947)
    at oracle.apps.xdo.dataengine.XMLPGEN.processSQLDataSource(XMLPGEN.java:501)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeData(XMLPGEN.java:445)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:308)
    at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
    at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
    at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
    at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
    at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:334)
    at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:294)
    at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
    +---------------------------------------------------------------------------+
    Start of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    +---------------------------------------------------------------------------+
    End of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    +---------------------------------------------------------------------------+
    Executing request completion options...
    +------------- 1) PUBLISH -------------+
    Beginning post-processing of request 1425152 on node ORAPPSUS64 at 18-OCT-2013 16:43:39.
    Post-processing of request 1425152 failed at 18-OCT-2013 16:43:40 with the error message:
    One or more post-processing actions failed. Consult the OPP service log for details.
    +--------------------------------------+
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed
    Current system time is 18-OCT-2013 16:43:40
    +---------------------------------------------------------------------------+
    Thanks,
    user.

    Hi,
    I got this error ..i am not figured out where the error lies .please resolve will be great appriciation ....
    XDO Data Engine Version No: 5.6.3
    Resp: 50697
    Org ID : null
    Request ID: 1425152
    All Parameters: P_ORG_ID=111:P_FROM_DATE="2013/01/01 00:00:00":P_TO_DATE="2013/08/31 00:00:00":P_VENDOR_NAME=1235
    Data Template Code: TECREMDET
    Data Template Application Short Name: SQLAP
    Debug Flag: N
    {P_VENDOR_NAME=1041, P_TO_DATE=2013/08/31 00:00:00, P_FROM_DATE=2013/01/01 00:00:00, P_ORG_ID=101}
    Calling XDO Data Engine...
    --SQLException
    java.sql.SQLSyntaxErrorException: ORA-00936: missing expression
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
    at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1189)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
    at oracle.apps.xdo.dataengine.XMLPGEN.processQuery(XMLPGEN.java:1947)
    at oracle.apps.xdo.dataengine.XMLPGEN.processSQLDataSource(XMLPGEN.java:501)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeData(XMLPGEN.java:445)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:308)
    at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
    at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
    at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
    at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
    at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:334)
    at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:294)
    at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
    +---------------------------------------------------------------------------+
    Start of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    +---------------------------------------------------------------------------+
    End of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    +---------------------------------------------------------------------------+
    Executing request completion options...
    +------------- 1) PUBLISH -------------+
    Beginning post-processing of request 1425152 on node ORAPPSUS64 at 18-OCT-2013 16:43:39.
    Post-processing of request 1425152 failed at 18-OCT-2013 16:43:40 with the error message:
    One or more post-processing actions failed. Consult the OPP service log for details.
    +--------------------------------------+
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed
    Current system time is 18-OCT-2013 16:43:40
    +---------------------------------------------------------------------------+
    Thanks,
    user.

  • Native SQL Query Error: DBIF_DSQL2_SQL_ERROR -- ORA-00936: missing express

    Hi,
    I tried to read data using the following SQL Query,
    fp_work = 'ABCD'.
      EXEC SQL PERFORMING WRITE_TO_ITAB .
      SELECT fp_code, bank_acc_code, bank_acc_num,
      INTO :gs_cds_data-FP_CODE,
               :gs_cds_data-BANK_ACC_CODE,
               :gs_cds_data-BANK_ACC_NUM,
       FROM  BANK_TABLE
      WHERE fp_code = :fp_wrk
      ENDEXEC.
    *&      Form  WRITE_to_itab
    FORM write_to_itab.
    To move the data into the Internal Table.
      APPEND gs_cds_data TO gt_cds_data.
      CLEAR  gs_cds_data.
    ENDFORM.                    "WRITE_to_itab
    and im getting the run time error..
    What happened?                                                                               
    The error occurred in the current database connection "SAPABC".                                                                               
    How to correct the error                                                                               
    Database error text........: "ORA-00936: missing expression"             
    Triggering SQL statement...: "FETCH NEXT "                               
    Internal call code.........: "[DBDS/NEW DSQL]"                           
    Please check the entries in the system log (Transaction SM21).                                                                               
    You may able to find an interim solution to the problem                  
    in the SAP note system. If you have access to the note system yourself,  
    use the following search criteria:                                                                               
    "DBIF_DSQL2_SQL_ERROR" C                                                                               
    If you cannot solve the problem yourself, please send the                
    following documents to SAP:
    Can anyone give me a solution to correct this error?
    In addition, Can i omit the WHERE clause, as i need to get all the data in the oracle database?

    BUT,
          EXEC SQL.
            connect to :LV_DB_NAME as :sy-uname
          ENDEXEC.
          EXEC SQL.
            SET CONNECTION :sy-uname
          ENDEXEC.
         check sy-subrc..
    connection is happening.. with sy-subrc value as ZERO

Maybe you are looking for

  • Suspend Dunning lock and dunning procedures

    Event 0303 has this description:  The function module called up at Event 0303 provides the option of executing further checks for an open item, which may mean suspending dunning or changing the dunning procedure. Tried to use it but it did not work. 

  • What is the Battery with a plug in it symbol?

    On the right hand side across from the name of your shuffle (3rd Generation) before the eject button appears a Battery with a plug inside of it, does anyone know what this is?

  • Can I get a MagSafe power connector from Apple?

    Like many, my power adaptor is coming apart at the MagSafe connector. I need a new MagSafe connector with a few inches of cable coming out of it to more permanently repair it - I really don't want to have to buy a whole power adaptor just to get a ne

  • Linked server using ASEOLEDB

    Hello. Has anyone managed to get a linked server working between SQL 2008R2 and Sybase ASE 15.7 using the SAP/Sybase OLE DB driver and not using an ODBC DSN? I've tried what seems like every combination of parameters to create the linked server both

  • LR CC reinstall

    Hi, I bought and installed Photoshop CC photographic program (PS + LR). Then, when I tried to uninstall the old LR, I think I did the uninstall of the new one. How do I reinstall LR CC? thank you.