I'm doing an audit of a system, which the developers insist is SQL injection proof. This they achieve by stripping out the single-quotes in the login form - but the code behind is not parameterized; it's still using literal SQL like so:
username = username.Replace("'", "");
var sql = "select * from user where username = '" + username +...
I have a table that is self referencing, with id, parentid (referencing id), name, ordering as columns.
What I want to do is to select the first leaf node of each root and have a pairing of the id of the leaf node with the name of the root node.
The data can have unbounded levels, and siblings have an order (assigned by the "ordering" ...
I just come to use database management system and have no experience with all the DBMS programme. For those expert who have experience all the three platform, your opinion on this is very much appreciated. Please guide and let me know the pros and cons.
I been doing my database in Excel and would like to continue in other platform despi...
i have some numbers which i want to store in an array. how will i declare array and assign value to it in oracle pl/sql??
...
I', using ojdbc14.jar to connect to Oracle 10g DB.
While working on single machine i have to problem to connect to DB,
but in cluster i got this exception:
J2CA0036E: An exception occurred while
invoking method
setDataSourceProperties on
com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl
used by resource jdbc/OracleDSBS...
I would like to have a table in my Oracle database whose rows act as locks. The table would have one column, a varchar, and my clients (Java processes over JDBC) would run statements to acquire and release locks.
The acquire statement should check existence of a row with a given value and insert if not there. The statement should some...
In Oracle are indexes used when an UPDATE is fired without a WHERE clause
...
How do I create XSD from an Oracle Table? Are there any tools available for this?
...
i found this site: here
its very well described why it works and why not.
but my question is a little different.
select 'true' from dual where 'test' not in ('test2','');
why does this query not returing a row?
is '' handled like null?
thx for your help
...
Using Toad 9.7.2 against a network Oracle DB (10g) I can't see any objects in the schema browser using the account information provided to me by my DBA. Using Oracle 10g installed locally, I see all objects in my local Oracle instance using the account I created which has all privileges. I believe this is an instance where the account p...
Hello, I need to convert a date from this format:
2002-10-10T12:00:00-05:00
(xs:dateTime as defined in XML)
to an Oracle date.
I'm used to using this in PL/SQL: to_date('date here', 'yyyymmdd'), is there a way to convert this while keeping the time zone info?
Thanks
...
I am attempting to pull some information from my tnsnames file using regex. I started with the following pattern:
MYSCHEMA *? = *?[\W\w\S\s]*\(HOST *?= *?(?<host>\w+\s?)\)\s?\(PORT *?= *?(?<port>\d+)\s?\)[\W\w\S\s]*\(SERVICE_NAME *?= *?(?<servicename>\w+)\s?\)
which worked fine when MYSCHEMA was the only schema in the file, but when t...
IdList = 1,2,3,4,5,6,7,8,9,10
better:
Foreach(id in IdList)
Update MyTable set isDeleted = 1 where id = ?id
or
Update MyTable set isDeleted = 1 where id IN (?IdList)
Forgive my pseudocode, but I think it should be clear.
I know there are limits to the size of the list in an IN clause. It used to be 255 in Oracle.
I'm thinki...
What's PLSQL (Oracle) equivalent of this SQL server snippet?
BEGIN TRAN
INSERT INTO mytable(content) VALUES ("test") -- assume there's an ID column that is autoincrement
SELECT @@IDENTITY
COMMIT TRAN
In C#, you can call myCommand.ExecuteScalar() to retrieve the ID of the new row.
How can I insert a new row in Oracle, and have JDBC g...
Hi, guys. Say I have the following table:
ID | String
---+---------
1 | <123><345>
2 | <1-2><45-67>
3 | <345-321><234>
This is a legacy data format in my app which is currently impossible to avoid. What I need to acheive, is:
ID | String
---+---------
1 | <123>
1 | <345>
2 | <1-2>
2 | <45-67>
3 | <345-321>
3 ...
I have a table
TableName: MACAddresses
Columns:
- Computer
- MACAddress
I would like to create a sql script that creates a new column and correctly formats the mac address with the colon (ie with Substring) - To create a new column called CorrectMAC
How would I do this with Oracle?
...
Hi All,
This is the exception I am getting while trying to connect to an oracle database. This is not happening all the time.
If you can help me out with this..it wil be great.
System.Data.OleDb.OleDbConnectionInternal
..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactor...
I have a huge table. First range partitioned by price_date, then hash partitioned by fund_id. The table has 430 million rows. Every day I have a batch job in which insert 1.5 million to 3 million rows, every day.
We are looking the for enable and disable local indexes(not all indexes but based on data which partitions are touched by d...
I have a table MyTable with columns:
ID number (autoincrement)
STAT number(3) (status: 1-start, 2-stop)
USER varchar2(15) (user name)
DATE date (date)
with data:
ID STAT USER DATE
---------------------------------------
1 1 USER1 18.08.2010 13:10:14
2 2 USER1 18.08.2010 15:15:40
3 1 USER1 1...
Hello,
i'm trying to save accented chars (èòàèì) to an Oracle DB in a VARCHAR2 field; i've put
<html>
<head>
<meta http-equiv="Content-type" value="text/html; charset=utf-8">
</head>
<body>
<?php
header('Content-type: text/html; charset=utf-8');
....
//and here i make the insert into the DB:
$str=utf8_encode("JeanPièrre"); // or...