JDBC Bound variable limit for sql queries
I need to know if there is a limit on the no of variables that can be bound using a prepared Statement ?
And somebody insisted that the bound variable limit is only when the variables belong to certain types of operators eg:
A query like this :
select * from table where column in(?, ?, ?.....)
cannot have more than 1000 variables but
a query like this
select * from table where column in(?, ?, ?) and column1=? and column2=? and column3=? ... and so on ..... can have more than 1000 bound variables ?
Also is this dependent on the driver or inherent to Oracle versions ?
Per the Oracle documentation:
Stage 5: Bind Any Variables At this point, Oracle knows the meaning of the SQL
statement but still does not have enough information to run the statement. Oracle
needs values for any variables listed in the statement; in the example, Oracle needs a
value for department_id. The process of obtaining these values is called binding
variables.
A program must specify the location (memory address) where the value can be found.
End users of applications may be unaware that they are specifying bind variables,
because the Oracle utility can simply prompt them for a new value.
Because you specify the location (binding by reference), you need not rebind the
variable before reexecution. You can change its value and Oracle looks up the value on
each execution, using the memory address.
bind variables are stored in the PGA if running a dedicated server. Shared servers use the SGA. The PGA is fixed and OS specific.
Similar Messages
-
Offset and Limit for sql queries
Hello all,
Can anybody help me please...
i have used the offset and limit in postgres sql when we want to get only a number of rows starting from a particular row of a table. is there any similar things available in oracle.
Hope some one can help me soon...
Thanks and regards,
sreejesh Rajan,use the following query to get records from 10th row to 14th row
select * from scott.emp where rownum < 15
minus
select * from scott.emp where rownum < 10 -
Gtksql pkgbuild. Simple GUI for sql queries.
This is simple program for running sql queries. I made this pkgbuild some time ago but I'm not sure how much it is good. Gtksql should support both mysql and postgresql but postgresql support is broken (probably to old). Developer promises a brand new gtk2 based application. We will see...
Since I can't make this pkgbuild any better I'm just posting it.
gtksql PKGBUILD
pkgname=gtksql
pkgver=0.4.2
pkgrel=1
pkgdesc="Gtk front-end for sql queries"
url="http://gtksql.sourceforge.net/"
depends=('lua' 'gtk')
makedepends=('mysql')
source=(http://dl.sourceforge.net/sourceforge/gtksql/$pkgname-$pkgver.tar.gz)
md5sums=('a0ba598027cd49f69f951a31342b51fd')
build() {
cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr
--with-mysql
--with-lua
make || return 1
make prefix=$startdir/pkg/usr installHello:
I'm trying to do add a calculated variable to my view that isn't an Entity
Attribute, its simple really but i don't know if I'm leaving something out or
not.
I add the "new Attribute" , call it nCompleted, type - number
I then check off everything as is required(as documented in Help)
for an Sql Derived Attribute, the following code is entered in the
Expression Box :
Select group_services.office, count(client_group_services.clnt_group_services_id) as nCompleted
Where group_services_id=client_group_services_id(+)
And client_group_services_id.result="Completed";
It isn't working, what am I missing???? Sheena:
It probably isn't working because of missing 'group by' clause. I don't know the exact detail of your query statement, but suppose you want to count number of employees in a dept, then you're query should look like:
select dept.deptno, dept.dname, count(emp.empno) as nCount
from dept, emp where dept.deptno = emp.deptno(+)
group by dept.deptno, dept.dname // This group-by is important
OR if you want to use nested SELECT
select dept.deptno, dept.dname,
(select count(emp.empno) from emp where dept.deptno=emp.deptno(+)) as nCount
from dept -
Has anybody used the microsoft JDBC 2.0 driver for sql server 2000?
Hi,
Has anybody used the JDBC 2.0 driver for sql server 2000 downloadable from the
microsoft website?When I try using it with WL 6.1 sp1 it says it can't load the
driver.I try viewing the class file from the jar file using the jar utility it
gives an unknown Zip format error.Anybody has any solution for this ?If anybody
has managed to work with this microsoft driver i will be grateful if they provide
me with a solution.
Thanks
ThomasHello Thomas,
You may want to download the driver again and install it again.
heres a sample xml tag in the config.xml:
<JDBCConnectionPool
DriverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
InitialCapacity="3" MaxCapacity="12" Name="MSpool"
Password="{3DES}fUz1bxR0zDg=" Properties="user=uid"
Targets="myserver"
URL="jdbc:microsoft:sqlserver://mydbserver:1433"/>
ensure that you follow the instructions from Microsoft. For using 2000
driver you will need to have
Install_dir/lib/msbase.jar and Install_dir/lib/msutil.jar in addition to
Install_dir/lib/mssqlserver.jar in the CLASSPATH.
hth
sree
"Thomas" <[email protected]> wrote in message
news:3c91ec0e$[email protected]..
Hi,
Has anybody used the JDBC 2.0 driver for sql server 2000 downloadable from
the
microsoft website?When I try using it with WL 6.1 sp1 it says it can't load
the
driver.I try viewing the class file from the jar file using the jar utility
it
gives an unknown Zip format error.Anybody has any solution for this ?If
anybody
has managed to work with this microsoft driver i will be grateful if they
provide
me with a solution.
Thanks
Thomas -
Hi,
SQL Server best practices indicates the use of Windows Authentication instead of Mixed Mode.
In this case, if you need to create reports that connect to the database,you need to add the users accessing the data source to the sql server security.
For reports that show error logs and table contents do you create a specific domain account for SQL queries and then specify it on the data source?
Thank youHi Pedro,
A report server uses credentials to connect to external data sources that provide content to reports or recipient information to a data-driven subscription. You can specify credentials that use Windows Authentication, database authentication, no authentication,
or custom authentication. When sending a connection request over the network, the report server will either impersonate a user account or the unattended execution account. For more information about the security context under which a connection request is
made, see
Data Source Configuration and Network Connections further on in this topic.
The network environment determines the kinds of connections you can support. By default, when you create an datasoource the credential is "Windows Authentication(Windows integrated security)", as you know, the user must has permission to the server
and database.
Each user must have a Windows account. It can be a local account (i.e., an account on the report server) or a trusted domain account. The account must be added as an allowed user to the report server either individually or as part of a group. Furthermore,
the client application must support Windows integrated security.
More details information please reference to below article:
Understanding SQL Server Reporting Services Authentication
Specify Credential and Connection Information for Report Data Sources
If you still have any problem, please feel free to ask.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support -
Microsoft JDBC 2.0 driver for SQL: Integrated Windows Authentication?
Has anyone had success with the MS JDBC 2.0 driver for SQL and Integrated Windows Authentication in distributed mode (Multiserver)? At best, we can get server-to-server authentication.
Hello Thomas,
You may want to download the driver again and install it again.
heres a sample xml tag in the config.xml:
<JDBCConnectionPool
DriverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
InitialCapacity="3" MaxCapacity="12" Name="MSpool"
Password="{3DES}fUz1bxR0zDg=" Properties="user=uid"
Targets="myserver"
URL="jdbc:microsoft:sqlserver://mydbserver:1433"/>
ensure that you follow the instructions from Microsoft. For using 2000
driver you will need to have
Install_dir/lib/msbase.jar and Install_dir/lib/msutil.jar in addition to
Install_dir/lib/mssqlserver.jar in the CLASSPATH.
hth
sree
"Thomas" <[email protected]> wrote in message
news:3c91ec0e$[email protected]..
Hi,
Has anybody used the JDBC 2.0 driver for sql server 2000 downloadable from
the
microsoft website?When I try using it with WL 6.1 sp1 it says it can't load
the
driver.I try viewing the class file from the jar file using the jar utility
it
gives an unknown Zip format error.Anybody has any solution for this ?If
anybody
has managed to work with this microsoft driver i will be grateful if they
provide
me with a solution.
Thanks
Thomas -
[DW 8.02 + PHP] how to use variables in advanced SQL queries
Hi all,
I can't find a way to use variables in an SQL query after
updating
dreamweaver 8.02.
I always get error messages that says: 'missing variable
type:myvariablename', undefined#myvariablename... and so on.
What is the correct way to use variables?
I usually set a variable in a PHP statement (example: <?
$today=date('Y-m-d'); ?>)
and then I compare this variable in the SQL query.
What is the correct syntax for variable in DW 8.02 in
advanced SQL
queries?
TIA
tonysweetman wrote:
> I'm editing a website created with DW 8.01 and MX
Kollection.
>
> I updated DW to 8.02 and now I can't edit an existing
SQL query.
> I always get an error message 'Missing variable type'
and I can't go
> on.
InterAKT released a new version of Kollection to cope with
the 8.0.2
changes. AFAIK, you should be able to download the updated
version from
your InterAKT account area.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Hello everybody,
First off, let me apologize if my inquiry does not belong on this forum. I am confident however, that someone here has had experience with this since Oracle and ruby on rails/ruby are used frequently. My fingers are crossed, here's is my problem:
I am currently working on a database system that utilizes ruby on rails
with a oracle database. Here's the situation:
the ruby on rails web application is up and running;
my oracle database is full of tables that are populated with data;
there is a successful connection between rails and my oracle database;
however, what isn't finished is I currently have data mining queries in
sql (eg. find minimum time someone has been employed = "Select
min(time) from table...etc") and what I need to do is write one ruby
program for each of my sql queries so that the ruby program:
1) connects to the oracle database each time the query is called
2) runs the sql query on the oracle database
3) takes the results from the query and returns them in an array or
something of that nature (so that I can use the results in an html file
on the ruby on rails web application).
Again, I apologize if this question does not belong on this forum. If someone however has experience with this could you please give me example code of what this would look like (using different sql queries). Thank youI apologize if this question does not belong on this forum. OTN does have a forum dedicated to Ruby/Ruby On Rails. I admit it doesn't seem to get much traffic. I think that's because most people working with Ruby tend to go for F/OSS products.
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/ -
Need help for SQL Queries Tunning
hi all,
we have a procedure for search consumers, which using sql queries like:
SELECT TRIM (NAME) AS NAME, TRIM (accno) AS accno,
TRIM (connaddress) AS connaddress,
TRIM (CATEGORY) AS CATEGORY, TRIM (landmark) AS landmark,
SUBSTR (accno, 1, 3) AS subdivisionname
FROM consumermaster
WHERE LOWER (accno) LIKE
LOWER ('%' || NVL (caccno, '#noval#') || '%')
OR LOWER (NAME) LIKE LOWER ('%' || NVL (cname, '#noval#') || '%')
OR LOWER (connaddress) LIKE
LOWER ('%' || NVL (cadd, '#noval#') || '%')
OR phone LIKE '%' || NVL (cphone, '#noval#') || '%'
OR accno = (SELECT accno
FROM requestregistration
WHERE requestid = creqid)
UNION
SELECT TRIM (NAME) AS NAME, TRIM (accno) AS accno,
TRIM (connaddress) AS connaddress, TRIM (CATEGORY)
AS CATEGORY,
TRIM (landmark) AS landmark,
SUBSTR (accno, 1, 3) AS subdivisionname
FROM scodetails
WHERE LOWER (accno) LIKE
LOWER ('%' || NVL (caccno, '#noval#') || '%')
OR LOWER (NAME) LIKE LOWER ('%' || NVL (cname, '#noval#') || '%')
OR LOWER (connaddress) LIKE
LOWER ('%' || NVL (cadd, '#noval#') || '%')
OR phone LIKE '%' || NVL (cphone, '#noval#') || '%'
OR accno = (SELECT accno
FROM requestregistration
WHERE requestid = creqid);
it's ok for small tables but now data increase .......
searching method is very slow
now i want to tune this query for better performance
please sugg me best method
Thanks in advance
Regards
vij..The link given by Asif should get you on the right track for tuning this query.
I just formatted your SQL:
SELECT Trim(NAME) AS NAME,
Trim(accno) AS accno,
Trim(connaddress) AS connaddress,
Trim(category) AS category,
Trim(landmark) AS landmark,
Substr(accno,1,3) AS subdivisionname
FROM consumermaster
WHERE Lower(accno) LIKE Lower('%'
||Nvl(caccno,'#noval#')
||'%')
OR Lower(NAME) LIKE Lower('%'
||Nvl(cname,'#noval#')
||'%')
OR Lower(connaddress) LIKE Lower('%'
||Nvl(cadd,'#noval#')
||'%')
OR phone LIKE '%'
||Nvl(cphone,'#noval#')
||'%'
OR accno = (SELECT accno
FROM requestregistration
WHERE requestid = creqid)
UNION
SELECT Trim(NAME) AS NAME,
Trim(accno) AS accno,
Trim(connaddress) AS connaddress,
Trim(category) AS category,
Trim(landmark) AS landmark,
Substr(accno,1,3) AS subdivisionname
FROM scodetails
WHERE Lower(accno) LIKE Lower('%'
||Nvl(caccno,'#noval#')
||'%')
OR Lower(NAME) LIKE Lower('%'
||Nvl(cname,'#noval#')
||'%')
OR Lower(connaddress) LIKE Lower('%'
||Nvl(cadd,'#noval#')
||'%')
OR phone LIKE '%'
||Nvl(cphone,'#noval#')
||'%'
OR accno = (SELECT accno
FROM requestregistration
WHERE requestid = creqid); You are using some function on almost each and every column in the where clause. Try getting rid of them as they are hindering the use of indexes, if any, on any of the columns.
Also the guidelines in the link provided are the best starting point. -
Variable Limit for User Defined Variables, Arrays
Hi -
Does anyone know the limit for the number of user-defined variables in a Captivate project?
Also, does anyone know if Captivate 5.5 supports user-defined arrays that will hold more variables?
I'm used to creating large questionnaires in Authorware where I could have over 1,000+ variables stored in various arrays and I'm trying to create the same projects in Captivate. (Or if anyone has a suggestion for a software that would be better suited, please let me know.)
Thanks!Hi there
You might want to review the information at the link below:
Click here to view
Cheers... Rick
Helpful and Handy Links
Captivate Wish Form/Bug Reporting Form
Adobe Certified Captivate Training
SorcerStone Blog
Captivate eBooks -
Essbase substitution variable used for SQL Dimension load-URGENT
Hi All,
I am creating one dimension through SQL Dimension load rule writing by parent child build rule. The SQL query is like below---
distinct trim(dist_mobile),trim(ret_mobile) from dist_retailer al1 where al1.proc_dt=to_date(&Proc_date,'dd/mm/yyyy')
When I fixed the value of proc_date (e.g.- '27/09/2008') then it is retrieving data properly, but when I try to make the same as a essbase variable as shown above (to give user the priviledge to select for which date data will be fetched from RDBMS to create the dim) and after setting the aforesaid value of that variable in essbase subs var screen and click 'OK/Retrieve' in rule,it is returning no rows executing the query as well as no error coming.
I guess in query nothing is wrong but the subs variable part is not working. Can anybody please give some insight to resolve the problem.
In this context, I would like to mention that I will have to use substitution variable in some other rule file also to automate the load process. How can I use essbase subs variable in SQL load rule? Could you please show me a proper summarise query illustrating how to use the subs var in aforesaid purpose for the sake of understanding?
Thanks in advance.Hi,
Sorry for delayed response. Appreciate your inputs. At last I have found out the solution which is as below----
distinct trim(dist_mobile),trim(ret_mobile) from dist_retailer al1 where al1.proc_dt=to_date('&Proc_Dt','dd/mm/yyyy')
after setting the substitution variable as Proc_Dt and set the value as 27/09/2008 (without any quotation mark or such sign) now I checked and now it is retrieving fine.
Thanks & Regards. -
Setting Multi Variables with Multi SQL Queries: Performance Bottleneck?
Hello ODI Experts,
I have created a Logical & Physical Schema and Source Data Store to pick data from DB Table. Now I am setting variables with simple SELECT Query for setting each variable (in its Refreshing tab>Select Query field).
It gives me a less optimized approach picking one column per query (per variable). Lets say, I have to pick 35 columns from a table and put those in 35 variables...It would mean running 35 queries for fetching one record from the database table.
Doesn't it seem less performance effective (less optimized)..a little scary..or ODI does it with some internal optimized technique?
Any thing better or a different approach that I can do to make variable setting more optimized?
Please guide.
Thanks & Regards,
Ahsan AsgharHi GottaLoveSQL,
According to your description, you want to improve the performance of report with subreports. Right?
In Reporting Services, the usage of subreport will impact the report performance, because the report server processes each instance of a subreport as a separate report. So the best way is avoid using subreport by using LookUp , MultiLookUp , LookUpSet, which
will bridge different data sources. In this scenario, we suggest you cache the report with subreport. We can create a cache refresh plan for the report in Report Manager. Please refer to the link below:
http://technet.microsoft.com/en-us/library/ms155927.aspx
Reference:
Report Performance Optimization Tips (Subreports, Drilldown)
Performance, Snapshots, Caching (Reporting Services)
Performance Issue in SSRS 2008
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Collation problem for sql queries
Hi All,
We have 1 old database which have collation "Latin1_General_100_CI_AS".
We have moved this DB to other server & on for this DB collation is "Latin1_General_100_CS_AS"
There are lots of SQL procedure we had written & all table,field name in case insensitive manner.
so for new db it will give us error invalid object name because this db is set as "Latin1_General_100_CS_AS".
Now we can not change the collation of db.
so please know us how we can achive case insensitivity for object name in query for "Latin1_General_100_CS_AS" collation.
please help us we are stucked in big issue & it is not easy to change Store procedure as Senstive name of object.Anybody have another suggestion for JK?
Thanks!
Ed Price, Azure & Power BI Customer Program Manager (Blog,
Small Basic,
Wiki Ninjas,
Wiki)
Answer an interesting question?
Create a wiki article about it! -
Bind Variable Values in SQL Queries
When I want to test a query in Raptor, say something like this:
select first_name, last_name from people
where first_name like :P1_SEARCH or last_name = :P1_SEARCHI am prompted to provide a value for :P1_SEARCH two times.
It would make more sense if I were only required to provide the value one time, as that's how it will be executed anyways.
Thanks,
- Scott -thanks i have bugged it.
Mike -
Setting a time out limit for OBIEE Queries
Hi Experts,
I am using OBIEE 11g. I have a scenario where I have to cancell a query if the query runs for more than 15 mins to fetch the data. The requirement is if the query takes longer than 15 mins the query to the database should be cancelled and in the OBIEE answers it should show the query cancelled message. Even if we are not able to show the exact message in answers is fine. But the front end and backend query must be cancelled after running for 15 mins.
Any help on this would be highly appreciated. Thanks in Advance.
SatyabratHi,
Please try the following:
Add the below code in instanceconfig.xml
To set time to expire for Idle Oracle BI Presentation services Client connections.
<ConnectionExpireMinutes>Number of Minutes</ConnectionExpireMinutes>
Setting the Time to Expire for Oracle BI Presentation Services Client Sessions
<ClientSessionExpireMinutes>Number of Minutes</ClientSessionExpireMinutes>
And also try in RPD
Go to Manage-->Identity-->Application Roles
Select the ROLE and click on the permissions tab.
In the next wizard go to the “Query limits” tab.
Against the database row set the following values
Max Time Minutes=20
Status Max Time=Enable
For Custom messages for the error message:
Find error webmessage template and rewrite it in customMessages. For example:
<WebMessage name="kmsgCatalogAccessDenied" exception="true">
<TEXT>Отказ в доступе на <sawm:param insert="2"/> пользователю <sawm:param insert="3"/> по пути <sawm:param insert="1"/>.</TEXT>
</WebMessage>
Found this in catalogmessages.xml. Then I created file custommessages.xml in msgdb\customMessages:
<?xml version="1.0" encoding="utf-8" ?>
<WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
<WebMessageTable system="CustomMessages">
<WebMessage name="kmsgCatalogAccessDenied" exception="true"><TEXT>Some other error message</TEXT></WebMessage>
</WebMessageTable>
</WebMessageTables>
It's possible not to show error message code.
There are a lot of perfect examples in the documentation.
Also Please refer the below link:
http://sranka.wordpress.com/2008/05/23/style-sheet-changes-custom-look-and-feel-in-obiee/
This should resolve your problem
Regards
MuRam
Maybe you are looking for
-
How to add to a group of fill in boxes with one click?
I need to create a form, for surveying a building. If I had to survey a room with fill in fields for one room (width, length, height, how many windows, doors, etc.), is there a way to add one buttom below that says "another room" and pressing that w
-
[Solved]How to fix grub after Windows XP install?
I installed Windows XP on top of Arch in a different partition. It looks something like this: /dev/sda1 - XP /dev/sda2 - Arch /dev/sda3 - Swap Grub is located on /dev/sda2/ in /boot/grub/ Windows XP obviously overwritten the mbr like it normally does
-
I can no longer hide my purchases in the new version of iTunes
Since Apple removed the automatic download option for available episodes, I've been navigating my purchased list A LOT. I still don't understand why this option disappeared for passholders, a stupid and consumer-unfriendly move. But now not even the
-
How to trim the spaces at end of the line
Hi, My requirement is to spool the data returned by query with column seperator as "|" . I am setting linesize before running the query and can't expect the exact linesize. There may be extra spaces also. Example: 2030588|EPM_NA_US_RMT_12295_________
-
Modifying parameters in Initialization file
Hi, I wanted to modify the control_files parameter in the Initialization file, whatz the SQL command to modify this ? and also how can I start my database in nomount mode using Oracle Enterprise manager, please advise. Regards Faiz