Updating a Table Using a Stored Procedure.
Hi,
i have a table with 3 columns viz name,salary and e mail id.
i need to update the current salary by 15% and update it in the same table.
Kindly help me on this
SQL Developer refers to an application, not you. The forum you want is "SQL and PL/SQL".
As for your query:
UPDATE table
SET salary = salary*1.15;
The Oracle database documentation (download at OTN if you don't have it) is very complete and user friendly on SQL reference, I suggest you read up, especially being a newbie...
Regards,
K.
Similar Messages
-
How to use the Stored Procedure to update my UDF
I want to use the Stored Procedure to update my UDF U_InstokCS when the warehouse "OnHand" was changed. The UDF is display the stock by cases. I copied the query as follewing. I couldn't see any thing in the UDF after I made some transactions. Can anybody tell me why? How to continue it?
if @transaction_type in ('A','U','D') and @Object_type='64'
begin
Update OITW
Set U_InstokCS = OnHand/(Select T0.NumInBuy from [DBO].[OITM] T0
Where T0.ItemCode = @list_of_cols_val_tab_del)
Where ItemCode = @list_of_cols_val_tab_del
end
Thanks.
Ying ZhangYing,
The use of any stored procedures against the SAP Business One database is not allowed per SAP Support. There is not an instance where you can use SP's. The ONLY SP that you are allowed to use is the SBO_SP_TransactionNotification SP that comes with SAP Business One itself. You can read about the use of this SP from this article...
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e991e2b9-0901-0010-0395-ef5268b00aaf
Eddy -
Check If Tables are being used in Stored Procedures & How many times !!
Dear All,
I want to make a script which can give me an answer, that If there is any table , then Whether It's using in any stored procedure or not ? If yes, then what the occurrence in procedures - means if table is "ABC" & Its being used in stored procedure
"XYZ" then i want to know that its using 1 time, 2 time or more in particular procedure ..
Pls Helpjust in-case if you want to get the Cross DB dependency
i have extent Visakh16 code
please use sql_modules to get the full definition of the DB Objects
you can replace stg_table with your decided table, also use dbname.schemaname.tablename if you want to get Cross DB dependency
just came up with this from
link
create table #temp (
dbname sysname,
name sysname,
Occurance int
exec sp_MSforeachdb '
use ?
DECLARE @TableName varchar(100)
SET @TableName = ''stg_table''
insert into #temp
SELECT db_name() ,name,(LEN(definition) - LEN(REPLACE(definition,'' '' + @TableName + '' '','''')))/LEN('' '' + @TableName + '' '') AS Occurance
FROM sys.sql_modules m
INNER JOIN sys.objects o
ON o.object_id = m.object_id
AND o.type = ''p''
WHERE m.definition LIKE ''% '' + @TableName + '' %'''
select *
from #temp
where dbname not in ('master','model','msdb','tempdb')
order by 1,2
Thanks
Saravana Kumar C -
Issue using SQL stored procedure to insert/update
With help I finally managed to execute the stored procedure to insert/ update the sql database with the below stored procedure
ALTER PROCEDURE [dbo].[uspInsertorUpdate]
@dp char(32),
@dv char(32),
@e_num char(12),
@mail varchar(50),
@emerg char(32),
@opt1 char(16),
@stat char(20),
@e_id char(35),
@e_tit varchar(64),
@e_date datetime
AS
BEGIN
SET NOCOUNT ON;
IF EXISTS (SELECT 1 FROM [dbo].[sampleemployee] WHERE e_id= @e_id)
BEGIN
UPDATE [dbo].[sampleemployee]
SET dp = @dp,
dv = @dv,
e_num = @e_num,
mail = @mail,
emerg = @emerg,
opt1 = @opt1,
stat = @stat,
e_tit = @e_tit,
e_date = @e_date
WHERE e_id = @e_id
END
ELSE
BEGIN
INSERT INTO [dbo].[sampleemployee]( dp, dv, e_num, mail, emerg, opt1, stat, e_id, e_tit, e_date)
VALUES ( @dp, @dv, @e_num, @mail, @emerg, @opt1, @stat, @e_id, @e_tit, @e_date );
END
END;
But the issue here is it just insert only one row and update that row only, even if there are some no.of rows need to be inserted . Not sure whyHi Sid_siv,
To pass a table value to stored procedure, you can refer to the sample query below.
create type FileDetailsType as table
FileName varchar(50),
CreatedDate varchar(50),
Size decimal(18,0)
create procedure InsertFileDetails
@FileDetails FileDetailsType readonly
as
insert into
FileDetails (FileName, CreatedDate, Size)
select FileName, CreatedDate, Size
from
@FileDetails;
Reference
http://www.codeproject.com/Articles/22392/SQL-Server-Table-Valued-Parameters
http://forum.codecall.net/topic/75547-sql-server-2008-passing-table-parameter-to-stored-procedure/
Regards,
Charlie Liao
TechNet Community Support -
ORA-04030: out of process memory when using Java Stored Procedures
Hello,
I have a problem using Java Stored Procedures in Oracle 10g.
My Java application performs http posts to a webservice and the response is parsed in order to populate some DB tables.
There is a scheduled job which calls the Java Stored Procedure every x minutes.
No matter of the 'x minutes' values - after about 160 - 200 calls I get this error:
ORA-04030: out of process memory when trying to allocate 1048620 bytes (joxp heap,f:OldSpace)
ORA-04030: out of process memory when trying to allocate 2097196 bytes (joxp heap,f:OldSpace)
The job stops just while is posting the http request. The weird thing is that almost each time the first http post request I get this error:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:426)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(DashoA6275)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:130)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
and the second try works fine.
So, The out of process memory occured each time just before getting such an error, and I suspect to be a connection between these errors.
Tech details:
1. OS: WinXP
2. Oracle 10.1.0.2.0
3. To perform http post I use HttpClient 3.1 from Apache.
4. I checked the http connection to be closed each time, and this is done.
5. I checked the oracle statement and connection to be closed each time and this is done
6. The JVM error (logged in .trc files of Oracle) is:
java.lang.OutOfMemoryError
at java.lang.Thread.start(Native Method)
at sun.security.provider.SeedGenerator$ThreadedSeedGenerator.run(SeedGenerator.java:297)
DB Settings details:
Starting up ORACLE RDBMS Version: 10.1.0.2.0.
System parameters with non-default values:
processes = 200
sessions = 225
shared_pool_size = 159383552
large_pool_size = 8388608
java_pool_size = 104857600
nls_language = AMERICAN
control_files = C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL01.CTL, C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL02.CTL, C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL03.CTL
db_block_size = 8192
db_cache_size = 29360128
compatible = 10.1.0
fal_client = XXXXXX
fal_server = XXXXXXs
log_buffer = 524288
log_checkpoint_interval = 100000
db_files = 70
db_file_multiblock_read_count= 32
db_recovery_file_dest = C:\oracle\product\10.1.0\flash_recovery_area
db_recovery_file_dest_size= 2147483648
standby_file_management = AUTO
undo_management = AUTO
undo_tablespace = undotbs_01
undo_retention = 14400
remote_login_passwordfile= EXCLUSIVE
db_domain =
dispatchers = (PROTOCOL=TCP) (SERVICE=XXXXXXXDB)
remote_dependencies_mode = SIGNATURE
job_queue_processes = 4
parallel_max_servers = 5
background_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\BDUMP
user_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\UDUMP
max_dump_file_size = 10240
core_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\CDUMP
sort_area_size = 1048576
sort_area_retained_size = 1048576
db_name = XXXXXX
open_cursors = 500
optimizer_mode = FIRST_ROWS
pga_aggregate_target = 25165824
Any help would be appreciated. Thanks.
Can be a problem with JVM threading under Oracle ?The server prcess failed to allocate more memory for large objects ( in Oldspace).
If you Google ORA-04030, you will see several recommendations to work around this.
The Java VM in the database already has HttpClient, i don't know why you are loading the Apache HttpClient but this might not be the surce of the problem.
Kuassi http://db360.blogspot.com -
How to get an updatable ADODB Recordset from a Stored Procedure?
In VB6 I have this code to get a disconnected ADODB Recordset from a Oracle 9i database (the Oracle Client is 10g):
Dim conSQL As ADODB.Connection
Dim comSQL As ADODB.Command
Dim recSQL As ADODB.Recordset
Set conSQL = New ADODB.Connection
With conSQL
.ConnectionString = "Provider=OraOLEDB.Oracle;Password=<pwd>;Persist Security Info=True;User ID=<uid>;Data Source=<dsn>"
.CursorLocation = adUseClientBatch
.Open
End With
Set comSQL = New ADODB.Command
With comSQL
.ActiveConnection = conSQL
.CommandType = adCmdStoredProc
.CommandText = "P_PARAM.GETALLPARAM"
.Properties("PLSQLRSet").Value = True
End With
Set recSQL = New ADODB.Recordset
With recSQL
Set .Source = comSQL
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockBatchOptimistic
.Open
.ActiveConnection = Nothing
End With
The PL/SQL Procedure is returning a REF CURSOR like this:
PROCEDURE GetAllParam(op_PARAMRecCur IN OUT P_PARAM.PARAMRecCur)
IS
BEGIN
OPEN op_PARAMRecCur FOR
SELECT *
FROM PARAM
ORDER BY ANNPARAM DESC;
END GetAllParam;
When I try to update some values in the ADODB Recordset (still disconnected), I get the following error:
Err.Description: Multiple-step operation generated errors. Check each status value.
Err.Number: -2147217887 (80040E21)
Err.Source: Microsoft Cursor Engine
The following properties on the Command object doesn't change anything:
.Properties("IRowsetChange") = True
.Properties("Updatability") = 7
How can I get an updatable ADODB Recordset from a Stored Procedure?4 years later...
I was having then same problem.
Finally, I've found how to "touch" the requierd bits.
Obviously, it's hardcore, but since some stupid at microsoft cannot understand the use of a disconnected recordset in the real world, there is no other choice.
Reference: http://download.microsoft.com/downlo...MS-ADTG%5D.pdf
http://msdn.microsoft.com/en-us/library/cc221950.aspx
http://www.xtremevbtalk.com/showthread.php?t=165799
Solution (VB6):
<pre>
Dim Rst As Recordset
Rst.Open "select 1 as C1, '5CHARS' as C5, sysdate as C6, NVL(null,15) as C7, null as C8 from DUAL", yourconnection, adOpenKeyset, adLockBatchOptimistic
Set Rst.ActiveConnection = Nothing
Dim S As New ADODB.Stream
Rst.Save S, adPersistADTG
Rst.Close
Set Rst = Nothing
With S
'Debug.Print .Size
Dim Bytes() As Byte
Dim WordVal As Integer
Dim LongVal As Long
Bytes = .Read(2)
If Bytes(0) <> 1 Then Err.Raise 5, , "ADTG byte 0, se esperaba: 1 (header)"
.Position = 2 + Bytes(1)
Bytes = .Read(3)
If Bytes(0) <> 2 Then Err.Raise 5, , "ADTG byte 9, se esperaba: 2 (handler)"
LongVal = Bytes(1) + Bytes(2) * 256 ' handler size
.Position = .Position + LongVal
Bytes = .Read(3)
If Bytes(0) <> 3 Then Err.Raise 5, , "ADTG, se esperaba: 3 (result descriptor)"
LongVal = Bytes(1) + Bytes(2) * 256 ' result descriptor size
.Position = .Position + LongVal
Bytes = .Read(3)
If Bytes(0) <> 16 Then Err.Raise 5, , "ADTG, se esperaba: 16 (adtgRecordSetContext)"
LongVal = Bytes(1) + Bytes(2) * 256 ' token size
.Position = .Position + LongVal
Bytes = .Read(3)
If Bytes(0) <> 5 Then Err.Raise 5, , "ADTG, se esperaba: 5 (adtgTableDescriptor)"
LongVal = Bytes(1) + Bytes(2) * 256 ' token size
.Position = .Position + LongVal
Bytes = .Read(1)
If Bytes(0) <> 6 Then Err.Raise 5, , "ADTG, se esperaba: 6 (adtgTokenColumnDescriptor)"
Do ' For each Field
Bytes = .Read(2)
LongVal = Bytes(0) + Bytes(1) * 256 ' token size
Dim NextTokenPos As Long
NextTokenPos = .Position + LongVal
Dim PresenceMap As Long
Bytes = .Read(3)
PresenceMap = Val("&H" & Right$("0" & Hex$(Bytes(0)), 2) & Right$("0" & Hex$(Bytes(1)), 2) & Right$("0" & Hex$(Bytes(2)), 2))
Bytes = .Read(2) 'ColumnOrdinal
'WordVal = Val("&H" & Right$("0" & Hex$(Bytes(0)), 2) & Right$("0" & Hex$(bytes(1)), 2))
'Aca pueden venir: friendly_columnname, basetable_ordinal,basetab_column_ordinal,basetab_colname
If PresenceMap And &H800000 Then 'friendly_columnname
Bytes = .Read(2) 'Size
LongVal = Bytes(0) + Bytes(1) * 256 ' Size
.Position = .Position + LongVal * 2 '*2 debido a UNICODE
End If
If PresenceMap And &H400000 Then 'basetable_ordinal
.Position = .Position + 2 ' 2 bytes
End If
If PresenceMap And &H200000 Then 'basetab_column_ordinal
.Position = .Position + 2 ' 2 bytes
End If
If PresenceMap And &H100000 Then 'basetab_colname
Bytes = .Read(2) 'Size
LongVal = Bytes(0) + Bytes(1) * 256 ' Size
.Position = .Position + LongVal * 2 '*2 debido a UNICODE
End If
Bytes = .Read(2) 'adtgColumnDBType
'WordVal = Val("&H" & Right$("0" & Hex$(Bytes(0)), 2) & Right$("0" & Hex$(bytes(1)), 2))
Bytes = .Read(4) 'adtgColumnMaxLength
'LongVal = Val("&H" & Right$("0" & Hex$(Bytes(3)), 2) & Right$("0" & Hex$(Bytes(2)), 2) & Right$("0" & Hex$(Bytes(1)), 2) & Right$("0" & Hex$(Bytes(0)), 2))
Bytes = .Read(4) 'Precision
'LongVal = Val("&H" & Right$("0" & Hex$(Bytes(3)), 2) & Right$("0" & Hex$(Bytes(2)), 2) & Right$("0" & Hex$(Bytes(1)), 2) & Right$("0" & Hex$(Bytes(0)), 2))
Bytes = .Read(4) 'Scale
'LongVal = Val("&H" & Right$("0" & Hex$(Bytes(3)), 2) & Right$("0" & Hex$(Bytes(2)), 2) & Right$("0" & Hex$(Bytes(1)), 2) & Right$("0" & Hex$(Bytes(0)), 2))
Dim ColumnFlags() As Byte, NewFlag0 As Byte
ColumnFlags = .Read(1) 'DBCOLUMNFLAGS, First Byte only (DBCOLUMNFLAGS=4 bytes total)
NewFlag0 = ColumnFlags(0)
If (NewFlag0 And &H4) = 0 Then 'DBCOLUMNFLAGS_WRITE (bit 2) esta OFF
'Lo pongo en ON, ya que quiero escribir esta columna LOCALMENTE en el rst DESCONECTADO
NewFlag0 = (NewFlag0 Or &H4)
End If
If (NewFlag0 And &H8) <> 0 Then 'DBCOLUMNFLAGS_WRITEUNKNOWN (bit 3) esta ON
'Lo pongo en OFF, ya que no me importa si NO sabes si se puede updatear no, yo lo se, no te preocupes
'ya que quiero escribir esta columna LOCALMENTE en el rst DESCONECTADO
NewFlag0 = (NewFlag0 And Not &H8)
End If
If (NewFlag0 And &H20) <> 0 Then 'DBCOLUMNFLAGS_ISNULLABLE (bit 5) esta OFF
'Lo pongo en ON, ya que siendo un RST DESCONECTADO, si le quiero poner NULL, le pongo y listo
NewFlag0 = (NewFlag0 Or &H20)
End If
If NewFlag0 <> ColumnFlags(0) Then
ColumnFlags(0) = NewFlag0
.Position = .Position - 1
.Write ColumnFlags
End If
.Position = NextTokenPos
Bytes = .Read(1)
Loop While Bytes(0) = 6
'Reconstruyo el Rst desde el stream
S.Position = 0
Set Rst = New Recordset
Rst.Open S
End With
'TEST IT
On Error Resume Next
Rst!C1 = 15
Rst!C5 = "MUCHOS CHARS"
Rst!C7 = 23423
If Err.Number = 0 Then
MsgBox "OK"
Else
MsgBox Err.Description
End If
</pre> -
How to use a stored procedure as a datasource in Crystal Report for Eclipse
Hi All,
I've written a stored procedure in oracle 10g with few input parameters and one refcursor output parameter. I want to use this stored procedure as a data source for creating a report in "Crystal Report For Eclipse 3.6.0".
When I tried to add this stored procedure to the report using the connection explorer, I don't see any option to do this. But when I try to add any table, it shows options like "Add to the current report"....
Can anybody assist me how to use a stored procedure as a data source in "Crystal Report For Eclipse"?
Which driver should I use to connect to the oracle database? I tried using JDBC Driver for Oracle.
Thanks in advance.Did you solve your problem? How did you do?
-
Oracle error while using an stored procedure in forms
Hi all,
I used a stored procedure in a form,and it worked well.Recently i just update this procedure by desactivate some codes lines.The stored proc is well compile but when i try to use it in a form module, the following Oracle error occurs:
ORA-04020 deadlock detected while trying to lock object name
Cause: While trying to lock a library object, a deadlock is detected.
If some one have a solution to this problem, plz react to this topic
TYAG.Hi all,
I used a stored procedure in a form,and it worked well.Recently i just update this procedure by desactivate some codes lines.The stored proc is well compile but when i try to use it in a form module, the following Oracle error occurs:
ORA-04020 deadlock detected while trying to lock object name
Cause: While trying to lock a library object, a deadlock is detected.
If some one have a solution to this problem, plz react to this topic
TYAG. -
ORA-29855 - Error creating Spatial Index using a Stored Procedure
Hi
I am using Oracle 10gR2 database and I have written a stored procedure to create spatial index. But when i execute this function i get the following error message.
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-13249: internal error in Spatial index: [mdidxrbd]
ORA-13249: Error in Spatial index: index build failed
ORA-13249: Error in R-tree: [mdrcrtscrt]
ORA-13231: failed to create index table [MDRT_217C1$] during R-tree creation
ORA-13249: Stmt-Execute Failure: CREATE TABLE FGDABZ40.MDRT_217C1$ (NODE_ID NUMBER, NODE_LEVEL NUMBER, INFO BLOB) LOB (INFO) STORE AS (CACHE) NOLOGGING PCTFREE 2
ORA-29400: data cartridge error
ORA-01031: insufficient privileges
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 10
ORA-06512: at line 1
ORA-06512: at "FGDABZ40.PKG_PSSDBE_APPLICATION", line 298
ORA-06512: at line 17
The tables that i am passing are registered in metadata and I am able to create indexes directly in sql plus. But when i try to create using this stored procedure, it fails.
it should be possible to create indexes using a generic function. Has any faced a similar problem?
regards
samHi,
I am having a same error on Oracle 10gR2 database. When I execute the same statement in sqlplus, it works. But it gives this error when I call the procedure which has this create spatial index statement.
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-13249: internal error in Spatial index: [mdidxrbd]
ORA-13249: Error in Spatial index: index build failed
ORA-13249: Error in R-tree: [mdrcrtscrt]
ORA-13231: failed to create index table [MDRT_20CDA$] during R-tree creation
ORA-13249: Stmt-Execute Failure: CREATE TABLE "SDOMGR".MDRT_20CDA$ (NODE_ID NUMBER, NODE_LEVEL NUMBER, INFO BLOB) LOB (INFO) STORE AS (CACHE) NOLOGGING PCTFREE 2
ORA-29400: data cartridge error
ORA-01031: i
Any help will be appreciated.
Thanks,
Sri -
Two temp tables in a Stored Procedure
Hi guys,
Is it feasable to use two stored procedures and form joins between them within a single stored procedure. I am trying a workaround for cursors in SYBASE.
Thanks,
DeveloperThis Create a temporary table in stored proc is a long and occasionally fractious discussion of the differences between temp tables in Oracle and MS SQL Server (and hence Sybase). You may wish to review it, or at least the links to the documentation.
Alternatively, expalin what it is the sybase code is doing and we will tell the best way to implement it in Oracle.
Cheers, APC -
Using a stored procedure for a sender jdbc adapter
Hi all,
The requirement is to use a stored procedure, for extracting data from a oracle database.
Is it possible to do this.
If yes, what should be the source structure in this case.
Please help with the exact soln.
Thanks!!
YounusHi,
Did you check the blog pointed by Aamir?
/people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
You will need to use Oracle Functions instead of Oracle Stored Procedures. Read thru the blog and the note pointed in the blog . Think it is quite a good example.
Regards
Bhavesh -
Writing data to a foreign database-SQLServer using a stored procedure
Does anyone know if I can Insert data into a SQLServer table which resides out on the WAN using a stored procedure which resides in my Oracle database?
Is it possible? Sure. How easy it is really depends...
Oracle has a feature called Heterogeneous Connectivity which allows you to create database links to non-Oracle databases. You can then treat the remote SQL Server objects just like you would use remote Oracle tables across a database link, i.e.
INSERT INTO table_name@sql_server_dblink( <<list of columns>> )
VALUES( <<list of values>> )Heterogeneous Connectivity requires some configuration on the Oracle database side. If you want to use Generic Connectivity, which is part of the base license, you'll need a SQL Server ODBC driver on the machine where Oracle is running. If you run Oracle on Windows, this is relatively easy. If you run Oracle on Unix, this gets a bit more challenging.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Beans using plsql stored procedures
Hi all
My question is: has jdeveloper any graphic tool or asistant to make something like use stored procedures that return multiple rows ( ref cursor ).
This is my problem, i'm student and have to build a web project that use beans, stored procedures and webservice.... i'm total noob in ejb, but i had worked with plsql some time.
Can anyone tell me pls where to start, some article to read or something that may help me in this task
VictorA Ref Cursor doesn't have any implicit structure, so it's not easy to automatically bind bean to it, however if you create database types like this, for example:
drop type dept_t_list;
drop type dept_t;
drop type emp_t_list;
drop type emp_t;
create type emp_t as object(
empno number(4),
ename varchar2(10),
job varchar2(9),
mgr number(4),
hiredate date,
sal number(7,2),
comm number(7,2),
deptno number(2),
terminated varchar(1)
create type emp_t_list as table of emp_t;
create type dept_t as object(
deptno number(2),
dname varchar2(14),
loc varchar2(13),
emps emp_t_list
create type dept_t_list as table of dept_t;
/Then you can create a pl/sql store procedure that works with this types and list types easily as beans and arrays of beans using the JPublisher tool.
If you visit my Not Yet Documented Examples page and see example 36, it contains the SQL scripts that create example types and a stored package to work with them. It also contains the JPublisher-created Java classes for working with those types and package.
http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
Inside JDeveloper, if you visit the connection navigator, expand your database connection and expand the "Packages" node, you can right-mouse and generate java (using JPublisher under the covers for you) on any package. -
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 -
Is is possible to create Socket using Java Stored Procedures/Function(Ora)?
Hello Friends,
Is is possible to create Socket using Java Stored Procedures/Function in Oracle?
OR
How I can send a message from oracle to Java Desktop Application which is working like server program?
Please Guide !!J3Ganesh wrote:
Hello Friends,
Is is possible to create Socket using Java Stored Procedures/Function in Oracle?No, Oracle was very careful to take that feature out of the JDK provided in Oracle 10/11, but you can buy that feature back for, if I remember correctly, about 5000 dollars. (I actually raised a service request on this and then told my rep what I thought about the answer I received--some thing along the line of money grubbing so and so....)
How I can send a message from oracle to Java Desktop Application which is working like server program?You can make a table and poll it from time to time from the Java side and write and commit what ever you want to the table. I do not know any way to send a signal from Oracle DB an external Java application--Java or PL/SQL stored procedure.
Maybe you are looking for
-
How do I add a submenu without having to add a page?
I have a "Services" page created for our customer. There are currently two sub-pages from the Services page each having their own SubMenu button. On the services page are two types of services that DO NOT need their own pages (which is why they are
-
Filter block driver / struct page *b_pages / B_PAGEIO flag
Hi, i'm develloping a pseudo block driver wich intercepts all requests made on a underlying device ( a hard drive for example ). I want to have acces to data written to this lower device. Sometimes everything is OK : the "struct buf *" i got in my "s
-
Need to run the same query on different databases with the same argument
Hi folks, I've a script: obj, which has simple stuff, when I execute @obj this asked me for the object_name and in return gives me object/s if it exists in this (connected) db. Now to check in 2 other dbs, I've to disconnect from here and then connec
-
IPhoto and Flickr - disappearing photos and involuntary syncing
After control-clicking on Check Now in one of my Flickr albums, within iPhoto of course, all of the pictures in the album disappeared, leaving only the name of the album in the list of Flickr albums in iPhoto. The set made from that album is still pr
-
Trying to update to version 2 and keep getting error
I keep getting error (-6971) which has to do with backup. In order for my update to continue I have to continue and loose all saved data. HELP! What do I do?