Query with error "Missing Expression"
Hi
I have written a query but it returns the following error:
ORA-00936: missing expression
The code is as below:
SELECT
ENUM_AT_ABSENCE_REASON_CODE.absence_type AS "VALUE",
ENUM_AT_ABSENCE_REASON_CODE.absence_type AS "LABEL",
'2'AS "SORTORDER"
FROM ENUM_AT_ABSENCE_REASON_CODE
WHERE
ENUM_AT_ABSENCE_REASON_CODE.DISTRICT_NUMBER = ('1000')
AND
ENUM_AT_ABSENCE_REASON_CODE.SCHOOL_ID IN ('705')
AND
AND SY_SCHOOL_TRACK.SCHOOL_YEAR = '2006'
ORDER BY SORTORDER,LABELI am not sure how to correct the error. Any help is gratefully acknowledged.Thanks in advance.
You have two ANDs together. Kind of leaps out when you format the query ;)
Similar Messages
-
Global query block is causing a DNS server to fail a query with error code Name Error exists in the DNS database for WPAD on a Windows 2008 server.
The global query block list is a feature that prevents attacks on your network by blocking DNS queries for specific host names. This feature has caused the DNS server to fail a query with error code NAME ERROR for wpad.contoso.com. even though data
for this DNS name exisits in the DNS database. Other queries in all locally authoritative zones for other names that begin with labels in the block list will also fail, but no event will be logged when further queries are blocked until the DNS server
service on this computer is restarted. -
How to create an ABAP Query with OR logical expression in the select-where
Hi,
In trying to create an ABAP query with parameters. So it will select data where fields are equal to the parameters entered. The default logical expression is SELECT.. WHERE... AND.. However I want to have an OR logical expression instead of AND.. how can I attain this??
Please help me on this.. Points will be rewarded.
Thanks a lot.
Regards,
Question ManHi Bhupal, Shanthi, and Saipriya,
Thanks for your replies. But that didn't answer my question.
Bhupal,
You cannot just replace AND with OR in an ABAP QUERY. ABAP QUERY is a self generated SAP code. You'll just declare the tables, input parameters and output fields to be displayed and it will create a SAP standard code. If you'll try to change the code and replace the AND with OR in the SAP standard code, the system will require you to enter access key/object key for that particular query.
Shanthi,
Yes, that is exactly what need to have. I need to retireve DATA whenever one of the conditions was satisfied.
Saipriya,
Like what I have said, this is a standard SAP code so we can't do your suggestion.
I have already tried to insert a code in the ABAP query (there's a part there wherein you can have extra code) but that didn't work. Can anybody help me on this.
Thanks a lot.
Points will be rewarded.
Regards,
Question Man -
Query with error "...Invalid Identifier"
Hi
I have a query that returns an error as follows:
ORA-00904: "AT_HOURLY_ATTENDANCE_RECORDS"."ABSENCE_TYPE": invalid identifier
The code is as follows:
SELECT
AT_HOURLY_ATTENDANCE_RECORDS.absence_type AS "value",
AT_HOURLY_ATTENDANCE_RECORDS.absence_type AS "LABEL",
'2' AS "SORTORDER"
FROM AT_HOURLY_ATTENDANCE_RECORDS
WHERE
AT_HOURLY_ATTENDANCE_RECORDS.district_number = ('1000')
AND AT_HOURLY_ATTENDANCE_RECORDS.SCHOOL_ID IN ('705')
AND AT_HOURLY_ATTENDANCE_RECORDS.SCHOOL_YEAR = '2006'
ORDER BY SORTORDER,LABELAll suggestions and help are gratefully acknowledged. Thanks in advanceHmmm, very similar error with one of your others posts :
help with query with sub query
Same cause, same effect ?
Nicolas. -
Problem for XSL copying XML file with Error in expression '*|/'.
Hi,
I am trying to convert xml file to another xml through command-line interface but failed.
java oracle.xml.parser.v2.oraxsl data.xml data.xsl data_new.xml
My sample xml and xsl files are:
1. XML file
<employee_data>
<employee_row>
<employee_number>7950</employee_number>
<employee_name>ABC</employee_name>
<employee_title>PRESIDENT</employee_title>
<manager>1111</manager>
<date_of_hire>20-JAN-93</date_of_hire>
<salary>65000</salary>
<commission>1000</commission>
<department_number>10</department_number>
</employee_row>
</employee_data>
2. XSL file
<?xml version="1.0" ?>
<xsl:stylesheet xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates>
<xsl:sort select=".//employee_name"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
The error message:
Error occurred while processing data.xsl: Error in expression: '*|/'.
I used a sample XSL files copying from a XML book to do the convert but got the same error.
Does anyone know how to fix this problem? I'll appreciate it very much for your help.
Thanks.
Yiguang ZhongHi swanelvis ,
I have the same issue. Were you able to resolve this ?
Thanks -
SQL Error : missing expression - Creating XML file with ODI
Hi,
I saw threads about errors like this and read that maybe it can come from how I chose the staging area. I still can't see where the problem is. I'm trying to create an xml file from data stored in a Oracle database. The interface which execution fails select data from tables and create a tag in the XML file. Here are information about it :
The staging area is diferent from the target and is an oracle database schema. (I guess it creates temporary tables in that schema ?)
In the flow tab, the LKM is LKM SQL to SQL, the option delete temporary objects is set to yes.
The IKM choice for the target is IKM SQL Control Append and options are as following :
- insert : yes
- commit : yes
- flow contreol : no
- recycle errors : no
- static control : no
- truncate : no
- delete all : no
- create target table : yes
- delete temporary objects : yes
Columns mapping in the target are the following :
WKID > THEADER.WKID
EXTID > THEADER.EXTID
ORDER > THEADER.ORDER
INSTFK > THEADER.INSTFK
For every column in the target :
- Run on source
- Updating : insert, update and ud4 are checked
no update key is defined
In the operator, the step failing when running the interface is the loading data in the work table.
If you need the SQL request in the execution plan, or anything else, please tell me.
Thank you in advance for any help on this.
MarieIt would help if you provide error message and its stack trace.
Please also look at the documentation (If not already done so) for creating xml file XML Files - 11g Release 1 (11.1.1) -
Query with error: ORA-01843: not a valid month
Hi,
I have a problem with a query. I have modified a query that before worked but not now!
The correct original query was:
SELECT rtrim('Cambio di: '
|| (CASE WHEN nvl(A.CODICE_EMITTENTE ,' ') <> nvl(B.CODICE_EMITTENTE ,' ') THEN 'Codice emittente, ' ELSE '' END)
|| (CASE WHEN nvl(A.DESCRIZIONE_TITOLO,' ') <> nvl(B.DESCRIZIONE_TITOLO,' ') THEN 'Descrizione titolo, ' ELSE '' END)
|| (CASE WHEN nvl(A.SOTTOSTANTE,' ') <> nvl(B.SOTTOSTANTE,' ') THEN 'Sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.TIPO_SOTTOSTANTE, ' ') <> nvl(B.TIPO_SOTTOSTANTE,' ') THEN 'Tipo sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.CEDOLA_LORDA_CORRENTE, 0) <> nvl(B.CEDOLA_LORDA_CORRENTE, 0) THEN 'Cedola lorda corrente, ' ELSE '' END)
|| (CASE WHEN nvl(A.FREQUENZA_CEDOLA, ' ') <> nvl(B.FREQUENZA_CEDOLA, ' ') THEN 'Frequenza cedola, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') THEN 'Data inizio facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') THEN 'Data fine facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') THEN 'Data inizio facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') THEN 'Data fine facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.AMMONTARE_EMESSO, 0) <> nvl(B.AMMONTARE_EMESSO, 0) THEN 'Ammontare emesso, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') <> nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999') THEN 'Data primo godimento, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_SCADENZA, '31-Dec-2999') <> nvl(B.DATA_SCADENZA, '31-Dec-2999') THEN 'Data scadenza, ' ELSE '' END)
|| (CASE WHEN nvl(A.PRIMO_PREZZO_EMISSIONE, 0) <> nvl(B.PRIMO_PREZZO_EMISSIONE, 0) THEN 'Primo prezzo di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.MODALITA_RIMBORSO, 0) <> nvl(B.MODALITA_RIMBORSO, 0) THEN 'Modalità rimborso, ' ELSE '' END)
|| (CASE WHEN nvl(A.SUBORDINAZIONE, ' ') <> nvl(B.SUBORDINAZIONE, ' ') THEN 'Subordinazione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS_CODE, 0) <> nvl(B.DIV_EMIS_CODE, 0) THEN 'Codice divisa di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS, ' ') <> nvl(B.DIV_EMIS, ' ') THEN 'Divisa di emissione, ' ELSE '' END)
,', ') TIPO_VARIAZIONE,
A.ISICOD ,
A.CODICE_EMITTENTE AS EMIT_COD_T, B.CODICE_EMITTENTE AS EMIT_COD_T1,
A.DESCRIZIONE_TITOLO AS DESC_TITOLO_T, B.DESCRIZIONE_TITOLO AS DESC_TITOLO_T1,
A.SOTTOSTANTE AS SOTTOSTANTE_T, B.SOTTOSTANTE AS SOTTOSTANTE_T1,
A.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T, B.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T1,
A.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T, B.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T1,
A.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T, B.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T1,
A.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T, B.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T1,
A.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T, B.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T1,
A.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T, B.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T1,
A.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T, B.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T1,
A.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T, B.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T1,
A.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T, B.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T1,
A.DATA_SCADENZA AS DATA_SCADENZA_T, B.DATA_SCADENZA AS DATA_SCADENZA_T1,
A.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T, B.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T1,
A.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T, B.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T1,
A.SUBORDINAZIONE AS SUBORDINAZIONE_T, B.SUBORDINAZIONE AS SUBORDINAZIONE_T1,
A.DIV_EMIS_CODE AS DIV_EMIS_CODE_T, B.DIV_EMIS_CODE AS DIV_EMIS_CODE_T1,
A.DIV_EMIS AS DIV_EMIS_T, B.DIV_EMIS AS DIV_EMIS_T1,
A.START_DATE AS DATA_AGG_T, B.START_DATE AS DATA_AGG_T1
FROM SPR_KLERS_ISD A, SPR_KLERS_ISD B
WHERE A.START_DATE=TRUNC(SYSDATE)
AND A.ISICOD=B.ISICOD
AND B.START_DATE = decode(trim(to_char(sysdate, 'Day')), 'Monday',trunc(sysdate-3), trunc(sysdate-1))
AND (nvl(A.CODICE_EMITTENTE,' ') != nvl(B.CODICE_EMITTENTE,' ')
OR
nvl(A.DESCRIZIONE_TITOLO,' ') != nvl(B.DESCRIZIONE_TITOLO,' ')
OR
nvl(A.SOTTOSTANTE,' ') != nvl(B.SOTTOSTANTE,' ')
OR
nvl(A.TIPO_SOTTOSTANTE, ' ') != nvl(B.TIPO_SOTTOSTANTE,' ')
OR
nvl(A.CEDOLA_LORDA_CORRENTE, 0) != nvl(B.CEDOLA_LORDA_CORRENTE, 0)
OR
nvl(A.FREQUENZA_CEDOLA, ' ') != nvl(B.FREQUENZA_CEDOLA, ' ')
OR
nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
OR
nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
OR
nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
OR
nvl(A.PRIMO_PREZZO_EMISSIONE, 0) != nvl(B.PRIMO_PREZZO_EMISSIONE, 0)
OR
nvl(A.MODALITA_RIMBORSO, 0) != nvl(B.MODALITA_RIMBORSO, 0)
OR
nvl(A.SUBORDINAZIONE, ' ') != nvl(B.SUBORDINAZIONE, ' ')
OR
nvl(A.DIV_EMIS_CODE, 0) != nvl(B.DIV_EMIS_CODE, 0)
OR
nvl(A.DIV_EMIS, ' ') != nvl(B.DIV_EMIS, ' '))The new query that not works is:
SELECT rtrim('Cambio di: '
|| (CASE WHEN nvl(A.CODICE_EMITTENTE ,' ') <> nvl(B.CODICE_EMITTENTE ,' ') THEN 'Codice emittente, ' ELSE '' END)
|| (CASE WHEN nvl(A.DESCRIZIONE_TITOLO,' ') <> nvl(B.DESCRIZIONE_TITOLO,' ') THEN 'Descrizione titolo, ' ELSE '' END)
|| (CASE WHEN nvl(A.SOTTOSTANTE,' ') <> nvl(B.SOTTOSTANTE,' ') THEN 'Sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.TIPO_SOTTOSTANTE, ' ') <> nvl(B.TIPO_SOTTOSTANTE,' ') THEN 'Tipo sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.CEDOLA_LORDA_CORRENTE, 0) <> nvl(B.CEDOLA_LORDA_CORRENTE, 0) THEN 'Cedola lorda corrente, ' ELSE '' END)
|| (CASE WHEN nvl(A.FREQUENZA_CEDOLA, ' ') <> nvl(B.FREQUENZA_CEDOLA, ' ') THEN 'Frequenza cedola, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') THEN 'Data inizio facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') THEN 'Data fine facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') THEN 'Data inizio facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') THEN 'Data fine facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.AMMONTARE_EMESSO, 0) <> nvl(B.AMMONTARE_EMESSO, 0) THEN 'Ammontare emesso, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') <> nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999') THEN 'Data primo godimento, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_SCADENZA, '31-Dec-2999') <> nvl(B.DATA_SCADENZA, '31-Dec-2999') THEN 'Data scadenza, ' ELSE '' END)
|| (CASE WHEN nvl(A.PRIMO_PREZZO_EMISSIONE, 0) <> nvl(B.PRIMO_PREZZO_EMISSIONE, 0) THEN 'Primo prezzo di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.MODALITA_RIMBORSO, 0) <> nvl(B.MODALITA_RIMBORSO, 0) THEN 'Modalità rimborso, ' ELSE '' END)
|| (CASE WHEN nvl(A.SUBORDINAZIONE, ' ') <> nvl(B.SUBORDINAZIONE, ' ') THEN 'Subordinazione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS_CODE, 0) <> nvl(B.DIV_EMIS_CODE, 0) THEN 'Codice divisa di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS, ' ') <> nvl(B.DIV_EMIS, ' ') THEN 'Divisa di emissione, ' ELSE '' END)
,', ') TIPO_VARIAZIONE,
A.ISICOD ,
A.CODICE_EMITTENTE AS EMIT_COD_T, B.CODICE_EMITTENTE AS EMIT_COD_T1,
A.DESCRIZIONE_TITOLO AS DESC_TITOLO_T, B.DESCRIZIONE_TITOLO AS DESC_TITOLO_T1,
A.SOTTOSTANTE AS SOTTOSTANTE_T, B.SOTTOSTANTE AS SOTTOSTANTE_T1,
A.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T, B.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T1,
A.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T, B.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T1,
A.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T, B.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T1,
A.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T, B.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T1,
A.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T, B.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T1,
A.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T, B.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T1,
A.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T, B.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T1,
A.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T, B.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T1,
A.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T, B.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T1,
A.DATA_SCADENZA AS DATA_SCADENZA_T, B.DATA_SCADENZA AS DATA_SCADENZA_T1,
A.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T, B.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T1,
A.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T, B.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T1,
A.SUBORDINAZIONE AS SUBORDINAZIONE_T, B.SUBORDINAZIONE AS SUBORDINAZIONE_T1,
A.DIV_EMIS_CODE AS DIV_EMIS_CODE_T, B.DIV_EMIS_CODE AS DIV_EMIS_CODE_T1,
A.DIV_EMIS AS DIV_EMIS_T, B.DIV_EMIS AS DIV_EMIS_T1,
A.START_DATE AS DATA_AGG_T, B.START_DATE AS DATA_AGG_T1
FROM SPR_KLERS_ISD A, SPR_KLERS_ISD B
WHERE A.START_DATE=TRUNC(SYSDATE)
AND A.ISICOD=B.ISICOD
AND B.END_DATE = TRUNC(SYSDATE)
AND (nvl(A.CODICE_EMITTENTE,' ') != nvl(B.CODICE_EMITTENTE,' ')
OR
nvl(A.DESCRIZIONE_TITOLO,' ') != nvl(B.DESCRIZIONE_TITOLO,' ')
OR
nvl(A.SOTTOSTANTE,' ') != nvl(B.SOTTOSTANTE,' ')
OR
nvl(A.TIPO_SOTTOSTANTE, ' ') != nvl(B.TIPO_SOTTOSTANTE,' ')
OR
nvl(A.CEDOLA_LORDA_CORRENTE, 0) != nvl(B.CEDOLA_LORDA_CORRENTE, 0)
OR
nvl(A.FREQUENZA_CEDOLA, ' ') != nvl(B.FREQUENZA_CEDOLA, ' ')
OR
nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
OR
nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
OR
nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
OR
nvl(A.PRIMO_PREZZO_EMISSIONE, 0) != nvl(B.PRIMO_PREZZO_EMISSIONE, 0)
OR
nvl(A.MODALITA_RIMBORSO, 0) != nvl(B.MODALITA_RIMBORSO, 0)
OR
nvl(A.SUBORDINAZIONE, ' ') != nvl(B.SUBORDINAZIONE, ' ')
OR
nvl(A.DIV_EMIS_CODE, 0) != nvl(B.DIV_EMIS_CODE, 0)
OR
nvl(A.DIV_EMIS, ' ') != nvl(B.DIV_EMIS, ' '))where I have changed only this:
B.START_DATE = decode(trim(to_char(sysdate, 'Day')), 'Monday',trunc(sysdate-3), trunc(sysdate-1)) --------->AND B.END_DATE = TRUNC(SYSDATE)
Both START_DATE and END_DATE are date filds.
When I execute the second query I receive this:
ORA-01843: not a valid monthin many ponts of the query that change every time I execute the query, why this behaviour?
How can I solve?
Thanks, bye bye.Could you execute the following query and post the output.
select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
select sysdate from dual;Also what are the datatypes for these columns
>
nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
OR
nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
OR
nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
>
I hope you know anything given in single quotes is a string and not a date.
Regards
Raj -
Pivot function and Missing expression error
select * from (
select T.PAT_MRN_ID, T.ABBREVIATION,CONCEPT_VALUE from TBL_WORKLFOw T
pivot
max(concept_value)
for ABBREVIATION in (select ABBREVIATION from TBL_WORKLFOW )
this query is throwing "missing expression"..error.
Can some one help figuring out the problem.Hi, Parth,
Parth Divekar wrote:
So your suggestion is to have it in a procedure ...form a dynamic sql using values from query and then execute the sql..That's one thing you can do.
You might also look into string aggregation, where you have one gargantuan column containing all the pivoted data from all the abbreviatons, no matter how many there are. That big column can be formatted so that it looks like several distinct columns.
Assuming dynamic SQL is the best answer, I find it easier to do in SQL*Plus, using files or substitution variables, as shown below. That's just my preference; you may like PL/SQL better.
How to Pivot a Table with a Dynamic Number of Columns
This works in any version of Oracle
The "SELECT ... PIVOT" feature introduced in Oracle 11
is much better for producing XML output.
Say you want to make a cross-tab output of
the scott.emp table.
Each row will represent a department.
There will be a separate column for each job.
Each cell will contain the number of employees in
a specific department having a specific job.
The exact same solution must work with any number
of departments and columns.
(Within reason: there's no guarantee this will work if you
want 2000 columns.)
Case 0 "Basic Pivot" shows how you might hard-code three
job types, which is exactly what you DON'T want to do.
Case 1 "Dynamic Pivot" shows how get the right results
dynamically, using SQL*Plus.
(This can be easily adapted to PL/SQL or other tools.)
PROMPT ========== 0. Basic Pivot ==========
SELECT deptno
, COUNT (CASE WHEN job = 'ANALYST' THEN 1 END) AS analyst_cnt
, COUNT (CASE WHEN job = 'CLERK' THEN 1 END) AS clerk_cnt
, COUNT (CASE WHEN job = 'SALESMAN' THEN 1 END) AS salesman_cnt
FROM scott.emp
WHERE job IN ('ANALYST', 'CLERK', 'SALESMAN')
GROUP BY deptno
ORDER BY deptno
PROMPT ========== 1. Dynamic Pivot using Script ==========
-- ***** Start of dynamic_pivot.sql *****
-- Suppress SQL*Plus features that interfere with raw output
SET FEEDBACK OFF
SET PAGESIZE 0
SPOOL p:\sql\cookbook\dynamic_pivot_subscript.sql
SELECT DISTINCT
', COUNT (CASE WHEN job = '''
|| job
|| ''' ' AS txt1
, 'THEN 1 END) AS '
|| job
|| '_CNT' AS txt2
FROM scott.emp
ORDER BY txt1;
SPOOL OFF
-- Restore SQL*Plus features suppressed earlier
SET FEEDBACK ON
SET PAGESIZE 50
SPOOL p:\sql\cookbook\dynamic_pivot.lst
SELECT deptno
@@dynamic_pivot_subscript
FROM scott.emp
GROUP BY deptno
ORDER BY deptno
SPOOL OFF
-- ***** End of dynamic_pivot.sql *****
EXPLANATION:
The basic pivot assumes you know the number of distinct jobs,
and the name of each one. If you do, then writing a pivot query
is simply a matter of writing the correct number of ", COUNT ... AS ..."\
lines, with the name entered in two places on each one. That is easily
done by a preliminary query, which uses SPOOL to write a sub-script
(called dynamic_pivot_subscript.sql in this example).
The main script invokes this sub-script at the proper point.
In practice, .SQL scripts usually contain one or more complete
statements, but there's nothing that says they have to.
This one contains just a fragment from the middle of a SELECT statement.
Before creating the sub-script, turn off SQL*Plus features that are
designed to help humans read the output (such as headings and
feedback messages like "7 rows selected.", since we do not want these
to appear in the sub-script.
Turn these features on again before running the main query.
PROMPT ========== 2. Dynamic Pivot using Substitution Variable ==========
-- ***** Preliminary Query: *****
COLUMN sql_txt_col NEW_VALUE sql_txt
WITH all_jobs AS
SELECT DISTINCT
job
, DENSE_RANK () OVER (ORDER BY job) AS r_num
FROM scott.emp
SELECT SYS_CONNECT_BY_PATH ( job || ''' THEN 1 END) AS '
|| job
|| '_CNT'
|| CHR (10) -- Newline, for legibility only
, ', COUNT (CASE WHEN job = ''' -- Delimiter, goes before each entry
) AS sql_txt_col
FROM all_jobs
WHERE CONNECT_BY_ISLEAF = 1
START WITH r_num = 1
CONNECT BY r_num = PRIOR r_num + 1
-- ***** Main Query *****
SELECT deptno
&sql_txt -- Ends with newline, so occupy that line
FROM scott.emp
GROUP BY deptno
ORDER BY deptno
EXPLANATION:
Using a substitution variable is very similar to using a script.
The main difference is that the output of the preliminary query has to
go into one row. This is done with SYS_CONNECT_BY_PATH, and getting
that requires that the jobs be numbered with consecutive integers, 1, 2, 3, ...
which we get from DENSE_RANK.
The NEWLINE character was added just to make the output line easier
to read during debugging.
*/ -
ORA-00936: missing expression
Hi All,
i using SQl Query to insert value from one table to another but Show me Error MISSING EXPRESSION.
i have 35 Column in crm_sales_customers Table and 65 column in VENDOR_CUSTOMER_MAS table ,i want to jus insert selected column value in table VENDOR_CUSTOMER_MAS
insert into crm_sales_customers(customer_name,customer_address1,customer_address2,customer_city,customer_state,customer_country,customer_postal_code,customer_web_site,phone1,phone2,email,
active_flag,cust_id,UPLOAD) values(select name,address1,address2,CITY_CODE,null,country_code,pin_no,web_site,PHONE_NO1,FAX_NO,EMAIL,active_flg,code,'Y' from VENDOR_CUSTOMER_MAS)I am runing this Query in SQL command.
How to solve this problem..
Thanks
Edited by: 805629 on Feb 2, 2011 9:20 PMHi,
The problem with the above query is your syntax. Take a look here: http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_9014.htm#i2111652
When you do an insert from query, you dont need the 'values' clause.
insert into my_table (col1, col2, etc)
select col1, col2, etc
from other_Table
where some_conditionbtw, this is not an Apex problem, more an SQL.
Ta,
Trent -
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
ThanksSince 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.
-
See my query and error, see my query and error
hi master
sir i use inner query but not run
please see my query with error
query :==========
select accid as acccode,fstatus, case when fstatus=1 then
(select sum(drbal) from accbal where substr(accbal.accid,1,length(acccode))=acccode)
end what
from chartofacc
error :========
SQL> /
(select sum(drbal) from accbal where substr(accbal.accid,1,length(acccode))=acccode)
ERROR at line 2:
ORA-00904: "ACCCODE": invalid identifier
please sir give me any idea *Does this column ACCCODE exist in your table accbal?
The columns in the outer query will not be visible in the inner query but the vise versa is true. -
DocumentClient query with Int64 where clause is incorrect when converted and sent to Azure
The code below constructs a query with a lambda expression involving an Int64. When the query is converted and sent to Azure, it is incorrect. I captured the request to Azure using Fiddler for the example below, and the body contained:
{"query":"SELECT * FROM root WHERE (root.car.id = 1.01036229983142E+16) "}
Notice the constant does not match that of the code. Is this a bug in Azure DocumentDB library? If so, where can I submit a bug?
long carId = 10103622998314238;
IQueryable<MyDocument> query = documentClient.CreateDocumentQuery<MyDocument>("<collectionLinkGoesHere>", new FeedOptions { MaxItemCount = 1 });
query = query.Where((MyDocument d) => d.Car.Id == carId);
await query.AsDocumentQuery().ExecuteNextAsync<T>();@kurifodo1, DocumentDB follows the JSON standard for numbers, which is http://en.wikipedia.org/wiki/IEEE_754 notation. So any long integer gets serialized to a double stored as IEE754, and will lose some precision. While this isn't the most intuitive behavior,
it's important in order to be compliant with other tools and platforms that speak JSON.
If you'd like to just perform equality queries, consider storing this as a string. If you'd like to perform range queries, consider breaking up the number into two parts (high and low), similar to the BigInteger structure in C#.
Hope this helps. -
Syntax error (missing operator) in query expression works in sql
Hi guys,
I am having a problem with this query in Access 2007, it runs
fine in MSSQL.
I get this error when I run it.
[Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error
(missing operator) in query expression
'tbl_skuoption_rel.optn_rel_Option_ID = tbl_skuoptions.option_ID
INNER JOIN tbl_skus ON tbl_skuoption_rel.optn_rel_SKU_ID =
tbl_skus.SKU_ID INNER JOIN tbl_products AS p ON
tbl_skus.SKU_ProductID = p.product_ID'.Access may require parenthesis ( ) around the JOINs when
joining more than two tables -
Missing Expression error in query...
Hi,
SELECT DECODE(NAME, '~', '', NAME),
DECODE(NAME_2, '~', '', NAME_2),
DECODE(SALES_ORG_ID, '~', '', SALES_ORG_ID),
DECODE(PARTNER_ID, '~', '', PARTNER_ID)
FROM DMN_SALES_PARTNER
WHERE (
(upper(trim(country_name)),(trim(state_id))) IN
SELECT DISTINCT upper(trim(scsm.country_name)),upper(trim (scsm.state_name))
FROM sop_region_country_map srsm, sop_user_map smap,sop_country_state_map scsm
WHERE SSO_ID = '&sso_id' AND
upper(trim(smap.region_id)) = upper(trim(srsm.region_id)) AND
upper(trim(srsm.country_name)) = upper(trim(scsm.country_name)) AND
decode(upper(trim(srsm.state_name)),NULL,'~',upper(trim(srsm.state_name)) ) = upper(trim(scsm.state_name))
AND deviation_from_sap = 'N'
OR
SELECT upper(trim(scsm.country_name)),upper(trim(scsm.state_name))
FROM sop_country_state_map scsm
WHERE (upper(trim(scsm.country_name)),scsm.sap_state_map_id) in (
select upper(trim(scssm.country_name)),scssm.sap_state_map_id
from sop_country_state_sap_mapping scssm )
)I want to return the combination of country_name and state_name from any of the queries in OR clause so as to compare them with the country_name and state_id of main query..I have written the above query for it but its giving me "Missing Expression" error..
Pls help..
Thx
JPJP,
Your second part after the "OR" is just a SQL statement and it is not being compared to an expression. That's probably what the error message is telling you.
Regards,
Rob. -
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
-
Itunes Crashes When Shuffle mode enabled
I am using Windows 7 32-Bit with iTunes 10.3.1. Whenever I enabled the shuffle feature, iTunes' memory usage will increase to somewhere around 1.7GB, and freeze. This happens in under one minute from launch. However if shuffle is disabled, iTunes ope
-
Upgrade from CS3 extended to CS5
Does anyone know if I am able to just upgrade to the regular CS5, rather then the extended version? I found I'm not using the features and it's over $100.00 more to upgrade the extended version. I'm in Australia and was hoping to buy from Amazon whi
-
Hello folks, does anyone know how to form an ROI based on two original ROI. I intend as a function of the location of two ROI's created a new ROI covering the region between them. Thank you very much.
-
Program won't load due to external drive failure
I thought I was doing a smart thing when my laptop began getting a little too full by setting up the installation of Photoshop to use a Seagate hard drive as my preferences and scratch disk, with my computer's drive as the second choice. Now the Seag
-
Hi guys, I have 2 problems with the Formulas and calculations in Share Point. 1. I want to calculate time, that has been used for work on a location, if I use the preconfigured date/time calculation and use the formula: End Time - Start Time, the hou