Parameter queries in Oracle?
Does Oracle allow for queries that receive a
parameter from ADO? The ability to call
pre-compiled queries is very powerful in SQL
Server. I would like to use the same in Oracle,
but I don't find any reference in the documentation.
Any help will be appreciated, Tony.
I thought I give you the details.
The Package (ITEM_CLIENT) looks like this:
AS
TYPE outputCursor IS REF CURSOR;
PROCEDURE Client_Return (ClientID IN NUMBER OUT ItemClient.outputCursor);
END ItemClient;
When I click over Edit Package Body I see:
IS
PROCEDURE Client_Return (ClientID IN NUMBER,
Clients OUT outputCursor)
AS
BEGIN
OPEN Clients FOR
SELECT * FROM Clients
WHERE Client_ID = ClientID;
END;
Finally, when I click Compile I get the error:
Encountered end-of-file when....
I find it very confusing to deal with packages and
stored procedures. I understand the concept of package
and I like the idea of being able to group all
associated stored procedures in one package, but I am
having a hard time associating the stored procedure
with the package. I read the documentation on PL/SQL
and followed the syntax spelled out there (and as
provided by you), but I have yet to still cannot
create a simple stored procedure I can call from VB.
I have also not found in the PL/SQL documentation how
a stored procedure is called once it is created.
Your help will be appreciated, as always.
Similar Messages
-
3 range parameter query to Oracle data base from Excel 2000
A user bas been trying to setup parameter queries into an Oracle
DB. He normally used MS query and written VBA code to
modify the query for daily or adhoc updates.
With Excel 2000, he wanted to take advantage of parameter
queries linked directly to cells in a spreadsheet.
He was able to get single or two level parameter queries
directly linked to the spreadsheet to run, however every time he
went to a
three level parameter query it crashed while returning the data
to Excel.
The error windows read: Microsoft Excel [Oracle][ODBC] with no
other details.
Is there a limit on the number of "levels" for parameter
queries.
The user was able to build and see the results of a three level
query in MS Query, but every time he tried to return the data to
Excel, it crashed.
JeffThis is an Microsoft Access problem. When you initally connect
to an ODBC source database Access caches the connection and does
not ask for connection information on subsequent linked table
accesses. This causes a problem if you request information from
tables belonging to different users during the same Access
session. The way to avoid this error happening is to create a
user with access privileges to both users being used by the
Access front end. When you connect to Oracle use the new user
and you should be able to connect to all the linked tables. It
may also be worth copying the Access databases to one single
database and trying the migration that way.
Regards
Daniel -
Parameter Form in Oracle Report!!
Dear Oracle Users' Group:
I have problem with "Parameter Form" in Oracle Report.
The Report that I created has the SQL:
"SELECT A.FIELD1, A.FIELD2
FROM MYDATABASE.MYTABLE A
WHERE
A.FIELD1 = :P_1";
When the report is run, it asks for the parameter
and generates the report based on the runtime
parameter. Works perfect on Oracle8i database's
Report front end.
The PROPERTY PALETTE for the FIELD (Field that
takes the runtime parameter) is:
====================
General Information
Name: PF_P_1
Comments:
Parameter Form Field
Source: P_1
Parameter
Datatype: Character
Width: 40
Initial Value:
Validation Trigger:
List of Values:
(For the list of values, I have put the SQL:
"SELECT DISTINCT A.FIELD1 from
MYDATABASE.MYTABLE A", Also I had
tried with list of fixed values like A, B, C)
Web Setting
Additional Attributes (HTML):
================
But the report does NOT work when called from the Web.
(This is only because of the problem with this Parameter
Form in my report. If I get rid of the parameter form by
changing the last line of my SQL to: "A.FIELD1 = 'Chicago'",
it works fine from the Web).
When accessed the report from the Web, the error I get
is:
Oracle Reports Server CGI - Report Job has terminated with this error.
Reports Server Replies:
REP-0788: Warning: The value of restricted LOV parameter P_1 is not among the selectable values.
I do not know what is the error with this simplest Parameter Form based Report!!
In the Property Palette (above) of the Field, there was a field named "Additional Attributes (HTML)"
under "Web Setting" heading.
Do I need to write something there!!
Please help!!
thanks.
kimmyHi, Kimmy
Try: ¶mform=yes]http://webserver.com:80/dev60cgi/rwcgi60.exe?server=repserver&report=rep1&userid=scott/tiger@orcl&destype=cache&desformat=htmlcss¶mform=yes
I've also sent you an email about key maps.
Enjoy! Web Reporting is a great feature.
Pedro. -
Note 830576 - Parameter recommendations for Oracle 10g
hi all DBA experts.
I am not good familiar with Oracle database while i read a Note 830576 - Parameter recommendations for Oracle 10g. in which SAP General Recommendation:
You should delete obsolete initialization parameters from the profile.
To determine which obsolete parameters are currently set, proceed as follows:
SQL> SELECT NAME FROM V$OBSOLETE_PARAMETER WHERE ISSPECIFIED = 'TRUE';
when i execute above command then result is no rows selected
while there are many parameters in above SAP Note which are already obsolete and not set in initSID.ora file.
for exp. the parameter OPTIMIZER_INDEX_COST_ADJ is showing
#### OPTIMIZER MODE
#optimizer_index_cost_adj = 10
as you know that this parameter is very important regarding System Performance.
now please guide me . I have to set these parameter or no need while there is not showing any parameters against obsolete command.
waiting you valuable reply.
Regards,hi both,
thanks for knowledge sharing with me other SDN users,
Dear Orkun,
Ok. At this stage, I can recommend you that apply what they have suggested,
in the message. So, you already did a part of it by configuring
Oracle parameters, already.
SAP support sent me this file (PRD_Parameters)
*** INFORMATION 1 ***
*** INFORMATION 2 ***
*** INFORMATION 3 ***
*** INFORMATION 4 ***
*** INFORMATION 5 ***
*** INFORMATION 6 ***
*** INFORMATION 7 ***
*** INFORMATION 8 ***
*** INFORMATION 9 ***
*** INFORMATION 10 ***
*** INFORMATION 11 ***
_b_tree_bitmap_plans
_fix_control (4728348)
event (10753)
event (38087)
event (10183)
optimizer_index_cost_adj
star_transformation_enabled
event (10027)
event (10028)
event (10411)
event (10629)
event (14532)
_fix_control (5705630)
_fix_control (5765456)
_optimizer_mjc_enabled
_sort_elimination_cost_ratio
event (10091)
event (10142)
event (38068)
event (38085)
event (44951)
parallel_execution_message_size
parallel_threads_per_cpu
query_rewrite_enabled
log_archive_dest_1
log_archive_format
max_dump_file_size
optimizer_features_enable
log_archive_dest
_push_join_union_view
_cursor_features_enabled
_first_spare_parameter
event (10049)
db_writer_processes
parallel_max_servers
db_cache_size
pga_aggregate_target
processes
sessions
dml_locks
job_queue_processes
log_checkpoint_interval
remote_login_passwordfile
sga_max_size
shared_pool_reserved_size
sort_area_retained_size
sort_area_size
statistics_level
workarea_size_policy
they only highlighted these following parameters from above
**** INFORMATION 8 *** DB Patchset: 10.2.0.4.0
**** INFORMATION 9 *** DB Mergefix: 0 (released before 2008-07-11)
FYI... recently, i applied the Oracle Patches 10.2.0.4 in this sequence
MS Windows x86-64 (64-bit)
Patchset_10204_MSWIN-x86-64aa.bin
Patchset_10204_MSWIN-x86-64ab.bin
Patchset_10204_MSWIN-x86-64ac.bin
OPatch
OPatch_10205_Generic_v0.zip
Generic (32-bit / 64-bit)
p8350262_10204_Generic.zip
p7592030_10204_WIN_GENERIC.zip
p9254968_10204_WIN_GENERIC.zip
10204_Patch44_MSWIN-x86-64.zip
p9584028_102040_Generic.zip
p9843740_10204_Generic.zip
and please tell me , still i have to apply highlighted parameters or now no need.
Regards, -
SAP Note 830576 - Parameter recommendations for Oracle 10g
As per SAP Note 830576 - Parameter recommendations for Oracle 10g, I have tried to change the value for
parameter "db_file_multiblock_read_count".
In sql prompt it shows:
SQL> show parameter DB_FILE_MULTIBLOCK_READ_COUNT
NAME TYPE VALUE
db_file_multiblock_read_count integer 128
and in brtools it shows:
58 - db_file_multiblock_read_count both no * yes 128
But I got the following error, when i tried to set it null
1 * Parameter description (desc) ..... [db block to be read each IO]
2 * Parameter type (type) ............ [integer]
3 * Current parameter value (parval) . [128]
4 * Value in spfile (spfval) ......... []
5 # New parameter value (value) ...... [null]
6 - Scope for new value (scope) ...... [both]
7 # Database instance (instance) ..... []
8 ~ Comment on update (comment) ...... []
9 - SQL command (command) ............ [alter system reset db_file_multiblock_read_count scope = spfile sid = '*'; alter system reset db_file_multiblock_read_count scope = memory sid = 'MBD']
BR0662I Enter your choice:
c
BR0280I BRSPACE time stamp: 2008-08-14 18.19.22
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...
BR0280I BRSPACE time stamp: 2008-08-14 18.19.23
BR0301E SQL error -32010 at location BrSqlExecute-1, SQL statement:
'/* BRSPACE / alter system reset db_file_multiblock_read_count scope = spfile sid = '''
ORA-32010: cannot find entry to delete in SPFILE
BR1017E Execution of SQL statement 'alter system reset db_file_multiblock_read_count scope = spfile sid = '*'; alter system reset db_file_multiblock_read_count scope = memory sid = 'MBD'' failed
BR0669I Cannot continue due to previous warnings or errors - you can go back to repeat the last action
BR0280I BRSPACE time stamp: 2008-08-14 18.19.23
BR0671I Enter 'b[ack]' to go back, 's[top]' to abort:
Kinldy let me know, what could me wrong.Hi Markus,
As per your suggestion we have downloaded the files from UCLIB_3-20000978.SAR. But now getting the error as
sapccmsr -DCCMS -j2ee pf=profile value
INFO: use SAPLOCALHOST hostname
INFO: CCMS agent sapccmsr working directory is /usr/sap/ccms/XX1_00/sapccmsr
INFO: CCMS agent sapccmsr config file is /usr/sap/ccms/XX1_00/sapccmsr/csmconf
INFO: Central Monitoring System is [XX1]. (found in config file)
INFO: additional Central Monitoring System is [AS2]. (found in config file)
ERROR: Cannot open Monitoring Segment 0 rtc = 245
Last reported error: [249] CCMS monitoring segment has wrong EYE CATCH. It seems to be created as non-unicode segment.
This program runs as unicode. Please use non-unicode version
Please suggest
Thanks,
Anu -
JDBC issue while calling queries in oracle- urgent
Hi !
Theres a peculiar problem being faced while calling queries(SQL statements having join of more than 2 tables) in oracle database. We are using JDBC thin driver.
We are calling SQL statements from stateless session EJBs deployed in weblogic app server and using connection pool facility to connect to oracle database.
Now, the issue is that select queries having more then 2 tables run fine & give proper result in java but when we see trace in oracle by setting sql_trace to true.. we see some column rowid added as first column selected in such queries and oracle shows such queries to be failed.
Can anyone tell why & how & who adds this rowid ?
Has anyone faces such a problem ?
regards'Am I right in you saying that the data is returned to the app server, but the database is saying it's not???
Veeeeeerrrry strange.
...I mean, if I understand you right, then I have to ask if you're sure that's what's actually happening.
Can anyone tell why & how & who adds this rowid?...and that you're sure you're not adding this yourself in the join?
...since (you imply) you're not using entities, just sql queries against the datasource connection, did you try running that query direct against the database?
...and... oh never mind.
hth
/k1 -
Running Stacked Queries in Oracle SQL Developer
Is it possible to run stacked queries in Oracle SQL Developer???
Something like this...
SELECT *
FROM TABLE_1
SELECT *
FROM TABLE_2
SELECT *
FROM TABLE_3
And give my 3 different result sets in my Query Result window
I tried "BEGIN" and "END" and Oracle SQL Developer did not seem to like it.
Can someone let me know if this is possible and what the syntax might be???
Thanks in advance for your review and am hopeful for a reply.
PSULionRPWrong forum!
Please post this in the sql developer forum.
SQL Developer
You can run multiple queries exactly the way you posted them but you need to use F5 - the run script toolbar button. -
How to change timeout parameter value in Oracle 10g R2
Anyone knows how to change timeout parameter value in Oracle 10g Database R2?
Waheed Azhar wrote:
actually i am getting ORA-01013 exception which directly relates to the timeout value but i think it's hidden parameter...What makes you think it's a hidden parameter?
A search of MetaLink for that error turns up a number of hits, most of which a very situational specific. Exactly what are you doing when you get this error? Are you connecting over an ODBC connection? Are you getting it on a connection request? At db shutdown? During a long-running query? -
Doubt's regarding the Hierarchial Queries in Oracle
Hi,
i have a doubt regarding the Hierarchial Queries in Oracle.
SELECT * FROM TMP_TEST;
ID NUMVAL STRVAL
1 100 Hello
1 -100 World
2 1 Concatenate
2 2 In String
2 3 using Connect By
2 4 Using SYS_CONNECT_BY_PATH
i am clear with my execution of IN_Line view (mechanism how it work's) .
But i have also read about the Hierarchial queries in the Oracle product documentation's. i am also aware of the
SYS_CONNECT_BY_PATH , LEVEL & START WITH , CONNECT BY Keywords.
But i couldnot able to Manually work out as how this below Query works.
Can you please explain me how this Hieracial query works ?
SELECT ID, (SYS_CONNECT_BY_PATH(STRVAL,',')),LEVEL
FROM
SELECT ID,STRVAL,ROW_NUMBER() OVER(PARTITION BY ID ORDER BY ID) RNUM,
COUNT(*) OVER(PARTITION BY ID ORDER BY ID) CNT,NUMVAL
FROM TMP_TEST
START WITH RNUM = 1
CONNECT BY PRIOR RNUM = RNUM - 1
Many Thanks,
Rajesh.Hi, Rajesh,
My first message was in response to your first message.
In your latest message, the query is:
SELECT ID, (SYS_CONNECT_BY_PATH(STRVAL,',')),LEVEL
FROM (
SELECT ID,STRVAL,ROW_NUMBER() OVER(PARTITION BY ID ORDER BY ID) RNUM,
COUNT(*) OVER(PARTITION BY ID ORDER BY ID) CNT,NUMVAL
FROM TMP_TEST
WHERE RNUM = CNT
START WITH RNUM = 1
CONNECT BY PRIOR RNUM = RNUM - 1;It looks like you lost the second CONNECT BY condition:
AND PRIOR ID = IDPut it back: it's important.
Now you're confused about the output row:
2 ,Hello,World,using Connect By,Using SYS_CONNECT_BY_PATH 4It doesn't seem to correspond to anything results that you got when you ran the sub-query alone.
That's because the resutls from your sub-query may change every time you run it, even though the data doesn't change. The ORDER BY clauses in both of the analytic functions do not result in a complete ordering. In fact, they're completely meaningless. It never makes any sense to PARTITON BY and ORDER BY the same value; "PARTITION BY id" means that only rows with the same id will be compared to each other; you might as well say "ORDER BY 0" or "ORDER BY dmbs_random.value".
The ORDER BY clause of ROW_NUMBER whould reflect that way in which you want the results to appear within each id, for example:
ROW_NUMBER () OVER (PARTITION BY id ORDER BY UPPER (strval))Note that this is very similar to what was in my first reply.
In the COUNT function, why do you want an ORDER BY clause at all? Just say:
COUNT (*) OVER (PARTITION BY id) -
Longrunning jobs/Queries in oracle
Hi ,
How to find long running jobs/queries which are executing less than 6 seconds.
The primary criterion for any operation to appear in v$session_longops is to run more than 6 seconds. I want to find out the queries which are executing more than 1 seconds.
Please suggest.
Thanks in advance.
-Surya884629 wrote:
I agree with you but still at any point of time if we want to find out the queries which are running more than 4 secs(may be because lot of resources issue) then how we can find out? I hope we can not say 'Its meaningless'.It is totally meaningless. You even originally said you want to look at queries running longer than 1 second for problem queries. Now you want to look at queries running more than 4 seconds for problems.
So are 1 sec queries okay now? And 4+ sec queries not? What made you decide that?
You do not know where to draw the line as you do not where the problem is. A sub-second query can be non-optimally written. A 1 hour query can be optimally written.
So what does the query's time tell you? How can you look at the time and say "+Yep, this 2 second query is okay and this 4 second query needs further investigation+".?
What about the SAME query that gives DIFFERENT execution times? You have very conveniently chosen to ignore this basic behaviour of queries in Oracle. For example:
SQL> select count(*) from all_objects;
COUNT(*)
69465
Elapsed: 00:00:04.96
SQL> select count(*) from all_objects;
COUNT(*)
69465
Elapsed: 00:00:02.88So is the 1st query bad as it is almost 5 seconds? And the 2nd query good as it just over 2 seconds? Where do you draw the line using execution time? And what about the same query falling in falling into both good and bad query time regions?
In Oracle® Database Performance Tuning Guide, section 1.1.2.1 Performance Principles, it says:
+"Tuning is driven by *identifying the most significant bottleneck* and making the appropriate changes to reduce or eliminate the effect of that bottleneck."+
So how do you identify the most significant bottleneck? By looking at something as variable and inconsistent as query time? You are wrong if you think that. -
ID parameter name for oracle.apps.ar.hz.CustomerProfile.update BE
Dear All,
I am not able to find ID parameter name for oracle.apps.ar.hz.CustomerProfile.update businees event.
TIA.Hi Hameed;
lose your thread here as changing thread status to answered and move it to Forum Home » E-Business Suite » EBS General Discussion
Regard
Helios -
Find out the name of parameter file while oracle is running
can any one please tell me how can i find the name of oracle parameter file while oracle is running, i mean is there any parameter that specifies this thing, or is there any data dictionary view
second thing i want to change the default database i mean istead of starting the default database at startup the oracle should start the database that i specify,
i would be greatfull if any one could answer my questionsOk, so you're running with SPFILE in default location. The file you speak about is used during the database create phase.
Just having a look at the file:
c:\oracle\admin\orcl\pfile\init.ora.1142006183316I can say that:
. The SID is ORCL
. You used DBCA to create the database
. DBCA started creating the database: Saturday 11 of February 2006 at 18:33
This file is used by the DBCA because when you create a database, you must have a parameter file in order to start the instance. This file is easily created as a text file (PFILE) first, then the instance is started. Once the database creation is over, the SPFILE is created from this PFILE. If you check the database create logs (in the %ORACLE_BASE%\admin\ORCL\* directory) you'll see a "CREATE SPFILE FROM PFILE" is ran after the database creation, or before, it depends, and the instance restarted in order for it to use the newly created SPFILE. After that, this file is useless.
HTH,
Yoann. -
Hung queries, and Oracle thin driver query timeout implementation
We are seeing occasional instances of stuck threads, where the code is in Oracle thin XA driver code waiting for a socket read for a response from the database. Usually only one thread at a time. The connection never terminates and we have to shut down WebLogic to clear it. The DBAs tell us that all connections to the 11g RAC cluster members from our hosts are idle, with no hung or long-running transactions.
This happens every few days across two WebLogic 10.3.5 clustered instances in our QA environment, usually not the same time on two servers (one had four incidents, the other had only one, in the last 15 or so days). Sometimes it has resulted in a hung server, as the driver is holding a lock that blocks other threads (today we had numerous threads block in a TX rollback).
I'm guessing our WebLogic instance somehow is not getting the connection close from the remote host. BTW, there is no firewall between us and the DB. I have not got any strong suspect for the cause (although we are running Linux on a VMWare 4.0 VM, which always worries me).
Ordinarily I'd either ask the application to set a query timeout, or set the query timeout parameter for the connection pools as a workaround (we are using a MultiDatasource), so the transaction would at least abort and the application can handle it. However, while the Oracle driver does support java.sql.Statement.setQueryTimeout(), some brief investigation on my part leads me to believe the timeout is implemented on the server side and not the client side - so that if it is indeed the case that WebLogic does not see the close on the connection, it also would never see the timeout.
Two questions:
1. Is my suspicion about server-side implementation of timeout for Oracle 11g correct?
2. If so, is there some property I can set for the driver that will implement a socket timeout? Is this "safe"?
Thanks for any help!
[ Oracle WebLogic 10.3.5, HotSpot 64 bit JVM 1.6.0_29 on RHEL 5.6 on VMWare; Oracle Thin XA driver bundled with WebLogic; Oracle RAC 11g (three-node cluster)]
Edited by: SteveElkind on Dec 3, 2012 5:25 AMThanks, Joe.
My investigations were heading in this direction (e.g., http://docs.oracle.com/cd/B28359_01/java.111/b31224/apxtblsh.htm#CHDBBDDA). However, for WebLogic, is it as simple as adding the following property in the Datasource Connection properties edit box in the WebLogic console?
oracle.net.READ_TIMEOUT=300000
or do I have to edit the connection URL?
I've tried this, and the Datasource restarts OK after the change, but I have no way right now to check whether it actually "works".
(we have some long-running queries; five minutes seems to be a "safe" limita for now) -
List of queries in oracle forms
Hi can any one help me out for the following doubts: ( Please relate the requirements to oracle apps.)
1. How to close one screen using 'x' button in the right corner for which I have written close_form('form_name') in the on_exit trigger but I am not able to achieve it. Is there any property setting.
2. When to use parameters.
3. What is text-parameter and data-parameter (specified while adding parameters to parameter list)
4. Can we provide access key to editors, if so, how to add access key
5. How to update the values in a screen from another screen
6. How to pass multiple parameters to a form
7. How to read the value of parameters
8. While saving the data in the first screen (database block) I want to store the data from the second screen also which is transaction details related to the first master screen.
Regards,
Chandra sekar1. Use key-exit trigger, not on_exit.
2. Parameters are good for passing values from one form to another, or when starting a form from Windows or the browser. They are also useful sometimes as bind variables used in where clauses, or to hold the result from an LOV selection.
6. What environment are you asking about?
8. Issue a Post; in the details (second screen) before returning to the first screen. -
Running Multiple queries in Oracle 10g Express Edition! Help Me!
I am new to Oracle 10g Express Edition.
I used my browser to navigated to http://127.0.0.1:8080/apex
I saw the database page.. logged in.. went into the SQL section.. now am not able to run two or more queries at the same time.. i have given a screenshot too. Plz.. check it and reply me quickly..
http://i71.photobucket.com/albums/i149/prasanna7287/546895215.jpg
Help me plz..
Prasanna.There are two possibilities:
1) Run the SQL commands, one command at a time;
2) Create a script of multiple commands, and run the script.
These are discussed in some detail in the online documentation at http://www.oracle.com/pls/xe102/homepage
In particular, look at
http://download-east.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25108/xedev_sql.htm#BJEIEIFJ
Message was edited by:
Hans Forbrich
No ... wait ... please do not read the documentation! <g>
Maybe you are looking for
-
Only SSL in web AS 6.40
Hi everyone! How do I prohibit access to the webAS6.40 through any other socket than SSL? I.e. I do only want users to access my webAS through port 5<instanceNo>001 ? I have looked in the HTTP Provider and updated the value from Ports = (Port:58100,T
-
Macbook aluminium unibody (not pro) not recognizing my cinema display
hi guys, i have an issue as you can read on this topic, i just purchased a macbook aluminium, and tried to connect my cinema display with the mini displayport to dvi, and does not work at all. when i connect the adapter it seems the machine suddently
-
Using collapsible divs with cfoutput
Hi there - I haven't quite got started yet - I'm trying to avoid a bunch of time-consuming experimentation and was hoping someone here had already done something like this and could point me in the right direction - I'm attaching some code created by
-
Does "Classic by MotionApps" or " Chapura's Echo" sync to Palm desk top for Pre 3 ? Post relates to: Treo 600 (Bell Mobility)
-
When I go to options I cannot access "content" so I cannot make any changes to popups
I've been getting a lot of popups and want to check if I have block popups clicked but I cannot access the "content" tab under options. I can click on all the other tabs but the "content" tab just shows the last tab I clicked on...