How do I CANCEL a quey in SQL Worksheet?
For some reason, I keep getting errors right now while attemping a search for this, SO, does ANYONE know how to cancel out a query in the middle of the operation?
Ex. In SQLPLUS, I can do a 'select * from table' on a 1 million row table (just an example). IF the query appears to 'hang' or the output is to long, I can always <ctrl>C and the operation terminates early.
How do I do this in SQLWorksheet?
Hi Freydja13!
So that the Community can help you better, we will need to know what model printer you are working with.
Any other details you'd like to give will only help the Community better understand your issue!
If this is an urgent support need, please CLICK HERE to reach our friendly Technical Support Team by phone or email.
Thanks and have a great day!
Similar Messages
-
Execute a function in SQL Worksheet
How can I execute a function in SQL Worksheet.
The function takes in two parameters of type varchar2 and returns a boolean.
the syntax is:
set serveroutput on
VARIABLE x BOOLEAN;
EXECUTE :x := check_number('78','A');
PRINT x ;
my error is:
SP2-0552: Bind variable "X" not declared.
I have also tried:
set serveroutput on
select check_number('78','A')
from dual;
my error is:
ERROR at line 1:
ORA-06552: PL/SQL: Statement ignored
ORA-06553: PLS-382: expression is of wrong type
thanks.You could even cut out the variable:
SQL> CREATE OR REPLACE FUNCTION is_true
2 ( p1 VARCHAR2
3 , p2 VARCHAR2 )
4 RETURN BOOLEAN
5 AS
6 BEGIN
7 RETURN p1 = p2;
8 END is_true;
9 /
Function created.
SQL> exec dbms_output.put_line(sys.diutil.bool_to_int(IS_TRUE('x','y')))
0
PL/SQL procedure successfully completed.
SQL> exec dbms_output.put_line(sys.diutil.bool_to_int(IS_TRUE('x','x')))
1
PL/SQL procedure successfully completed. -
Auto commit in JDeveloper SQL Worksheet
Can anybody tell me how to turn OFF the autocommit in SQL Worksheet withing JDeveloper,
Many Thanks in advance,
IanI'm afraid you can't - That's just the way it works at the moment.
-
How do I cancel a rman job from command line?
Hello to all,
I am having some problems with a rman job that is running via OEM-GC. I get an error message regading the SPFILE and control file being locked due to another job accessing it. I found this in the RMAN ref guide:
To determine which job is holding the conflicting enqueue:
1. After you see the first RMAN-08512: waiting for snapshot controlfile enqueue message, start a new SQL*Plus session on the target database:
% sqlplus sys/sys_pwd@prod1
2. Execute the following query to determine which job is causing the wait:
SELECT s.sid, username AS "User", program, module, action, logon_time "Logon", l.*
FROM v$session s, v$enqueue_lock l
WHERE l.sid = s.sid and l.type = 'CF' AND l.id1 = 0 and l.id2 = 2;
You should see output similar to the following (the output in this example has been truncated):
SID User Program Module Action Logon
9 SYS rman@h13 (TNS V1-V3) backup full datafile: c1 0000210 STARTED 21-JUN-99
Solution
After you have determined which job is creating the enqueue, you can do one of the following:
* Wait until the job creating the enqueue completes
* Cancel the current job and restart it once the job creating the enqueue completes
* Cancel the job creating the enqueue
So with this in mind; How do I cancel the job from RMAN command line!!!
This is my output by the way:
SID User PROGRAM MODULE ACTION Logon ADDR KADDR SID TY ID1 ID2 LMODE REQUEST CTIME BLOCK
475 SYS [email protected] (TNS V1-V3) backup full datafile 0000018 STARTED16 23-APR-09 00000023EB8D488 000000023EB8D4A8
475 CF 0 2 4 0 113123 0
Any help will be gratefully received
Thanks to all that replyI used the following to get the spid and killed the process on the OS.
set linesize 120
col sid for 999
col username for a14 trunc
col osuser for a18 trunc
col spid for 99990
col logon_time for a12
col status for a9 trunc
col machine for a26 trunc
col running for a10 trunc
select s.sid
, s.username
, s.osuser
, s.machine
, s.status
, p.spid spid
, to_char( logon_time, 'Mon dd@hh24:mi') logon_time
, rtrim (s.module)||decode( nvl(length( rtrim(s.module)),0),0,'',' ')|| upper(s.program) running
from v$session s
, v$process p
where ( p.addr = s.paddr ) and s.type!='BACKGROUND'
and upper(s.program) not like '%CJQ0%' and s.program is not null and s.username is not null
order by s.sid; -
How to print a something in oracle sql developer
Hello all
Do you know How to print a something in oracle sql developer? i mean for example in the query we write something, (offcourse i dont mean comments)
thank u in advance.
best1003209 wrote:
Hello all
Do you know How to print a something in oracle sql developer? i mean for example in the query we write something, (offcourse i dont mean comments)
thank u in advance.
bestDBMS_OUTPUT() -
How can I cancel the "Recreate All Virtual Dekstops" for a pooled collection in 2012 R2?
I currently have a system single-server installation of VDI, using 2012 R2 Standard as the server, using pooled collections of Windows 8.1. In general, everything works very well, but I've been searching in vain for ONE command. When
I make a change to the master template in Hyper-V, Checkpoint it, then go into the Remote Desktop Services, go the appropriate collection and initiate a "Recreate All Virtual Desktops", how would I cancel that?
It's happened on more than one occasion, where I make a change or an update to the template, and then push out the 25 new Virtual Desktops, and then the client comes back asking for a "little" change....but I'm stuck pushing it out until
all 25 desktops have been recreated. There must be a way to interrupt this process (probably leaving a few VM Desktops in an unstable state...which I don't care too much about as it's a pooled collection), update the template, and push it out again with
the "Recreate All Virtual Desktops". I do have the concurrency set so it recreates 5 at a time, but that noticeably impacts the users, and I don't want to just push out all 25 at a pop and interrupt everyone's work. Any ideas?
JHi,
Have you tried Stop-RDVirtualDesktopCollectionJob ? Something like below:
Import-Module RemoteDesktop
Stop-RDVirtualDesktopCollectionJob -CollectionName "PooledCollectionName" -ConnectionBroker "broker.yourdomain.com"
-TP -
How do i cancel my apple id and use the other one
How do i cancel my first apple id and use my other one
What, exactly, are you trying to do?
~Lyssa -
How to execute procedure in SQL Worksheet ?
Hi, anybody know, how I can execute procedure here?
I try EXEC sec_roles, EXEC security_admin.sec_roles, EXECUTE - there is a SQL statement error. When I use CALL - there is no such procedure (I have execute previleges).
Although in SQLPlus EXEC works, but there are problems with standard SQL commands (all of them returns "2" no matter what content is).
Any ideas?
Regards
Krzysztofexec procedure(parameters) is a sql plus (and a few others) shortcut for
BEGIN
procedure(parameters);
END;So try that then pressing/clicking whatever it is in sql worksheet that makes a statement run.
Note that if your procedure has parameters defined as OUT or IN OUT, you will need to supply a variable to accept the returned value(s).
John -
How to pass a structure in PL/SQL external proc.
This is for educational purpose only. I am trying to implement kernel32.dll and shell32.dll in PL/SQL using external proc. Everything is working fine, except When there is a structure in OUT parameter.
My database version.
SQL> SELECT * FROM v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - ProductionI have set up the listner.ora and tnsnames.ora and written a package called dbms_kernel32sb.
There are 9 program units.
1. CreateFile -- working fine
2. CloseFile -- working fine
3. GetSize -- working fine
4. FindFirstFile -- NOT working, because one OUT parameter has the structure type WIN32_FIND_DATA.
5. GetFileTime -- NOT working, because one OUT parameter has the structure type FILETIME
6. GetDiskFreeSpace -- working fine
7. GetDriveType -- working fine.
8. GetLastError -- working fine
9. ExecuteCommand -- working fine.
Here is the package specification:
CREATE OR REPLACE PACKAGE dbms_kernel32sb AS
Name: dbms_kernel32sb.pks
Author: Saubhik Banerjee
Date: 24th Jan 2011
Version: 1.0
Comment: This package is to implement some functionality from kernel32.dll.
Usng extproc
OPEN_EXISTING_FILE CONSTANT PLS_INTEGER :=3;
FILE_ATTRIBUTE_NORMAL CONSTANT PLS_INTEGER :=128;
DISABLE_FILE_SHARE_MODE CONSTANT PLS_INTEGER :=0;
NO_FILE_SECURITY_ATTRIBUTE CONSTANT PLS_INTEGER :=0;
NO_TEMPLATE_FILE CONSTANT PLS_INTEGER :=0;
GENERIC_FILE_ACCESS CONSTANT PLS_INTEGER :=0;
FILE_SIZE_HIGH CONSTANT PLS_INTEGER :=400000000;
EXECUTE_FILE CONSTANT VARCHAR2(4):='open';
PRINT_FILE CONSTANT VARCHAR2(5):='print';
NO_PARAMATER CONSTANT VARCHAR2(2):=' ';
FUNCTION CreateFile(pi_FileName VARCHAR2 --1, File name
,pi_DesiredAccess BINARY_INTEGER --2, Type of access required (read/write ect)
,pi_ShareMode BINARY_INTEGER --3, share mode
,pi_SecurityAttributes BINARY_INTEGER --4, securoty attribute
,pi_CreationDisposition BINARY_INTEGER --5, open existing, create new etc
,pi_FlagsAndAttributes BINARY_INTEGER --6, File attribute- normal
,pi_TemplateFile BINARY_INTEGER) --Not required.
Return BINARY_INTEGER;
FUNCTION CloseFile (pi_FileHandle BINARY_INTEGER)
Return BINARY_INTEGER;
FUNCTION GetSize (pi_FileHandle BINARY_INTEGER,
pio_FileSizeHigh IN OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;
FUNCTION FindFirstFile ( pi_FileName VARCHAR2
,pio_Win32_Find_data OUT
WIN32_FIND_DATA
RETURN BINARY_INTEGER;
FUNCTION GetFileTime ( pi_FileHandle BINARY_INTEGER
,pio_FileCreationTime IN OUT FILETIME
,pio_LastAccessTime IN OUT FILETIME
,pio_LastWriteTime IN OUT FILETIME
RETURN BINARY_INTEGER;
FUNCTION GetDiskFreeSpace ( pi_RootPathName VARCHAR2
,pio_SectorsPerCluster OUT BINARY_INTEGER
,pio_BytesPerSector OUT BINARY_INTEGER
,pio_NumberOfFreeClusters OUT BINARY_INTEGER
,pio_TotalNumberOfClusters OUT BINARY_INTEGER
RETURN BINARY_INTEGER;
FUNCTION GetDriveType( pi_driveLetter VARCHAR2) RETURN VARCHAR2;
FUNCTION GetLastError RETURN BINARY_INTEGER;
FUNCTION ExecuteCommand ( pi_OperationType VARCHAR2
,pi_FileName VARCHAR2
,pi_Parameters VARCHAR2
,pi_DefaultDirectory VARCHAR2
RETURN VARCHAR2;
END dbms_kernel32sb;
Here is the package body:
CREATE OR REPLACE PACKAGE BODY dbms_kernel32sb AS
/* Name: dbms_kernel32sb.pkb
Author: Saubhik Banerjee
Date: 24th Jan 2011
Version: 1.0
Comment: This package is to implement some functionality from kernel32.dll.
Usng extproc
FUNCTION
CreateFile( pi_FileName VARCHAR2 --1
, pi_DesiredAccess BINARY_INTEGER --2
, pi_ShareMode BINARY_INTEGER --3
, pi_SecurityAttributes BINARY_INTEGER --4
, pi_CreationDisposition BINARY_INTEGER --5
, pi_FlagsAndAttributes BINARY_INTEGER --6
, pi_TemplateFile BINARY_INTEGER) --7
Return BINARY_INTEGER IS EXTERNAL LIBRARY kernel32 Name "CreateFileA"
PARAMETERS( pi_FileName STRING
, pi_DesiredAccess long
, pi_ShareMode long
, pi_SecurityAttributes long
, pi_CreationDisposition long
, pi_FlagsAndAttributes long
, pi_TemplateFile long
, return long);
FUNCTION CloseFile (pi_FileHandle BINARY_INTEGER)
Return BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 Name "CloseHandle"
PARAMETERS (pi_FileHandle long, return long);
FUNCTION GetSize (pi_FileHandle BINARY_INTEGER,
pio_FileSizeHigh IN OUT BINARY_INTEGER)
RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "GetFileSize"
PARAMETERS (pi_FileHandle long, pio_FileSizeHigh long, return long );
FUNCTION GetFileTime ( pi_FileHandle BINARY_INTEGER
,pio_FileCreationTime IN OUT FILETIME
,pio_LastAccessTime IN OUT FILETIME
,pio_LastWriteTime IN OUT FILETIME
RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "GetFileTime"
WITH CONTEXT
PARAMETERS ( CONTEXT,
pi_FileHandle long
, pio_FileCreationTime OCIColl
, pio_FileCreationTime INDICATOR SHORT
, pio_LastAccessTime OCIColl
, pio_LastAccessTime INDICATOR SHORT
, pio_LastWriteTime OCIColl
, pio_LastWriteTime INDICATOR SHORT
, return long );
FUNCTION FindFirstFile ( pi_FileName VARCHAR2
,pio_Win32_Find_data OUT
WIN32_FIND_DATA
RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "FindFirstFileA"
--WITH CONTEXT
PARAMETERS
( --CONTEXT,
pi_FileName STRING--, pi_FileName INDICATOR SHORT
, pio_Win32_Find_data BY REFERENCE OCIColl--,pio_Win32_Find_data INDICATOR long
, return long );
FUNCTION GetDiskFreeSpace ( pi_RootPathName VARCHAR2
,pio_SectorsPerCluster OUT BINARY_INTEGER
,pio_BytesPerSector OUT BINARY_INTEGER
,pio_NumberOfFreeClusters OUT BINARY_INTEGER
,pio_TotalNumberOfClusters OUT BINARY_INTEGER
RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "GetDiskFreeSpaceA"
PARAMETERS ( pi_RootPathName STRING
, pio_SectorsPerCluster BY REFERENCE long
, pio_BytesPerSector BY REFERENCE long
, pio_NumberOfFreeClusters BY REFERENCE long
, pio_TotalNumberOfClusters BY REFERENCE long
, return long );
FUNCTION GetDriveTypeA( pi_driveLetter VARCHAR2) RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "GetDriveTypeA"
PARAMETERS (pi_driveLetter STRING, RETURN long);
FUNCTION GetDriveType( pi_driveLetter VARCHAR2) RETURN VARCHAR2 IS
BEGIN
CASE GetDriveTypeA(pi_driveLetter)
WHEN 2 THEN RETURN 'Removable';
WHEN 3 THEN RETURN 'Drive Fixed';
WHEN 4 THEN RETURN 'Remote';
WHEN 5 THEN RETURN 'Cd-Rom';
WHEN 6 THEN RETURN 'Ram disk';
ELSE RETURN 'Unrecognized';
END CASE;
END;
FUNCTION GetLastError RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "GetLastError"
PARAMETERS (return long);
FUNCTION ShellExecute( pi_Hwnd BINARY_INTEGER
,pi_Operation VARCHAR2
,pi_FileName VARCHAR2
,pi_Parameters VARCHAR2
,pi_DefaultDirectory VARCHAR2
,pi_ShowCmd BINARY_INTEGER
) RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY SHELL32 NAME "ShellExecuteA"
PARAMETERS (pi_Hwnd long,pi_Operation STRING,pi_FileName STRING
,pi_Parameters STRING,pi_DefaultDirectory STRING
,pi_ShowCmd long, return long
FUNCTION ExecuteCommand ( pi_OperationType VARCHAR2
,pi_FileName VARCHAR2
,pi_Parameters VARCHAR2
,pi_DefaultDirectory VARCHAR2
RETURN VARCHAR2 IS
v_return_val BINARY_INTEGER;
BEGIN
v_return_val:= ShellExecute(0,pi_OperationType
,pi_FileName,pi_Parameters
,pi_DefaultDirectory,0
IF v_return_val <=32 THEN
RETURN 'Error!';
ELSE RETURN 'Success!';
END IF;
END;
END dbms_kernel32sb;
Now the working demos:
SQL> SET SERVEROUT ON
SQL> /* Demo I:- How to obtain file size */
SQL> DECLARE
2 v_FileSize BINARY_INTEGER;
3 v_FileSizeHigh PLS_INTEGER;
4 v_FileHandle BINARY_INTEGER;
5 v_filename VARCHAR2(500) :='C:\test2.csv';
6 v_dummy BINARY_INTEGER;
7 BEGIN
8 v_FileSizeHigh := DBMS_KERNEL32SB.FILE_SIZE_HIGH;
9 v_FileHandle:=DBMS_KERNEL32SB.CreateFile(v_filename -- File name
10 ,DBMS_KERNEL32SB.GENERIC_FILE_ACCESS
11 ,DBMS_KERNEL32SB.DISABLE_FILE_SHARE_MODE
12 ,DBMS_KERNEL32SB.NO_FILE_SECURITY_ATTRIBUT
13 ,DBMS_KERNEL32SB.OPEN_EXISTING_FILE
14 ,DBMS_KERNEL32SB.FILE_ATTRIBUTE_NORMAL
15 ,DBMS_KERNEL32SB.NO_TEMPLATE_FILE);
16 v_FileSize := DBMS_KERNEL32SB.Getsize(v_FileHandle, v_FileSizeHigh)
17 DBMS_OUTPUT.put_line('File Size in Bytes: ' ||v_FileSize);
18 v_dummy:=DBMS_KERNEL32SB.CloseFile(v_FileHandle);
19 END;
20 /
File Size in Bytes: 61
PL/SQL procedure successfully completed.
SQL>
SQL> /* Demo II:- How to find free disk space */
SQL> DECLARE
2 v_rootpath VARCHAR2(500) :='C:\';
3 v_dummy BINARY_INTEGER;
4 v_sectorspercluster BINARY_INTEGER;
5 v_bytespersector BINARY_INTEGER;
6 v_numberoffreeclusters BINARY_INTEGER;
7 v_totalnumberofclusters BINARY_INTEGER;
8 v_freespace NUMBER;
9 v_totalspace NUMBER;
10 BEGIN
11 v_dummy:=DBMS_KERNEL32SB.GetDiskFreeSpace(v_rootpath
12 ,v_sectorspercluster
13 ,v_bytespersector
14 ,v_numberoffreeclusters
15 ,v_totalnumberofclusters
16 );
17
18 DBMS_OUTPUT.put_line('Sector pre Cluster: ' ||v_sectorspercluster);
19 DBMS_OUTPUT.put_line('Bytes per sector: ' ||v_bytespersector);
20 DBMS_OUTPUT.put_line('Number Of Free Clusters: ' ||v_numberoffreeclusters);
21 DBMS_OUTPUT.put_line('Total Number Of Clusters: ' ||v_totalnumberofclusters);
22 v_freespace:=v_numberoffreeclusters/1024/1024/1024;
23 v_freespace:=ROUND(v_freespace*v_sectorspercluster*v_bytespersector,3);
24 v_totalspace:=v_totalnumberofclusters/1024/1024/1024;
25 v_totalspace:=ROUND(v_totalspace*v_sectorspercluster*v_bytespersector,3);
26 DBMS_OUTPUT.put_line('Total Space (GB):' ||v_totalspace);
27 DBMS_OUTPUT.put_line('Total number of Free space (GB): '||v_freespace );
28 END;
29 /
Sector pre Cluster: 8
Bytes per sector: 512
Number Of Free Clusters: 739477
Total Number Of Clusters: 9765622
Total Space (GB):37.253
Total number of Free space (GB): 2.821
PL/SQL procedure successfully completed.
SQL>
SQL> /* Demo IV:- How to get drive type*/
SQL> SELECT dbms_kernel32sb.GetDriveType('C:\') FROM dual;
DBMS_KERNEL32SB.GETDRIVETYPE('C:\')
Drive Fixed
SQL> SELECT dbms_kernel32sb.GetDriveType('D:\') FROM dual;
DBMS_KERNEL32SB.GETDRIVETYPE('D:\')
Cd-Rom
SQL> SELECT dbms_kernel32sb.GetDriveType('E:\') FROM dual;
DBMS_KERNEL32SB.GETDRIVETYPE('E:\')
Unrecognized
SQL>
SQL> /* Demo V:- How to execute an Operating System Command*/
SQL> DECLARE
2 v_FileToExecute VARCHAR2(20):='test.bat';
3 v_Parameter VARCHAR2(20):='test1.csv';--dbms_kernel32sb.NO_PARAMATER
4 v_DefaultDirectory VARCHAR2(20):='C:\';
5 v_ReturnValue VARCHAR2(20);
6 BEGIN
7 v_ReturnValue:=dbms_kernel32sb.ExecuteCommand(dbms_kernel32sb.EXECUTE_FILE
8 ,v_FileToExecute
9 ,v_Parameter
10 ,v_DefaultDirectory
11 );
12 DBMS_OUTPUT.put_line('Status: '||v_ReturnValue);
13 END;
14 /
Status: Success!
PL/SQL procedure successfully completed.
SQL> Now the sub programs with structures are NOT getting called successfully.
SQL> /* Demo III:- How to obtain file time */
SQL> DECLARE
2 v_FileHandle BINARY_INTEGER;
3 v_filename VARCHAR2(500) :='C:\test2.csv';
4 v_dummy BINARY_INTEGER;
5 v_filecreationtime FILETIME;
6 v_lastaccesstime FILETIME;
7 v_lastwritetime FILETIME;
8 v_err BINARY_INTEGER;
9 BEGIN
10 v_FileHandle:=DBMS_KERNEL32SB.CreateFile(v_filename -- File name
11 ,DBMS_KERNEL32SB.GENERIC_FILE_ACCESS
12 ,DBMS_KERNEL32SB.DISABLE_FILE_SHARE_MODE
13 ,DBMS_KERNEL32SB.NO_FILE_SECURITY_ATTRIBUTE
14 ,DBMS_KERNEL32SB.OPEN_EXISTING_FILE
15 ,DBMS_KERNEL32SB.FILE_ATTRIBUTE_NORMAL
16 ,DBMS_KERNEL32SB.NO_TEMPLATE_FILE);
17 v_dummy := DBMS_KERNEL32SB.GetFileTime( v_FileHandle
18 ,v_filecreationtime
19 ,v_lastaccesstime
20 ,v_lastwritetime
21 );
22 v_err:=DBMS_KERNEL32SB.GetLastError;
23 DBMS_OUTPUT.put_line('File Size in Bytes: ' ||v_dummy);
24 DBMS_OUTPUT.put_line('Error:'||v_err);
25 v_dummy:=DBMS_KERNEL32SB.CloseFile(v_FileHandle);
26 END;
27 /
File Size in Bytes: 0
Error:203
PL/SQL procedure successfully completed.
SQL> So, I have noticed that, Where ever a STRUCTURE is involved in external routine, there is a problem. I want to know, How to implement functions with STRUCTURE as OUT parameter.
Forgot to mention: This is my FILETIME object which corresponds to FILETIME structure of win32.
CREATE OR REPLACE TYPE FILETIME_rec IS OBJECT
( LowDateTime NUMBER
,HighDateTime NUMBER
CREATE OR REPLACE TYPE FILETIME IS TABLE OF FILETIME_rec;Edited by: Saubhik on Feb 1, 2011 4:15 PMSaubhik wrote:
This is for educational purpose only. I am trying to implement kernel32.dll and shell32.dll in PL/SQL using external proc. Interesting. Familiar with the Wn32 API, but do not run Oracle on Windows and never looked at this aspect of integration.
So, I have noticed that, Where ever a STRUCTURE is involved in external routine, there is a problem. I want to know, How to implement functions with STRUCTURE as OUT parameter.
Forgot to mention: This is my FILETIME object which corresponds to FILETIME structure of win32.The problem is that this passes the parameter by reference and not value. In a vanilla C/C++/Delphi program, you will create a variable of that struct and then pass a long pointer to that variable when making the API call. That pointer will be dereferenced and the memory it points to, populated. This is not a problem as the underlying DLL you call that does this, uses your process's data segment.
Extproc is different. In order to protect the integrity of the database server process, an external call is done by a "proxy" process. It acts as the interface between your PL/SQL code and the actual external call.
In this case, this "proxy" process will be doing the implicit LoadLibrary() call to load kernel32.dll interface - and the DLL will expect to dereference and access this process's memory struct to populate it. This "proxy" process in turn needs to know that despite it calling the interface by reference, it needs to return that parameter to PL/SQL by value - as your PL/SQL code cannot dereference a pointer passed back by that "proxy" process and access its memory to gain access to that struct.
In basic terms - that argument is a 32 bit number containing a pointer. That is what the "proxy" process needs to pass to the interface call. Your code is passing a struct and not a pointer, right?
And that is the basic problem I believe. How to address this.. not sure. You can have your own DLL as interface that does not use pointers but expect arguments to be passed by value. But this will suck as you then need to include a custom DLL to deploy and have PL/SQL call that, instead of simply accessing and calling the native kernel interface.
Doubt that many Win32 programmers with OCI (Oracle Call Interface) frequents this forum. So perhaps this is not the best place to ask. I would be hitting Metalink (support.oracle.com) search function in your sho3s though as there should be support notes dealing with this subject matter. -
How to check Cancelled invoices
Hi Gurus,
Can anybody please let me know how to check cancelled invoices in costing. Also please let me know the importance of VBRP table in costing. Thanks.
Regards,
S.Sumana.HI
VBRK-FKSTO field can be used to check the cancelled invoices,
If you mark this field as X then you can get the list
Thanks
Prashant -
How to pass a col of pl/sql tab to a parametrized cursor?
Hi,
I'm getting this error constantly:
Error on line 1
declare
j number :=1;
cursor f
ORA-06550: line 9, column 20:
PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table LONG_ double ref
char time timestamp interval date binary national character
nchar
Code Snippet:
declare
j number :=1;
cursor firstquery (c_item in varchar2) is
SELECT SEARCH, NAME, ID FROM tablename
WHERE name LIKE c_item;
first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;
first_rec_tbl first_rec_tbl_type;
type act_str_tbl_type is table of varchar2(50) index by binary_integer;
act_put_str_tbl act_str_tbl_type;
begin
this is executing fine as i have executed it as a standalone script also
act_put_str_tbl table has values here.passing these to below:
----------------------------------- i guess the problem lies here------------------------
begin
dbms_output.put_line('reached second begin');
For i in act_put_str_tbl.first..act_put_str_tbl.last
loop
dbms_output.put_line('inside loop of second begin');
open firstquery(act_put_str_tbl(i));
loop
fetch firstquery into first_rec_tbl(j);
j:=j+1;
exit when firstquery%notfound or firstquery is null;
end loop;
close firstquery;
end loop;
How to use parametrized cursor with PL/SQL table, any help is appreciated in the above snippet.
ThanksSatyaki_De wrote:
first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;Create this type in side any package like ->
create or replace package patch_array
is
first_rec_tbl_type is table of firstquery%rowtype index by pls_integer;
end;But, you have to use explicit record type instead of firstquery%rowtype here.
And, then refer this type inside your parametrized cursor to use that properly, that might solve your current problem - i guess.
So, you cursor should look something like this ->
cursor firstquery (c_item in patch_array.first_rec_tbl_type)
is
SELECT SEARCH, NAME, ID
FROM tablename
WHERE name LIKE c_item; N.B.:Not Tested...
Regards.
Satyaki De.
Edited by: Satyaki_De on Dec 28, 2008 1:32 AM??? No package is needed:
SQL> declare
2 j number := 1;
3 cursor firstquery(
4 c_item in varchar2
5 )
6 is
7 SELECT ename,
8 sal
9 FROM emp
10 WHERE ename LIKE c_item;
11 type first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;
12 first_rec_tbl first_rec_tbl_type;
13 type act_str_tbl_type is table of varchar2(50) index by binary_integer;
14 act_put_str_tbl act_str_tbl_type;
15 begin
16 act_put_str_tbl(1) := 'S%';
17 act_put_str_tbl(2) := '%L%';
18 act_put_str_tbl(3) := 'KING';
19 begin
20 dbms_output.put_line('reached second begin');
21 For i in 1..nvl(act_put_str_tbl.count,0) loop
22 dbms_output.put_line('inside loop of second begin');
23 dbms_output.put_line('act_put_str_tbl(' || i || ') = ' || act_put_str_tbl(i));
24 open firstquery(act_put_str_tbl(i));
25 loop
26 fetch firstquery into first_rec_tbl(j);
27 exit when firstquery%notfound;
28 dbms_output.put_line('first_rec_tbl(' || j || ').ename = ' || first_rec_tbl(j).enam
e);
29 dbms_output.put_line('first_rec_tbl(' || j || ').sal = ' || first_rec_tbl(j).sal);
30 j:=j+1;
31 end loop;
32 close firstquery;
33 end loop;
34 end;
35 end;
36 /
reached second begin
inside loop of second begin
act_put_str_tbl(1) = S%
first_rec_tbl(1).ename = SMITH
first_rec_tbl(1).sal = 800
first_rec_tbl(2).ename = SCOTT
first_rec_tbl(2).sal = 3000
inside loop of second begin
act_put_str_tbl(2) = %L%
first_rec_tbl(3).ename = ALLEN
first_rec_tbl(3).sal = 1600
first_rec_tbl(4).ename = BLAKE
first_rec_tbl(4).sal = 2850
first_rec_tbl(5).ename = CLARK
first_rec_tbl(5).sal = 2450
first_rec_tbl(6).ename = MILLER
first_rec_tbl(6).sal = 1300
inside loop of second begin
act_put_str_tbl(3) = KING
first_rec_tbl(7).ename = KING
first_rec_tbl(7).sal = 5000
PL/SQL procedure successfully completed.
SQL> To OP. It is better to use BULK COLLECT:
SQL> declare
2 cursor firstquery(
3 c_item in varchar2
4 )
5 is
6 SELECT ename,
7 sal
8 FROM emp
9 WHERE ename LIKE c_item;
10 type first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;
11 first_rec_tbl first_rec_tbl_type;
12 type act_str_tbl_type is table of varchar2(50) index by binary_integer;
13 act_put_str_tbl act_str_tbl_type;
14 begin
15 act_put_str_tbl(1) := 'S%';
16 act_put_str_tbl(2) := '%L%';
17 act_put_str_tbl(3) := 'KING';
18 begin
19 dbms_output.put_line('reached second begin');
20 For i in 1..nvl(act_put_str_tbl.count,0) loop
21 dbms_output.put_line('inside loop of second begin');
22 dbms_output.put_line('act_put_str_tbl(' || i || ') = ' || act_put_str_tbl(i));
23 open firstquery(act_put_str_tbl(i));
24 fetch firstquery bulk collect into first_rec_tbl;
25 for j in 1..nvl(first_rec_tbl.count,0) loop
26 dbms_output.put_line('first_rec_tbl(' || j || ').ename = ' || first_rec_tbl(j).enam
e);
27 dbms_output.put_line('first_rec_tbl(' || j || ').sal = ' || first_rec_tbl(j).sal);
28 end loop;
29 close firstquery;
30 end loop;
31 end;
32 end;
33 /
reached second begin
inside loop of second begin
act_put_str_tbl(1) = S%
first_rec_tbl(1).ename = SMITH
first_rec_tbl(1).sal = 800
first_rec_tbl(2).ename = SCOTT
first_rec_tbl(2).sal = 3000
inside loop of second begin
act_put_str_tbl(2) = %L%
first_rec_tbl(1).ename = ALLEN
first_rec_tbl(1).sal = 1600
first_rec_tbl(2).ename = BLAKE
first_rec_tbl(2).sal = 2850
first_rec_tbl(3).ename = CLARK
first_rec_tbl(3).sal = 2450
first_rec_tbl(4).ename = MILLER
first_rec_tbl(4).sal = 1300
inside loop of second begin
act_put_str_tbl(3) = KING
first_rec_tbl(1).ename = KING
first_rec_tbl(1).sal = 5000
PL/SQL procedure successfully completed.
SQL> SY.
Edited by: Solomon Yakobson on Dec 27, 2008 12:32 PM -
TS3988 How do I cancel an iCloud account from an Apple ID?
How do I cancel a me.account created on my Apple ID?
Welcome to the Apple Community.
You can't cancel an account or an Apple ID, you can only stop using them and delete them from your devices. -
I have 2 iphones, 1 personal and 1 business. I thought I was supposed to have 2 separate itunes accounts. I now have a work ipad and want to only have 1 itunes account that I can use for all 3 devices. How do I cancel 1 account or just combine the 2?
I want to be able to transfer my apps from my original itunes account that I have on my personal iphone 3 and work ipad 3 to my work iphone 4S ,as well as purchase more more apps for the work iphone with the original itunes account. Plus I need to sync all 3 of them with my work tower computer. I really appreciate you're trying to help me out.
-
I seem to have 2 iCloud accounts with different names - a free storage that came with my MacBook and one I used when I bought some iCloud space. How can I cancel the free account? Because of this I can't access iMatch and the ICloud account I paid for on my MacBook
Any ideas cos its frustrating that I can't access something I paid for!Sign out of the account you do not wish to use, sign into the one that you do wish to use.
-
Have tried to set up sync between two of my pcs. Both PCs' firefox browsers require the entry of that browsers respective four character, x 3 codes into the OTHER pc for syncing. How do I cancel one of the accounts?
Hi there,
Sorry for the frustrating experience, looking at the account I could see the billing has been stopped for the subscription and you will continue to have the access to software till 2016.
Please update this thread if you would like to cancel the subscription and get refund.
^Ani
Maybe you are looking for
-
Startup and performance problems
Hi Community! First of all, i don't expect to get a good answer to this. I've search for three days for these specific errors, and thought i should share my experiences with other users with similiar problems. I ran Apple Hardware Diagnostics and fin
-
I rely heavily on Firefox's profiling ability to assist me in my web design projects. Lately, using Firefox 3.6, I have run into some problems with how it opens Internet Shortcuts that are saved locally (i.e.- shortcuts that reside on my Desktop). Wh
-
How to use another SIM card with my AT&T Iphone
I have to go in france and use a French office' sim card from another provider than AT&T. But here, I've got all my professional, and private, mail box and conatct on it. How have I to do in order to use this other sim card in my Iphone? I don't want
-
Missing parts list shows only the first material.
in case of MTO cycle, when i create a plnd order to prod order,in material availability check, system is not displaying all the materials for which shortages are there, instead its showing only the first material. any help
-
Far fewer print settings in this version?
In the previous iPhoto, I was easily able to select different printing layouts that would print a bunch of photos on a single page in such a way that they were laid out nicely, filling the available space and all the right way up. Can't seem to find