error in the procedure
HelloPlease help me to fix errors in the compilation of the following procedure, working with 11g.
LINE/COL ERROR
-------- -----------------------------------------------------------------
1/37 PLS-00103: encountered the symbol "(" quand attend un de la) "
Next:
:= . ), @ % of default characters
The symbol ': = ' has been replaced by "("pour continuer.) "
13/39 PLS-00103: encountered the symbol "(" quand attend un de la) "
Next:
, of in bulk
----------------------------------------------------------------------------------------------------------------------
create or replace procedure getvertices (id IN varchar2 (5))
is
type ref_cur is REF CURSOR;
ref_cur c_v;
type myrec is RECORD (RID number, x, y I number, varchar2 (5));
REC myrec;
Start
Open c_v to select row_number() over (partiton in order of idarpt to idarpt) RID, t.x, t.y XY, testpoly idarpt t, table (sdo_util.getvertices (a.geometry)) where a.idarpt = id;
loop
extract the c_v in rec;
dbms_output.put_line (rec.rid |) » --'|| Rec.x: '-' | Rec.y: '-' | Rec.i);
end loop;
close c_v;
end;
I think there may be a conflict with the name "id" parameter Try to use something else instead, like "p_id" as shown below.
SCOTT@orcl_11gR2> create table testpoly
2 (idarpt varchar2(5),
3 geometry mdsys.sdo_geometry)
4 /
Table created.
SCOTT@orcl_11gR2> INSERT INTO testpoly VALUES(
2 'PQRD',
3 SDO_GEOMETRY(
4 2003,
5 NULL,
6 NULL,
7 SDO_ELEM_INFO_ARRAY(1,1003,3),
8 SDO_ORDINATE_ARRAY(1,1, 5,7)
9 )
10 );
1 row created.
SCOTT@orcl_11gR2> CREATE OR REPLACE PROCEDURE getvertices
2 (p_id IN VARCHAR2)
3 AS
4 TYPE ref_cur IS REF CURSOR;
5 c_v ref_cur;
6 TYPE myrec IS RECORD
7 (rid NUMBER,
8 x NUMBER,
9 y NUMBER,
10 i VARCHAR2(5));
11 rec myrec;
12 BEGIN
13 OPEN c_v FOR
14 SELECT ROW_NUMBER () OVER (PARTITION BY idarpt ORDER BY idarpt) rid,
15 t.x x, t.y y, idarpt
16 FROM testpoly a,
17 TABLE (SDO_UTIL.GETVERTICES (a.geometry)) t
18 WHERE a.idarpt = p_id;
19 LOOP
20 FETCH c_v INTO rec;
21 EXIT WHEN c_v%NOTFOUND;
22 DBMS_OUTPUT.PUT_LINE
23 (rec.rid || '--' || rec.x || '--' || rec.y || '--' || rec.i);
24 END LOOP;
25 CLOSE c_v;
26 END getvertices;
27 /
Procedure created.
SCOTT@orcl_11gR2> show errors
No errors.
SCOTT@orcl_11gR2> exec getvertices('PQRD')
1--1--1--PQRD
2--5--7--PQRD
PL/SQL procedure successfully completed.
Tags: Database
Similar Questions
-
Original title: IApple synchronize notifier.exe - not found entry point
I typed a mistake in my first question. Here he again the question.
The procedure entry point sqlite3_wal_checkpoint be found in the librayr of Hotlinks SQLite3.dll.
I called Apple, but they checked my computer and cannot find any problems with the above, but he always comes back.
Hello
1. when exactly you receive this error message?
2. did you of recent changes on the system?
Method 1:
Temporarily disable the antivirus on the computer program and check if it helps. If it works, you may need to check the settings of the program.
Note: check that you activate your anti-virus protection on the computer back after you complete these steps. It is not recommended to disable these settings on the computer. It's just to solve the problem.
Method 2:
You can try to uninstall and reinstall everything produced Apple installed on the system and check if this may help:
Remove and reinstall iTunes, QuickTime, and other software components for Windows Vista or Windows 7
-
error in the procedure 'Send Jython HTML Email'
I used the procedure to "Send the Email of HTML Jython" to send an email to ODI 11 g.
Options:
The entries I used are
Host: Address of the SMTP server
< Default > port: 25
< Default > SMTP Auth: Yes
User:
Password *.
At ***@***.com
Of ***@***.com
Test of the object
LoadfromFile No.
FilePath D:\
MessageText Test_Message
Is < default > HTML: Yes
Spare D:\
Error message after I got to the step "to create a complete message:
"
org.apache.bsf.BSFException: exception of Jython:
Traceback (most recent call changed):
File "< string >", line 25, < module >
IOError: (21, "Is a directory", ")
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:322)
at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2472)
at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:47)
at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:1)
at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ 2.doAction(StartSessRequestProcessor.java:376)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:309)
to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$ 0 (StartSessRequestProcessor.java:301)
to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ StartSessTask.doExecute (StartSessRequestProcessor.java:865)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:137)
to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:662)
Caused by: Traceback (most recent call changed):
File "< string >", line 25, < module >
IOError: (21, "Is a directory", ")
at org.python.core.PyException.fillInStackTrace(PyException.java:70)
at java.lang.Throwable. < init > (Throwable.java:181)
at java.lang.Exception. < init > (Exception.java:29)
to java.lang.RuntimeException. < init > (RuntimeException.java:32)
to org.python.core.PyException. < init > (PyException.java:46)
to org.python.core.PyException. < init > (PyException.java:43)
at org.python.core.Py.IOError(Py.java:175)
to org.python.core.io.FileIO. < init > (FileIO.java:77)
at org.python.core.PyFile.file___init__(PyFile.java:157)
to org.python.core.PyFile$ exposed___new__.createOfType (unknown Source)
at org.python.core.PyOverridableNew.new_impl(PyOverridableNew.java:12)
at org.python.core.PyType.invoke_new_(PyType.java:432)
at org.python.core.PyType.type___call__(PyType.java:1397)
at org.python.core.PyType.__call__(PyType.java:1388)
at org.python.core.OpenFunction.__call__(__builtin__.java:1576)
at org.python.core.PyObject.__call__(PyObject.java:414)
at org.python.core.PyObject.__call__(PyObject.java:418)
to org.python.pycode._pyx1609.f$ 0 (< string >: 30)
to org.python.pycode._pyx1609.call_function (< string >)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1204)
at org.python.core.Py.exec(Py.java:1248)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:172)
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
... 19 more
"
Hi 2782749,
It seems that this has to do with the path of the attachment. Could you try giving a full path to the file to see if it works? It is perhaps required in this procedure.
Could you post the code of procedure you?
Best regards
JeromeFr
-
Query running beside the database successfully but in error in the procedure!
Hi all
I'm something get odd errors on in ODI 11 g.
When I run the query to the database, it performs very well, and it creates a table.
But when encorporate this query in the procedure, it gives me following error.
ODI-1228: PROC_POZ_BOSS_OMP_BOSSWORKORDER (procedure) has failed on the staged target of connection ORACLE ODI POZ.
Caused by: java.sql.SQLDataException: ORA-01843: not one month valid
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:79)
I am convert Char to the data types Date in the Code.
Details of the DB: - Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
ODI Details:-Standalone Edition Version 11.1.1
Build ODI_11.1.1.3.0_GENERIC_100623.1635
What would be the reason for query next to the DB with success but in error next to the ODI?
I'm really confused... :(
Help me how can I fix this error?Hi Manu
I think that I've already advised the same thing in your previous thread. It could be because NLS_DATE_FORMAT.
Something weird situation while running the interface in ODiThank you.
-
Get error in the procedure of Jython
Hi all
I m writing this code in the procedure of ODI with technology like Jython target and ignore the errors checked.
filesrc = open (was: \MyFile.txt ',' r')
First = filesrc. ReadLine()
lines = 0
all first:
lines += 1
First = filesrc. ReadLine()
def intWithCommas (x):
If not in kind (x) [type (0), type(0L)]:
raise TypeError ("parameter must be an integer.")
If x 0 are:
return '-' + intWithCommas (x)
result = "
While x > = 1000:
x, r = divmod (x 1000)
result = ', % 03d %s' % (r, result)
return '%d %s' % (x, result)
S1 = Str (intWithCommas (Lines))
S2 = "\n\n and the first line of the file is - > > \n\n"
filesrc. Seek (0)
S3 = STR (filesrc. ReadLine())
final = s1 + s2 + s3
raise "\n\n are the number of lines in the file - > > ', final"
but this error:
org.apache.bsf.BSFException: exception of Jython:
Traceback (innermost last):
(no object code) on line 0
SyntaxError: ('invalid syntax', ('< string >", 5, 1, ' lines += 1'))
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:345)
at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:169)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2374)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java:1615)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java:1580)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2755)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ 2.doAction(StartSessRequestProcessor.java:322)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$ 0 (StartSessRequestProcessor.java:237)
to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ StartSessTask.doExecute (StartSessRequestProcessor.java:794)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:619)
Please help me with this...Hello
You are able to run this code directly from Jython?
What you can do is to copy this code into a text file and name it say sample_jython.py.
Now, open a command prompt and navigate to the
\oracledi\bin Issue the following command
Jython
\sample_jython.py Thank you
Fati -
Hi all
I wrote plsql procedure to lode, spaces of table as data:
CREATE OR REPLACE PROCEDURE PTABLESPACES IS
CURSOR C1 IS
Select occupied_space, d.owner, d.tablespace_name, sum(d.BYTES/1024) as total_space, sum(e.BYTES/1024)
((((sum(d.BYTES/1024) - sum(e.BYTES/1024)) as free_space,ROUND((sum(e.BYTES/1024)/sum(d.BYTES/1024)) * 100) AS PERCENT_OCCUPIED
by dba_segments d, e dba_extents where d.owner = e.owner and d.tablespace_name = e.tablespace_name
D.owner group, d.tablespace_name order of d.owner;
BEGIN
FOR I IN C1 LOOP
INSERT INTO TABLE_SPACES VALUES(I.OWNER,I.tablespace_name,I.total_space,I.occupied_space,I.free_space,I.PERCENT_OCCUPIED);
END LOOP;
END PTABLESPACES;
When I run it as a block of Nedved, it works perfectly.
But when I put it in the procedure is to show errors.
Error:
5/21 PL/SQL: ORA-00942: table or view does not exist
Please help about this
Thanks in advance.Hello
As Urs said, you must have the priviges granted directly to you, not only for a role that is granted.
The statement "In PL/SQL grants must be made directly with the user" is a little too simplified.
Roles used within stored procedures.
Roles work in anonymous PL/SQL blocks, PL/SQL, but are not stored in the database. -
Error during the procedure of creatine
Hello
I'm new to plsql. can u please let me know, what is wrong in the following procedure?
CREATE OR REPLACE PROCEDURE PROCEDURE1
(
VPIZZA_TYPE IN VARCHAR2
OUT VARCHAR2 REC
) AS
BEGIN
Select pizza_id, pizza_name, pizza_size, pizza_cost, pizza_type pizza_item REC
where pizza_type = vpizza_type;
If (vpizza_type = 'V' and vpizza_type = 'NV') then
dbms_output.put_line (rec.pizza_id |) » '|| Rec.pizza_name |' '|| Rec.pizza_size |' '|| Rec.pizza_cost);
on the other
dbms_output.put_line ('invalid pizza type');
end if;
END PROCEDURE1;
It's my table of > > > > > >
pizza_id, pizza_name, pizza_cost, pizza_cost, pizza_type
1 Italian Max 250 NV 2 Italian medium 150 NV 3 Italian Max 200 V 4 Italian medium 100 V 5 cheese Mini 100 NV Prashant_patil wrote:
Hello
I'm new to plsql. can u please let me know, what is wrong in the following procedure?
CREATE OR REPLACE PROCEDURE PROCEDURE1
(
VPIZZA_TYPE IN VARCHAR2
OUT VARCHAR2 REC
) AS
BEGIN
Select pizza_id, pizza_name, pizza_size, pizza_cost, pizza_type pizza_item REC
where pizza_type = vpizza_type;
If (vpizza_type = 'V' and vpizza_type = 'NV') then
dbms_output.put_line (rec.pizza_id |) » '|| Rec.pizza_name |' '|| Rec.pizza_size |' '|| Rec.pizza_cost);
on the other
dbms_output.put_line ('invalid pizza type');
end if;
END PROCEDURE1;
It's my table of >
pizza_id, pizza_name, pizza_cost, pizza_cost, pizza_type
1 Italian Max 250 NV 2 Italian medium 150 NV 3 Italian Max 200 V 4 Italian medium 100 V 5 cheese Mini 100 NV You do not say what problem you are having with him, well, I guess:
First, you must get your columns in separate variables. You cannot paste all results
in a single varchar2.
Secondly, any type of pizza will be the two 'V' and 'NV' at the same time - so your 'if' will always be false.
In the future, you must describe the problem you are experiencing, with relevant error messages.
-
Table not found error in the procedure
I am logged in as A user.
Trying to create a procedure in the TGT schema by reference to a table in the TSG scheme.
I can select directly from the table as
Select count (*) from STG. TABLE1; by logging in as A USER.
The foregoing, works very well and gives the result set.
But when I try to create a procedure such as
create or replace procedure TGT.delme as
number of v_cnt;
Start
Select count (*) in the v_cnt of ILI. TABLE1;
dbms_output.put_line (' the number is: ' | v_cnt);
end;
/
Compilation error, he throws as "PL/SQL: ORA-00942 table or view does not exist.
Please let me know the reason. Thank you.Hello
You must grant certain privileges on STG. Table1 directly to the TGT, which is you can't give them a role, and then grant the role of TGT. For PL/SQL to access an object code, privs must be granted directly. So, at some point, you'll need to issue
GRANT SELECT ON STG.TABLE1 TO TGT /
and you will need to either make connected to stg or connected as another user with permissions for this...
HTH
David
-
what I'm missing here. I get this error message.
[Error] Syntax checking (24:23): line ERROR 24, col 23, ending_line 24, ending_col 33, found "p_selection", Expecting :)
-or - OR - or - AND - or - BETWEEN IN AS LIKE2 LIKE4
LIKEC MEMBER SUBMULTISET - or - or -! =,
< < = <>= > > = ^ ^ = IS NOT - or - + - | -or - * / MOD REST
-or - *-or -; updated MULTISET YEAR - or - %. [- or - @ - or - (string
CREATE OR REPLACE PROCEDURE Standard_Specifications_Book ( p_specsearch IN VARCHAR2, -- p_selection in varchar2, p_results OUT SYS_REFCURSOR) AS p_selection VARCHAR2 :='1'; BEGIN OPEN p_results FOR SELECT (SUBSTR (ITEM, 1, 4) || '.' || SUBSTR (ITEM, 5)) ItemNumber, Item, IDESCR ShortDescription, IDESCRL LongDescription, IUNITS UnitName, FUNC_GET_UNIT_NAME (IUNITS) PlanUnitName, ispecyr SpecYear, IOBSELET FROM ITEMLIST WHERE ITEM <> '2999509/00001' AND IOBSELET = 'N' AND Ispecyr = '05' AND (if p_selection = '1' then ( ItemNumber like '%p_specsearh' or ItemNumber like 'P_specsearch%' or Item like '%p_specsearh' or Item like 'P_specsearch%') else ( ShortDescription like '%p_specsearh' or ShortDescription like 'P_specsearch%' or LongDescription like '%p_specsearh' or LongDescription like 'P_specsearch%') end if ) ORDER BY ItemNumber ASC, LongDescription ASC; END;
Do not use in case of a SQL query. Use:
CREATE OR REPLACE PROCEDURE Standard_Specifications_Book ( p_specsearch IN VARCHAR2, p_selection in varchar2, p_results OUT SYS_REFCURSOR) AS p_selection VARCHAR2 :='1'; BEGIN OPEN p_results FOR SELECT (SUBSTR (ITEM, 1, 4) || '.' || SUBSTR (ITEM, 5)) ItemNumber, Item, IDESCR ShortDescription, IDESCRL LongDescription, IUNITS UnitName, FUNC_GET_UNIT_NAME (IUNITS) PlanUnitName, ispecyr SpecYear, IOBSELET FROM ITEMLIST WHERE ITEM '2999509/00001' AND IOBSELET = 'N' AND Ispecyr = '05' AND ( (p_selection = '1' and ( ItemNumber like '%p_specsearh' or ItemNumber like 'P_specsearch%' or Item like '%p_specsearh' or Item like 'P_specsearch%')) OR (ShortDescription like '%p_specsearh' or ShortDescription like 'P_specsearch%' or LongDescription like '%p_specsearh' or LongDescription like 'P_specsearch%') ) ORDER BY ItemNumber ASC, LongDescription ASC; END;
SY.
-
Original title: Windows XP Home error message
I reformatted the hard drive and restorded factory settings. I've upgraded to Service Pack 3 and IE 8. I now receive the errors listed below and the computer does not turn off. I have to hold in the power button to make it stop.
Errors:
The procedure entry Point aspSearchInterfuce could not
Be found in the library of links dynamic wlanapi.dll
The apsInitialze procedure entry Point could not be
located in the library of links dynamic wlanapi.dll
can someone please tell me what are these errors and how to fix?
Hi Daytona931,
Hope you were able to resolve the issue and thank you for sharing the information.
-
I get the error message "the procedure point?getText@FxtField@@QBE entry? "AVFXWString@@XZ could not be located in the dynamic linklibrary fox.dll ' when I boot. How should I do?
Looks like it has something to do with the Acronis software, there is an old post here: -.
http://Forum.Acronis.com/Forum/6553
If it is of no use and that you use the disk imaging software and then uninstall it or go to start/run type msconfig press enter and edit startup.
-
I just updated my version of Skype at: 5.10.0.14, but every time he tries to load at startup, I get this error message: "the procedure entry point"NtalpcSendWaitReceivePort not found in the dynamic link library ntdll.dll.
When I click ok, it loads. I have re-uploaded twice, but it's always the same!
Please, can anyone help?
Hello
Method 1:
You can uninstall Skype by using the Fixit, then reinstall.http://support.Microsoft.com/mats/Program_Install_and_Uninstall/Method 2:
Scan the file system (CFS) auditor to repair corrupted files.Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe)
http://support.Microsoft.com/kb/310747
Alternatively, you can display the query in the Skype forum to get help.
Skype - Forums
http://Forum.Skype.com/ -
Running Windows 7 Home premium
Hi I get this error when I try to add or remove windows features. Before I even tried to change anything, I get this error when I try to access point to add or remove windows features. I just reinstall windows then perhaps it's to do with it?
ERROR
The procedure entry point ucrtbase.terminate could not be found in the api-ms-win-crt-runtime-l1-1-0.dll dynamic link library
If anyone knows what this means or what I have to do to get rid of the error, any help would be accepted with gratitude.
Best regards Steve
Hi, I have now discovered what the problem was. It wasn't Office exactly. Rather have just reinstalled windows 7, windows update did not work properly. Virtually no updates had been installed. I had to run the "windows update diagnostic" program from Microsoft support. Once that had solved the problem of update on 180 updates have been installed. Once they have been installed the problem with the error has been resolved. I do not know what update fixed but one of them did.
Best regards Steve
-
The procedure entry point DwmHintDxUpdate be found in USER32.dll dynamic link library.
I have a Win 7 Ultimate machine. I get the error message
The procedure entry point DwmHintDxUpdate be found in USER32.dll dynamic link library.
What it means? Is he serious? How can I get rid of him?
Thank you
ChasThe top of the box, said Aurora.src. This is the screensaver provided by Microsoft. The DEFAULT screensaver supplied with Windows 7 is not compatible with Windows 7 64 bit, causes a message box and often freezes the system for a few minutes. Is not on the beta version.
Certainly picked a different screen saver seems to fix the problem. -
Hi all
I am a beginner in PL/SQL... Need your expertise in this...
CREATE TABLE CUST
(
S_DATA VARCHAR2 (40 BYTES) BY DEFAULT ' ' NOT NULL,
V_YEAR VARCHAR2 (8 BYTES) BY DEFAULT ' ' NOT NULL,
S_STAT VARCHAR2 (1 BYTE),
DATE OF START_DT,
END_DT DATE,
S_DESP VARCHAR2 (60 BYTE),
SRCE_YEAR VARCHAR2 (4 BYTE),
S_SEQ NUMBER 4,
S_SOURCE VARCHAR2 (30 BYTE),
);
CREATE A UNIQUE CUST_PK ON CUST (S_DATA, V_YEAR) INDEX;ALTER TABLE CUST ADD()
CONSTRAINT CUST_PK
KEY ELEMENTARY SCHOOL
(S_DATA, V_YEAR)
ENABLE VALIDATE);
Few records of the table...Insert into cust values (' 2014 'LITEM', ',', TO_DATE (1 January 2014 ',' DD/MM/YYYY '), TO_DATE (December 31, 2014 ',' DD/MM/YYYY '), 'BookLEM', ' 2014 ", 89, 'Mary');
Insert into cust values (' 2011 'NJM', ',', TO_DATE (January 1, 2014 ',' DD/MM/YYYY '), TO_DATE (December 31, 2014 ',' DD/MM/YYYY '), 'BookLEM', ' 2014 ", 89, 'Mary');
Insert into cust values ('LM', '2014', ', TO_DATE (1 January 2014 ',' DD/MM/YYYY '), TO_DATE (December 31, 2014 ',' DD/MM/YYYY '), 'test rec', '2014', 1, 'Jacob');
Insert into cust values (' 2014 'KHJ', ',', TO_DATE (January 1, 2014 ',' DD/MM/YYYY '), TO_DATE (December 31, 2014 ',' DD/MM/YYYY '), 'store rec', '2014', 4, 'Jacob');
Insert into cust values ('KIFM', ' 2000 ',', TO_DATE (1 January 2014 ',' DD/MM/YYYY '), TO_DATE (December 31, 2014 ',' DD/MM/YYYY '), 'BookLEM', ' 2014 ", 89, 'Mary');Table cust has around 48000 records. I create a stored procedure to insert records for each record in the cust with v_year = 2014, with the range below...
1. for each record from 2014 to cust = v_year, create records with v_year = 2015 (with s_stat = 'B') and v_year = 2016,2017,2018 (with s = s_stat ')
2 start_dt, end_dt will vary respective to the v_year as below in insert statements.
3. prior to insert the records, check if the file already exists, if there are jump the insert for this year. -I don't know how this script as well...create or replace procedure cust_test ( out_ret_code OUT NUMBER, out_err_msg OUT VARCHAR2) is CURSOR samp_cur is select * from cust where v_year='2014'; TYPE cur_data is TABLE OF cust%ROWTYPE; result_data cur_data := cur_data(); begin open samp_cur; loop fetch samp_cur BULK COLLECT into result_data limit 1000000; exit when result_data.COUNT=0; FORALL idx in 1..result_data.COUNT insert into cust (s_data,v_year,s_stat,start_dt,end_dt,s_desp,srce_year,s_seq,s_source) values (result_data(idx).s_data,'2015','B',to_date('01/01/2015', 'MM/DD/YYYY'),to_date('12/31/2015','MM/DD/YYYY'),result_data(idx).s_desp,'2015',result_data(idx).s_seq,'user1'); insert into cust (s_data,v_year,s_stat,start_dt,end_dt,s_desp,srce_year,s_seq,s_source) values (result_data(idx).s_data,'2016','S',to_date('01/01/2016', 'MM/DD/YYYY'),to_date('12/31/2016','MM/DD/YYYY'),result_data(idx).s_desp,'2016',result_data(idx).s_seq,'user1'); insert into cust (s_data,v_year,s_stat,start_dt,end_dt,s_desp,srce_year,s_seq,s_source) values (result_data(idx).s_data,'2017','S',to_date('01/01/2017', 'MM/DD/YYYY'),to_date('12/31/2017','MM/DD/YYYY'),result_data(idx).s_desp,'2017',result_data(idx).s_seq,'user1'); insert into cust (s_data,v_year,s_stat,start_dt,end_dt,s_desp,srce_year,s_seq,s_source) values (result_data(idx).s_data,'2018','S',to_date('01/01/2018', 'MM/DD/YYYY'),to_date('12/31/2018','MM/DD/YYYY'),result_data(idx).s_desp,'2018',result_data(idx).s_seq,'user1'); END LOOP; Close samp_cur; end; /
I get an error in the procedure that must be declared IDX... Also, please advise if it is correct in terms of scope... Appreciate your help...
Thank you very much.
INSERT INTO CUST
(
S_DATA
V_YEAR
S_STAT
START_DT
END_DT
S_DESP
SRCE_YEAR
S_SEQ
S_SOURCE
)
SELECT S_DATA, the_year, CASE WHEN the_year = 2015 CAN ' to ' B' ELSE ' END
TO_DATE(the_year||) e 0101', 'YYYYMMDD'), TO_DATE(the_year||) e 1231', 'YYYYMMDD')
s_desp
the_year
s_seq
, "user1".
FROM CUST, (SELECT 2014 + LEVEL the_year FROM DUAL CONNECT BY LEVEL<>
WHERE V_YEAR = ' 2014 "
;
You can use merge or condition NOT EXISTS to skip existing records, like this:
MERGE INTO CUST
WITH THE HELP OF)
SELECT S_DATA, the_year V_YEAR, WHEN the_year-CASE = 2015 THEN ' of ' B' ELSE ' END S_STAT
TO_DATE(the_year||) e 0101', 'YYYYMMDD') START_DT, TO_DATE(the_year||) e 1231', 'YYYYMMDD') END_DT
s_desp
the_year SRCE_YEAR
s_seq
"user1" S_SOURCE
FROM CUST, (SELECT 2014 + LEVEL the_year FROM DUAL CONNECT BY LEVEL<>
WHERE V_YEAR = ' 2014 "
) D
ON (CUST. S_DATA = D.S_DATA AND CUST. V_YEAR = D.V_YEAR)
WHEN NOT MATCHED THEN INSERT
(
S_DATA
V_YEAR
S_STAT
START_DT
END_DT
S_DESP
SRCE_YEAR
S_SEQ
S_SOURCE
)
VALUES)
D.S_DATA
D.V_YEAR
D.S_STAT
D.START_DT
D.END_DT
D.S_DESP
D.SRCE_YEAR
D.S_SEQ
D.S_SOURCE
);or:
INSERT INTO CUST
(
S_DATA
V_YEAR
S_STAT
START_DT
END_DT
S_DESP
SRCE_YEAR
S_SEQ
S_SOURCE
)
SELECT S_DATA, the_year V_YEAR, WHEN the_year-CASE = 2015 THEN ' of ' B' ELSE ' END S_STAT
TO_DATE(the_year||) e 0101', 'YYYYMMDD') START_DT, TO_DATE(the_year||) e 1231', 'YYYYMMDD') END_DT
s_desp
the_year SRCE_YEAR
s_seq
"user1" S_SOURCE
CUST C1, (SELECT 2014 + LEVEL the_year FROM DUAL CONNECT BY LEVEL<>
WHERE V_YEAR = '2014' AND NOT EXISTS (SELECT 1 FROM CUST WHERE S_DATA = C1. S_DATA AND V_YEAR = the_year);
Maybe you are looking for
-
Buy iPhone7 of the United States will work in India
Hello!!! My brother brings iPhone 7 (factory unlock) for me as a gift of Deepawali (Festival). India it will work correctly. Rgds, Punishes
-
Re: Laptop screen went pink and white
Help, half my laptop screen went pink and white! This means a new screen is necessary - its only 3 months.He began to blink, but is now permanently rose/stripey.
-
Receive messages \aio_cdb_prodyctontext.masiimaging Imaging {B61ED343-0B14-4241-999C-490CB1A20DA4} is not package valid for the TrayApp product installation. and I have re-installed HP but says it's not found
-
How to get values from keyboard?
Hi friends, I want to get the data of the main features of the keyboard of the device. I use the canvas and RIM keyListener implementation. the substitution of the canvas keyPressed() and RIM keyDown() but impossible to get the alphabetic values (I m
-
"Compatible" black and tricolor cartridges of HP 60XL online still not being accepted by D110a!
1. product name and number: HP Photosmart e-All-in-One D110a printer. 2 operating system installed (if applicable): Windows 7 Home Premium 64-bit. 3. error message (if applicable): "Cartridge Incompatible." 4. all changes made to your system until th