im trying to take a query that pulls all the info in the current tables, and narrow it down to one day plus current. here is the error i am getting.
(SELECT OH.ORD_CNTRL_NO, OH.ORD_NO, OH.ASSGN_SHIP_DATE, oh.account_no, sum(OL.ORD_QTY) AS ORD_QTY * ERROR at line 5: ORA-00936: missing expression
old query:
select a.assign_no, a.assign_type, a.act_end, X.ord_no, x.account_no, X.ASSGN_SHIP_DATE, X.ORD_QTY, td.from_loc, sum(td.act_qty) AS ACTQTY, sum(td.exp_qty) AS EXPQTY from clsd_assign a, clsd_task t, clsd_task_detail td, sku s, (SELECT OH.ORD_CNTRL_NO, OH.ORD_NO, OH.ASSGN_SHIP_DATE, oh.account_no, sum(OL.ORD_QTY) AS ORD_QTY
[code]...
new query
select a.assign_no, a.assign_type, TRUNC(A.ACT_END), to_char(a.act_end), X.ord_no, x.account_no, X.ASSGN_SHIP_DATE, X.ORD_QTY, td.from_loc, sum(td.act_qty) AS ACTQTY, sum(td.exp_qty) AS EXPQTY from clsd_assign a, clsd_task t, clsd_task_detail td, sku s where a.act_end between to_char(sysdate -1, 'dd-mon-yyyy') and to_char(sysdate, 'dd-mon-yyyy')
I ran into a problem recently which has to do with the following query:
SELECT '' || ROUND(GEOGR_LAENGE,5) || ',' || ROUND(GEOGR_BREITE,5) || '," [BUE] ' || BAUFORM_GRUPPE || '"', KM AS TEXT FROM MYTABLEA mmtable WHERE (mmtable.GEOGR_LAENGE IS NOT NULL AND mmtable.GEOGR_BREITE IS NOT NULL AND mmtable.STRECKE_NR IN (
[code].....
The problem is, that Oracle alerts a missing expression at line 4, and highlights the "IS NOT NULL". Personally I don't see that anything is wrong with this line. I think the problems source is somewhere else but I cannot find it.
I'll give you a little bit of background to the script:
What I am trying to achieve is to request the values in the first line with the following conditions:
- mmtable.GEOGR_LAENGE, GEOGR_BREITE must not be empty - rbtable.STRECKE_NR for the requested line (which is similar to mmtable.STRECKE_NR) must have "MITTE" as a value for NL_NAME - mmtable.KM => rbtable.VON_KM - mmtable.KM <= rbtable.BIS_KM
I'm working on Oracle SQL Developer: ODMiner. I keep getting a syntax error with the following code,
CREATE TABLE FINAL_WEBLOG AS select SESSION_DT, C_IP, CS_USER_AGENT, LISTAGG(WEB_LINK, ' ') WITHIN GROUP (ORDER BY C_IP, CS_USER_AGENT) "WEB_LINKS", FROM WEBLOG_VIEWS GROUP BY C_IP, CS_USER_AGENT, SESSION_DT ORDER BY SESSION_DT
I understand if it's the semicolon that is missing after "FROM WEBLOG_VIEWS", but I'm not sure on how I can rephrase it.
I am getting the ORA-00936: missing expression error while running the below stated query. Problem is that it is running and fetching the data successfully for the first 5 runs. But from the 6th run it is not fetching the data and throwing the ORA-00936: missing expression error. consider I am passing parameters to the query and for the first 5 values i pass its runnign fine. when i run the query for the 6th time or more with different parameter, its throwing the error. it does not seems to be the data issue because when i pass the 6th parameter for the first run on the next day, it is fetching data.
(SELECT ABC.POST_SMRY_CORR_I,NVL(ABC.CORR_TYPE_C,' ') AS CORR_TYPE_C,NVL(ABC.ENTR_DOC_I,' ') AS ENTR_DOC_I, ABC.EST_LIQN_D, '' AS EVNT_TYPE_C, ABC.CORR_STAT_C FROM POST_SMRY_CORR ABC,POST_ENTR_DISCP PSCWQ,ENTR_DOC ED WHERE ABC.POST_SMRY_CORR_I = PSCWQ.POST_ENTR_DOC_I and ED.ENTR_DOC_I = '123'AND ABC.ENTR_DOC_I=ED.ENTR_DOC_I AND ED.ENTR_TYPE_C != 11 AND POST_ENTR_TYPE_C='PSC' AND DISCP_STAT_C !='CL' AND ABC.CORR_STAT_C !='CLS' [code]....
I want to convert an amount value in 99,999,999,990.99 format without using TO_CHAR function. I was trying to use regex. Is there any other function through which I would be able to do this?
New to using Oracle and SQL Developer. I am trying to subtract a maximum date from today and adding back 1 to get a field named daysSinceLastActivity....
Syntax I am trying is (date()-max(activity_date))+1 as daysSinceLastActivity
I keep getting a error message of missing expression. After googling, I am not finding anything. This should be a simple calculation.
I have the following statement dynamic sql statement in a database package.
begin EXECUTE IMMEDIATE 'SELECT REPLACE(SUBSTR('||V_WHERE_CLAUSE||',1,3, ''AND'', NULL) INTO V_WHERE_FILTER FROM DUAL'; EXCEPTION NULL; end;
When executed it gives following error.
ORA-20000: ORA-20000: ORA-00936: missing expression ### TRACE ### ORA-06512: at "NDSS.DUP_SRCH_PKG_MOD", line 931 ### END TRACE ### ### TRACE ### ORA-06512: at "NDSS.DUP_SRCH_PKG_MOD", line 935 ORA-06512: at "NDSS.DUP_SRCH_PKG_MOD", line 164 ### END TRACE ### ORA-06512: at "NDSS.DUP_SRCH_PKG_MOD", line 184 ORA-06512: at line 9
I have got the following error while executing below Query.
ORA-01791 'Not a SELECTed expression'
select distinct sgbstdn_levl_code from sgbstdn,spriden where spriden_pidm = sgbstdn_pidm and spriden_id = '200076543' order by sgbstdn_term_code_eff desc;
The above Query is not working with Distinct & Order By clause are present and by joining two tables. I need the distinct values of levels in Descending order of Terms.
Say for example, I want to group by the fields "Type" and and expression called "expression" (which is a case statement). I tried running this query and it says "expression" is invalide identifier.
select type, case when SUBSTR (glnumber, 1, 2) = '05' then 'IS' when SUBSTR (glnumber, 1, 2) = '06' then 'IS' else 'BS' end "expression" , sum(balance) from table group by TYPE, "expression"
If there is any online material on how to GROUP BY on an expression(like above)
I putted in a table "conditions" some rules (if conditions) and I want to read and execute those conditions in another table "list_parameters" in pl/sql procedure.
conditions : ID||||||||||||||RULE 1-----------(param1 = F) 2-----------(param2 is null) .....
I have an arithmatic expression which is dynamic say
expression = [Col5]/[Col1]
I will be using this in building a dynamic SQL.so i have to make sure that the divisible by zero is taken care. In the expression Col1,Col5 are values coming from a SQL.
I have to build a function which takes in the expression and fetches me the result.My expression can be any combination of arithmaticexpression involving columns.
I need to calculate the sum of values over a period of exactly one month (including the current row). Now if I use a windowing clause of "range between interval '1' month preceding and current row", the total period length is 1 month plus one day (being the day in the current record).
Basically, I want to sum over a period starting at "add_months(startdate, -1) + 1" up until startdate of each row.
drop table window_tst; create table window_tst ( id number primary key
[Code]....
So instead of having 01-feb going back to 01-jan, it should only include 02-jan till 01-feb
I could of course recalculate the period length back to a number of days for each row, but that is not really what I would prefer, as it would make the code rather unreadable.
I want to use Analytical function instead of group by clause for below query..
select CASE WHEN ADMT.SOURCESYSTEM ='CLU' THEN COUNT(ADMT.TOTAL_COUNT)*5 ELSE COUNT(ADMT.TOTAL_COUNT) END TOTAL_COUNT from ESMARTABC.ABC_DRVR_MFAILS_TMP ADMT group by ADMT.SOURCESYSTEM
I have a function that returns the total sum of an account. From reports I call the function passing the account code. The function sums the values for that specific account code and returns the value. In my function I have the following code :
where account_code = P_CODE.
Eg. The value of :P_CODE is 'CS'.
I now want to pass multiple account codes ('CS','TV',LJ') to the function. How do I change the IN clause in the function to accommodate multiple values.
I have tried using the instr function, but it does not work. eg. AND instr(o.ACCOUNT_CODES,','||P_CODE||',') > 0
DECLARE cnt number(10); BEGIN SELECT COUNT(*) INTO CNT FROM TBL_ADDRESS WHERE ADDRESS_ZIP IN (SELECT * FROM TABLE(MY_PACK.STR2TBL('46227'))); DBMS_OUTPUT.PUT_LINE (cnt); END;
MY_PACK.STR2TBL() is a function which takes '|' delimited string, extracts values and returns a table of zipcodes. The function works fine and returns 46227 but the count returned is 0 instead of 280(count returned by replacing inner select with '46227').
can i create the user-defined functions and use them in the FILTER clause in the sem_match function? there are some built-in functions for the FILTER clasue. however, only one function (DATATYPE(literal)) support for date/time in the built-in functions. i want to implement some user-defined funcitons in the FILTER clause which can check time intervals in ontology. there are some functions about valid time in the WorkSpace Manager such as WM_OVERLAPS, WM_CONTAINS,WM_MEETS, etc. so, can i write some functions using the these valid time functions in WM and use them in the FILTER clause?
I get "ORA-00936: missing expression" when I issue the following SQL:
select 4 - .2 from dual
from the following VB.NET code (3.5 framework):
Dim conn As Oracle.DataAccess.Client.OracleConnection = New Oracle.DataAccess.Client.OracleConnection(My.Settings.oraconn) conn.Open() Dim da As Oracle.DataAccess.Client.OracleDataAdapter Dim ds As New DataSet da = New Oracle.DataAccess.Client.OracleDataAdapter("select 4 - .2 from dual", conn) da.Fill(ds) MsgBox(ds.Tables(0).Rows(0)(0))
I have the following installed when connecting to 10.2.0.3 database: 11.2.0.1 client installed 11.2.0.3.20 ODP installed
This is really strange behaviour as the following SQL variants work: select 4 - 0.2 from dual select 4 - '.2' from dual select -.2 + 4 from dual
This is a big problem as I have a complex application deployed in a number of sites so won't be able to rollout ODP 11