Inserting Object into Intermedia through HTMLDB form
Greetings,
I'm using HTMLDB and trying to upload an image via a form into an intermedia table with the following columns
id number
image ORDSYS.ORDIMAGE
The object is uploaded into www_flow_files into a BLOB datatype (I'm using an html form and browsing for the file) into wwv_flow_files. I'm trying to figure out how to copy this into my intermedia table from the wwv_flow_files table. How does one go about doing this in pl/sql. Is there a conversion from blob to ORDSYS.ORDIMAGE?
Any help greatly appreciated.
thx in advance,
cliff
at the end is an example of a procedure that will copy lobs from a table and make them image objects, it may help...
You could load OrdImage for one blob at a time with something like:
insert into images <YOURID>,ORDSYS.ORDImage.init()
returning rowid, pict into thisrowid, obj;
select b from wwv_flow_files into myblob;
-- Set the lob locator in the object and flag it as local
obj.source.localdata := myblob;
obj.setLocal();
obj.setMimeType(<MIMETYPE FROM WEB FILE POST>);
begin
obj.setProperties();
Exception
when others then
null; -- Ignore exceptions
end;
create table lobs (item_id number primary key, b blob);
create table images (item_id number primary key, pict ordsys.ordimage);
create or replace procedure copy_blobs_to_imgobjs
as
obj ORDSYS.ORDImage;
ctx raw(4000):=null;
nxtseq number;
thisrowid urowid;
BEGIN
for b_rec in (select item_id, b from lobs) loop
insert into images (item_id,pict) values (
b_rec.item_id,
ORDSYS.ORDImage.init())
returning rowid into thisrowid;
select t.pict into obj from images t
where rowid = thisrowid for update;
-- Set the lob locator in the object and flag it as local
obj.source.localdata := b_rec.b;
obj.setLocal();
-- Extract the properties of the image.
obj.setproperties();
update images t set t.pict=obj
where rowid = thisrowid;
commit;
end loop;
END;
show errors;
Similar Messages
-
Servlet inserting record into postgresql through hibernate
Hi
I have developed a servlet. This servlet is inserting record into postgres sql through hibernate using eclispe ide. When I run my code then I find the following exception
exception
java.lang.NullPointerException
hibernate.example.FirstExample.doGet(FirstExample.java:54)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
I have developed the following code
package hibernate.example;
public class Contact {
private String firstName;
private String lastName;
private String email;
private long id;
public String getEmail() {
return email;
public String getFirstName() {
return firstName;
public String getLastName() {
return lastName;
public void setEmail(String string) {
email = string;
public void setFirstName(String string) {
firstName = string;
public void setLastName(String string) {
lastName = string;
public long getId() {
return id;
public void setId(long l) {
id = l;
**Now the servlet is**
package hibernate.example;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class FirstExample extends HttpServlet {
Session session = null;
public String getServletInfo() {
return "Servlet connects to PostgreSQL database and displays result of a SELECT";
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
try{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Configuration cfg = new Configuration().configure();
SessionFactory factory = cfg.buildSessionFactory();
session = factory.openSession();
out.println("Inserting Record");
Contact contact = new Contact();
contact.setId(6);
contact.setFirstName("Deepak");
contact.setLastName("Kumar");
contact.setEmail("[email protected]");
session.save(contact);
out.println("Done");
catch(Exception e){
System.err.println(e.getMessage());
finally{
session.flush();
session.close();
**web.xml is**
<web-app>
<database>
<driver>
<type>org.postgresql.Driver</type>
<url>jdbc:postgresql://127.0.0.1:5432/ali</url>
<user>ali</user>
<password>ali</password>
</driver>
</database>
<servlet>
<servlet-name>FirstExample</servlet-name>
<servlet-class>hibernate.example.FirstExample</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>FirstExample</servlet-name>
<url-pattern>/hb</url-pattern>
</servlet-mapping>
</web-app>
**And contact.hbm.xml is**
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="hibernate.example.Contact" table="CONTACT">
<id name="id" type="long" column="ID" >
<generator class="assigned"/>
</id>
<property name="firstName">
<column name="FIRSTNAME" />
</property>
<property name="lastName">
<column name="LASTNAME"/>
</property>
<property name="email">
<column name="EMAIL"/>
</property>
</class>
</hibernate-mapping>
**And hibernate.cfg.xml is**
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.postgressql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:postgresql://127.0.0.1:5432/ali</property>
<property name="hibernate.connection.username">ali</property>
<property name="hibernate.connection.password">ali</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="contact.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Pleas tell me that where I have done the mistake and how can I resolove the error.ahmadgee wrote:
Thank u very much.
First I tried with out the servlet. I took a simple class. But it was displaying the null pointer exception.
then you still have the problem. do you understand the root cause?
After then I made a servlet. how was that going to help your null pointer exception?
Now it is displaying error hibernate.cfg.xml not found.that's part of the problem. where is the servlet reading that file and initializing the session factory? how is it finding that file?
i don't know where you have that .cfg.xml file, or where the recommended place is where hibernate expects to see it, but i'd bet it needs to be in the CLASSPATH, which means WEB-INF/classes.
figure out why you get that NPE first, though. the servlet is only making things worse.
% -
How to Insert Hastables Into Database Through JDBC
hi all,
I have place the Data from the Hashtables Into the Database.I can place it by Iterating through the Hastables.I would Like to Place the Entire Hashtable Itself Into the Database.
Can Any one tell me how?
bye.Hi,
Can anyone help me out how to insert image into
database using struts...with dao n dto classes?If it matters whether or not you are using struts then you might have something wrong.
Make sure you separate the database logic out.
I know these types of questions are asked frequently, you might want to search the forum for additional examples.
Here is a good one:
http://forum.java.sun.com/thread.jspa?threadID=620455&messageID=3495899 -
Which trigger to use for insert data into db table in Forms
Hi,
My form is current having a database block with table reference. When enter data into form field and click on save button. Automatically the record is inserted into database table.
I want to make this as manual insert. I changed the data block to a non-database. Where should i write the insert statement in order to insert data into table.
Is it Key-commit trigger at form level?
Please advise.
Thanks,
Yuvaraaj.Hi Yuvaraaj.
Insert should happen when we click on the save which is inbuilt in the form. In this case where should i write the insert statement.Forms in built save commit's the form data where block is based on database not non database.
@2nd reply
Ypu are right. The reason i chnaged the database block to non-database is Currently i have a database block with form field canvas which insert only 1 record in to >table when we click on standard save button. The requirement was to add a field called CHANNEL which should have multiple values displayed. (i created this channel >field in a seperate datablock (non database) and used the same canvas.) When we insert data in all fields (single record) and channel we should be able to selected >multiple channel (say A,B and C) when we click on save then 3 records should be inserted in to the table which looping values for each channel. This was the actual >requirement and this is the reason why iam changing the block to non-database block.You are talking about two blocks.. 1. Master block and 2. Details block name channel
You are inserting one record in master block then insert 3 record name A,B,C for that master record.
Now you want master record should insert to each A,B,C record. Means
'how are you' --master record
and you want
'A'- 'how are you'
'B'- 'how are you'
'C'- 'how are you'OR
?Ok. If you want master record save in database and then want to save non-database(channel) data into database USE Post-Insert trigger at block level and do the rest.
Hope this helps...
Hamid
Mark correct/helpful to help others to get right answer(s).*
Edited by: HamidHelal on Jan 26, 2013 1:20 AM -
Hello all,
I'm pulling my hair out--thank you for any help you can give
me.
I have a form that a person fills out that has a field that
asks "How
many visitors including you" and I'd like them to type in a
number, and
on submit of the form, have that value -2 multiplied by 20
and inserted
into a "total cost" column.
I'm using the standard DW server behaviors and I've searched
the
internet. How do I perform basic math on that value and
insert it into
the database?
If you have any pointers, that would be great.
Thank you!
-JohnJohn R. Lenz wrote:
> Your code below works great, and I just noticed links to
your book were
> available on your web site, and it's in the mail to me.
Looking forward
> to it.
Thanks, hope you find it useful.
> After the form is posted, I'd like to address the person
who posted it
> by their first name and last name, as well as some of
the details. How
> would you go about doing this in the best way? Would you
set a variable
> and echo it on the 'Thank you' page, or are there better
ways of doing
> it with a recordset and filtering it on form submit?
To pass the details to a thank you page, you would need to
store the
information in $_SESSION variables. You could amend the
earlier script
like this:
<?php
session_start();
if (isset($_POST['visitors'])) {
if ($_POST['visitors'] < 3) {
$num = 0;
} else {
$num = $_POST['visitors'] - 2;
$_POST['total_cost'] = $num * 20;
$_SESSION['total_cost'] = $_POST['total_cost'];
$_SESSION['first_name'] = $_POST['first_name'];
$_SESSION['last_name'] = $_POST['last_name'];
?>
In the thank you page, put the following at the top of the
page:
<?php session_start(); ?>
It must go before anything is output to the browser, so put
it above the
DOCTYPE declaration, and make sure there's no space before
it.
You can then use the $_SESSION variables in the thank you
page.
At the end of the page, add this to clear up the session
variables:
<?php
$_SESSION = array();
destroy_session();
?>
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Re: [JExcel API] how to insert object into a cell
Hi all,
i am using JExcel API for Excel file creation. i want to
insert object like file in particular cell how can i do it.
i tried WritableHyperLink but it is only inserting hyper link.
i want proper object inserted into the specific cell.
please help me out.
VenuG.I am using jxl api to generate a report. i want the insert->object->create from file excel functionality to be implemented using jxl. Help me
-
Inserting Images into Dreamweaver through Div Tag
Hi im quite new to Dreamweaver and i've got CS3...I've just
designed and sliced up a website in Photoshop and have started to
compile it together in Dreamweaver using HTML and CSS. I've just
added a Div tag and added images into the page and i've got stuck,
i cant seem to put another image next to one iv already placed
their.
I need help on how to work with Div Tags and applying images
so that i can fix my website like a Jigsaw.
I have provided the code i hav in my HTML so far...Maybe this will help you -
Taking a Fireworks comp to a CSS-based layout in Dreamweaver
http://www.adobe.com/devnet/fireworks/articles/web_standards_layouts_pt1.html
http://www.adobe.com/devnet/fireworks/articles/web_standards_layouts_pt2.html
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"DThandi" <[email protected]> wrote in
message
news:gk8anj$4qc$[email protected]..
> Let me show you the before and after images of the site
im working on,
> then
> maybe what im trying to describe can become more
clearer...Your right that
> i do
> need some basic understanding, I actually used to know
the answer to my
> own
> question but since i havn't played around with
Dreamweaver for a while i
> seem
> to have forgotten.
>
> This was the image on Photshop:
>
http://i187.photobucket.com/albums/x151/ohhchakdeh/SAMPLE.jpg
>
> This is where I am stuck now:
>
http://i187.photobucket.com/albums/x151/ohhchakdeh/stuck.jpg
>
> These are all the small images i have sliced up from
Photshop:
>
http://i187.photobucket.com/albums/x151/ohhchakdeh/Untitled.jpg
>
> As you can see i have trouble coding in HTML. So far i
have been
> following a
> tutorial video showing me how to had images and align
them through Div
> Tag...But now i am trying to put images side by side in
the Navigation
> area and
> on top of and underneath each other. As you can see i
have Home.jpg and
> Home-Scrap.jpg. Home Scrap needs to go under Home and
both of them images
> need
> to go next to image Left-Short.jpg.
>
> Thank You
> -
Inserting data into table through linked server
Hi
I am trying to insert data from a remote database into my database using linked server.
Below is the syntax that I am using
set XACT_ABORT on
INSERT INTO MyTable
EXEC [172.xx.xx.xxx].MyDatabase.dbo.[MyStoredProc] '2014-10-20','2014-10-26'
When I execute the SP (EXEC [172.xx.xx.xxx].MyDatabase.dbo.[MyStoredProc] '2014-10-20','2014-10-26' ) I get the result.
but when I try inserting the data into a table using the above code I get the following error
OLE DB provider "SQLNCLI11" for linked server "172.xx.xx.xxx" returned message "No transaction is active.".
Msg 7391, Level 16, State 2, Line 59
The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "172.xx.xx.xxx" was unable to begin a distributed transaction.
I tried solutions given on
http://stackoverflow.com/questions/7473508/unable-to-begin-a-distributed-transaction
but still i get the issue... I don't know whats wrong.I think you may need to set the remote proc transaction promotion for linked server option to
false.
Please read the articles in below links for more info:
How to Share Data between Stored Procedures - The Challenges of Linked Servers (Erland)
How to insert in table from remote stored procedure without creating a distributed transaction?
Krishnakumar S -
Error inserting data into database
Hello I am having error inserting data into database through a servlet.Please I am very new to Java Technology and need your immediate help. beloww is the codea nd the error
Apache Tomcat/4.0.3
ERROR: Problems with adding new entry
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]There are more 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.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:2525)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:337)
at Register.insertIntoDB(Register.java:71)
at Register.doPost(Register.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)
COde:
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
public class Register extends HttpServlet
public static Statement statement;
private Connection DBConn;
public void init(ServletConfig config) throws ServletException
super.init(config);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
DBConn=DriverManager.getConnection("jdbc:odbc:Challenge");
catch(Exception e) {
e.printStackTrace();
DBConn=null;
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
String user_id,FirstName,LastName, Email, Login, Password;
FirstName = req.getParameter("FirstName");
LastName = req.getParameter("LastName");
Email = req.getParameter("Email");
Login = req.getParameter("Login");
Password = req.getParameter("Password");
PrintWriter output = res.getWriter();
res.setContentType("text/html");
if (user_id.equals("")||
FirstName.equals("") ||
LastName.equals("") ||
Email.equals("") ||
Login.equals("") ||
Password.equals(""))
output.println("<H3>Please click back " + "button and fill in all " + "fileds.</H3>");
output.close();
return;
boolean success = insertIntoDB("'" + FirstName + "','" + LastName + "','" + Email + "','" + Login + "','" + Password + "'");
if (success)
output.print("<H2>Thank You " + FirstName + " for registering.</H2>");
res.sendRedirect("file:///Register.html");
else
output.print("<H2>An error occured. " + "Please try again later.</H2>");
output.close();
private boolean insertIntoDB(String stringtoinsert)
try
statement = DBConn.createStatement();
statement.execute("INSERT INTO Users(user_id,FirstName,LastName,Email,Login,Password) values (" + stringtoinsert + ");");
statement.close();
catch (Exception e)
System.err.println("ERROR: Problems with adding new entry");
e.printStackTrace();
return false;
return true;
public void destroy()
try
DBConn.close();
catch(Exception e)
System.err.println("Problem closing the database");
Your Help will be very much appreciate.I am using SQL Server databaseThe error concerns these two lines:
boolean success = insertIntoDB("'" + FirstName + "','" + LastName + "','" + Email + "','" + Login + "','" + Password + "'");
statement.execute("INSERT INTO Users(user_id,FirstName,LastName,Email,Login,Password) values (" + stringtoinsert + ");");
In the first line above, you have a string which represents the VALUES which you are inserting. There are 5 values. However in the second line above this is your actual SQL execution you are specifying 6 columns of data. If the column "user_id" is an identity or auto-incrementing field in the database, just remove it from this line. If not then you need to supply the "UserID" into the VALUES.
This should fix the problem. -
How do i insert into table through forms
Hi
I have developed a custom form based on custom table.
the only way to insert data into database table is through form.
there are two tables: one table is to store all contract details & second table is to maintain history forthis.
one condition(col1,col2,col3,col4) are unique combination,we are not creating any PK or FK at database level.evrythng is captured at form level.
if all 4 columns combination exist thn e should not insert that record.
if 4 columns combination doesnot exist then insert into table.
I have used just pre insert,pre update triggers.
I think its a basic form functionality ,by itself it inserts ,update record.now it is doing the same thng.
But I have to add the above condition ,how can i do that.
Pl provide me some ex code .
Thank you.
Hope any one can help meSQL> create table t
2 (object_id number
3 ,object_name varchar2(30));
Table created.
SQL>
SQL> create sequence t_seq;
Sequence created.
SQL>
SQL> insert into t (object_id, object_name)
2 select t_seq.nextval
3 ,object_name
4 from all_objects
5 ;
52637 rows created. -
Problem in Insertion into table through After Report Parameter form trigger
Hi All,
I am getting problem in inserting some data into temp table through Report.
My requirement is like that, I have to do a calculation based on user parameters, and then insert the data into the temp table. I wanted to do this into After Report Parameter form trigger function. I have done all the calculation and wrote all the insert statement in that function. There is no problem in compilation. then I am taking value from this temp table in my formula columns.
When I run this report, it hangs, don't understand what is the problem.Can anybody help me out in this.
Thanks,
NidhiThe code is as follows:
function AfterPForm return boolean is
CURSOR CUR_RECEIPT(RECEIPT_NUM_FROM NUMBER, RECEIPT_NUM_TO NUMBER) IS
SELECT DISTINCT receipt, item_no FROM xxeeg.xxeeg_1229_sp_putaway WHERE RECEIPT BETWEEN
RECEIPT_NUM_FROM AND RECEIPT_NUM_TO ;
V_CUR_RECEIPT CUR_RECEIPT%ROWTYPE;
begin
OPEN CUR_RECEIPT(:RECEIPT_NUM_FROM, :RECEIPT_NUM_TO);
FETCH CUR_RECEIPT
INTO V_CUR_RECEIPT;
LOOP
EXIT WHEN CUR_RECEIPT%NOTFOUND;
IF V_CUR_RECEIPT.ITEM_NO = 'TEST1' AND V_CUR_RECEIPT.RECEIPT = '12' THEN
INSERT INTO SP_TEMP
(RECEIPT, ITEM_NO, LOCATION1)
VALUES
(V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
UPDATE SP_TEMP
SET LOCATION2 = 12
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION3 = 13
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION4 = 14
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
ELSE
IF V_CUR_RECEIPT.ITEM_NO = 'TEST2' AND V_CUR_RECEIPT.RECEIPT = '12' THEN
INSERT INTO SP_TEMP
(RECEIPT, ITEM_NO, LOCATION1)
VALUES
(V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
UPDATE SP_TEMP
SET LOCATION2 = 16
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION3 = 17
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO =V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION4 = 18
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
ELSE
INSERT INTO SP_TEMP
(RECEIPT, ITEM_NO, LOCATION1)
VALUES
(V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
UPDATE SP_TEMP
SET LOCATION2 = 19
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION3 = 20
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO =V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION4 = 21
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
END IF;
END IF;
END LOOP;
COMMIT;
CLOSE CUR_RECEIPT;
return(TRUE);
end;
..................................................................................................................... -
How can I insert values from table object into a regular table
I have a table named "ITEM", an object "T_ITEM_OBJ", a table object "ITEM_TBL" and a stored procedure as below.
CREATE TABLE ITEM
ITEMID VARCHAR2(10) NOT NULL,
PRODUCTID VARCHAR2(10) NOT NULL,
LISTPRICE NUMBER(10,2),
UNITCOST NUMBER(10,2),
SUPPLIER INTEGER,
STATUS VARCHAR2(2),
ATTR1 VARCHAR2(80),
ATTR2 VARCHAR2(80),
ATTR3 VARCHAR2(80),
ATTR4 VARCHAR2(80),
ATTR5 VARCHAR2(80)
TYPE T_ITEM_OBJ AS OBJECT
ITEMID VARCHAR2(10),
PRODUCTID VARCHAR2(10),
LISTPRICE NUMBER(10,2),
UNITCOST NUMBER(10,2),
SUPPLIER INTEGER,
STATUS VARCHAR2(2),
ATTR1 VARCHAR2(80),
ATTR2 VARCHAR2(80),
ATTR3 VARCHAR2(80),
ATTR4 VARCHAR2(80),
ATTR5 VARCHAR2(80)
TYPE ITEM_TBL AS TABLE OF T_ITEM_OBJ;
PROCEDURE InsertItemByObj(p_item_tbl IN ITEM_TBL, p_Count OUT PLS_INTEGER);
When I pass values from my java code through JDBC to this store procedure, how can I insert values from the "p_item_tbl" table object into ITEM table?
In the stored procedure, I wrote the code as below but it doesn't work at all even I can see values if I use something like p_item_tbl(1).itemid. How can I fix the problem?
INSERT INTO ITEM
ITEMID,
PRODUCTID,
LISTPRICE,
UNITCOST,
STATUS,
SUPPLIER,
ATTR1
) SELECT ITEMID, PRODUCTID, LISTPRICE,
UNITCOST, STATUS, SUPPLIER, ATTR1
FROM TABLE( CAST(p_item_tbl AS ITEM_TBL) ) it
WHERE it.ITEMID != NULL;
COMMIT;
Also, how can I count the number of objects in the table object p_item_tbl? and how can I use whole-loop or for-loop to retrieve values from the table object?
Thanks.Sigh. I answered this in your other How can I convert table object into table record format?.
Please do not open multiple threads. It just confuses people and makes the trreads hard to follow. Also, please remember we are not Oracle employees, we are all volunteers here. We answer questions if we can, when we can. There is no SLA so please be patient.
Thank you for your future co-operation.
Cheers, APC -
How To Insert A object into Conext
Hi Techies,
I have 8 tables in my designer
and I have two contexts at designer level
And how to insert a object into a context that is not referencing any table.
For Example I have an object like "rownum" (Which should must be added at Universe level only not at report level). Here this object is not referencing any table and I want this to be used in a query where the remaining objects are coming from the context..
Thanks in Advance..Double-click the Objects and click the TABLES button and select the table you want to associate the object to for the context to work properly (see below).
Regards,
Ajay -
Insert data into multiple entities at once using a view object
Hi,
I'm trying to insert data into multiple entities at once using a view object, but unfortunately it doesn't seem to work. The two entities have a 1:1 association. I created a view object which contains both entities and I made sure they aren't read-only. But like I said it doesn't work, I can't insert data in both entities at once... :(
Is this possible? And how (if it is)?Hi,
I'm trying to insert data into multiple entities at once using a view object, but unfortunately it doesn't seem to work. The two entities have a 1:1 association. I created a view object which contains both entities and I made sure they aren't read-only. But like I said it doesn't work, I can't insert data in both entities at once... :(
Is this possible? And how (if it is)? Peter:
This is definitely supported and tested. Please send us the exception stack trace. You must running into other problems. A few things to note:
A) You have to mark the entities as both updateable (not read-only) and not reference-only.
B) If you're not seeing an exception stack, turn on diagnostic. Here is how:
To turn on diagnostic, go to the IDE,
1. Select the project.
2. Do right mouse click and select "Project Settings..."
3. On the Settings dialog, select Configurations/Runner.
4. In the righthand side pane, you should see a textbox for "Java
Options". Please add the following JVM switch:
-Djbo.debugoutput=console
Then, rerun. The run command should include
-Djbo.debugoutput=console as in
"D:\JDev9i\jdk\bin\javaw.exe" -Djbo.debugoutput=console -classpath ...
You should now see a lot more output on the IDE's message window. Here you should see the exception stack trace.
If you invoking your app directly from command prompt, just add "-Djbo.debugoutput=console" after your "java.exe".
Thanks.
Sung -
Cannot open PDFs inserted as objects into Excel.
Two-part question. I know this has been addressed before, but the solutions are not working for me.
I have Adobe Acrobat 9 Pro and Adobe Reader XI. When inserting a PDF document as an object into Excel, it will not allow me to insert the icon/object from the "Create New" option. I get one of two error messages: 'Cannot insert object' or 'Cannot start the soruce application for this object'. I am able to insert the PDF icon/object if I insert from the "Create from file" option. (Please note I cannot always link to the PDF, as some spreadsheets are sent out externally and will not have access.)
Once I am finally able to insert the document as an object, I can open and view the PDF. However, when I close the spreadsheet and re-open it, if I try to open the PDF document again, I get this error message again: 'Cannot start the soruce application for this object'.
I have changed my preference to disable the Protected Mode at startup and this issue is still happening. VERY frustrating. I never encountered this is past versions of Adobe and all previous suggestions are not fixing the issue. Does anyone have any insight or know of an update to fix this issue? Is this an Adobe issue or a Microsoft Office issue?Hi Jerry,
Can you check the similar thread
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d554e88c-d72f-46b0-8b1a-2f2024fcb9c0/i-e-8-browser-wont-open-pdf-file-returned-from-sharepoint-2010-search?forum=sharepointadminprevious
My Blog- http://www.sharepoint-journey.com|
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful
Maybe you are looking for
-
Safari won't display online banking login - ipad mini
Hi, my ipad mini has stopped displaying my online banking login page in safari. It is ok when using iPhone 4S and ipad. Have not got any idea as to why but it is driving me NUTS! Please can someone help?
-
Are pictures duplicated when they are imported?
I am new to iMac. All of my pictures are in a main folder called "The Photo Album", with many subfolders within it. I placed the folder in the folder "Pictures." I then choose "Import to Library" from the File menu. So my question is, were the pictur
-
Oracle 11g client for Windows 8 - 64bit exists impromptu without error msg
HI all. I just got a new laptop and its running Windows 8 Pro 64 bit os. I downloaded Oracle Client 11g 64bit from the oracle website. After clicking the setup.exe installer a msg box pops up saying '[INS -13003] Environment does not meet the require
-
I recently had to replace my hard drive. I restored all my files including my iPhone backup. Yesterday while syncing I had a power failure. Now when I try to syn my iPhone 5 with my computer I get an error that says the backup file is corrupted and I
-
My iPhone no longer rings when someone calls and I have no txt tone either. The button on the side is not on silent