SQL & PL/SQL :: Execute Several Statements In One Command Of DataAdapter Class?

Jul 18, 2012

When working with SQL Server it's possible to execute several sql statements in one command of the DataAdapter in ADO.Net Now I try the same thing with an oracle database and recieve error ORA-00911: invalid character.

When remove ;character from query it again gives error- ORA-00933: SQL command not properly ended.

My query is like this-

update activity set activityname='Route Survey' where activityid=1;
SELECT * FROM activity where activityid=1

View 4 Replies


ADVERTISEMENT

PL/SQL :: Procedure To Execute Multiple Statements As A Batch Script

Jul 16, 2012

here's my question.

(I'm using PL/SQL Developer with Oracle 10g)

I have an table 'tbcontrol' where for each row I can have one or more sql statements (DML or DDL) in an column.

Example:

task | sql_scripts
1 | create table t1 (c1 number); insert into t1 (c1) values 100;
2 | create table t2 (c2 number); alter table t1 modify c1 not null default 0;
3 | alter table t2 modify c2 not null default 0; alter table t1 add c10 varchar2(10); create table t3 (c3 number not null default 0;

I need to create a procedure where I can pass an task number to execute the sql statements which are in the column 'sql_scripts'. Something like this:

create or replace sp_run_scripts (v_task number)
is
v_scripts varchar2(2000);
begin
select sql_scripts into v_scripts from tbcontrol where task = v_task
execute immediate v_scripts;
end;

But, here I'll have some problems:

- The script will have semicolons (EXECUTE IMMEDIATE doesn't support);
- If I put a begin/end like a PL/SQL script, I can only run DML statements because DDL statements have implicit commit.
- I can't use a cursor for execute each statement at a time because the scripts have multiples-rows. Even if I search for semicolons to 'separate' the scripts in the cursor (using SUBSTR and INSTR functions), I'll have problems with the semicolons between '' (quotations marks).

Now, I admit I'm lost.

Is there another way to make this process work?

View 20 Replies View Related

TimesTen In-Memory :: Ttisql - Execute Prepared Statements In Script?

Dec 13, 2012

I want increase speed of importing data using ttisql. My script contains about 12k simular MERGEs. Can I prepare this state,ent once and later substitute params from script?

View 1 Replies View Related

JDeveloper, Java & XML :: Using PL/SQL Function To Execute Java Class?

May 20, 2013

i`m trying to use pl/sql function to execute java class. I created 2 tables with around 100 values and java class with simple functionality. I need to create function to loop through my table1 and get with each iteration one value from table and pass that value as parameter to java class.

table1 is something like this:

ID NAME
1 name1
2 name2
3 name3
. .
. .
100 name100

table2 is empty with same columns as table1 ( table2 is for data obtained from java returns ) I created in sql+ java class.

CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "myClass" AS
import java.io.*;
import java.util.*
public class myClass {
public static String fun(String strName)

[code]....

Then i wanna make a pl/sql function for:

1)For i = 1 Obtain first value from table1 (column name) and pass it throught java class then return value and save it in table2 with the same id as id from table1

2) change i=1 to i=2 and do that same

3) end if i=101

View 1 Replies View Related

SQL & PL/SQL :: Execute Immediate Command Error

Oct 14, 2011

I am facing a problem regarding the execute immediate command. I have created a procedure as given below

SQL> set echo on ;
SQL> set serveroutput on;
SQL> declare
2 l_var varchar2(50);
3 sqlstring varchar2(3000);
4 begin
[code].......

In this procedure the execute immediate command shows error ( if i avoid exception).I have tried other syntax too of this command
but it is showing error only.

View 13 Replies View Related

Execute Immediate Command For Multiple Rows?

Mar 25, 2007

I have to build a select query but its where conditions will be retrieved from a table. I was told that the execute immediate command can handle it.

lets say i have this:

string_var:= 'select field1, field2, field3
from mytable
where' ' || i.condition_selection || ';'

If the above select resuls in a single row, i could do this:

EXECUTE IMMEDIATE string_var INTO var_field1, var_field2, var_field3;

In my case the select will return multiple rows. How do I proceed ?

View 4 Replies View Related

SQL & PL/SQL :: Error Message In Execute Immediate Command

May 30, 2012

I have created a procedure, which should be executed on the below condition with EXECUTE IMMEDIATE COMMAND. But i am getting error.

The error shows the procedure/function name is not existing. But it is exist.

SQL>
1 Declare
2 a varchar2(20);
3 b varchar2(20);
4 c varchar2(1000);
5 begin
6 select to_char(sysdate,'day') into a
7 from dual;
8 select to_char(sysdate,'HH24') into b
9 from dual;
10 if
11 (a='friday' and b>=22)
12 or
13 (a='saturday' and b<=6)
14 or
15 (a='wednesday' and b>=9)
16 then
17 begin
18 EXECUTE IMMEDIATE ('begin'||BACKUP_AUTO_execute_bat_file||'end;');
19 end;
20 else
21 null;
22 end if;
23* end;
SQL> /
EXECUTE IMMEDIATE ('begin'||BACKUP_AUTO_execute_bat_file||'end;');
*
ERROR at line 18:
ORA-06550: line 18, column 32:
PLS-00222: no function with name 'BACKUP_AUTO_EXECUTE_BAT_FILE' exists in this
scope
ORA-06550: line 18, column 4:
PL/SQL: Statement ignored

View 6 Replies View Related

PL/SQL :: Execute Unix Command From Oracle

Oct 17, 2013

I'm on Oracle 11g R1. I've a requirement where user will be putting CSV files on Unix server and I've to create a job which runs periodically to check if any new file is added by user in the folder. If it finds a new file (s), then it needs to identify it and insert its name in an Oracle table. Once file's name is noted, it has to move file from that directory to another one.

View 2 Replies View Related

Execute Command Line Program Within Java?

Jan 10, 2012

I've created a Java class in my Oracle DB that calls a Visual Basic program to convert a XLS file into a CSV file in order to load it into an external table. The problem that I have is that when I call the Visual Basic program from the Java class, nothing happens. I had the same problem with a Python program, and I thought that the problem was from Python, but now with Visual Basic the problem remains, both aren't executed.

The strange thing is that when I call the same Java class outside Oracle, directly from a command line, it executes both Python and Visual Basic programs.

Here is the Java class defined in Oracle:

CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "OSCommand" AS
import java.io.*;
public class OSCommand{
public static void Run(){
try
{

[code]....

And here is the procedure that calls the Java class:

create or replace
procedure run_os_command
as language java
name 'OSCommand.Run()';

View 1 Replies View Related

SQL & PL/SQL :: Using EXECUTE IMMEDIATE For DDL Command In Procedure For Password Change?

Nov 6, 2011

I have a procedure in this procedure i use.

EXECUTE IMMEDIATE 'alter user '||use||' identified by '||modp ||' replace '||oldp;

but when i execute it show insufficient privilages but i create for this procedure as public.and grant execute facility to the user.

View 6 Replies View Related

Could Not Execute Auto-check For Display Colors Using Command / Usr / Openwin

Mar 2, 2013

SO: Solaris 11 x86-64
DB: 11.2.0.3

I'm trying to install the Grid Infrastucture + Oracle db 11.2.0.3 on a Solaris 11. I'm used to work with Red-hat, so i don't remember in having such a problem. The issue is the following, when trying to run "runInstaller" as oracle user:

Checking Temp space: must be greater than 180 MB.   Actual 1527 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 2104 MB    Passed
Checking monitor: must be configured to display at least 256 colors
    >>> Could not execute auto check for display colors using command /usr/openwin/bin/xdpyinfo. Check if the DISPLAY variable is set.    Failed <<<<

Some requirement checks failed. You must fulfill these requirements before continuing with the installation,Continue? (y/n) [n] n

User Selected: NoDoing some researches, would be to install the SUNWxwplt package.i have installed all the required packages:

root@sol11:/mnt/sf_Compartilhamentos# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibms SUNWpool SUNWpoolr SUNWsprot SUNWtoo SUNWlibm SUNWuiu8 SUNWfont-xorg-core SUNWfont-xorg-iso8859-1 SUNWmfrun SUNWxorg-client-programs SUNWxorg-clientlibs SUNWxwfsw SUNWxwplt
system      SUNWarc                  Lint Libraries (usr)
system      SUNWbtool                CCS tools bundled with SunOS
system      SUNWfont-xorg-core       X.Org Foundation X11 core fonts
system      SUNWfont-xorg-iso8859-1  X.Org Foundation X11 iso8859-1 fonts
[code]....

xhost:  unable to open display "192.168.0.20:0.0"I think i made all the necessary configurations (?).

View 4 Replies View Related

Automatic Storage Management :: Execute Multipath -ll Command Not Display All 5 Path

Aug 3, 2012

When I execute multipath -ll command that time display only 3 path (orafra2,oradata2 and oradata1), not display other 2 path (orafra1 and data1). I have configure 5 path in /etc/multipath.conf file. What is the reason behind it.

[root@reuxeuls003 ~]# multipath -ll
orafra2 (360060160a71e2100de29aae7f4f9de11) dm-10 DGC,RAID 10
size=200G features='1 queue_if_no_path' hwhandler='1 emc' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| |- 1:0:1:3 sds 65:32 active ready running
[code]....

View 4 Replies View Related

SQL & PL/SQL :: Insert Statements / Give A Commit One By One After Each Insert Statements?

Oct 11, 2012

Can we execute more than one insert statements at a time (eg 10) in database and givecommit at the end of insert statements or else give a commit one by one after each insert statements ?

View 8 Replies View Related

Brtools Command Versus Oracle Command For Shutdown And Startup (statistics)

Sep 13, 2013

we are running SAP application against oracle database. say, if I use brspace or brtools (from SAP side) to shutdown or startup database or collect stats, does this mean it not recommend to use oracle command to shutdown/start & collect stats?

View 3 Replies View Related

SQL & PL/SQL :: Using Dbms_sql.execute To Build / Execute Dynamic Sql?

Oct 23, 2013

I'm working with old code that uses dbms_sql.execute to build/execute dynamic sql. In our case, the user can select varying columns(I think up to 20) with different where conditions as needed.

After building the sql, here's an example

WITH ph AS
(SELECT ph.* FROM po_header ph WHERE 1 = 2),
pf AS
(SELECT DISTINCT pf.order_id, pf.fund
FROM po_fau pf, ph
WHERE 1 = 1
AND ph.order_id = pf.order_id

[code]....

Where table records for

po_header = ~567746
po_fau = ~2153570

and PK "order_id" is a NUMBER(10) not null and a snippet of the code looks like

nDDL_Cursor := dbms_sql.open_cursor;
dbms_sql.parse(nDDL_Cursor, sSQLStr, 2);
FOR x IN 1 .. nCols LOOP
sCols(x) := '';
dbms_sql.define_column(nDDL_Cursor, x, sCols(x), 100);
END LOOP;
nError := dbms_sql.execute(nDDL_cursor);

why when the "execute" statement is fired off the elapsed time takes ~4.5 seconds but If I change "1 = 1" above to "1 = 2" it takes ~.2 seconds. If I run the above query interactively it takes ~.2 seconds. Shouldn't the above query when joining

ph.order_id = pf.order_id

return zero rows back instantly or does the "dbms_sql_execute" do some other type of parsing internally that takes cpu time.

View 14 Replies View Related

How To Display Row Value Of Each Class As Column Value

May 27, 2008

How to display row value of each class as a column value

IDNAMECLASSHOURSSCHOOLNAME
1AllenMaths12school1
2SamMaths12school1
4PamMaths10school1
3SamComp10school1
9SmithComp15school1
7SmithPhy20school1
5PamPhy12school1

[code]....

I wanted output like below for School1

NamemathsCompPhyAccountsBusiness
Allen120000
Sam1210000
Pam10012150
Smith01520120
Adams000030

I wanted output like below for School2

NameCompAccountsBusiness
Anthony2000
Chris102020

I wanted output like below for School3

NamemathsAccounts
Angelo2015
Robert1515

how to write a single query, Also i may add /delete school/class anytime. Query should support mesans everything dynamically should get the data.Even stored procedure will work for me.

View 3 Replies View Related

Creating Cursor For Every Class?

Aug 24, 2008

I'm modifying a package which contains a function with different parameters (say cno, gno, pname etc) need to be passed though it and that function is called by the cursor later in the program. I need to create a cursor (select statement) for every class (a program set)...i.e. multiple select statements for a program set with different values. The parameters needed to be passed correspond to same columns in different tables...so do i have to refer those tables everytime i'm passing the parameters using a select statement? The Program accepts the parameters as an array (list of parameters) and returns a cursor and the program handles one program set (class) at a time. That parameter list will be in a loop..i.e. it will be repeated for every certain combination (say cno - pname combination). So ... How should i proceed and create a select statement with different parameters declared in the function of type string making it dynamic and returning them using ref cursor?

View 1 Replies View Related

Forms :: Importing Sound Class

Jun 2, 2010

My technical environment is: Win xp, dev9i AS vers9.0.2, Jinit vers1.3.1.9, OracleDB9i.

I created a sound,java file using Oracle9i JDeveloper, I compile it and the result is:

" Compiling...
D:Dev9ijdevWorkspaceWorkspace5soundsrcoracleformsfdSound.java
Successful compilation: 0 errors, 0 warnings."

I deploy sound.java to sound,jar and the deployed process is completed Successfully. I also executed all the configuration steps required to use this class from "Orale9i form builder" and it's ok

The problem is:

When I tried to import "sound" class from "Oracle9i form builder" by clicking

Program----> Import Java Class-----> Oracle.forms.fd.sound
Then an error has occurred:

Importing Class oracle.forms.fd.Sound...
Exception occurred: java.lang.NoClassDefFoundError: oracle/forms/ui/VBean

View 8 Replies View Related

PL/SQL :: Filter Ticket Prices According To Class?

Sep 24, 2013

I need to filter ticket prices according to the class; i.e. 

CASE WHEN booking_class = 'Economy'           THEN economy_saver ELSE 0 END AS ECONOMY_SAVER           THEN economy_basic ELSE 0 END AS ECONOMY_BASIC           THEN economy_basic_plus ELSE 0 END AS ECONOMY_BASIC_PLUSEND, CASE WHEN booking_class = 'Business'           THEN business ELSE 0 END AS BUSINESS           THEN business_flexible ELSE 0 END AS BUSINESS_FLEXIBLEEND.

..The objective is to show only the prices that belong to the selected class. I am not sure if my sql is correct at this point. 

View 7 Replies View Related

JVM :: Download Jar / Java Class From Database

Mar 28, 2013

I have database 10.2.0.3 with one procedure that calls some java class loaded in database. Unfortunately I don't have source code of that java class or whole jar that was loaded into database.I would like to download it from database and try to decompile it.

how can I download some java classes from database? Everything I know is only the name of some java class that is used in one PL/SQL procedure (CREATE OR REPLACE PROCEDURE ..... AS LANGUAGE JAVA).

View 1 Replies View Related

Forms :: Java Class Import In Oracle?

Sep 22, 2013

when I import java class from oracle forms (import java class ->> FFileChooser) appeared FFileChooser package but i don't know how use it how use OPEN_DIALOG or other function .

View 2 Replies View Related

SQL & PL/SQL :: How To Use A Java Class File Into Oracle Code

May 16, 2010

I am using Developer 10g R2. I have a form with two fields named input_value and output_value and a button named ok. I have a java class named Factorial which return the factorial of the input value. Now i want to use this class into pl/sql in ok button.

View 4 Replies View Related

Forms :: Import From Java Class Into Oracle?

Apr 12, 2010

I need to add one validation in one form. The form is not getting run locally because of some imported java classes which was already there. From application server it works fine. When i run locally it gives ORA_JAVA.EXCEPTION_THROWN. Actually some trigger calls a procedure from this imported java class. Some path is specified in JNI.NEW_OBJECT(). That patg may not be in local system. If those files are included in our oracle home directory

View 4 Replies View Related

SQL & PL/SQL :: Invoking Java Class From Oracle Server?

Jun 7, 2013

I need to invoke a JavaMail code from oracle server. Conditions are :

On insertion of a row in a table a TRIGGER is to be run. This trigger would invoke a java code, that shoots an email, with desired credentials and login.

The code to send email, is based on JavaMail API, and is compiled on JVM version, 1.6.

The javaMail code can be loaded in oracle server using:

loadjava -user scott@TESTDB SendMailSSL.class

Another code doscmd.class is written and loaded in oracle, that is compiled in java 1.5. It is intended to call the SendMailSSL.class

import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;

[code].....

Is there a way to invoke SendMailSSL.class, without upgrading the oracle Java version

View 3 Replies View Related

Forms :: Calling Java Class Files From PLSQL?

Jun 19, 2007

I have imported a java class file that inturn gets content from a webservice. One of the functions on that imported class file is as follows ...

Funtion getcontent(A1 JOBJECT,A2 JOBJECT, A3 String) return JOBJECT ....

In my PLSQL package ...How do I invoke this class file ?

So far I have done this ...

Declare
abc ORA_JAVA.JOBJECT;
xyz ORA_JAVA.JOBJECT;
xxx VARCHAR2(25);
value ORA_JAVA.JOBJECT;
BEGIN

[code]...

I am getting an error saying the object type is wrong .... I would like to know how to assign a hardcoded value to the JOBJECT just to test before I continue.

View 20 Replies View Related

Forms :: Adding Image Manipulating Java Class?

Jul 13, 2012

Our system stores images on the unix filesystem. We scan full page images.

Our image specs are:

black and white: tiff, group4 compression, 300dpi. so files are about 40-80k compressed

photograpshs/gray scale: jpeg/jpeg compression 256 gray scale. Some images can be 2megs...but most of them are about 400-700k

We build a demo with forms10G/application server 1 year ago and performance was really bad. Took about 10-15 seconds to generate a report with 1 image of it...compared to about 1-2 secs using forms 6i. We just installed weblogic 11G (10.3.5) with forms 11gr2. I'm guessing performance will still be an issue but we will still be testing it.

Our users currently use nfs to access images on the unix server. So that would not changed.

- read_image from filesystem (c: unc path //server/images/.../1.jpeg)

- zoom in, zoom out (having vertical/hori scroll bars to move around...or best would be panning)

- save_image on filesystem

- fit to window/cancas

- always keeping aspect ratio

nice to have options, but not needed at this time

- save in blobs

- editing capabilities (mostly just select an area to delete, like black borders...some speckles here and there)

View 1 Replies View Related

JVM :: How To Extract Java Class Objects From Oracle Database

Jun 26, 2013

How to Pick / Extract the java class files from the database.? We have not maintained the latest codes in the oracle application server where java class code is residing.

All the Java Classes are available only in database. So we need to pick the latest java class code from production environment. In TOAD we tried but all class objects are listing at the left side but we are unable to take the code. So how can we take the latest codes(java classes) from the Production Database as a backup. 

View 1 Replies View Related

Execute Dynamic SQL Using Both Execute Immediate And Ref Cursor

Jan 8, 2009

We can execute dynamic sql using both execute immediate and ref cursor..But what is the difference between the two and performance-wise which is better?

View 5 Replies View Related

Database Time Spent Waiting % For Event Class Concurrency

Dec 4, 2012

Most of my day to day work involves the support of DB2 on AIX and z/OS. I support the database infrastructure for one business system that runs on the Oracle RDBMS. The application is Oracle Transportation Management. The non-production environments don't get much traffic. If I sign into the TEST or DEV Enterprise Manager DB Control screen, the following warning is almost always listed on the main page:

Metrics "Database Time Spent Waiting (%)" is at 44.00384 for event class "Concurrency"

Enterprise Manager reports that this metric is continuously fluctuating above and below the warning threshold of 30% of db time when the environment is idle.To investigate(and I am no oracle expert, far from it), I ran the following:

SELECT * FROM v$session_event
WHERE WAIT_CLASS='Concurrency'
ORDER BY TOTAL_WAITS DESC;

By far, the top two entries in the result are the following:
SIDEVENTTOTAL_WAITSTIME_WAITEDAVERAGE_WAITMAX_WAIT
124os thread startup12041423733.5218
359os thread startup150653433.5521
[code]...

Does this indicate a possible problem with the operating system?

View 2 Replies View Related

Failed To Load Main-class Manifest Attribute From Apex

Dec 14, 2012

i'm trying to install Oracle Apex Listener but when i try to open the apex.war file is giving me an error:

$ java -jar apex.war

Failed to load Main-class manifest attribute from apex

i see in another topic that if i create a txt file inserting the MainClass: Main-Class that my error will disappear.

i'm using VM with OEL 5

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved