Using DBMS_METADATA. GET_DDL get error: ORA-00907: lack the right parenthesis
HelloI try to extract the schema DDL to a base (10.2.0.4.0 - 64-bit Enterprise Edition on Solaris 10). I ran the query below and get an ORA-00907: parenthesis right absent error.
SELECT DBMS_METADATA. GET_DDL (REPLACE(object_type,' ','_') AS object_type, object_name) FROM user_objects WHERE object_type NOT IN ('TABLE_PARTITION', "INDEX_PARTITION", "LOB");
This is the output when executing the above in the sqlplus worksheet
Select DBMS_METADATA. GET_DDL (REPLACE (object_type, ", '_') as object_type, object_name) FROM user_objects if object_type in ('TABLE_PARTITION',"INDEX_PARTITION","LOB")
*
ERROR on line 1:
ORA-00907: lack of right parenthesis
remove the where the clause gives the following:
Select DBMS_METADATA. GET_DDL (REPLACE (object_type, ", '_') as object_type, object_name) FROM user_objects
*
ERROR on line 1:
ORA-00907: lack of right parenthesis
Pointers would be welcome. I know I could get the DDL using exp/imp, but I'd like to understand why I get the error of missing parenthesis.
see you soon,
Ewan
SELECT DBMS_METADATA. GET_DDL (REPLACE(object_type,' ','_') AS object_type, object_name) FROM user_objects WHERE object_type NOT IN
You don't need an alias here. Getting rid of the "as long as object_type' and it should work.
Tags: Database
Similar Questions
-
error: ora-00907 lack the right parenthesis
Hello
I don't know where I am doing wrong, please help me
update of tmp_data_mins p
SET p.DISPLAY_VOLUME = ((select display_volume from tmp_data_mins
where RULE_APPLIED =' rule 2: three consecutive time intervals are
missing with the period ') q
where (to_char (p.DAYASDATE,'DD/MM/YYYY HH24')) =
(to_char (q.DAYASDATE,'DD/MM/YYYY HH24'))
AND p.HOURASNUMBER = q.HOURSNUMBER);
Thanks in advance
Your syntax is disabled, you try to make a mixture of subquery and join that is not valid. It should be something more like:
update of tmp_data_mins p
SET p.DISPLAY_VOLUME = (select display_volume
of tmp_data_mins q
where q.RULE_APPLIED =' rule 2: three consecutive time intervals are missing the period ' and
trunc (p.DAYASDATE, 'hh24') = trunc (q.DAYASDATE, 'hh24')
AND p.HOURASNUMBER = q.HOURSNUMBER)
where exists (select display_volume
of tmp_data_mins q
where q.RULE_APPLIED =' rule 2: three consecutive time intervals are missing the period ' and
trunc (p.DAYASDATE, 'hh24') = trunc (q.DAYASDATE, 'hh24')
AND p.HOURASNUMBER = q.HOURSNUMBER);
I'm not ethat you really need the trunc applied to dates, but it is equivalent to your expression to_char, and it is generally much safer to compare dates in dates rather than convert a date to a string and compare those.
Also note that, as wrote your query and mine updates all rows in the parameter tmp_data_mins display_volume table to null for rows that do not match the subquery. You would (probably) need to add another predicate in the outer query the identifu only the lines that you want to update, and there are predicate using the same query in the clause set would be a likely candidate.
That said, I don't understand what you're trying to accomplish with this update because you're updating at the same table you are querying of. As said by Frank, a few examples of data and an explanation of what you're trying to accomplish would be useful.
John
After seeing just this thread https://community.oracle.com/thread/3560425 I think I understand what you're trying to do and changed the query above (I think) do the update that you want, and it seems that you have the trunc applied to dates.
Post edited by: John Spencer
-
ORA-00907 - "lack the right parenthesis.
Hello
I am trying to create a procedure to add table scores each month. This is my code:
create or replace procedure add_partitions
as
v_partition all_tab_partitions.partition_name%type;
v_limit varchar2 (50);
LONG v_sql;
Start
Select to_char (trunc (add_months(sysdate,1), 'MM'), 'Mon_YYYY')
in v_partition
Double; -napr. 072014
Select to_char (trunc (add_months(sysdate,2), 'MM'), 'DD-MM-YYYY')
in v_limit
Double; -napr. 08/01/2014
v_sql: = ' ALTER TABLE CENTRUMADMIN. AUD$ _BACKUP ADD PARTITION '. v_partition | «VALUES LESS THAN (' |)» v_limit | ') tablespace BACKUP_AUDIT';
immediately run v_sql;
end;
/
The procedure is compiled without errors, but when I run it I get this error:
ORA-00907 - "lack the right parenthesis.
After some tests, I am sure that this problem is here: VALUES LESS THAN (' | v_limit |) (')... but I'cant understand whats wrong
Any ideas? Thanks in advance
Honza
Hi Mika,
Try
VALUES LESS THAN ("' | v_limit |) (') - three times - 2 gives you a ' in your statement - the 3rd chain delimited
concerning
Kay -
ORA-00907: lack the right parenthesis when using Group by clause with xmlagg
I have the following query and I am getting ORA-00907 error when I use the clause with the xmlagg function group.
If I remove the clause xmlagg and the group by clause, the query works well and not give me the result.select xmlelement("Mitigation", xmlelement("m_szMethodName",tm.DisplayName), xmlelement("SubstanceInterferenceProtocolList", (select xmlagg(xmlelement("MitigationProtocol", xmlelement("m_szMethodName",tm.DisplayName), xmlelement("m_szInterferenceProtocolName",tmp.protocol_name), xmlelement("m_szInterferenceSubstance",tmp.intf_mtrl_prod_code), xmlelement("m_ProtocolParameters", xmlelement("m_szProtocolName",tmp.protocol_name), xmlelement("m_Consumables", xmlelement("Consumable", xmlelement("m_szConsumId", xrl.rgnt_pack_name), xmlelement("m_szProductCode",xrl.pack_prod_code), xmlelement("m_nVolume",tmp.fluid_vol), xmlelement("m_szProtocolStep",xps.protocol_step_name))), xmlelement("m_ProtParamList", xmlagg( xmlelement("ParameterValues", xmlelement("m_szProtocolName",tmp.protocol_name), xmlelement("m_Time",xpsd.parameter_ntime_value)) group by tmp.ccd_test_id,tmp.intf_mtrl_prod_code) ))) order by tmp.ccd_test_id, tmp.intf_mtrl_prod_code, xps.protocol_step_intprotocolstep ) from XPR_tdef_mitigation_protocol tmp, xp_reagentlist xrl, xpr_protocol_settings xps, xpr_protocol_settings_default xpsd where tmp.ccd_test_id = tm.ccd_test_id and tmp.ccd_test_id = xrl.ccd_test_id and tmp.pack_prod_code = xrl.pack_prod_code and tmp.intf_type = 1 and xps.protocol_name = xpsd.protocol_name and xps.protocol_step_name = xpsd.protocol_step_name and xps.ps_action_parameterlist = xpsd.ps_action_parameterlist and xps.protocol_name = tmp.PROTOCOL_NAME ))) from XPtoXPRTdef_defn_mapping tm where tm.DisplayName = 'SYPH'
But in this code XML, the output format is incorrect for my application.
Could someone help out here?Now my problem is that this unique coating is more than 32767 characters and utl_file can write 32767 bytes per line.
Someone deal with this?Serialize the output as CLOB and DBMS_XSLPROCESSOR.clob2file procedure used to write to a file:
DECLARE xml_output CLOB; BEGIN SELECT XMLElement("Department", XMLAgg( XMLElement("Employee",e.job_id||' '||e.last_name) ORDER BY e.last_name ) ).getClobVal() AS "Dept_list" INTO xml_output FROM hr.employees e WHERE e.department_id = 30 OR e.department_id = 40; DBMS_XSLPROCESSOR.clob2file(xml_output, 'XML_DIR', 'test.xml'); END; /
-
[Error] Run (): ORA-00907: lack the right parenthesis
Hello world
help out me fom this problem
SELECT (SELECT LPAD (s.b_borough_no, 2, 0) |) '/' || LPAD (s.site_no, 6, '0')
OF s app.sites@sfm
ID WHERE = sit_id)
as full_id,
TRS.*,
VP. FINPERID,
VP. FINPERCH
OF tr_review_schedules trs, TIMINGREVIEW. VP VW_FINANCIAL_PERIODS
WHERE the trs.sched_closeout_date BETWEEN (vp. PERSTARTDATE = TO_DATE (APRIL 1, 2011 00:00:00 "," MM/DD/YYYY HH24:MI:SS')))
AND (vp. PERENDDATE = TO_DATE (APRIL 30, 2011 00:00:00 "," MM/DD/YYYY HH24:MI:SS')))
AND trs.trd_id IS NOT NULL
AND trs.reportable = 'Y '.
ORDER BY 1;
Your problem is in him between predicate. The format of is:
column between value1 and value2
I don't quite know what you're trying to do with the columns perstartdate and perenddate, but maybe something more like:
Select (select lpad (s.b_borough_no, 2, 0) |) '/' || LPAD (s.site_no, 6, '0')
of app.sites@sfm s
where id = sit_id) as full_id,
TRS.*, vp.finperid, vp.finperch
of tr_review_schedules trs, timingreview.vw_financial_periods vp
where trs.sched_closeout_date between vp.perstartdate and vp.perenddate and
TRS.trd_id is not null and
TRS.reportable = 'Y' and
VP.perstartdate = to_date (April 1, 2011 00:00:00 ',' dd/mm/yyyy hh24:mi:ss') and
VP.perenddate = to_date (April 30, 2011 00:00:00 ',' hh24:mi:ss' of dd/mm/yyyy)
order by 1;
However, I am not convinced that this is between a reasonable join between tr_review_schedules and vw_financial_periods.
John
-
ORA-00907: lack of right parenthesis
Hi all
on 11.2.0.4 on Win 2008
When executing:
Select creele, TRUNC ((creele, 'DD')) of loans;
I get:
ORA-00907: missing a closing parenthesis (on column 28).
Any idea?
Let's see creele format:
Select creele loans;
CREELE
--------
10/11/14
21/10/14
Thank you.
Can you tell me please why column A and B have different results:
Select trunc (AVG (trunc(rendule,'DD')-trunc(creele+1,'DD')), 2) A.
TRUNC (AVG (trunc(rendule,'DD')-trunc(creele,'DD') + 1), (2) B
details, loans
WHERE details.emprunt = emprunts.numero
and borrowing. NUMBER = dΘtails. LOAN
AND details.rendule is not null
GROUP Member;
Because you say to do different things. Suppose that there is just a line in your table, with a rendule of 30/04/2015 and a creele from 20/04/2015.
A = 30/04/2015 - (20/04/2015 + 1) = 30/04/2015 - 21/04/2015 = 9
B = 30/04/2015-4/20/2015 + 1 = 10 + 1 = 11
If you want to arithmetic operations to be performed in a particular order, it is best to use parentheses to make the order without ambiguity. This would return the same value as the A (if that's what you want):
TRUNC (AVG (trunc(rendule,'DD') - (TRUNC(creele,'DD') + 1)), 2).
-
Formula node error: lack the right parenthesis
Community salvation OR,.
I work with the structure of nodes formula for the first time and I came across this error that I can't fix.
He says he finds a character #, but the strange thing is that there is no character. Is there someone who can help me with this one please?
Kind regards
Thomas Ruts
On your first long form you are missing a closing parenthesis. It is in the last half of the formula. You have two left parenthesis, but only a right.
-
One more time: lack of right parenthesis
Hi guys,.
I searched the forum for another thread that might give me the answer I'm looking for, but I found no one.
I'm new to APEX and I have to build a crosstab. To do this, I founded my development on really force crosstab / Pivot report example.
My package is completely identical it is on that page and I have adapted to the query of the report (= classic, non-interactive) based on PL/SQL, so it fits my needs, the result is:
DECLARE
l_return_value VARCHAR2 (32767).
BEGIN
l_return_value: = PK_PIVOT. PivotSQL ("SELECT * FROM"Ploegrapport - view "', 'SOD_OMSCHR_LANG, OOD_OMSCHR_LANG, ACT_OMSCHR_LANG, TAAK_OMSCHR_LANG, ORG_NIV4, ORG_NIV5', 'NK_WERKNEMER', 'MIN', 'J_N', nvl (:P2_PAGENUMBER,1));)
RETURN l_return_value;
END;
When I try to run it, I get the error ORA-00907: lack the closing parenthesis.
When I click on "debug", it changes to:
debug logging error ORA-06502: PL/SQL: digital or value error: character string of the buffer too small ORA-00907: lack the right parenthesis
Failed to parse the SQL query:
ORA-00907: lack of right parenthesis
When I then click on "debug mode" I get the following:
... Run the statement: declare function x return varchar2 is begin DECLARE l_return_value VARCHAR2 (32767). BEGIN l_return_value: = PK_PIVOT. PivotSQL ("SELECT * FROM"Ploegrapport - view "', 'SOD_OMSCHR_LANG, OOD_OMSCHR_LANG, ACT_OMSCHR_LANG, TAAK_OMSCHR_LANG, ORG_NIV4, ORG_NIV5', 'NK_WERKNEMER', 'MIN', 'J_N', nvl (:P2_PAGENUMBER,1));) RETURN l_return_value; END; Returns a null value. end; begin wwv_flow.g_computation_result_vc: = x; end;
...... Result = SELECT SOD_OMSCHR_LANG, OOD_OMSCHR_LANG, ACT_OMSCHR_LANG, TAAK_OMSCHR_LANG, ORG_NIV4, ORG_NIV5, MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE(NK_WERKNEMER,XXXXX',J_N,null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER Null 'XXXXX' ((, J_N,)) as "XXXXX" MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) 'XXXXX', MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER, J_N ' XXXXX', null)) as 'XXXXX '. MIN (DECODE(NK_WERKNE~), MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as 'XXXXX'
(Don't worry the XXXXX, I put it there manually because this is sensitive information, the field is actually correct and represents the names of people.) The query works when I cut the last piece, which is broken, and when I add a group, so the query he built seems to be OK
As you can see the query in debug is actually broken after 999 characters, this is simply due to the fact that debugging will show no more than 999 characters, or is this really my problem, that the query is broken before the full statement is complete.
If this is the first option: then where would my problem? If it's the latter: I checked the report query code and the package code and I can't find a reason why this request would be accepted to exist out of 999 characters.
I am currently working with the test environment Oracle supplied us, because we test if we can use APEX in our company.
The version is Application Express 4.2.2.00.11 and it is running on Oracle 11 g.
If you need more information, just ask and I'll post it as soon as possible.
During the validation of the responses, please keep in mind that I am a beginner at this and have trouble understanding complex responses .
Thanks for your help!
NDG
Hello
I discovered what the problem was.
In my data, there is an employee with a '-character in his name and that's what makes the query returns an error. I tried again, this time without taking account of all the names with a '-character and that the query ran successfully, now a column made dynamically for each employee, just as I wanted.
Thank you Tom for your efforts!
-
get the table script using dbms_metadata.get_ddl but with clob field
Thus, Oracle 11g R2...
I use dbms_metadata.get_ddl for table scripts and it works fine...
now, I have a table with clob field, and it does not work... I got an error "missing a closing parenthesis (ora-0907) '...
I could paste a script I had, but I don't think that it makes no sense...
does anyone have an experience on the use of this package on clob tables?
TNXSee this code.
DECLARE myddl clob; PROCEDURE print_clob(p_clob in clob) as l_offset number default 1; BEGIN loop exit when l_offset > dbms_lob.getlength(p_clob); dbms_output.put_line(dbms_lob.substr(p_clob, 255, l_offset)); l_offset := l_offset + 255; end loop; END print_clob; FUNCTION get_metadata return clob is h number; th number; doc clob; BEGIN h := dbms_metadata.open('TABLE'); dbms_metadata.set_filter(h, 'SCHEMA', 'HR'); dbms_metadata.set_filter(h, 'NAME', 'EMPLOYEES'); th := dbms_metadata.add_transform(h, 'MODIFY'); th := dbms_metadata.add_transform(h, 'DDL'); --dbms_metadata.set_transform_param(th,'SEGMENT_ATTRIBUTES',false); doc := dbms_metadata.fetch_clob(h); dbms_metadata.CLOSE(h); return doc; END get_metadata; BEGIN myddl := get_metadata; print_clob(myddl); END;
This procedure of print_ddl I took of the documentation.
Use of the long VALUE. See, in the first example out put is truncated.SQL> SELECT dbms_metadata.get_ddl('TABLE','EMP','SCOTT') FROM dual; DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT') -------------------------------------------------------------------------------- CREATE TABLE "SCOTT"."EMP" ( "EMPNO" NUMBER(4,0), "ENAME" VARCHAR2(10), SQL> set long 10000 SQL> / DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT') -------------------------------------------------------------------------------- CREATE TABLE "SCOTT"."EMP" ( "EMPNO" NUMBER(4,0), "ENAME" VARCHAR2(10), "JOB" VARCHAR2(9), "MGR" NUMBER(4,0), "HIREDATE" DATE, "SAL" NUMBER(7,2), "COMM" NUMBER(7,2), "DEPTNO" NUMBER(2,0), CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO") DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT') -------------------------------------------------------------------------------- USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ENABLE, CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO") REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS"
SQL> SET LINESIZE 132 SQL> SET pagesize 0 SQL> SET LONG 1000000 SQL> / CREATE TABLE "SCOTT"."EMP" ( "EMPNO" NUMBER(4,0), "ENAME" VARCHAR2(10), "JOB" VARCHAR2(9), "MGR" NUMBER(4,0), "HIREDATE" DATE, "SAL" NUMBER(7,2), "COMM" NUMBER(7,2), "DEPTNO" NUMBER(2,0), CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ENABLE, CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO") REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" SQL>
-
CARS: 2 nodes with Oracle single Client Access name (SCAN)
OS: OEL 5.4 64-bit
Version: 11.2.0.3
When I try to connect from the client to the RAC by using the SCANNER, I get ERROR: ORA-12541: TNS: no listenerOracle. I noticed that the service is in place and properly configured (client tnsnames).
servicioBD = (DESCRIPTION = (LOAD_BALANCE = yes) (ADDRESS = (PROTOCOL = TCP)(HOST = scanvip.domain1.local) (PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = serviceBD) (FAILOVER_MODE = (TYPE = SΘLECTIONNER) (METHOD = BASIC) (RETRIES = 180) (DELAY = 5))))
serviceBD service
SQL > select name, failover_method, failover_type, failover_retries, goal, clb_goal, aq_ha_notifications from dba_services where service_id = 3;
METHOD NAME TYPE PURPOSE CLB_GOAL AQNOT ATTEMPTS
---------------------------------------------------------------- ----------- ---------- -------- ---------- -------- -----
serviceBD BASIC SELECT 180 NO LONG YES
But when I do not use the service created for the tnsnames file SCAN, it's that if I directly put tnsnames to connect to any work of two nodes very well.
Node 1
servicioBD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.210.2.10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
Or
Node 1
servicioBD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.210.2.11)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
I have also observed the following (cluvfy).
1 all LISTENER_SCAN running node 1
2 there is no TCP connectivity
3 the error message is obtained PRVF-5713
[grid@rac1 ~] comp cluvfy $ scan - verbose
Check scan
Checking the single Client access name (SCAN)...
ANALYZE the running node name? ListenerName Port running?
---------------- ------------ ------------ ------------ ------------ ------------
scanvip.Domain1.local 1521 LISTENER_SCAN1 true true rac1
scanvip.Domain1.local 1521 LISTENER_SCAN2 true true rac1
scanvip.Domain1.local 1521 LISTENER_SCAN3 true true rac1
Checking TCP connectivity to ANALYZE listeners...
Node of ListenerName TCP connectivity?
------------ ------------------------ ------------------------
RAC1 LISTENER_SCAN1 no
RAC1 LISTENER_SCAN2 no
RAC1 LISTENER_SCAN3 no
PRVF-5713: command "/u01/app/11.2.0/grid/bin/tnsping" (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=10.210.2.17) (PORT = 1521)))'"running on the node"rac1"produces no output no output.
PRVF-5713: command "/u01/app/11.2.0/grid/bin/tnsping" (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=10.210.2.19) (PORT = 1521)))'"running on the node"rac1"produces no output no output.
PRVF-5713: command "/u01/app/11.2.0/grid/bin/tnsping" (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=10.210.2.18) (PORT = 1521)))'"running on the node"rac1"produces no output no output.
Check the resolution settings of name to 'scanvip.domain1.local '...
SCAN the IP address status comment name
------------ ------------------------ ------------------------ ----------
scanvip.Domain1.local 10.210.2.18 spent
scanvip.Domain1.local 10.210.2.19 spent
scanvip.Domain1.local 10.210.2.17 spent
Verification of the installation program ANALYZES VIP and the listener has failed
The analysis check failed on all specified nodes.
Could someone help me please.
The solution was to restart scan_listener.
srvctl stop scan_listener
srvctl start scan_listener
-
ERROR: ORACLE prepare error: ORA-00936: lack of expression
Hello
I am required to run the 'pass-through' Oracle SQL, to extract data from tables in the SAS for processing and handling. My code (attached) reads and writes (runs) but with zero records to test first. I can't get beyond the error to prepare.
The request is just like other queries that seem to work, but I can't get past this prepare error. I have no other access to individauls with an adequate knowledge of the PL SQL and as a last stop hoped others in the forum could quickly identify the source of the error.
Thank you very much in advance for any help.
Jeff
_______________________________________
1; *'; * « ; * / ; Quit; execution risk;
2 OPTIONS NUMPAGE = MIN;
3% LET _CLIENTTASKLABEL = % NRBQUOTE (rx_biplr_v3_2);
4% LET _EGTASKLABEL = % NRBQUOTE (rx_biplr_v3_2);
5% LET _CLIENTPROJECTNAME = %NRBQUOTE();
6% LET _SASPROGRAMFILE =;
7
8 ODS CLOSE SUBJECT;
NOTE: Some of your options or statements will not be managed with the Activex or Java Series devices. Chart by default for these
drivers may be different from other SAS/GRAPH device drivers. For more information, please contact Technical Support.
9 OPTIONS DEV = ACTIVEX;
10 EGHTML TEMP FILE NAME;
NOTE: Writing, body HTML (EGHTML) file: EGHTML
11 ODS HTML(ID=EGHTML) FILE = EGHTML ENCODING = 'utf - 8' STYLE = EGDefault.
11. STYLESHEET=(URL="file:///C:/program%20Files/SAS/shared%20Files/BIClientStyles/EGDefault.CSS")
11. ATTRIBUTES = ("http://www2.sas.com/codebase/graph/v91/sasgraph.exe"="CODE") NOGTITLE NOGFOOTNOTE GPATH = & sasworklocation
11.
12
gaccessible 13%;
14 /********************************************************/
15 * RX_BIPLR_V3. SAS;
16 /********************************************************/
17
18 dm 'journal clearly out; delete ";
19 linesize options = 120;
20 option obs = 0 NoReplace;
21
22 ****************************************************************************************;
23 * date reviewed programmer in WHICH WAS MADE;
24 *----- -------------- ------------ -----------------------------------------;
25 * 2005 creation of David Boyd program to the test population;
26 *;
27 * 06/02/2006 Ivon Jones changed to include the whole of the population;
28 *;
29 * 20/07/2006 Ivon Jones identified the holdout data elements;
30 * or inclusion in the consolidation with;
31 * Robin report;
32 *;
33 * 18/08/2006 Ivon Jones updated specific therapeutic Classes.
34 * 10 - 2009 J Shaf - changed to extract actual or potential of UBH bipolar Dx and medical claims.
35 ****************************************************************************************;
36
37
38
39 * % let allclmorgn = (', 'A'); / * claims origin code * /.
40% would let begdate ='01 SEP 2009;
41% let enddate = 30 SEP 2009 would be;
42% let q = %str(%');
43
44
45 data _null_;
46. call symput ("fdos", put (intnx ('month' ' and begdate "d,-27," starts"), date9.));
47 call symput ('ldos', put (intnx ('months', ' and enddate "d-0, 'end'" "), date9.));
48, run;
NOTE: DATA statement used (total duration of processes):
time real 0.01 seconds
2 the system SAS 11:44 Friday, October 30, 2009
time CPU 0.01 seconds
49
50
51
52 **************************************************************;
53 *? Data _null_ stage allows to create a macro variable to;
54 * year and month, based on the macro ldos variable in the data;
55 * step up? ;
56 **************************************************************;
57
58
59 data _null_;
If 60 months ("& ldos" d) < 10
61, then call symput ("yr_mo", compress (year ("& ldos" d) |)) '0' || months ("& ldos" d)));
62 other call symput ("yr_mo", compress (year ("& ldos" d) | months ("& ldos" d)));
63 to run;
NOTE: The numeric values were converted to character values in the locations given by: (Line): (Column).
61:39 61:64 62:39 62:57
NOTE: DATA statement used (total duration of processes):
time real 0.01 seconds
time processor 0.01 seconds
64
65 * make % & biplr_dx;
position 66% & begdate;
' 01 SEP 2009 would be
67% put & enddate;
30 SEP 2009 would be
68% put & fdos;
JUNE 1, 2007
69% put & ldos;
SEPTEMBER 30, 2009
70% put & q;
'
71
72
73 libname biplr ' / home/jshafi01/projects/adhoc/biplr_dprsn/data ';
NOTE: Libref BIPLR has been awarded with success as follows:
Engine: V9
Physical name: / home/jshafi01/projects/adhoc/biplr_dprsn/data
74 rosdwp libname = oracle user "& oracle_user." pass = "& oracle_pass." ' buffsize = 32767 path = "rosdwp"; "
NOTE: Libref ROSDWP has been awarded with success as follows:
Engine: ORACLE
Physical name: rosdwp
75
work.biplr_up_v1 76 data;
mbr_id length 77 attrib = $ 26;
78 the value biplr.biplr_ubh_med_v1;
79 to be performed;
NOTE: There were 0 read comments from the BIPLR data set. BIPLR_UBH_MED_V1.
NOTE: All data WORK. BIPLR_UP_V1 has 0 comments and variables 1.
NOTE: DATA statement used (total duration of processes):
time real 0.01 seconds
3 the system SAS 11:44 Friday, October 30, 2009
time processor 0.01 seconds
80
81 proc content;
82 to be performed;
NOTE: PROCEDURE used CONTENT (total duration of processes):
time real 0.03 seconds
time CPU 0.03 seconds
83
84 proc datasets
85 = rosdwp nolist library.
86. delete biplr_up_v1;
87 of quitting;
NOTE: The removal of ROSDWP. BIPLR_UP_V1 (memtype = DATA).
NOTE: PROCEDURE used DATASETS (time Total of processes):
time real 3.74 seconds
time CPU 0.03 seconds
88
89 proc datasets
90 = work nolist library.
copy 91 = rosdwp move;
92 select biplr_up_v1;
93 of quitting;
NOTE: Move WORK. BIPLR_UP_V1 to ROSDWP. BIPLR_UP_V1 (memtype = DATA).
NOTE: Variable labels SAS, formats and lengths are not written to the DBMS tables.
NOTE: There were 0 read comments from the WORKING data set. BIPLR_UP_V1.
NOTE: All the data ROSDWP. BIPLR_UP_V1 has 0 comments and variables 1.
NOTE: PROCEDURE used DATASETS (time Total of processes):
real 0.32 seconds
time CPU 0.04 seconds
94
95
96
97 *****************************************************************************;
98
99 * execute (commit) by rosdwp
100 ******************************************************************************;
101
102
103 proc SQL noprint.
104, connect to oracle as rosdwp (user = "" & oracle_user. "password =" "& oracle_pass ' buffsize = 32767 path ="rosdwp")
104. preserve_comments);
run 105 (alter session set nls_date_format = 'ddmonyyyy') by rosdwp;
CREATE table biplr_rx like 106
107 SELECT
mrb_id 108,
pcp_spc 109,
rx_date 110,
4 the system SAS 11:44 Friday, October 30, 2009
Mark 111,
generic, 112
113 ahfs_cd
ahfs_dsc 114,
lbl 115,
strngth 116,
UNT 117,
spc_tx_cls_cd 118,
119 spc_tx_cls_dsc,
GCN 120,
rx_num 121,
rx_ingrd 122,
rx_paid 123,
rx_cnt 124,
rx_qty 125,
rx_day 126
127 rosdwp CONNECTION
128 (SELECT
129, middle of the year. UNIQ_MBR_ID as mrb_id,
130 DB. PRVDR_SPCLTY_DESC as pcp_spc,
FCP 131. LAST_SRVC_DT as rx_date,
132 JJ. BRAND_NAME as mark,
133 JJ. GNRC_NAME as generic,
134 JJ. AHFS_THRPTC_CLS_CD as ahfs_cd,
DD 135. AHFS_THRPTC_CLS_DESC as ahfs_dsc,
136 JJ. LABEL_NAME as lbl,
137 JJ. STRNGTH_NUM as strngth
138 JJ. STRNGTH_UNIT_DESC as unt,
139 JJ. SPECF_THRPTC_CLS_CD as spc_tx_cls_cd,
140 DD. SPECF_THRPTC_CLS_DESC as spc_tx_cls_dsc,
141 JJ. GCN_NUM as gcn,
FCP 142. PRSCRPTN_NUM as rx_num,
SUM of 143 (FCP. INGRDNT_AMT) as rx_ingrd,
SUM of 144 (FCP. PD_AMT) as rx_paid,
$ 145 (FCP. UNIT_SRVC_CNT) as rx_cnt,
SUM of 146 (FCP. DSPNSD_QTY) as rx_qty,
SUM of 147 (FCP. DAY_SUPLY_CNT) as rx_day
148
149 PHRMCY_CLM_FACT pcf,
150 MBR_ID_DMNSN environment,
151 DRUG_DMNSN dd,
152 PRVDR_DMNSN pd,
153 biplr_up_v1
154. WHERE THE
(155)
156 (biplr_up_v1.mbr_id = MBR_ID_DMNSN. UNIQ_MBR_ID) and
157 (PHRMCY_CLM_FACT. FINL_CLM_KEY = PHRMCY_FINL_CLM_DMNSN. FINL_CLM_KEY) AND
158 (PHRMCY_CLM_FACT. MBR_KEY = MBR_ID_DMNSN. MBR_KEY) and
159 (PHRMCY_CLM_FACT. BNFT_KEY = MBR_BNFT_DMNSN. BNFT_KEY) and
160 (PHRMCY_CLM_FACT. DRUG_KEY = DRUG_DMNSN. DRUG_KEY) and
161 (PHRMCY_FINL_CLM_DMNSN. CLM_ORGN_CD IN (', 'A')) AND
162 (PHRMCY_CLM_FACT. LAST_SRVC_DT BETWEEN q. & fdos. & q and & q. & ldos. & q)
163)
164 Group By
165 mi. UNIQ_MBR_ID,
166 pd. PRVDR_SPCLTY_DESC,
FCP 167. LAST_SRVC_DT,
168 JJ. BRAND_NAME,
5 the system SAS 11:44 Friday, October 30, 2009
169 JJ. GNRC_NAME,
170 JJ. AHFS_THRPTC_CLS_CD,
171 JJ. AHFS_THRPTC_CLS_DESC,
172 JJ. LABEL_NAME,
173 JJ. STRNGTH_NUM,
174 JJ. STRNGTH_UNIT_DESC,
175 JJ. SPECF_THRPTC_CLS_CD,
176 JJ. SPECF_THRPTC_CLS_DESC,
177 JJ. GCN_NUM,
FCP 178. PRSCRPTN_NUM
179);
ERROR: ORACLE prepare error: ORA-00936: lack of expression. SQL statement: SELECT middle. UNIQ_MBR_ID as mrb_id,
RDL PRVDR_SPCLTY_DESC like pcp_spc, FCP. LAST_SRVC_DT as rx_date, JJ. BRAND_NAME as brand, JJ. GNRC_NAME as generic,
DD. AHFS_THRPTC_CLS_CD like ahfs_cd, JJ. AHFS_THRPTC_CLS_DESC as ahfs_dsc, JJ. LABEL_NAME as lbl, JJ. STRNGTH_NUM as
strngth, JJ. STRNGTH_UNIT_DESC as unt, JJ. SPECF_THRPTC_CLS_CD as spc_tx_cls_cd, JJ. SPECF_THRPTC_CLS_DESC as
spc_tx_cls_dsc, JJ. GCN_NUM as gcn, FCP. PRSCRPTN_NUM as rx_num, SUM (FCP. INGRDNT_AMT) as rx_ingrd, SUM (FCP. PD_AMT)
as rx_paid, SUM (FCP. UNIT_SRVC_CNT) as rx_cnt, SUM (FCP. DSPNSD_QTY) as rx_qty, SUM (FCP. DAY_SUPLY_CNT) as rx_day
OF PHRMCY_CLM_FACT pcf, MBR_ID_DMNSN mi, DRUG_DMNSN JJ, pd of the PRVDR_DMNSN, biplr_up_v1 () WHERE the
(biplr_up_v1.mbr_id = MBR_ID_DMNSN. UNIQ_MBR_ID) and (PHRMCY_CLM_FACT. FINL_CLM_KEY =
PHRMCY_FINL_CLM_DMNSN. FINL_CLM_KEY) AND (PHRMCY_CLM_FACT. MBR_KEY = MBR_ID_DMNSN. MBR_KEY) and
(PHRMCY_CLM_FACT. BNFT_KEY = MBR_BNFT_DMNSN. BNFT_KEY) and (PHRMCY_CLM_FACT. DRUG_KEY = DRUG_DMNSN. DRUG_KEY) and
(PHRMCY_FINL_CLM_DMNSN. CLM_ORGN_CD IN (', 'A')) AND (PHRMCY_CLM_FACT. LAST_SRVC_DT BETWEEN ' 01 JUN 2007"
and 30 SEP 2009') Group By mi. UNIQ_MBR_ID, pd. PRVDR_SPCLTY_DESC, FCP. LAST_SRVC_DT, JJ. BRAND_NAME,
DD GNRC_NAME, JJ. AHFS_THRPTC_CLS_CD, JJ. AHFS_THRPTC_CLS_DESC, JJ. LABEL_NAME, JJ. STRNGTH_NUM,
DD STRNGTH_UNIT_DESC, JJ. SPECF_THRPTC_CLS_CD, JJ. SPECF_THRPTC_CLS_DESC, JJ. GCN_NUM, FCP. PRSCRPTN_NUM.
NOTE: PROC SQL set NOEXEC option and will continue to check the syntax of the instructions.
180 run (drop table biplr_up_v1) in rosdwp;
NOTE: Statement is not executed because the NOEXEC option.
181 disconnect of rosdwp;
NOTE: Statement is not executed because the NOEXEC option.
182 of quitting;
NOTE: The SAS system is stopped at this stage of processing errors.
NOTE: PROCEDURE used SQL (total duration of processes):
time real 0.14 seconds
time CPU 0.03 seconds
183
184(1) assuming that LAST_SRVC_DT is a column of PHRMCY_CLM_FACT, to precede the table alias "FCP" rather than the full table name. If a table alias is specified in the FROM clause, it should be used rather than the full table name when you reference the columns.
2) there are two tables in the WHERE clause that do not appear in the FROM clause:PHRMCY_FINL_CLM_DMNSN
MBR_BNFT_DMNSNuser12142482 wrote:
Hello again,Wish Oracle was a bit more informative. Uses an Institute of SAS product called Enterprise Guide. A "hot fix" has been installed to solve a problem that the product appears unable to save the latest version of the revised code changes (hence "BETWEEN between" remaining even after an earlier edition). In any case, with the change, now get this error:
«ERROR: ORACLE prepare error: ORA-00904: "PHRMCY_CLM_FACT".» ' LAST_SRVC_DT': invalid identifier. (The log file is displayed below)
-The-Les restes remains of the error, no matter if code "pass" is used to move the date range to Oracle (which seems correct to the log output below that I believe), or if I hard code the date range in the query SQL PL itself.
-L' preparation error always appears at the end of the internal SELECTION.
-L' error of preparation remain, with or without the GROUP BY clause.Is there something else I'm missing? Someone suggested a reserve word - but other versions of the ANSI SQL standard, I don't see that is the case. I went to Support SAS and SAS list serve to the University of Georgia, but nothing definite from these sources. Have requested either able to run Oracle directly, outside this SAS Institute product - process.
Any suggestions are greatly appreciated. Thank you to all the world very much.
Jeff
150 OF
151 PHRMCY_CLM_FACT pcf,
152 MBR_ID_DMNSN environment,
153 DRUG_DMNSN dd,
154 PRVDR_DMNSN pd,
155 BIPLR_UP_V1 BLPR2
156. WHERE THE
157 (BIPLR_UP_V1.mbr_id = MBR_ID_DMNSN. UNIQ_MBR_ID) and
158 (PHRMCY_CLM_FACT. FINL_CLM_KEY = PHRMCY_FINL_CLM_DMNSN. FINL_CLM_KEY) AND
159 (PHRMCY_CLM_FACT. MBR_KEY = MBR_ID_DMNSN. MBR_KEY) and
160 (PHRMCY_CLM_FACT. BNFT_KEY = MBR_BNFT_DMNSN. BNFT_KEY) and
161 (PHRMCY_CLM_FACT. DRUG_KEY = DRUG_DMNSN. DRUG_KEY) and
162 (PHRMCY_FINL_CLM_DMNSN. CLM_ORGN_CD IN (', 'A')) AND
163 (PHRMCY_CLM_FACT. BETWEEN LAST_SRVC_DT & q. & fdos. & q and q & ldos. & q)
(164);
ERROR: ORACLE prepare error: ORA-00904: "PHRMCY_CLM_FACT." "' LAST_SRVC_DT ': invalid identifier. SQL statement: -
Ideas:
- You have problems with programs
- I get error code 800F0825 when the computer attempts to install the update to vista KB938371. What should I do to fix this? messages
- Recent changes to your computer
- What you have already tried to solve the problem
Remember - this is a public forum so never post private information such as numbers of mail or telephone!
Backup of personal data (which none should be considered 100% reliable at this point) then do a format and clean install of Windows. Please note that a repair installation (upgrade AKA on-site) will NOT fix it!
Once installed the clean, you will have the equivalent of a "new computer" in order to take care of everything on the next page before connecting the machine to the internet or a network otherwise and before using a USB key that is not brand new, or has not been freshly formatted:
5 steps to help protect your new computer before going online
http://www.Microsoft.com/protect/computer/advanced/XPPC.mspxOther useful references include:
Measures to help prevent spyware
http://www.Microsoft.com/security/spyware/prevent.aspxMeasures to help prevent computer worms
http://www.Microsoft.com/security/worms/prevent.aspxAvoid fake security software!
http://www.Microsoft.com/security/antivirus/rogue.aspx~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft
-
I get error 201, despite all the advice, I found so far
I get error 201, despite all the advice, I found so far. I'm using 64-bit Windows of 8.1. Thank you.
If you already tried all the steps:
Download the direct installation file and install Adobe Creative Cloud app.
Step 1:
Click on the link below and open Photoshop Elements download link.
Do not close the page, just keep it open.
Download Photoshop Elements products | 10, 11, 12, 13
Step 2:
Click on the link below and download zip file of cloud creative direct Installer:
http://trials2.Adobe.com/AdobeProducts/KCCC/1/Win32/ACCCx3_0_0_74.zip
Once the downloaded Zip file, right-click on it and select the option extract all and extract the content and try to install the Adobe Creative Cloud app and check.
-
Error ORA-600 on the Production Oracle Applications Instance
Hello
We get the error ORA-600 on the Instance of the Production Oracle Applications.
Can any body suggest how to solve this problem.
We got the error on 30 - Mar below... but the instance is up & running.
Error as follows:
==========
error occurred at the SQL level 1 recursive
to "DMSYS. OLAPIHISTORYRETENTION', line 1
[internal error code, arguments: [16206], [4294951254], [] [] [], [], []]
internal error code, arguments: [16206], [4294951254]
Thanks in advance for your help.
Thank you
Mudunuri Billon.What version of Oracle?
-
you want to know how to block the ophcrack from running, my child uses this to get my password and in the parental controls in vista. I have 3 accounts going 2 for children and one for the parents/administrator. I found ophcrack in several places on the computer. any help would be greatly appreciated
The only question the idea of Malkeleah, that is when you put a password on BIOS, all you need to do is pop the battery from the motherboard and the password is gone. Faronics has in some programs such as anti-executable and a few other programs that may block the name or ID of a process and prevent it from running (some antiviruses have that option, such as Avast, but usually is a pain in the ass to configure)
Maybe you are looking for
-
Hello I currently use 42 FF as my browser and when I clicked on the arrow down on my address bar he use to drop down and show 12 items of my recent sites. But recently, I noticed that it displays only 6 points with a scroll bar to see the other 6 poi
-
Why TestStand change my movie file
Hello everyone, I see something new all of a sudden. We have five different clients that are available for operators to use files. Two of the files were made by a work colleague and the other three by myself. Lately, whenever the operator ends wit
-
Multifunction HP B110a stops working after update from Hp
I have the all-in-one HP Photosmart B110a, who stops working after applying "HP updates notification". Impossible to print or access HP Solution Center (nothing works). Only solution is to use the installation CD to completely uninstall the HP softwa
-
I tried to uninstall adobe reader 8.1 software and get code Error 1606 could not access network location % APPDATA%\. I tried the windows cleaning tool, Revo unistl and a few other ways. Not only it will uninstall but leaves do not install the latest
-
HP Officejet Pro 8500 A910 was not found.
I have a HP Officejet Pro 8500 bought more just. After you have installed on a HP Pavilion m8100n desktop, everything works but the scanner. I get this message "The HP Officejet Pro 8500 A910 is not found". Spent 3.5 hrs on the phone with HP support,