Insert only if the table is empty
hi all
i am searching on the net and would like to check/confirm if it is possible to do insert based on the condition if the table is empty else do update
i am doing bulk insert in the table but only want to do it if the table is empty
else i wanna do update
in the bulk insert
the code is as follow :
forall x in 1..tableabc.count
insert into table_name values tableabc(x);
exit when tbaleabc%notfound;
end loopcan you please let me know where i can put the condition ** an example would be very helpfull.
looking forward to all your suggestions/help
Is this question related to your other multiple threads?
bulk update/insert
bulk update
https://forums.oracle.com/forums/thread.jspa?messageID=9964721#9964721
https://forums.oracle.com/forums/thread.jspa?messageID=9952576#9952576
https://forums.oracle.com/forums/thread.jspa?messageID=9954587#9954587
Where you were repeatedly told to use merge, and that if merge needed tuning then to post the information needed for a tuning request?
Instead of doing that you went back and edited out most of the content of your posts and start up yet another thread, where you have been advised to use merge but you will not because you have tested it and it is too slow.
This is forum abuse and is leading to a lot of other members wasting their time repeating information spread across all your other threads and you need to stop it immediately.
Similar Messages
-
Using variables to insert data in the table
I want to insert datas in the table. I use constants,
all the constants are stored properly in the table. But,
when I use variables I get the error message
"Too few parameters. expected 6".
(I declared all the fields of the table as text only.)
My program is "newt.jsp"
<%@ page language="java" import="java.sql.*" %>
<html>
<head>
<title>storing customer information in the database</title>
</head>
<body>
<%
String cno1 = request.getParameter("cno");
String n1 = request.getParameter("n");
String add11 = request.getParameter("add1");
String add21 = request.getParameter("add2");
String phone1 = request.getParameter("phone");
String email1 = request.getParameter("email");
Connection con = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:customer"," "," ");
Statement statement1 = con.createStatement();
Statement statement2 = con.createStatement();
statement2.executeUpdate("create table cust1 (cno varchar(20),n varchar(20),add1 varchar(20),add2 varchar(20),phone varchar(20),email varchar(20))");
statement1.executeUpdate("insert into cust1 (cno,n,add1,add2,phone,email) values(cno1,n1,add11,add21,phone1,email1)");
catch(SQLException sqle) {
System.err.println(sqle.getMessage());
catch(ClassNotFoundException cnfe) {
System.err.println(cnfe.getMessage());
catch(Exception e) {
System.err.println(e.getMessage());
finally {
try {
if(con!=null) {
con.close();
catch(SQLException sqle) {
System.err.println(sqle.getMessage());
%>
<br><br>
Mr./Ms. <%=n1 %> <br>
Your datas have been stored.<br>
</body>
</html>
Those who know answer please reply.
My thanks in advance.I would expect your insert statement to be this:
statement1.executeUpdate("insert into cust1 (cno,n,add1,add2,phone,email) values('"+cno1+"','"+n1+"','"+add11+"','"+add21+"','"+phone1+"','"+email1+"')");
If you just create a string, it's not going to fill in variables into the string by magic. -
How to disply the input text box when the data in the table is empty
Hi,
I m using JDeveloper 11g 5.1.1.1 : How to display the Input text box when the data in the table is empty or by using the dual table.
Since there is no record in the table, screen is displying only the lable. not displying the Input text box.? Any property is there to enable?.
One more case i tried by using dual (eg Select '0' as name from dual) created one view object and dragged in the JSF screen as input combo box with list of values.
In this case also it is not displaying the combo box.Just displaying the Lable name and 0 only.
Regards
Bijesh KHi,
I didn,t get you.Could you please explain. I am not choosing the ADF table. Selecting and dragging ADF form only.
Regards
Bijesh K -
How to find last inserted record in the table.
Version: Oracle 10g
I have a table called "Manufacture" and 3 columns as mfno,itemname,quantity.
How to find last inserted record in the table "Manufacture".
As i come to know that Rowid is not result perfect results. Please provide your inputs.user13416294 wrote:
Version: Oracle 10gThat is not a version. That is a product name. A version is 10.1.0.2 or 10.2.0.4, etc.
I have a table called "Manufacture" and 3 columns as mfno,itemname,quantity.
How to find last inserted record in the table "Manufacture".Not possible as your data model does not cater for it. That simple.
If there is a need to determine some order or associate some time to an entity, then that should be part of the data model - and a relationship, or one or more attributes are needed to represent that information. Thus your data model in this case is unable to meet your requirements.
If the requirements are valid, fix the data model. In other words - your question has nothing to do with Oracle and nothing to do with rowid, rowscn or other pseudo columns in Oracle. It is a pure data modeling issue. Nothing more. -
How to generate the insert script of the tables data present in an entire
How to generate the insert script of the tables data present in an entire schema in sqlplus environment
with out toad can you please help me please!!!!!!!!!!!!!HI,
First create this function to get insert scripts.
/* Formatted on 2012/01/16 10:41 (Formatter Plus v4.8.8) */
CREATE OR REPLACE FUNCTION extractdata (v_table_name VARCHAR2)
RETURN VARCHAR2
AS
b_found BOOLEAN := FALSE;
v_tempa VARCHAR2 (8000);
v_tempb VARCHAR2 (8000);
v_tempc VARCHAR2 (255);
BEGIN
FOR tab_rec IN (SELECT table_name
FROM user_tables
WHERE table_name = UPPER (v_table_name))
LOOP
b_found := TRUE;
v_tempa := 'select ''insert into ' || tab_rec.table_name || ' (';
FOR col_rec IN (SELECT *
FROM user_tab_columns
WHERE table_name = tab_rec.table_name
ORDER BY column_id)
LOOP
IF col_rec.column_id = 1
THEN
v_tempa := v_tempa || '''||chr(10)||''';
ELSE
v_tempa := v_tempa || ',''||chr(10)||''';
v_tempb := v_tempb || ',''||chr(10)||''';
END IF;
v_tempa := v_tempa || col_rec.column_name;
IF INSTR (col_rec.data_type, 'CHAR') > 0
THEN
v_tempc := '''''''''||' || col_rec.column_name || '||''''''''';
ELSIF INSTR (col_rec.data_type, 'DATE') > 0
THEN
v_tempc :=
'''to_date(''''''||to_char('
|| col_rec.column_name
|| ',''mm/dd/yyyy hh24:mi'')||'''''',''''mm/dd/yyyy hh24:mi'''')''';
ELSE
v_tempc := col_rec.column_name;
END IF;
v_tempb :=
v_tempb
|| '''||decode('
|| col_rec.column_name
|| ',Null,''Null'','
|| v_tempc
|| ')||''';
END LOOP;
v_tempa :=
v_tempa
|| ') values ('
|| v_tempb
|| ');'' from '
|| tab_rec.table_name
|| ';';
END LOOP;
IF NOT b_found
THEN
v_tempa := '-- Table ' || v_table_name || ' not found';
ELSE
v_tempa := v_tempa || CHR (10) || 'select ''-- commit;'' from dual;';
END IF;
RETURN v_tempa;
END;
SET PAUSE OFF
SET LINESIZE 1200
SET PAGESIZE 100
SET TERMOUT OFF
SET HEAD OFF
SET FEED OFF
SET ECHO OFF
SET VERIFY OFF
SPOOL GET_INSERTS.SP REP
SELECT EXTRACTDATA('EMP') FROM DUAL;
SPOOL OFF
SET PAUSE ON
SET LINESIZE 120
SET PAGESIZE 14
SET TERMOUT ON
SET HEAD ON
SET FEED 5
SET ECHO ON
SET VERIFY ON
SELECT 'insert into EMP ('
|| CHR (10)
|| 'EMPNO,'
|| CHR (10)
|| 'ENAME,'
|| CHR (10)
|| 'JOB,'
|| CHR (10)
|| 'MGR,'
|| CHR (10)
|| 'HIREDATE,'
|| CHR (10)
|| 'SAL,'
|| CHR (10)
|| 'COMM,'
|| CHR (10)
|| 'DEPTNO) values ('
|| DECODE (empno, NULL, 'Null', empno)
|| ','
|| CHR (10)
|| ''
|| DECODE (ename, NULL, 'Null', '''' || ename || '''')
|| ','
|| CHR (10)
|| ''
|| DECODE (job, NULL, 'Null', '''' || job || '''')
|| ','
|| CHR (10)
|| ''
|| DECODE (mgr, NULL, 'Null', mgr)
|| ','
|| CHR (10)
|| ''
|| DECODE (hiredate,
NULL, 'Null',
'to_date('''
|| TO_CHAR (hiredate, 'mm/dd/yyyy hh24:mi')
|| ''',''mm/dd/yyyy hh24:mi'')'
|| ','
|| CHR (10)
|| ''
|| DECODE (sal, NULL, 'Null', sal)
|| ','
|| CHR (10)
|| ''
|| DECODE (comm, NULL, 'Null', comm)
|| ','
|| CHR (10)
|| ''
|| DECODE (deptno, NULL, 'Null', deptno)
|| ');'
FROM emp;
SELECT '-- commit;'
FROM DUAL;now run the baove select statement you will get the following insert statements
/* Formatted on 2012/01/16 10:57 (Formatter Plus v4.8.8) */
--'INSERT INTO EMP('||CHR(10)||'EMPNO,'||CHR(10)||'ENAME,'||CHR(10)||'JOB,'||CHR(10)||'MGR,'||CHR(10)||'HIREDATE,'||CHR(10)||'SAL,'||CHR(10)||'COMM,'||CHR(10)||'DEPTNO)VALUES('||DECODE(EMPNO,NULL,'NULL',EMPNO)||','||CHR(10)||''||DECODE(ENAME,NULL,'NULL',''''|
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm, deptno
VALUES (7369, 'SMITH', 'CLERK', 7902,
TO_DATE ('12/17/1980 00:00', 'mm/dd/yyyy hh24:mi'), 800, NULL, 20
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm, deptno
VALUES (7499, 'ALLEN', 'SALESMAN', 7698,
TO_DATE ('02/20/1981 00:00', 'mm/dd/yyyy hh24:mi'), 1600, 300, 30
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm, deptno
VALUES (7521, 'WARD', 'SALESMAN', 7698,
TO_DATE ('02/22/1981 00:00', 'mm/dd/yyyy hh24:mi'), 1250, 500, 30
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm,
deptno
VALUES (7566, 'JONES', 'MANAGER', 7839,
TO_DATE ('04/02/1981 00:00', 'mm/dd/yyyy hh24:mi'), 2975, NULL,
20
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm,
deptno
VALUES (7654, 'MARTIN', 'SALESMAN', 7698,
TO_DATE ('09/28/1981 00:00', 'mm/dd/yyyy hh24:mi'), 1250, 1400,
30
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm,
deptno
VALUES (7698, 'BLAKE', 'MANAGER', 7839,
TO_DATE ('05/01/1981 00:00', 'mm/dd/yyyy hh24:mi'), 2850, NULL,
30
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm,
deptno
VALUES (7782, 'CLARK', 'MANAGER', 7839,
TO_DATE ('06/09/1981 00:00', 'mm/dd/yyyy hh24:mi'), 2450, NULL,
10
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm,
deptno
VALUES (7788, 'SCOTT', 'ANALYST', 7566,
TO_DATE ('04/19/1987 00:00', 'mm/dd/yyyy hh24:mi'), 3000, NULL,
20
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm,
deptno
VALUES (7839, 'KING', 'PRESIDENT', NULL,
TO_DATE ('11/17/1981 00:00', 'mm/dd/yyyy hh24:mi'), 5000, NULL,
10
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm, deptno
VALUES (7844, 'TURNER', 'SALESMAN', 7698,
TO_DATE ('09/08/1981 00:00', 'mm/dd/yyyy hh24:mi'), 1500, 0, 30
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm,
deptno
VALUES (7876, 'ADAMS', 'CLERK', 7788,
TO_DATE ('05/23/1987 00:00', 'mm/dd/yyyy hh24:mi'), 1100, NULL,
20
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm, deptno
VALUES (7900, 'JAMES', 'CLERK', 7698,
TO_DATE ('12/03/1981 00:00', 'mm/dd/yyyy hh24:mi'), 950, NULL, 30
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm,
deptno
VALUES (7902, 'FORD', 'ANALYST', 7566,
TO_DATE ('12/03/1981 00:00', 'mm/dd/yyyy hh24:mi'), 3000, NULL,
20
INSERT INTO emp
(empno, ename, job, mgr,
hiredate, sal, comm,
deptno
VALUES (7934, 'MILLER', 'CLERK', 7782,
TO_DATE ('01/23/1982 00:00', 'mm/dd/yyyy hh24:mi'), 1300, NULL,
10
);i hope this helps .
Thanks,
P Prakash
Edited by: prakash on Jan 15, 2012 9:21 PM
Edited by: prakash on Jan 15, 2012 9:22 PM -
Form validation error when the Table is empty.
Hello Gurus,
I am getting form validation error as soon as the popup is rendered to submit new row.
I am using the this popup to add new row in the table and this is happening only when there no data in the table but it works fine when there is some data in the table.
Screen shot: [http://picpaste.com/adf_error-BAdP8Thv.JPG]
Is there any way can I defer this error till I submit the form. ( which works fine when there is some data in table )
Thanks
Abhijeethere i tested not happend for me.
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1" binding="#{backingBeanScope.backing_untitled8.d1}">
<af:form binding="#{backingBeanScope.backing_untitled8.f2}" id="f2">
<af:messages binding="#{backingBeanScope.backing_untitled8.m1}"
id="m1"/>
<af:popup binding="#{backingBeanScope.backing_untitled8.p1}" id="p1">
<af:dialog binding="#{backingBeanScope.backing_untitled8.d3}" id="d3">
<af:panelFormLayout binding="#{backingBeanScope.backing_untitled8.pfl1}"
id="pfl1">
<af:inputText value="#{bindings.AunitctrlBe.inputValue}"
label="#{bindings.AunitctrlBe.hints.label}"
required="#{bindings.AunitctrlBe.hints.mandatory}"
columns="#{bindings.AunitctrlBe.hints.displayWidth}"
maximumLength="#{bindings.AunitctrlBe.hints.precision}"
shortDesc="#{bindings.AunitctrlBe.hints.tooltip}"
binding="#{backingBeanScope.backing_untitled8.it10}"
id="it10">
<f:validator binding="#{bindings.AunitctrlBe.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.AunitctrlUnit.inputValue}"
label="#{bindings.AunitctrlUnit.hints.label}"
required="#{bindings.AunitctrlUnit.hints.mandatory}"
columns="#{bindings.AunitctrlUnit.hints.displayWidth}"
maximumLength="#{bindings.AunitctrlUnit.hints.precision}"
shortDesc="#{bindings.AunitctrlUnit.hints.tooltip}"
binding="#{backingBeanScope.backing_untitled8.it11}"
id="it11">
<f:validator binding="#{bindings.AunitctrlUnit.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.AunitctrlCostMethod.inputValue}"
label="#{bindings.AunitctrlCostMethod.hints.label}"
required="#{bindings.AunitctrlCostMethod.hints.mandatory}"
columns="#{bindings.AunitctrlCostMethod.hints.displayWidth}"
maximumLength="#{bindings.AunitctrlCostMethod.hints.precision}"
shortDesc="#{bindings.AunitctrlCostMethod.hints.tooltip}"
binding="#{backingBeanScope.backing_untitled8.it12}"
id="it12">
<f:validator binding="#{bindings.AunitctrlCostMethod.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.AunitctrlCostMgmtOpt.inputValue}"
label="#{bindings.AunitctrlCostMgmtOpt.hints.label}"
required="#{bindings.AunitctrlCostMgmtOpt.hints.mandatory}"
columns="#{bindings.AunitctrlCostMgmtOpt.hints.displayWidth}"
maximumLength="#{bindings.AunitctrlCostMgmtOpt.hints.precision}"
shortDesc="#{bindings.AunitctrlCostMgmtOpt.hints.tooltip}"
binding="#{backingBeanScope.backing_untitled8.it13}"
id="it13">
<f:validator binding="#{bindings.AunitctrlCostMgmtOpt.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.AunitctrlCostApprMtd.inputValue}"
label="#{bindings.AunitctrlCostApprMtd.hints.label}"
required="#{bindings.AunitctrlCostApprMtd.hints.mandatory}"
columns="#{bindings.AunitctrlCostApprMtd.hints.displayWidth}"
maximumLength="#{bindings.AunitctrlCostApprMtd.hints.precision}"
shortDesc="#{bindings.AunitctrlCostApprMtd.hints.tooltip}"
binding="#{backingBeanScope.backing_untitled8.it14}"
id="it14">
<f:validator binding="#{bindings.AunitctrlCostApprMtd.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.AunitctrlJocApprMtd.inputValue}"
label="#{bindings.AunitctrlJocApprMtd.hints.label}"
required="#{bindings.AunitctrlJocApprMtd.hints.mandatory}"
columns="#{bindings.AunitctrlJocApprMtd.hints.displayWidth}"
maximumLength="#{bindings.AunitctrlJocApprMtd.hints.precision}"
shortDesc="#{bindings.AunitctrlJocApprMtd.hints.tooltip}"
binding="#{backingBeanScope.backing_untitled8.it15}"
id="it15">
<f:validator binding="#{bindings.AunitctrlJocApprMtd.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.AunitctrlCreBy.inputValue}"
label="#{bindings.AunitctrlCreBy.hints.label}"
required="#{bindings.AunitctrlCreBy.hints.mandatory}"
columns="#{bindings.AunitctrlCreBy.hints.displayWidth}"
maximumLength="#{bindings.AunitctrlCreBy.hints.precision}"
shortDesc="#{bindings.AunitctrlCreBy.hints.tooltip}"
binding="#{backingBeanScope.backing_untitled8.it16}"
id="it16">
<f:validator binding="#{bindings.AunitctrlCreBy.validator}"/>
</af:inputText>
<af:inputDate value="#{bindings.AunitctrlCreDate.inputValue}"
label="#{bindings.AunitctrlCreDate.hints.label}"
required="#{bindings.AunitctrlCreDate.hints.mandatory}"
shortDesc="#{bindings.AunitctrlCreDate.hints.tooltip}"
binding="#{backingBeanScope.backing_untitled8.id1}"
id="id1">
<f:validator binding="#{bindings.AunitctrlCreDate.validator}"/>
<af:convertDateTime pattern="#{bindings.AunitctrlCreDate.format}"/>
</af:inputDate>
<af:inputText value="#{bindings.AunitctrlUpdBy.inputValue}"
label="#{bindings.AunitctrlUpdBy.hints.label}"
required="#{bindings.AunitctrlUpdBy.hints.mandatory}"
columns="#{bindings.AunitctrlUpdBy.hints.displayWidth}"
maximumLength="#{bindings.AunitctrlUpdBy.hints.precision}"
shortDesc="#{bindings.AunitctrlUpdBy.hints.tooltip}"
binding="#{backingBeanScope.backing_untitled8.it17}"
id="it17">
<f:validator binding="#{bindings.AunitctrlUpdBy.validator}"/>
</af:inputText>
<af:inputDate value="#{bindings.AunitctrlUpdDate.inputValue}"
label="#{bindings.AunitctrlUpdDate.hints.label}"
required="#{bindings.AunitctrlUpdDate.hints.mandatory}"
shortDesc="#{bindings.AunitctrlUpdDate.hints.tooltip}"
binding="#{backingBeanScope.backing_untitled8.id2}"
id="id2">
<f:validator binding="#{bindings.AunitctrlUpdDate.validator}"/>
<af:convertDateTime pattern="#{bindings.AunitctrlUpdDate.format}"/>
</af:inputDate>
<af:inputText value="#{bindings.RowID.inputValue}"
label="#{bindings.RowID.hints.label}"
required="#{bindings.RowID.hints.mandatory}"
columns="#{bindings.RowID.hints.displayWidth}"
maximumLength="#{bindings.RowID.hints.precision}"
shortDesc="#{bindings.RowID.hints.tooltip}"
binding="#{backingBeanScope.backing_untitled8.it18}"
id="it18">
<f:validator binding="#{bindings.RowID.validator}"/>
</af:inputText>
<f:facet name="footer">
<af:panelGroupLayout layout="vertical"
binding="#{backingBeanScope.backing_untitled8.pgl1}"
id="pgl1">
<af:panelGroupLayout layout="horizontal"
binding="#{backingBeanScope.backing_untitled8.pgl2}"
id="pgl2">
<af:commandButton actionListener="#{bindings.First1.execute}"
text="First1"
disabled="#{!bindings.First1.enabled}"
partialSubmit="true"
binding="#{backingBeanScope.backing_untitled8.cb1}"
id="cb1"/>
<af:commandButton actionListener="#{bindings.Previous1.execute}"
text="Previous1"
disabled="#{!bindings.Previous1.enabled}"
partialSubmit="true"
binding="#{backingBeanScope.backing_untitled8.cb3}"
id="cb3"/>
<af:commandButton actionListener="#{bindings.Next1.execute}"
text="Next1"
disabled="#{!bindings.Next1.enabled}"
partialSubmit="true"
binding="#{backingBeanScope.backing_untitled8.cb4}"
id="cb4"/>
<af:commandButton actionListener="#{bindings.Last1.execute}"
text="Last1"
disabled="#{!bindings.Last1.enabled}"
partialSubmit="true"
binding="#{backingBeanScope.backing_untitled8.cb5}"
id="cb5"/>
</af:panelGroupLayout>
<af:commandButton text="Submit"
binding="#{backingBeanScope.backing_untitled8.cb6}"
id="cb6"/>
</af:panelGroupLayout>
</f:facet>
</af:panelFormLayout>
</af:dialog>
</af:popup>
<af:panelCollection binding="#{backingBeanScope.backing_untitled8.pc2}"
id="pc2">
<f:facet name="menus"/>
<f:facet name="toolbar">
<af:toolbar binding="#{backingBeanScope.backing_untitled8.t3}"
id="t3">
<af:commandButton text="insert"
binding="#{backingBeanScope.backing_untitled8.cb7}"
id="cb7"
action="#{backingBeanScope.backing_untitled8.cb7_action}"
partialSubmit="true"/>
</af:toolbar>
</f:facet>
<f:facet name="statusbar"/>
<af:table value="#{bindings.ApplUnitControlView1.collectionModel}"
var="row" rows="#{bindings.ApplUnitControlView1.rangeSize}"
emptyText="#{bindings.ApplUnitControlView1.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.ApplUnitControlView1.rangeSize}"
rowBandingInterval="0"
filterModel="#{bindings.ApplUnitControlView1Query.queryDescriptor}"
queryListener="#{bindings.ApplUnitControlView1Query.processQuery}"
filterVisible="true" varStatus="vs"
selectedRowKeys="#{bindings.ApplUnitControlView1.collectionModel.selectedRow}"
selectionListener="#{bindings.ApplUnitControlView1.collectionModel.makeCurrent}"
rowSelection="single"
binding="#{backingBeanScope.backing_untitled8.t4}" id="t4"
partialTriggers=":::cb1 :::cb3 :::cb4 :::cb5 ::cb2">
<af:column sortProperty="AunitctrlBe" filterable="true"
sortable="true"
headerText="#{bindings.ApplUnitControlView1.hints.AunitctrlBe.label}"
id="c6" width="105">
<af:inputText value="#{row.bindings.AunitctrlBe.inputValue}"
label="#{bindings.ApplUnitControlView1.hints.AunitctrlBe.label}"
required="#{bindings.ApplUnitControlView1.hints.AunitctrlBe.mandatory}"
columns="#{bindings.ApplUnitControlView1.hints.AunitctrlBe.displayWidth}"
maximumLength="#{bindings.ApplUnitControlView1.hints.AunitctrlBe.precision}"
shortDesc="#{bindings.ApplUnitControlView1.hints.AunitctrlBe.tooltip}"
id="it1">
<f:validator binding="#{row.bindings.AunitctrlBe.validator}"/>
</af:inputText>
</af:column>
<af:column sortProperty="AunitctrlUnit" filterable="true"
sortable="true"
headerText="#{bindings.ApplUnitControlView1.hints.AunitctrlUnit.label}"
id="c3" width="105">
<af:inputText value="#{row.bindings.AunitctrlUnit.inputValue}"
label="#{bindings.ApplUnitControlView1.hints.AunitctrlUnit.label}"
required="#{bindings.ApplUnitControlView1.hints.AunitctrlUnit.mandatory}"
columns="#{bindings.ApplUnitControlView1.hints.AunitctrlUnit.displayWidth}"
maximumLength="#{bindings.ApplUnitControlView1.hints.AunitctrlUnit.precision}"
shortDesc="#{bindings.ApplUnitControlView1.hints.AunitctrlUnit.tooltip}"
id="it9">
<f:validator binding="#{row.bindings.AunitctrlUnit.validator}"/>
</af:inputText>
</af:column>
<af:column sortProperty="AunitctrlCostMethod" filterable="true"
sortable="true"
headerText="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMethod.label}"
id="c9" width="105">
<af:inputText value="#{row.bindings.AunitctrlCostMethod.inputValue}"
label="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMethod.label}"
required="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMethod.mandatory}"
columns="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMethod.displayWidth}"
maximumLength="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMethod.precision}"
shortDesc="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMethod.tooltip}"
id="it6">
<f:validator binding="#{row.bindings.AunitctrlCostMethod.validator}"/>
</af:inputText>
</af:column>
<af:column sortProperty="AunitctrlCostMgmtOpt" filterable="true"
sortable="true"
headerText="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMgmtOpt.label}"
id="c1" width="105">
<af:inputText value="#{row.bindings.AunitctrlCostMgmtOpt.inputValue}"
label="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMgmtOpt.label}"
required="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMgmtOpt.mandatory}"
columns="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMgmtOpt.displayWidth}"
maximumLength="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMgmtOpt.precision}"
shortDesc="#{bindings.ApplUnitControlView1.hints.AunitctrlCostMgmtOpt.tooltip}"
id="it3">
<f:validator binding="#{row.bindings.AunitctrlCostMgmtOpt.validator}"/>
</af:inputText>
</af:column>
<af:column sortProperty="AunitctrlCostApprMtd" filterable="true"
sortable="true"
headerText="#{bindings.ApplUnitControlView1.hints.AunitctrlCostApprMtd.label}"
id="c2" width="105">
<af:inputText value="#{row.bindings.AunitctrlCostApprMtd.inputValue}"
label="#{bindings.ApplUnitControlView1.hints.AunitctrlCostApprMtd.label}"
required="#{bindings.ApplUnitControlView1.hints.AunitctrlCostApprMtd.mandatory}"
columns="#{bindings.ApplUnitControlView1.hints.AunitctrlCostApprMtd.displayWidth}"
maximumLength="#{bindings.ApplUnitControlView1.hints.AunitctrlCostApprMtd.precision}"
shortDesc="#{bindings.ApplUnitControlView1.hints.AunitctrlCostApprMtd.tooltip}"
id="it2">
<f:validator binding="#{row.bindings.AunitctrlCostApprMtd.validator}"/>
</af:inputText>
</af:column>
<af:column sortProperty="AunitctrlJocApprMtd" filterable="true"
sortable="true"
headerText="#{bindings.ApplUnitControlView1.hints.AunitctrlJocApprMtd.label}"
id="c4" width="105">
<af:inputText value="#{row.bindings.AunitctrlJocApprMtd.inputValue}"
label="#{bindings.ApplUnitControlView1.hints.AunitctrlJocApprMtd.label}"
required="#{bindings.ApplUnitControlView1.hints.AunitctrlJocApprMtd.mandatory}"
columns="#{bindings.ApplUnitControlView1.hints.AunitctrlJocApprMtd.displayWidth}"
maximumLength="#{bindings.ApplUnitControlView1.hints.AunitctrlJocApprMtd.precision}"
shortDesc="#{bindings.ApplUnitControlView1.hints.AunitctrlJocApprMtd.tooltip}"
id="it4">
<f:validator binding="#{row.bindings.AunitctrlJocApprMtd.validator}"/>
</af:inputText>
</af:column>
<af:column sortProperty="AunitctrlCreBy" filterable="true"
sortable="true"
headerText="#{bindings.ApplUnitControlView1.hints.AunitctrlCreBy.label}"
id="c5" width="105">
<af:inputText value="#{row.bindings.AunitctrlCreBy.inputValue}"
label="#{bindings.ApplUnitControlView1.hints.AunitctrlCreBy.label}"
required="#{bindings.ApplUnitControlView1.hints.AunitctrlCreBy.mandatory}"
columns="#{bindings.ApplUnitControlView1.hints.AunitctrlCreBy.displayWidth}"
maximumLength="#{bindings.ApplUnitControlView1.hints.AunitctrlCreBy.precision}"
shortDesc="#{bindings.ApplUnitControlView1.hints.AunitctrlCreBy.tooltip}"
id="it7">
<f:validator binding="#{row.bindings.AunitctrlCreBy.validator}"/>
</af:inputText>
</af:column>
<af:column sortProperty="AunitctrlCreDate" filterable="true"
sortable="true"
headerText="#{bindings.ApplUnitControlView1.hints.AunitctrlCreDate.label}"
id="c8" width="103">
<f:facet name="filter">
<af:inputDate value="#{vs.filterCriteria.AunitctrlCreDate}"
binding="#{backingBeanScope.backing_untitled8.id5}"
id="id5"/>
</f:facet>
<af:inputDate value="#{row.bindings.AunitctrlCreDate.inputValue}"
label="#{bindings.ApplUnitControlView1.hints.AunitctrlCreDate.label}"
required="#{bindings.ApplUnitControlView1.hints.AunitctrlCreDate.mandatory}"
shortDesc="#{bindings.ApplUnitControlView1.hints.AunitctrlCreDate.tooltip}"
id="id3">
<f:validator binding="#{row.bindings.AunitctrlCreDate.validator}"/>
<af:convertDateTime pattern="#{bindings.ApplUnitControlView1.hints.AunitctrlCreDate.format}"/>
</af:inputDate>
</af:column>
<af:column sortProperty="AunitctrlUpdBy" filterable="true"
sortable="true"
headerText="#{bindings.ApplUnitControlView1.hints.AunitctrlUpdBy.label}"
id="c7" width="107">
<af:inputText value="#{row.bindings.AunitctrlUpdBy.inputValue}"
label="#{bindings.ApplUnitControlView1.hints.AunitctrlUpdBy.label}"
required="#{bindings.ApplUnitControlView1.hints.AunitctrlUpdBy.mandatory}"
columns="#{bindings.ApplUnitControlView1.hints.AunitctrlUpdBy.displayWidth}"
maximumLength="#{bindings.ApplUnitControlView1.hints.AunitctrlUpdBy.precision}"
shortDesc="#{bindings.ApplUnitControlView1.hints.AunitctrlUpdBy.tooltip}"
id="it5">
<f:validator binding="#{row.bindings.AunitctrlUpdBy.validator}"/>
</af:inputText>
</af:column>
<af:column sortProperty="AunitctrlUpdDate" filterable="true"
sortable="true"
headerText="#{bindings.ApplUnitControlView1.hints.AunitctrlUpdDate.label}"
id="c10" width="105">
<f:facet name="filter">
<af:inputDate value="#{vs.filterCriteria.AunitctrlUpdDate}"
binding="#{backingBeanScope.backing_untitled8.id6}"
id="id6"/>
</f:facet>
<af:inputDate value="#{row.bindings.AunitctrlUpdDate.inputValue}"
label="#{bindings.ApplUnitControlView1.hints.AunitctrlUpdDate.label}"
required="#{bindings.ApplUnitControlView1.hints.AunitctrlUpdDate.mandatory}"
shortDesc="#{bindings.ApplUnitControlView1.hints.AunitctrlUpdDate.tooltip}"
id="id4">
<f:validator binding="#{row.bindings.AunitctrlUpdDate.validator}"/>
<af:convertDateTime pattern="#{bindings.ApplUnitControlView1.hints.AunitctrlUpdDate.format}"/>
</af:inputDate>
</af:column>
<af:column sortProperty="RowID" filterable="true" sortable="true"
headerText="#{bindings.ApplUnitControlView1.hints.RowID.label}"
id="c11" width="105">
<af:inputText value="#{row.bindings.RowID.inputValue}"
label="#{bindings.ApplUnitControlView1.hints.RowID.label}"
required="#{bindings.ApplUnitControlView1.hints.RowID.mandatory}"
columns="#{bindings.ApplUnitControlView1.hints.RowID.displayWidth}"
maximumLength="#{bindings.ApplUnitControlView1.hints.RowID.precision}"
shortDesc="#{bindings.ApplUnitControlView1.hints.RowID.tooltip}"
id="it8">
<f:validator binding="#{row.bindings.RowID.validator}"/>
</af:inputText>
</af:column>
</af:table>
</af:panelCollection>
</af:form>
</af:document>
</f:view>
<!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_untitled8-->
</jsp:root>
public String cb7_action() {
try {
BindingContainer bindings1 = getBindings();
DCIteratorBinding dciter = (DCIteratorBinding)bindings1.get("ApplUnitControlView1Iterator");
Row oldCcurrentRow = dciter.getCurrentRow();
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
RichPopup popup = this.getP1();
RichPopup.PopupHints hints =
new RichPopup.PopupHints(); //empty hints renders dialog in center of screen
popup.show(hints);
catch (NullPointerException e)
System.out.println(" cause " + e.getCause());
System.out.println("message" + e.getLocalizedMessage());
System.out.println("stack trace" + e.getStackTrace());
return "insert";
}Edited by: ADF 7 on Feb 10, 2012 2:05 AM -
To store time only in the table and get it to the report in Apex
Hi,
I am very very new to Apex.
I get a txt file with around 57 columns(comma seperated). In apex we import this and insert it into a database table (csv into table) and then generate a reports out of this table using procedure/packages. we have different fields in this extract which gives different dates and times ( thats right dates and time comes seperate in seperate columns). I would like to insert this dates and times seperately into the table. thats is, getting a table as an exact image of the extract we receive.What data type do I choose to save just the time.
I can only see 'date' data type where I can have both date and time. But can't find anything just for time.
The main use of this time(s) saved seperately in the table is , I can then easily display it in reports.
The report the users want has got fields like transport start time, duty start time etc..
If you can't save time seperately in the database table, then can somebody suggest a way of saving it in table (in the method available)and then getting the time seperated out into the report.
Currently the users use macro on excel to get this reports and formatting a cell to 'time' is simple.
Any suggestions welcome.
Regards
LizaVarad,
I have been trying to get this date-time issue in different areas in my application.
From csv to table its working (once I got dates in the extract adjusted to '02mar2009' format).
Now I have manipulation to do on this datetime.
Say I have datetime1, to get datetime2 I have to get datetime1 and reduce some minutes.
I got the time part into l_temp after reducing the minutes.
datetime2 :=to_date(sysdate || l_temp,'dd-mon-yyyy hh24mi');
It gives an error saying 'literals doesn't match format string' (both at sql command and PL/SQL in apex
I even tried datetime2 :=to_date(to_char(sysdate,'dd-mon-yyyy') || l_temp,'dd-mon-yyyy hh24mi');
gets the same error in apex but this works fine in sql command.
But if I put datetime2 :=to_date('02mar09' || l_temp,'dd-mon-yyyy hh24mi');
Do you know why? Can you suggest something?
Obviously, I can't hard code it. I have read the date from table1 and write it to table 2 with after this manipulation.
Any suggestion?
regards
Liza
Edited by: liza on Mar 3, 2009 5:13 PM -
Inserting records in the table
Hi All,
I am working on a report where we are inserting huge numbers of records from an internal table to the ztable, I have been advised that rather than inserting all the records at one time we should divide the recods into small blocks may be let's say 100,000 of each block and try inserting the blocks in the ztable. So I was just wondering if anyone of you can help me with this how can I get this?
my internal table is it_data_table and my ztable is z_data_table.
Thanks,
RajeevHi,
Rather than inserting records from the workarea it is better if you use the inetrnal table for insertion. If youu have say 50025 records than it will hit the database that many times which definitely is a performance issue.If you have an internal table say 'it' and another internal table 'it_temp' with a similiar structure, you can try something like as follows
loop at it.
count = count + 1.
it_temp = it.
append it_temp.
if count = 10000.
insert ztable from table it_temp accepting duplicate keys. "to avoid a dump if there are duplicates count = 0.
refresh it_temp.
endif.
endloop.
if it_temp is not initial.
insert ztable from table it_temp accepting duplicate keys.
endif.
In the above code the loop will run the number of record times but, the insert statement will run only 50025/10000 times (i.e, 5 times). After the completion of the loop we need to add the remaining 25 records (because insert will work last inside the loop when 50000 records are reached), for that we will issue the insert statement after completion of the loop, after checking the it_temp table. So the total of 50025 records would be entered in a batch of 6 inserts rather than that many inserts if using just the workarea.
I hope this does help you in your issue.
Thanks and Regards,
Sachin. -
ORA-1013 when trying to insert data into the table
Hi,
While inserting record into a table, we are getting the following error:
ORA-1013
01013, 00000, "user requested cancel of current operation"
I could not find any information in alert log also.
We have a bitmap index on this table. However, we never got this error till now.
Also i found that the tablespace who stores data has lot of space and tablespace which consists of the indexes is close to 90% full today ( i dont know what was the space available yesterday when there was error).
I know that information i provided might be very less, but i gave as much information as i can provide.
Can you please help me in trouble shooting this problem.
Thank you
GiridharSorry. i forgot to give version information
Oracle version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
OS: SunOS 5.10
we got it only once yesterday. only for one table. not for any other tables.
Thanks aalap for your quick response.
Giridhar -
Hi all,
In my SQL Server 2012 Management Studio (SSMS2012), I tried to create a Database (MacLochainnsDB) and a dbo Table (marvel). then I wanted insert 8 VALUES into the Table by using the following code:
USE master
IF EXISTS
(SELECT 1
FROM sys.databases
WHERE name = 'MacLochlainnsDB')
DROP DATABASE MacLochlainnsDB
GO
CREATE DATABASE MacLochlainnsDB
GO
CREATE TABLE [dbo].[marvel] (
[avenger_name] [char] (30) NULL)
INSERT INTO marvel
(avenger_name)
VALUES
('Hulk', 1),
('Iron Man', 2),
('Black Widow', 3),
('Thor', 4),
('Captain America', 5),
('Hawkeye', 6),
('Winter Soldier', 7),
('Iron Patriot', 8)
I got the following error Message:
Msg 110, Level 15, State 1, Line 5
There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
How can I correct this problem?
Please kindly help and advise.
Thanks in advance,
Scott Chang
P. S.
The reason I tried to create the Database, dbo Table, and then to insert the VALUES is to learn the following thing:
You can query the entire node tree with the following xquery statement because it looks for the occurrence of any node with the /* search string:
DECLARE @x xml;
SET @x = N'<marvel>
<avenger_name>Captain America</avenger_name>
</marvel>';
SELECT @x.query('/*');
You can query the avenger_name elements from the marvel_xml table with the following syntax:
SELECT xml_table.query('/marvel/avenger_name')
FROM marvel_xml;
It returns the following set of avenger_name elements:
<avenger_name>Hulk</avenger_name>
<avenger_name>Iron Man</avenger_name>
<avenger_name>Black Widow</avenger_name>
<avenger_name>Thor</avenger_name>
<avenger_name>Captain America</avenger_name>
<avenger_name>Hawkeye</avenger_name>
<avenger_name>Winter Soldier</avenger_name>
<avenger_name>Iron Patriot</avenger_name>
You can query the fourth avenger_name element from the marvel_xml table with the following xquery statement:
SELECT xml_table.query('/marvel[4]/avenger_name')
FROM marvel_xml;
It returns the following avenger_name element:
<avenger_name>Thor</avenger_name>Hi Scott,
The master database records all the system-level information for a SQL Server system, so best practise would be not to create any user-defined
object within it.
To change your default database(master by default) of your login to another, follow the next steps so that next time when connected you don't have to use "USE dbname" to switch database.
Open SQL Server Management Studio
--> Go to Object explorer(the left panel by default layout)
--> Extend "Security"
--> Extend "Logins"
--> Right click on your login, click "propertites"
--> Choose the "Default database" at the bottom of the pop-up window.
--or simply by T-SQL
Exec sp_defaultdb @loginame='yourLogin', @defdb='youDB'
Regarding your question, you can reference the below.
SELECT * FROM master.sys.all_objects where name ='Marvel'
--OR
SELECT OBJECT_ID('master.dbo.Marvel') --if non empty result returns, the object exists
--usually the OBJECT_ID is used if a if statement as below
IF OBJECT_ID('master.dbo.Marvel') IS NOT NULL
PRINT ('TABLE EXISTS') --Or some other logic
What is the sys.all_objects? See
here.
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
Update a field multiple times, but only if the field is empty
I am having trouble updating a field in my table based upon a set of 7 different rules. I have been scratching my head at this for a few days, and am not sure what exactly is wrong, but am sure there is something small causing me problems. My current code
is:
BEGIN TRANSACTION
UPDATE MyTable
SET Field1 = 'Value1'
WHERE svc = 'Y' AND Field1 = '' ;
COMMIT TRANSACTION
BEGIN TRANSACTION
UPDATE MyTable
SET Field1 = 'Value2'
WHERE Dlv Is Null AND Cat = 'svc' AND Field1 = '';
COMMIT TRANSACTION
BEGIN TRANSACTION
UPDATE MyTable
SET Field1 = 'Value2'
WHERE (prod LIKE 'ABC%') OR (prod LIKE 'ABB%') AND Field1 = '';
COMMIT TRANSACTION
BEGIN TRANSACTION
UPDATE MyTable
SET Field1 = 'Value3'
WHERE Dlv = 'Elec' AND Field1 = '';
COMMIT TRANSACTION
BEGIN TRANSACTION
UPDATE MyTable
SET Field1 = 'Value4'
WHERE Ord = '0' AND Cat = 'Hdw' OR Cat = 'Bnd' AND Field1 = '';
COMMIT TRANSACTION
BEGIN TRANSACTION
UPDATE MyTable
SET Field1 = 'Value5'
WHERE Ord = '0' AND (NOT (Cat = 'Hdw')) AND (NOT (Cat = 'Bnd')) AND Field1 = '';
COMMIT TRANSACTION
BEGIN TRANSACTION
UPDATE MyTable
SET Field1 = 'Value4'
WHERE (Ind = '1' AND Cat = 'Hdw') OR (Cat = 'Bnd') AND Field1 = '';
COMMIT TRANSACTION
BEGIN TRANSACTION
UPDATE MyTable
SET Field1 = 'Value5'
WHERE (Ind = '1' AND NOT (Cat = 'Hdw')) AND (NOT (Cat = 'Bnd')) AND Field1 = '';
COMMIT TRANSACTION
BEGIN TRANSACTION
UPDATE MyTable
SET Field1 = 'Value6'
WHERE Ind = '0' AND Cat = 'Hdw' OR Cat = 'Bnd' AND Field1 = '';
COMMIT TRANSACTION
BEGIN TRANSACTION
UPDATE MyTable
SET Field1 = 'Value7'
WHERE (Ind = '0' AND NOT (Cat = 'Hdw')) AND (NOT (Cat = 'Bnd')) AND Field1 = '';
COMMIT TRANSACTION
My biggest problem seems to be that between the piece that updates Field1 as either Value4 or Value5 is that something is not right. I initially had this set up in MS Access, and so am using that as a comparison
to check my final values once the field has been udpated. When I run in Access I get a total of 9,802 for Value6 and 14,107 for Value4, yet when I run the SQL code I get 19,548 for Value 6 and 4,478 for Value4.
I also get some differences for the other values, but nowhere near as large of a difference as with the 2 values above. I feel fairly confident that I have something not quite right with my syntax, but I cannot
figure out exactly what it is. Field1 at the beginning of the query is inserted into the table as a blank value.
Thanks.Combining OR and AND may be tricky, so I think your problem lies here:
UPDATE MyTable
SET Field1 = 'Value4'
WHERE Ord = '0' AND Cat = 'Hdw' OR Cat = 'Bnd' AND Field1 = '';
You can change this to
UPDATE MyTable
SET Field1 = 'Value4'
WHERE (Ord ='0' AND Cat IN ('Hdw','Bnd')) AND Field1 = '';
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
Unable to insert data in the table
Hi,
I've a document which has a doctype that points to a URL. When I try to insert this document in the table (xmltype column), I am getting the following errors:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00263: couldn't connect to host URL port 80
Error at line 2
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at line 1
Can someone please suggest how should I resolve this issue?
Thanks in advance for all your help.Hi,
Have you just added a new field or you have adjusted the dimensions of the cube along with that. Any change in dimension or change in structure you need to delete the data and reload.
Regards
Akhan -
How to insert records into the Table?
Dear Sir,
I'm new to JDeveloper. Now I managed to create a Frame in JDeveloper with many Text fields and a button. In the back end, I have a procedure to insert records to a table, to which I pass the values of the fields as parameters. Now I'm not getting the steps to call the PL/SQL Stored procedure when I click on the button. I'm using Oracle 9i JDeveloper version 9.0.3.1. and Oracle 9i Database.
Please give me the complete steps to achieve my task - it is quite urgent.
Thanking You in advance.
Regards,
Senthil .A. Perumal.The JDBC tutorial will show you how to call a stored procedure from Java:
http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/basic.htm
One more thing, why are you using such an old version of JDeveloper? any reason not to upgrade to the 10.1.3 version of JDeveloper?
Also you might want to look into ADF and how it makes these type of database interactions easier.
See this demo:
http://www.oracle.com/technology/obe/obe1013jdev/adf_swing/master_detail_page_adfswing_bc.htm -
CREATE OR REPLACE
PROCEDURE cdsshell.prc_drop_partition (days IN NUMBER)
AS
l_sqlerrm VARCHAR2(4000);
BEGIN
<<Code >>
EXCEPTION
WHEN OTHERS THEN
l_sqlerrm := SQLERRM;
INSERT INTO ctrl.ctrl_typ (ctrl_id,
ctrl_typ,
ctrl_sum,
ctrl_detail,
ctrl_status,
ctrl_object,
ctrl_mapping,
ctrl_msg_inf,
ctrl_cd_err,
event_id)
VALUES ( ctrl.csr_ctrl_id_seq.NEXTVAL,
'ERR',
'SQL',
'Partition Management',
'ER',
v_table_name,
'Partition Management from cla, cdsshell, cdactimize',
l_sqlerrm,
SQLCODE,
(SELECT event_id FROM ctrl.ctrl_event
WHERE event_status = 'P'
AND event_desc = 'Partition Management'
AND TRUNC(end_dt) = TO_DATE('31-12-9999','dd-mm-yyyy')));
END;
SHOW ERRORS;
I get error on
l_sqlerrm := SQLERRM
PL/SQL: SQL Statement ignored
and
l_sqlerrm when inserting in the table.
PL/SQL: ORA-00984: column not allowed here
Please can I know what is wrong.
Thanks.>
CREATE OR REPLACE
PROCEDURE cdsshell.prc_drop_partition (days IN NUMBER)
AS
l_sqlerrm VARCHAR2(4000);
BEGIN
<<Code >>
EXCEPTION
WHEN OTHERS THEN
l_sqlerrm := SQLERRM;
INSERT INTO ctrl.ctrl_typ (ctrl_id,
ctrl_typ,
ctrl_sum,
ctrl_detail,
ctrl_status,
ctrl_object,
ctrl_mapping,
ctrl_msg_inf,
ctrl_cd_err,
event_id)
VALUES ( ctrl.csr_ctrl_id_seq.NEXTVAL,
'ERR',
'SQL',
'Partition Management',
'ER',
v_table_name,
'Partition Management from cla, cdsshell, cdactimize',
l_sqlerrm,
SQLCODE,
(SELECT event_id FROM ctrl.ctrl_event
WHERE event_status = 'P'
AND event_desc = 'Partition Management'
AND TRUNC(end_dt) = TO_DATE('31-12-9999','dd-mm-yyyy')));
END;
SHOW ERRORS;
>
I get error on
l_sqlerrm := SQLERRM
PL/SQL: SQL Statement ignored
and
l_sqlerrm when inserting in the table.
PL/SQL: ORA-00984: column not allowed here
Please can I know what is wrong.
Thanks.when all else fails Read The Fine Manual
http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/sqlerrm_function.htm -
Unable to insert rows into the table
My insert statement below is not correct, when i try run, its encoutering error "table or view does not exist".
Basically what i am doing here is collecting the table name in FOR variable which stores the table name in this variable. This variable, i am using as table. I know this is not the proper way, please let me how can insert the complete table rows with the following code.
DROP TABLE TEMP;
CREATE TABLE TEMP AS SELECT * FROM Comp WHERE 1=2;
DECLARE
I INTEGER DEFAULT 1;
S VARCHAR2(50);
begin
for C in (select TABLE_NAME INTO S from USER_TABLES where TABLE_NAME like 'CABLE%' and TABLE_NAME NOT like '%OLD' and Num_ROWS > 0 order by TABLE_NAME) loop
INSERT INTO TEMP SELECT * FROM c.TABLE_NAME;
dbms_output.put_line(c.table_name);
end loop;
end;
The above insert statement is not correct. How can i write proper way.
Thanks.
Best Regards
Arshaduser13360241 wrote:
My insert statement below is not correct, when i try run, its encoutering error "table or view does not exist".
Basically what i am doing here is collecting the table name in FOR variable which stores the table name in this variable. This variable, i am using as table. I know this is not the proper way, please let me how can insert the complete table rows with the following code.
DROP TABLE TEMP;
CREATE TABLE TEMP AS SELECT * FROM Comp WHERE 1=2;
DECLARE
I INTEGER DEFAULT 1;
S VARCHAR2(50);
begin
for C in (select TABLE_NAME INTO S from USER_TABLES where TABLE_NAME like 'CABLE%' and TABLE_NAME NOT like '%OLD' and Num_ROWS > 0 order by TABLE_NAME) loop
INSERT INTO TEMP SELECT * FROM c.TABLE_NAME;
dbms_output.put_line(c.table_name);
end loop;
end;
The above insert statement is not correct. How can i write proper way.
Thanks.
Best Regards
ArshadSTMT := 'INSERT INTO TEMP SELECT * FROM ';
STMT := STMT || S;
EXECUTE IMMEDIATE STMT;
Maybe you are looking for
-
When I run my app at the target, I get an error (show stopper) that says (more or less) Error in call to LoadPanel. Tsc_Setup_uir.uir, Panel Resource ID: 2, Error Code: -86. Callback function QuitLoginInstCB not known. Background: I'm using LabWindow
-
Macbook Pro not waking up with external monitor
I've connected an external display to my MBP. I've been able to work out how to mirror the two. But when I try to have the lid closed and then wake up the laptop with my wireless keyboard, the external monitor displays the desktop for a moment then a
-
so i just got a sony vaio after best buy junked out my old laptop which was shipped out 2 times for repair for a total of 8 weeks. I'm a college student, and this happened right before finals. now, my new vaio is getting the blue screen at least 2
-
Hi all, I am trying to show PO cancellation details in PO layout (smartforms). i want show text "PO CANCELLED" when PO is cancelled and text 'This item is cancelled' when line item is cancelled. for items i found delition indicator in structure <b>BB
-
Cant remove enterframe event listener in control animation
Hi I am trying to create a simple play, stop, rewind. fforward controller. I have the slideShow and the Control in the same time line. As the enterframe event is nested inside a function it will rewind but then none of the other buttons will work as