XSQL results differ from SQL Plus
Hello,
I have a view table that contains a CAST(MULTISET( statement. Does anyone know the restrictions placed on this statement? If I copy out the 'select' portion of my view table and paste it into SQL Plus, it works every time without problems. However, if I call my XSQL file from within my browser, I get the following:
<?xml version="1.0" ?>
<ERROR>oracle.xml.sql.OracleXMLSQLException: java.lang.NegativeArraySizeException</ERROR>
Or, it will display most of the data, but leave out some. I don't understand why it returns some of the data but leaves out other relevant data. Following are portions of my scripts:
create or replace type exp_descriptive_t as object (
room_id number(10),
attribute_id number(10),
description VARCHAR2(50),
quantity number(5),
name VARCHAR2(50)
create or replace type exp_descriptive_list as table of exp_descriptive_t;
create or replace type exp_property_t as object (
P_ID NUMBER(10),
.(other columns)
descriptives exp_descriptive_list);
CREATE OR REPLACE VIEW Exp_Property_View of exp_property_t
with object OID (p_id)
AS SELECT
P_ID,
(other columns here),
cast(multiset(select p_attributes.room_id, p_attributes.ATTRIBUTE_ID,a_list.description, p_attributes.quantity, r_list.name
FROM p_attributes, a_list, r_list WHERE p_attributes.p_id = prop.p_id and p_attributes.attribute_id = a_list.attribute_id and p_attributes.room_id = r_list.room_id )as exp_descriptive_list) descriptives,
FROM prop
null
When stuff like that happens to me it's usually because CF
and QA are pointing to different databases.
Similar Messages
-
How to start/stop process flow from sql*plus?
Hi,
i know how to start a process flow via sqlplus_exec_template.sql, but i cannot find any information on how to stop (and rollback) a working flow from sql*plus. Any help would be appreciated.
Greetings
Christoph
Message was edited by:
ctrierweilerHi,
I've had a go.
How should I interpret the results of list_requests:
owner_owr@ORKDEV01> @list_requests
====================
DEPLOYMENTS
====================
Audit ID Status Name Date Owner
2706 READY Deployment Fri Nov 11-NOV-05 10:49:59 OWNER_OWR
11 10:46:37 CET 2
005
====================
DEPLOYMENT UNITS
====================
Audit ID Status Name Date Owner
2707 READY Unit0 11-NOV-05 10:49:59 OWNER_OWR
====================
EXECUTIONS
====================
Er zijn geen rijen geselecteerd.
owner_owr@ORKDEV01>
Whilst a process flow is executing the last query will list executions, all of which have status BUSY:
owner_owr@ORKDEV01> @list_requests
====================
DEPLOYMENTS
====================
Audit ID Status Name Date Owner
2706 READY Deployment Fri Nov 11-NOV-05 10:49:59 OWNER_OWR
11 10:46:37 CET 2
005
====================
DEPLOYMENT UNITS
====================
Audit ID Status Name Date Owner
2707 READY Unit0 11-NOV-05 10:49:59 OWNER_OWR
====================
EXECUTIONS
====================
Audit ID Status Name Date Owner
394512 BUSY PF_ONB01 04-MEI-06 09:11:12 OWNER_OWX
395328 BUSY ONB:FULL_PREPARE 04-MEI-06 09:11:55 OWNER_OWR
395324 BUSY PF_ONB01:ONB 04-MEI-06 09:11:55 OWNER_OWR
owner_owr@ORKDEV01>
As an aside, I will attempt to get rid of the READY deployment and deployment unit using deactive_deployment.sql
Now, if I attempt to use deactivate_execution.sql on any of the executions with status BUSY I get:
owner_owr@ORKDEV01> @deactivate_execution
Voer waarde voor 1 in: 396136
declare
FOUT in regel 1:
.ORA-20003: The object is not in a valid state for the requested operation
ORA-06512: at "OWNER_OWR.WB_RTI_EXCEPTIONS", line 94
ORA-06512: at "OWNER_OWR.WB_RTI_EXECUTION", line 774
ORA-06512: at "OWNER_OWR.WB_RT_EXECUTION", line 90
ORA-06512: at line 4
owner_owr@ORKDEV01>
So all the seems to remain is to use abort_exec_request.sql
This does the job, but the script itself hangs.
I think it has to do with the l_stream_id not being checked again after the initial IF. I think it should probably be part of the loop condition as it is again reset in the do_acks inside the loop.
Cheers & thanks,
Colin -
How to execute procedure returning data rows from sql plus
Hi,
I want to execute a stored procedure that returns data rows from sql plus. please let me know the syntax for the same.
Thanks,
YGuser13065317 wrote:
Even if i get the result set into the cursor, do i have to do normal fetch into all the coumn variables within a loop
But suppose no of columns in my result set varies depending on a parameter to the stored procedure.
Is there any straightforward way to retrieve all the data irrespective of no of columns in the result set.There is no such thing as a "+result set+". Oracle does not create a temporary data set in memory that contains the results of your query. What would happen if this result set is a million rows and is too large to fit into memory? Or there are a 100 clients each with a 100,000 row result set?
This is not scalable. You will be severely limited in the number and sizes of these "+result sets+" that can be created in server memory.
A cursor is in fact a "program" that is created by compiling the SQL source code that you provide. This source code is parsed and compiled into what Oracle calls an execution plan. This is nothing but a series of instructions that the cursor will execute in order to return the rows required.
Thus the result set is actually the output from a cursor (a program). Likewise, bind variables are the input parameters to this program.
All SQLs are parsed and compiled as cursors and stored in the SQL Shared Pool. Oracle gives you handle in return to use to address this cursor - bind values to it, execute it, describe the output structure returned by the cursor, and fetch the output from the cursor.
On the client side, this handle is used in different ways. In PL/SQL alone, this cursor handle can be used as an implicit cursor (you do not even see or use the cursor handle in your PL/SQL code). Or you can use a PL/SQL cursor variable. Or a DBMS_SQL cursor variable. Or a reference cursor variable.
Why so many different client structures for the very same SQL cursor handle returned by Oracle? Because to allow you, the programmer, all kinds of different features and flexibility.
The ref cursor feature is the ability to pass this cursor handle around, not only between PL/SQL code, but also from PL/SQL to the actual client process (Java. VB, SQL*Plus, TOAD, etc).
The primary thing to remember - irrespective of what the client calls this (e.g. ref cursor, SQL statement handle, etc), this all refers to the same SQL cursor in the Shared Pool. And that this SQL cursor is a program that outputs data, and not a result set in itself. -
How to pass table type variable into function from SQL*PLUS ?
How to pass a table type variable from sql*plus prompt into a function ?
Thanx in advance.Krishna,
Do you mean like this?SQL> DECLARE
2 TYPE t_tbl IS TABLE OF VARCHAR2(20);
3 l_sample_tbl t_tbl;
4
5 FUNCTION print_contents ( p_tbl IN t_tbl )
6 RETURN VARCHAR2
7 IS
8 l_string VARCHAR2(1000);
9 BEGIN
10 FOR i IN 1..p_tbl.COUNT LOOP
11 IF (i = 1) THEN
12 l_string := p_tbl(i);
13 ELSE
14 l_string := l_string || ', ' || p_tbl(i);
15 END IF;
16 END LOOP;
17 RETURN (l_string);
18 END print_contents;
19
20 BEGIN
21 l_sample_tbl := t_tbl();
22 l_sample_tbl.EXTEND;
23 l_sample_tbl(1) := 'one';
24 l_sample_tbl.EXTEND;
25 l_sample_tbl(2) := 'two';
26 l_sample_tbl.EXTEND;
27 l_sample_tbl(3) := 'three';
28 l_sample_tbl.EXTEND;
29 l_sample_tbl(4) := 'four';
30 l_sample_tbl.EXTEND;
31 l_sample_tbl(5) := 'five';
32 DBMS_OUTPUT.PUT_LINE(print_contents(l_sample_tbl));
33 END;
34 /
one, two, three, four, five
PL/SQL procedure successfully completed.
SQL> HTH,
T. -
HI,I came to know that direct exit from SQL Plus without Oracle shutdown causes future issues of ORA-0600 kind of errors. Is it true? If yes could u pls suggest me how to shutdown from user "SYSTEM/manager". Bcoz with this am warned that I dont have previleges.
Hello,
HI,I came to know that direct exit from SQL Plus without Oracle shutdown causes future issues of ORA-0600 kind of errors. Is it true?The ORA-00600 is an internal error it can be caused for instance by a Bug, a corruption, ... , and if someday you experience this kind of error, you should open a Service Request to My Oracle Support.
However, I've never heard that exiting sqlplus could cause this kind of error. Where did you get such information ?
how to shutdown from user "SYSTEM/manager". To shutdown the database you should be connected with the User SYS (as SYSDBA). You may use the following statement:
sqlplus /nolog
connect / as sysdba
shutdown immediate;
exitHope this help.
Best regards,
Jean-Valentin -
How to connect from sql*plus to Sql Server
Dear Profs.
How I can connect from sql*plus v8 on my local pc(Win XP) to Sql Server Express 2005 light weight installed in same local pc ?
Thanks,
Ahmed.You'll need to setup heterogeneous services. This is done by creating an init file for the SQL Server db with %ORACLE_HOME%\hs\admin that refers to a DSN for the Sql Server Database. The listener would also need an entry for the SQL Server DB DSN. After that you would create a dblink to SQL Server in your Oracle instance and then could query across the dblink.
-
How to exit from SQL*Plus based on the return value of a SQL select stment?
Hi
I have a SQL script executed from SQL*Plus. I would like to know if SQL*Plus
supports any kind of branching or exiting from script execution based on a
returned value of a SQL select statement. I am on 9i.
Regards,
Tamas Szecsyin sqlplus, you have whenever
ex:
whenever sqlerror exit failure
insert into ...
-- if this fails, then you will be out
insert into ...
-- if this fails, then you will be out
whenever sqlerror continue
insert into ...
-- if this fails, this continues
insert into ...and you have PL/SQL
declare x number;
begin
select count(*) into x from emp;
if (x=14) then null; end if;
end;
/note that you can mix those in some case
-- exit if there is no row in emp
whenever sqlerror exit 1
var dummy number
exec select count(*) into :dummy from emp having count(*)!=0 -
Restricting the user to operate DML's from SQL PLUS Environment
how to Restrict the user to operate DML statements from SQL PLUS Environment.
Once you restrict SCOTT user to not be able to do an INSERT command, the SQL*Plus returns an error for user SCOTT when he tries to execute an INSERT statement.
Note however, that this is enforced by SQL*Plus, not the database!
Look into the use of product_user_profile from Oracle documentation for more information.
SQL> insert into product_user_profile values('SQL*Plus', 'SCOTT', 'INSERT', NULL, NULL, 'DISABLED', NULL, NULL) ;
1 row created.
SQL> commit ;
Commit complete.
SQL> disconnect
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production
SQL>
SQL> connect scott
Enter password:
Connected.
SQL>
SQL> insert into emp select * from emp ;
SP2-0544: invalid command: insert
SQL>
SQL> -
How execute this stored procedure from SQL PLUS???
Hello folks....
Help me please...
I have this procedure....
CREATE OR REPLACE PROCEDURE TEST(COD OUT VARCHAR2, NUM OUT
VARCHAR2, ID OUT VARCHAR2)
AS
BEGIN
END;
SO, I4D LIKE TO EXECUTE IT FROM SQL PLUS::
BUT, I DONT KNOW HOW TO DO..PLEASE SEND ME A SAMPLE..
THANK UThank u man!!!
look, my error before was :
SQL> set serveroutput on
SQL> declare
SQL> cod varchar2(100);
SQL> num varchar2(100);
SQL> id varchar2(100);
SQL> begin
SQL> TEST( cod, num, id );
SQL> EXEC DBMS_OUTPUT.put_line( cod || ' ' || num || ' ' ||
id );
SQL> end;
SQL> /
i put the EXEC....
thank u!!! -
Calling stored proc (with 2 IN and 3 OUT) - from SQL Plus
This is the signature of my stored proc:
CREATE OR REPLACE PROCEDURE myschema.myproc
p_usr_name IN VARCHAR2,
p_send_tmstmp IN DATE,
p_ret_value OUT NUMBER,
p_err_code OUT VARCHAR2
)If I need to call it from sql plus, how do I need to pass the arg?
This is what I am doing
execute myschema.myproc('abc123','02-MAY-2008');
What is wrong here? If someone could help. Thx!Try something like this
var usr_name varchar2(30)
var send_tmstmp varchar2(11)
var ret_value number
var err_code varchar2(10)
begin
:usr_name := 'abc123';
:usr_name := '02-MAY-2008';
myschema.myproc ( p_usr_name => :usr_name,
p_send_tmstmp => TO_DATE( :usr_name, 'DD-MON-YYYY' ),
p_ret_value => :ret_value,
p_err_code => :err_code);
end;
print ret_value;
print err_code; -
How to login as DBA in oracle 9i from sql plus .
how to login as DBA in oracle 9i from sql plus . ???
First you need to check whether your HR schema is still unlocked or not? If it is locked - then you have to unlock it. And, then you can connect the Hr schema.
But, i'm not sure - why you need system to log into the HR schema?
Regards.
Satyaki De. -
Calling a function from sql*plus
I can call my procedure from sql *plus
by doing
sql>call Proc_name(x,y);
How do you call a function?
nullJohn,
I think moifying the statement
CREATE OR REPLACE PROCEDURE "OGUSER"."OGX1" (user_county in integer, user_permit in integer )
TO
CREATE OR REPLACE FUNCTION "OGUSER"."OGX1" (user_county in integer, user_permit in integer ) return NUMBER is
AND before end you will have to add a return statement
(Probably
return 0;
exception
when others then
return 1;
end;
This will change your procedure to a function but I am not sure you'll be able to see your dbms_output's, if you call the function using select ...
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by john saucer ([email protected]):
I want to turn my procedure into a function.
So I can call it with a select statement.
I'm kind of having problems with the return statement at the top and bottom.
I don't quite understand how to declare the type in the return. My procedure calculates 2 pl/sql tables....
My procedure looks like.
CREATE OR REPLACE PROCEDURE "OGUSER"."OGX1" (user_county in integer, user_permit in integer )
as
i integer :=0;
j integer :=0;
type dept_table_type is table of ogxtest%rowtype
index by binary_integer;
type dept2_table_type is table of ogxtest%rowtype
index by binary_integer;
my_dept_table dept_table_type;
my_dept2_table dept2_table_type;
v_cotemp number := user_county;
v_permittemp number := user_permit;
v_origcotemp number := user_county;
v_origpermittemp number := user_permit;
v_count number(2) :=1;
v_count2 number(2) := 1;
v_oldcount number(2) :=1;
v_oldcount2 number(2) := 1;
begin
select count(*) into v_count from ogxtest where oco=v_cotemp and opermit=v_permittemp;
select count(*) into v_oldcount from ogxtest where nco=v_cotemp and npermit=v_permittemp;
while v_count >= 1 LOOP
i := i+1;
v_count2 := v_count2 +1;
select *
into my_dept_table(i)
from ogxtest where oco=v_cotemp and opermit=v_permittemp;
v_cotemp := my_dept_table(i).nco;
v_permittemp := my_dept_table(i).npermit;
select count(*) into v_count from ogxtest where oco=v_cotemp and opermit=v_permittemp;
end loop;
while v_oldcount >= 1 LOOP
j := j+1;
v_oldcount2 := v_oldcount2 +1;
select *
into my_dept2_table(j)
from ogxtest where nco=v_origcotemp and npermit=v_origpermittemp;
v_origcotemp := my_dept2_table(j).oco;
v_origpermittemp := my_dept2_table(j).opermit;
select count(*) into v_oldcount from ogxtest where nco=v_origcotemp and npermit=v_origpermittemp;
end loop;
for i in 1..v_count2-1
loop
dbms_output.put_line(' reassigned to - orig county ' | |my_dept_table(i).oco | | ' orig permit ' | |my_dept_table(i).opermit| | ' new county ' | |
my_dept_table(i).nco | | ' new permit ' | |my_dept_table(i).npermit );
end loop;
for j in 1..v_oldcount2-1
loop
dbms_output.put_line(' reassigned from - orig county ' | |my_dept2_table(j).oco | | ' orig permit ' | |my_dept2_table(j).opermit| | ' new county ' | |
my_dept2_table(j).nco | | ' new permit ' | |my_dept2_table(j).npermit );
end loop;
end;
<HR></BLOCKQUOTE>
null -
Windows service does not stop when DB is shutdown from SQL*Plus
I have a 11g XE DB in a Windows 7 machine.
The installation has created a Windows service called OracleServiceXE. It's status is STARTED.
I then login to SQLPLUS as sysdba and do a shutdown immediate;
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
Problem is, when I refresh the services, the OracleServiceXE is still showing as STARTED.
If I use the listener control to stop the listener the Windows service OracleXETNSListener changes status to BLANK.
Why is this?tvCa-Oracle wrote:
That service is a prerequisite Windows service to be able to start the database, but it is not the status of the database itself.
When you do start the database, he may or may not start the service automatically (not sure there), but it is a needed service, for each database SID, on Windows.
If you want to know what it is, open Task Manager or Process Explorer, only start the service (not the database), and see which OS process is launched.
AFAIK, this is only on Windows, there's no comparable component on Linux/Unix for this.
The Windows service OracleServiceXE has c:\app\oracle\product\11.2.0\server\bin\ORACLE.EXE XE as the Parth to executable.
If I click on the Services tab in Task manager, then right-click the OracleServiceXE and click Go to process, it show the oracle.exe in the processes tab.
If stop it, the service, from the Windows service control, the oracle.exe disappears and we cannot login to the DB.
If we start the service from the windows service control, the oradim.exe appears, then a second later the oracle.exe appears. Once the DB status of the Windows service is STARTED, the oradim.exe disappears.
So, I can start and stop the oracle DB with the Windows service. But If I stop the DB from sql*plus the the service is not stopped.... -
Execute a mapping deployed with OWB 9.0.4 from SQL*Plus
Hello,
I could execute a mapping designed with OWB 9.0.3 from SQL*Plus with the next sentence:
SQL> exec my_mapping.main;
But now, with OWB 9.0.4, mappings are deployed as functions (in 9.0.3 were deployed as procedures) and they need parameters.
Somebody know how I can execute deployed mappings with OWB 9.0.4 from SQL*Plus? I don't know the parameters I need to call a mapping.
Thanks in advance,
Pedro.Well, I've solved the problem with roles but
I've executed the script called sqlplus_exec_template.sql and it fails at Stage 2 because the next sentence
l_audit_execution_id := wb_rt_api_exec.open(l_task_type, l_task_name, l_location_name);
returns me NULL.
It is not clear the value that the variable called l_location_name have to stored. The script explain that this variable store the physical name of the
location to which the task was deployed. I understand that this variable have to store the schema where the mapping was deployed. That's right?
So I called the script in this manner:
SQL> @sqlplus_exec_template OWBRUN904I OJBHT PLSQL MY_MAPPING "," "," ;
where OWBRUN904I is the name of the Runtime Repository Schema, OJBHT is the
schema where MY_MAPPING is deployed, PLSQL is the task type and MY_MAPPING is
the name of the mapping I've designed.
Can you tell me why the scripts fails?
Regards,
Pedro -
How to use 10g's SQL tuning support from SQL*Plus
Hi,
I am having problems with my application's SQL queries execution time. I am not tuning guru, I know pretty little about tuning. As I read 10g has a SQL Tuning Advisor. Can I use it from SQL*Plus? I didn't say, but do not have the possibility to access the database, by no other means only SQL*Plus.
TIA
Regards,
Tamas SzecsyIf you have granted the ADVISOR privilege you may use it from SQL*PLUS
Look for examples on the web
(using DBMS_SQLTUNE package)
Maybe you are looking for
-
How to use Sharepoint Modal Popup loader in Sharepoint-Hosted Apps
Hi, I have a requirement to use a modal popup as loader in SharePoint-Hosted Apps. I have used this like following- SP.UI.ModalDialog.showWaitScreenWithNoClose( 'Please Wait', 'while we retrieve...', '400', '600'); But it does not work if we have "SP
-
Hint on resizing components with the window
Hi, I'm making a web browser and am having a bit of trouble getting the componenets inside ( a JSpliPane with various bits in it) and the top buttons to resize with the main frame when it is resized. At the moment it all stays in the top left at the
-
Error - "No Response From Server" when publishing.
Upload hangs up at random points. Seems to be whith larger files. website www.tcs-pub-and-grub.com
-
We have one Macbook Pro user here who is on our Windows AD network (using his own machine unfortunately) but experiencing problems. We have reserved an IP address to facilitate internet access\firewall rules, however whenever the user initiates any p
-
Error in Batch Specific Unit of Measure
Dear Friends, I am maintaining Batch Specific Unit of Measure with Usage as Product Unit for a Raw Material. Base Unit of Measure : NOS PO Unit : KG Batch Specific Unit of Measure : KGP (KG Per Piece) When I am doing GRN, I am entering Quantity in Un