How insert '€' in an oracle table by an stored function
How can the '€'-symbol be inserted in a field.
Has to be formatted like this (browser).
e.g.:
INSERT INTO reqquotedetail (req_id,curr) VALUES (created,'currency: €');
In SQL-Plus, "&" is the default for defining variables.
Issue SET DEFINE OFF, afterwards you should be able to execute your insert statement.
Similar Messages
-
How to create a oracle table in PLSQL Stored Procedure ?
Gurus,
Any one send the example link to me to create a oracle table through stored procedure ?
Thanks.
Sbegin
EXECUTE IMMEDIATE "CREATE TABLE BLAH (COL1
NUMBER)";
nd;By the way, it raises a question as to why you need
to create a table dynamically?
Cheers
Sarma.By the way, you wouldn't use double quotes for execute immediate:
begin
EXECUTE IMMEDIATE "CREATE TABLE BLAH (COL1 NUMBER)";
end;
Error at line 1
ORA-06550: line 2, column 22:
PLS-00114: identifier 'CREATE TABLE BLAH (COL1 NUMBER' too long
SQL> begin
EXECUTE IMMEDIATE 'CREATE TABLE BLAH (COL1 NUMBER)';
end;
PL/SQL procedure successfully completed. -
Insert data into oracle table from XML file
I need to insert data into oracle table from XML file
If anybody handled this type of scenario, Please let me know how to insert data into oracle table from XML file
Thanks in advanceThe XML DB forum provides the best support for XML topics related to Oracle.
Here's the FAQ on that forum:
XML DB FAQ
where there are plenty of examples of shredding XML into Oracle tables and such like. ;) -
How to display a oracle table from a java program?
How to display a oracle table from a java program.
Hello friends, I have written a Java program, using oracle 10g as backend.
I want to display a oracle table as output. Im not getting how to display oracle table as a output table.. Pls help me
Thank youjayanthds, you're not going to get a satisfactory
answer to this here. it's too big a task to justbe
quickly outlined in a forum - the reply "all youneed
to do is to query you table and return it asJTable"
is worthless, for example, since the solution to
any problem can be distilled to such a
soundbite, if need be. doesn't make the solutionany
simpler
essentially you're asking "how do I write adatabase
application?". all you'll get is snippets of code
that, when fitted together, will eventually helpyou
do this, but you'll spend days and days comingback
saying "right, I've done that, now what?" until
either you or the forum gets frustrated with the
whole affair and the process stops
there are entire books written about this subject,
and countless tutorials and guides on theinternet.
you're better off going down that routehehehe.well, it's true! I used to have a manager that would outline the solution to a problem in a few lines of pseudocode, and then firmly believe that the actual solution would be just as brief and simple. shame his pseudocode included such lofty abstractions as "reformat all data" -
How can i transfer oracle table's
Hi there
can anybody help?, i wana use my oracle table's ( that i created in system) and wana to use those table in another system (it doest have oracle software ). is ther any possible way to use entire oracle table's in a system without installing oracle s/w .. (i wana use these table to create a website).
please suggest how i can use those table to connect with a front end tool without installing oracle and , and how i can transfer oracle database table( how can i save and take it out from my system .
Thank youif you are trying to access the tables in oracle database from web application (J2EE) or some other using JDBC you can access oracle tables
you can query/modify the data -
How Create a Global Temporary Table inside a Stored Procedure?
Hi...
I need to create a Global Temporary Table inside a Stored
Procedure....
I have no idea how to do that....
Please....if u can send me a sample, send to me....
Thanks a lotthere are many ways to do this..
one u can use dbms_utility package to run ddl statements like
for ex:
declare
t varchar2(200):='order_no';
v number;
begin
--dbms_utility.exec_ddl_statement('select '||t||' into '||v||'
from
--ordermaster where rownum=1');
dbms_utility.exec_ddl_statement('create table cvt(t number)');
dbms_output.put_line(v);
end;
but the actual method(recommended) involves a bit coding using
dbms_sql package you will find examples on technet or metalink
to use this package..
I hope this helps
Narendra -
How to pass default value of argument to stored function?
Hi,
in procedure I don't have to pass all arguments, because I set it with name, but in stored function I have to set arguments with index som I must set all arguments. Some arguments have default value. So how to pass default value?
thx for any commentsIt really helps me if someone tell me that it isn't possiblle.
thx. -
Error trying to insert xml into Oracle table
Hi -
I am trying to (a)read a row from emp table and output the results in xml format
and (b) insert this row to another emp_new table (same structure as emp).
When I run it here is what I get:
OUTPUT IS:
<?xml verions='1.0'?>
<Employee>
<Emp num="1">
<EMPNO>7369</EMPNO>
<ENAME>Smith</ENAME>
<JOB>Clerk</JOB>
<MGR>7902</MGR>
<HIREDATE>12/7/1980</HIREDATE>
<SAL>800</SAL>
<DEPTNO>20</DEPTNO>
</Emp>
</Employee>
Exception in thread "main" oracle.xml.sql.OracleXMLSQLException:
No rows to modify -- the row enclosing tag is missing. Specify
the correct row enclosing tag.
etc...
The row enclosing tag is given by setRowTag("Emp").
What's wrong here? Any ideas?
PS: To Ambrose Padilla: Your response was helpful. Thank you.
Program
import java.sql.*;
import oracle.xml.sql.query.*;
import oracle.jdbc.driver.*;
import oracle.xml.sql.dml.*;
class testXML
public static void main(String[] args) throws SQLException
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//initialize a JDBC connection
Connecton conn = DriverManager.getConnection("jdbc:oracle:thin:mytest:1521:acme", "scott", "tiger");
//initialize the OracleXMLQuery
OracleXMLQuery qry =
new OracleXMLQuery(conn,"select * from emp where rownum < 2");
// set the document name
qry.setRowsetTag("Employee");
// set the row element name
qry.setRowTag("Emp");
// get the XML result
String xmlString = qry.getXMLString();
// print result
System.out.println(" OUPUT IS:\n"+xmlString);
OracleXMLSave sav = new OracleXMLSave(conn,"emp_new");
sav.insertXML(xmlString);
sav.close();
}Try inserting
sav.setRowTag("emp");
before calling insertXML. -
How to update an Oracle table from SSIS
Hi there
I've been working in a SSIS project where I need to update a table in an Oracle database that is located in a remote server. Until now I have used the OLE DB COMMAND to do this in a sql server database. To access the data that belongs to the Oracle database
I am using an OCDB task, but this component does not work with an OLE DB COMMAN and I also need to do an inner join with a table in SQL.
This is the schema of the query that I need to perform:
UPDATE OT
SET
OT.COLUMN1= ST.COLUMN1,
OT.COLUMN2= ST.COLUMN2,
OT.COLUMN3= ST.COLUMN3,
OT.COLUMN4= ST.COLUMN4,
FROM
ORACLE_TABLE AS OT INNER JOIN SQL_TABLE ST ON
OT.COLUMN5 = ST.COLUMN5
WHERE
(((OT.COLUMN1) Is Null) AND
((ST.COLUMN2) In ('A1','A2','A3') AND
((ST.COLUMN3)<>'B1' Or (ST.COLUMN3) Is Null) AND
((ST.COLUMN7)=1));
I am using Microsoft Visual Studio 2010.Hi dj2907,
According to your description, I find that you ever asked a similar question in the forum, and I have answered it. The thread URL is there:
https://social.technet.microsoft.com/Forums/en-US/aafd209f-56a0-4b09-9b82-0a57bcaa2448/ssis-updating-a-table-with-a-ole-db-command?forum=sqlintegratio
Based on your current requirement, we should change your current provider to Microsoft OLE DB Provider for Oracle supported by Microsoft or Oracle Provider for OLE DB
recommended by Microsoft to access the data in Oracle. Then we can directly use the OLE DB Connection Manager for OLE DB Command. The following similar thread is for your reference:
http://stackoverflow.com/questions/5168772/update-a-row-in-oracle-using-oledb-commandssis
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Insert data into oracle table from XML script not working
Hi,
I wrote simple PL/SQL program to extract values from a XML file and disply all the employee names. But the first employee name repeating. Please can you tell me how to fix it.
set serveroutput on size 2000;
declare
indoc VARCHAR2(2000);
indomdoc dbms_xmldom.domdocument;
innode dbms_xmldom.domnode;
myParser dbms_xmlparser.Parser;
l_nl dbms_xmldom.DOMNodeList;
lv_value varchar2(30);
l_n dbms_xmldom.DOMNode;
begin
indoc := '<emp> <name> Scott </name>
<name> Tiger </name>
</emp>';
myParser := dbms_xmlparser.newParser;
dbms_xmlparser.parseBuffer(myParser, indoc);
indomdoc := dbms_xmlparser.getDocument(myParser);
innode := dbms_xmldom.makeNode(indomdoc);
l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(indomdoc),'/emp/name');
dbms_output.put_line('Record count '||dbms_xmldom.getLength(l_nl));
FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP
l_n := dbms_xmldom.item(l_nl, cur_emp);
lv_value := dbms_xslprocessor.valueOf(l_n,'//name/text()');
dbms_output.put_line('Emp Name : '||lv_value);
END LOOP;
end;
/Based on an earlier example of mine from {message:id=2826611}
This works in 10.2.x.x for sure. I can't recall (didn't look up) whether in 10.1 it allowed for going straight from a CLOB to a DOMDocument via newDomDocument.
declare
indoc VARCHAR2(2000);
indomdoc dbms_xmldom.domdocument;
l_nl dbms_xmldom.DOMNodeList;
lv_value VARCHAR2(30);
l_n dbms_xmldom.DOMNode;
l_xmltype XMLTYPE;
l_index PLS_INTEGER;
begin
indoc := '<emp> <name> Scott </name>
<name> Tiger </name>
</emp>';
indomdoc := dbms_xmldom.newDomDocument(indoc);
l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(indomdoc),'/emp/name');
dbms_output.put_line('Record count '||dbms_xmldom.getLength(l_nl));
-- Method 1
FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP
l_n := dbms_xmldom.item(l_nl, cur_emp);
lv_value := dbms_xmldom.getnodevalue(dbms_xmldom.getfirstchild(l_n));
dbms_output.put_line('Emp Name : '||lv_value);
END LOOP;
dbms_xmldom.freeDocument(indomdoc);
-- Method 2
dbms_output.new_line;
l_xmltype := XMLTYPE(indoc);
l_index := 1;
WHILE l_xmltype.Existsnode('/emp/name[' || To_Char(l_index) || ']') > 0
LOOP
lv_value := l_xmltype.extract('/emp/name[' || To_Char(l_index) || ']/text()').getStringVal();
dbms_output.put_line('Emp Name : '||lv_value);
l_index := l_index + 1;
END LOOP;
end; -
Who know how to handle pl/sql table return from stored procedure calling from jsp
I have some stored procedure which return pl/sql table (index by table), It is look like an array. how jdbc handle this?
CallableStatement cs = con.prepareCall("EXECUTE bill.getcountry(?,?)");
cs.setInt(1, cid);
cs.registerOutParameter(2, java.sql.Types.VARCHAR);// ARRAY?
ResultSet rs = cs.executeQuery();
Array array = (Array) rs.getObject (1);
ResultSet array_rset = array.getResultSet ();Not that familiar with the OCI (Oracle Call Interface), but I think this call will be problematic - the OCI deals with SQL data types and not with PL/SQL structures.
The OCI has since Oracle 8i sported an object call interface (see OCI Runtime Environment for Objects for details).
This allows you to use the CREATE TYPE command to create advance user data types - and these are supported by the SQL engine, PL/SQL engine and external languages via the OCI.
So you need to have a look at the Perl-DBI documentation to see how it supports Oracle object types and consider using these. As for internal PL/SQL data structures. These are not supported by the SQL engine and I would expect limited or no support in the OCI for these. Anyway, using SQL data types makes a lot more sense ito flexibility and transparency across languages and environments. -
Insert /delete data from SAP Z table to Oracle table and opposite
Hi,
Can u help me write this FM from the SAP side?
So, I have two tables ZTABLE in SAP and Oracle table ORAC.
Let's put three columns in each of them, for example
TEL1
TEL2
ADRESS
NAME
where TEL field is primary from ZTABLE to ORAC...
(in FM there shoud be abap code for writing data in ZTABLE after we press some pushbutton made in sap screen painter..)
for example, when we write new record in ZTABLE
00
112233
Street 4
Name1
this data shoud be inserted in Oracle table ORAC.
when we write new record in Oracle table for example
01
445566
New Street
Name2
this data shoud be inserted in ZTABLE.
Field TEL1 can be only of two values 01 or 02, other combination is not valid...
I must have all data from Oracle table ORAC in ZTABLE and opposite.
It should be the same scenario for DELETE...
And this communication should be online between sap and table in oracle database...
Can u help me from sap side? and give idea how to configure on oracle side??
Thanks a lot,
NihadI dont know if we can directly connect to a oracle database ( wait for the answers from others on this )
but in XI we have the JDBC adaptor to insert and retrieve data.
so for the outbound from SAP the flow can be something like this (with XI in landscape):
1) You have a screen to maintain a new entry / delete an entry
2) On save , this record gets saved or deleted from the Ztable in SAP
3)) In the same screen you can call a proxy class-method (generated using SPROXY transaction ) to send the record to XI.
4) XI to format it and insert into the oracle table
Mathews -
Insert or fetch XML data so a sto insert in oracle table
Hi
I have the following XML structure .
Kindly guide as I am new to using XML .
Please provide the simplest and fastest way to extract or insert data from the below structure and insert in to oracle tables .
<id>
<id1> 123</id1>
<fe>
<fe1>1</fe1>
<fe2>1</fe2>
</fe>
<a>
<fe1>a1</fe1>
<fe2>a2</fe2>
</a>
<newid>
<atr>
<atr1> 34</atr1>
<atr2> 76 </atr2>
</atr>
<pr>
<pr1> 34</pr1>
<pr2> 34</pr2>
</pr>
</newid>
</id >Use XMLTABLE to convert the xml and INSERT ALL to do a multitable insert.
E.g.
http://odieweblog.wordpress.com/2012/05/10/how-to-load-xml-data-into-multiple-tables/
http://rwijk.blogspot.co.uk/2010/03/shredding-xml-into-multiple-tables-in.html -
Insert a oracle table from jquery/ajax
Hi.
i am new on apex and will like to know if can help me with my question.
i am calling an on demmand process from jquery javascript to insert some data on oracle apex_collection (i do delete and insert on the apex collection and works fine) , but i need to insert an oracle database table directly from jquery (through an on demmand process or any other way).
actually, i have an html page with an anonymus pl/sql which shows a list of items where user enter some values; using javascript, i call an on demmand - javascript process that will do the insert on an oracle table, but nothing happens. no data get inserted to my table
actually i am calling the on demmand process using this on javascript, and works nice, but only on apex_collection , not on oracle database table.
var ajaxRequest = new htmldb_Get(null,&APP_ID.,"APPLICATION_PROCESS=ADD_PRODUCTS",&APP_PAGE_ID.);
ajaxRequest.add('P1_PRODUCT_ID',html_GetElement('P1_PRODUCT_ID').value);
ajaxRequest.add('P1_QTY',html_GetElement('P1_QTY').value);
ajaxResult = ajaxRequest.get();
it is importante to mention that i am NOT SUBMITTING or refreshing the page at any time, because it will make it too slow, I think it has something to do with the problem but not sure.
thanks in advance.
Anthony.Hi Scott. thanks for your interest.
ok, i am using Application Express 4.2.2.00.11 (Oracle Database SE 11gR2)
i have created a HTML region Source with this code to call the Ajax Process :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Totalizar</title>
<script type="text/javascript">
$(function()
// Save the Order
$("#Save").click
function()
var ajaxRequestd = new htmldb_Get(null,&APP_ID.,"APPLICATION_PROCESS=SAVE",&APP_PAGE_ID.);
ajaxRequestd.add('P1_CODIGO_CLIENTE',html_GetElement('P1_CODIGO_CLIENTE').value);
ajaxRequestd.add('P1_TIPO_CLIENTE',html_GetElement('P1_TIPO_CLIENTE').value);
ajaxResult = ajaxRequestd.get();
alert('Order Placed !');
</script>
</head>
<body>
<div id="totals"></div>
<p align="center" style="clear: both;">
<button type="button" style="font-weight: bold;background-color:lightgray;margin-left:auto;margin-right:auto;display:block;margin-top:0%;margin-bottom:0%" id="Save">Place Order</button>
</p>
</body>
</html>
the Message 'Order Placed !' is displayed on the page, so it tells me that the javascript is executing (i will like to display some message or alert inside the SAVE ajax process, to make sure it executes and check values at that moment, but don't know how)
and here is my "SAVE" on Demand process, with this settings:
- Process Point - Run this process when request by ajax
- Run Process - One per Page visit
whit this source code on it:
-- Insert into table
insert into cab_orders(customer_id, order_total, order_timestamp, user_name)
values(:P1_CODIGO_CLIENTE, null, systimestamp, upper(:APP_USER));
commit;
Remember that at this point the page has not been refresehed or submitted, maybe tis where the problem come from.
Thanks in advance for any tip ! -
Incorrect data value when insert into oracle table
Would like to ask expert here, how could I insert data into oracle table where the value is 03 ? The case is like that, the column was defined as varchar2(50) data type, and I have a csv file where the value is 03 but when load into oracle table the value become 3 instead of 03.
user11432758 wrote:
Would like to ask expert here, how could I insert data into oracle table where the value is 03 ? The case is like that, the column was defined as varchar2(50) data type, and I have a csv file where the value is 03 but when load into oracle table the value become 3 instead of 03.
implicit datatype conversion to NUMBER can result in leading zero to be eliminated.
How do I ask a question on the forums?
https://forums.oracle.com/message/9362002#9362002
Maybe you are looking for
-
I have all this podcasts that I choosen over the years in my ipod 2nd. generation and now I have my newest ipod and trying to find podcasts in itunes , casuse I also have a new computer.some podcasts doesn;'t show ..how do i transfer all the informa
-
Airplay icon missing in iTunes, unable to set up Airport Express
Got a new Mini yesterday, replacing an old underpowered model with a 2.5 Ghz, 4GB, Radeon model for running an HTPC setup. Woo Hoo! Spent part of yesterday setting everything up. Very easy to do with the Assistant moving old files to new machine. Eve
-
How do I reinstall the OS on a solid-state imac
how do I reinstall the OS on a solid-state imac
-
Sending Smart form to Printer in SRM
Hi All, I am trying to send a smartform to Printer in SRM ITS. I gave output options and control parameters . When i see the Print dialog box i dont see the Front end printers in that. Normally when we pass LOCL we should see default printer in Prin
-
Which graphics card can fit in my HP 500-201IN?
Can you please provide a list of graphics card which will fit in my stock HP 500-201IN with stock case and stock PSU?