I have the following SQL query which returns the correct results:
SELECT *
FROM `tags`
WHERE tag_name = 'בית\\\"ר-ירושלים'
If I change it to
SELECT *
FROM `tags`
WHERE tag_name LIKE 'בית\\\"ר-ירושלים'
or to
SELECT *
FROM `tags`
WHERE tag_name LIKE 'בית\\\"ר-ירושלים%'
It doesn't work. It will work if I remove all the backslashes ...
I have a database table containing fields RACE, ETHNICITY and ETH. I need to evaluate RACE and ETHNICITY fields and populate ETH using a series of cases:
if Race = W and Ethncity = 1 then ETH = Caucasian etc.
Can someone advise me on the best way to structure a stored procedure to accomplish this?
...
Hi, We plan to configure a stored procedure to run as a batch job daily using Oracle DBMS scheduler package. We would like to know what would be the best way to log an error message when there is an error occured. Is logging to a temporary table an option? or is there a better option. Thanks in advance.
...
How to avoid
"characterset conversion buffer overflow" error in sql*loader? error # 00626.
I am not able to find this on internet please suggest me the solution for this.
...
I'm trying to make a Crystal Reports 11 report off an Oracle database that's grouped by user. I've got over one thousand users. I want to create a parameter field that prompts the person to select which users they would like to view the results for. However my parameter selection field is only showing 221 of the possible users. The u...
I have table that has date field. When I run a query, I see this:
01/10/2009 22:10:39
How can I retrieve only the time (IE: 22:10:39)
...
I want to select all rows of a table followed by a random number between 1 to 9:
select t.*, (select dbms_random.value(1,9) num from dual) as RandomNumber
from myTable t
But the random number is the same from row to row, only different from each run of the query. How do I make the number different from row to row in the same execution...
I have a query
select * from myTable
...and I want to wrap this query inside a stored procedure, and have the store procedure output the results of this query.
How do I do it?
In ms-sql, i can store my query as a string to a string variable. And then do "Execute (variable)". Why no such thing in Oracle?
...
I'm trying to run a query similar to
var results = MyItem.MyEntitySet.Where( x => x.PropertyB == 0 )
MyEntitySet has one association, PropertyA, with MyItem.
Ideally, the underlying SQL query should be
SELECT .. FROM .. WHERE ([t0].[PropertyA] = @p0) AND ([t0].[PropertyB ] = @p1)
since PropertyA and PropertyB are the two primary ...
In code that I inherited, I have a SqlDataSource that has a fairly complex select statement that for certain SelectParameters, always times out ("Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.").
When I run the exact same query with the same parameters in management stu...
Hi, I'm trying to do an ORDER BY where I want any rows without an entry in the join table to appear at the bottom of the list and then organised by name. Simplified tables are:
users (id, name)
photos (id, filename, user_id)
So far I have:
SELECT name FROM users
LEFT OUTER JOIN photos ON photos.user_id = users.id
ORDER BY *ANSWER HER...
I have a table to log site visits and it has over 100,000 records. There don't seem to be any performance issues, but should large log type tables be regularly moving records to an archive table and clearing out the current table?
...
I have the following (returning two separate result sets) being successfully executed from a proc but cannot do the same when executing this as a basic query.
SELECT * FROM persons;
SELECT * FROM addresses;
Possible? What's the syntax?
EDIT:
I am using Ruby's DBI library:
dbh.query("SELECT * FROM persons; SELECT * FROM addresses;"...
This error occurs when data binding a repeater:
SQL Server does not handle comparison of NText, Text, Xml, or Image data types
protected void Page_Load(object sender, EventArgs e)
{
topicid = Convert.ToInt32(Request.QueryString["topic".ToString()]);
if (!IsPostBack)
{
MusicForumDataContext db = new MusicForu...
I have a table with 117000 or so records. I need to perform a search that checks 3 separate fields for a given string pattern.
My where clause is as follows:
field1 LIKE '%' + @DESC + '%'
OR field2 LIKE '%' + @DESC + '%'
OR field3 LIKE '%' + @DESC + '%'
This seems to take about 24 seconds regardless of input...
Is there a better way ...
I have a job that performs several validation checks on rows in several tables in a database. If the check fails it logs the failure in a table that. The information that is logged includes the table name, a uniqueidentifier value of the row that failed, which check it failed, and which job was being run at the time. Here's the simpli...
Hi Community,
I'm getting the (probably trivial) error, but completely clueless about the possible causes. I want to insert two object in the DB using SQLAlchemy. Those objects are related, here are the declarations. Class User:
class User(Base):
__tablename__ = 'cp_user'
id = Column(Integer, Sequence('id_seq'), primary_key=Tr...
I'm trying to change a password with a DDL statement like:
CurrentProject.Connection.Execute "ALTER USER barney PASSWORD "[]!@#$%^ oldpassword"
Yes, that's a nasty password, but someone tried something like that. Notice the beginning quote of the password is not part of the sql syntax here. I need something like mysql_real_escape_st...
Getting data into and out of SQL tables with C#
I built a C# app that puts data into a SQL table.
I am currently using the SqlConnection class in .net.
Got started with this article.
http://www.codeproject.com/KB/database/sql_in_csharp.aspx
I had thought about looking at Linq to SQL but have not done it before and wasn't sure how to g...
Edit: Im running SQL Server 2008
I have about 400,000 rows in my table. I would like to duplicate these rows until my table has 160 million rows or so. I have been using an statement like this:
INSERT INTO [DB].[dbo].[Sales]
([TotalCost]
,[SalesAmount]
,[ETLLoadID]
,[LoadDate]
,[Up...