There's a way to get which fields were modified after a update query?
I want to keep track what field XXX user modified... any ways using active records?
I am implementing Paging in my application. For this i run a query and get a resultset.
Now i want to get total no of records in this resultset for my paging calculation. How can i get ? i dont want to execute a extra sql which gives me total rows
I have an app that is being used by a few users (< 12 users). There are less than 2000 records so I decided to use an XML file and store the file under \company\product\p.xml.
Is this okay or am I breaking some design guidelines without realizing it?
EnvironmentL .net/c#/winforms
I have three tables, Customers, Sales and Products.
Sales links a CustomerID with a ProductID and has a SalesPrice.
select Products.Category, AVG(SalePrice) from Sales
inner join Products on Products.ProductID = Sales.ProductID
group by Products.Category
This lets me see the average price for all sales by category. However, I only want to include customers that have more than 3 sales records or more in the DB.
I am not sure the best way, or any way, to go about this. Ideas?
Can we use Replace function in a update statement ?
If yes then How?
I have a column 'enrollno' having values like '800-00001' to '800-01800'.
I want to replace inital '800-' to '800' in all 1800 records.
(Output should be '8000001' to '80001800')
Is it possible through replace function or any other option is there in ORACLE8i ?
MaheshA...
Is it possible to get the duplicate count when executing MySQL "INSERT IGNORE" statement via JDBC?
For example, when I execute an INSERT IGNORE statement on the mysql command line, and there are duplicates I get something like
Query OK, 0 rows affected (0.02 sec)
Records: 1 Duplicates: 1 Warnings: 0
Note where it says "Duplicates: 1", indicating that there were duplicates that were ignored.
Is it possible to get the same information when executing the query via JDBC?
Thanks.
Hi, looking at a database dump file, and I see many records in various tables with their version number set in values other than 0 (even 94 in one case). I understand it has to do with hibernate locking strategy, but my concern is that today is Sunday, and the site has almost no visitors so is: is this normal ? Or is there a known hibernate bug or even some programming malpractice producing this ?
Thanks in advance.
I have complex logic which is not possible (too slow) to run through PHP with Doctrine, so I need to create a stored procedure for this. The logic also includes inserting/updating records in a table using the Timestampable behavior. How do I preserve this behavior in the stored procedure?
I have a Postgres table called clients. The name column contains certain values eg.
test23233 [987665432,2014-02-18]
At the end of the value is a date, I need to compare this date, and return all records where this specific date is younger than today
I tried
select id,name FROM clients where name ~ '(\d{4}\-\d{1,2}\-\d{1,2})';
but this isn't returning any values. How would I go about to achieve the results I want?
I have 2 tables, same structure, same rows, same data but the first has more columns (fields).
For example:
I select the same 3 fields from both of them (SELECT a,b,c FROM mytable1 and then SELECT a,b,c FROM mytable2)
I've tried to run those queries on 100,000 records (for each table) but at the end I got the same execution time (0.0006 sec)
Do you know if the number of the columns (and in the end the size of the one table is bigger than the other) has to do something with the query execution time?
i am getting some data:
rs.Filter = "datapath='" + dpath + "' and analystname='" + aname + "' and reportname='" + rname + "' and batchstate='" + bstate + "'"
If Not rs.EOF Then
MsgBox rs.Fields("rowid")
End If
if the rs.filter returns multiple records, how do i get rs.fields("rowid") to give me multiple rowid values?
How can I use regex to find all text before the text "All text before this line will be included"?
I have includes some sample text below for example
This can include deleting, updating, or adding records to your database, which would then be reflex.
All text before this line will be included
You can make this a bit more sophisticated by encrypting the random number and then verifying that it is still a number when it is decrypted. Alternatively, you can pass a value and a key instead.
I'm developing a touchscreen application that, aside from everything else, records the amount of times the screen is used so that the user can be reminded to clean the screen after a predefined number of clicks.
I've got the click functions written nicely, all I need now is make sure the function is called on a click.
I imagine $('*').click(function() { //do something }); would accomplish my goal, but is that the best way? Also, would that overwrite other click functions assigned to the elements?
Hello,
I have 3 tables and I am joining these 2 tables as follows:
SELECT EMP.FNAME,EMP.LNAME,EMP.AGE,EMPD.TQ,EMPD.TA,CTY.CITY_NAME FROM
EMPLOYEE EMP,EMPLOYEE_DETAIL EMPD, CITY CTY
WHERE EMP.EMP_ID=EMPD.EMP_ID AND EMPD_CITY_ID=CTY.CITY_ID
I want to display records even if City record is not in CITY table. For eg. if City_ID record for say 10 is not in City table but there is an employee detail record with City_id 10 it should display City_name as null instead of not displaying the record at all.
Appreciate your help
Hello,
I 've got a table field (membername) which contains both the last name and the first name of users. Is it possible to split those into 2 fields (memberfirst - memberlast)? All the records have this format "Firstname Lastname" (without quotes and a space in between).
I'm following this awful textbook, going through the basics of create/edit/delete records. The delete bit has a confirm button, and it is handled like so:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Delete(int id, string confirmButton) {
It offers no explanation of why the button is passed as a string or how MVC interprets it.
Can anyone help clarify what's going on here? The Create code has no such string being passed.
Hi Guys I have this Table
I need to replace the First Letter in ACCT_NAME with the First Name of ACCT_SHORT_NAME. Records like the Higliighted(RAFFMAN) should not be changed. I have tried:
select acct_name, ACCT_SHORT_NAME,replace(acct_name, substr(acct_name, 1, 1), ACCT_SHORT_NAME)
from tbaadm.gam where schm_type = 'TDA' and rcre_user_id = 'SYSTEM' and substr(acct_name,2,1) = ' '
I am getting:
This means that am Picking the whole value in ACCT_SHORT_NAME. WHat is the best way to do what am trying to do?
I am using an ASP page where I have to read a CSV file and insert it into DB table "Employee". I am creating an object of TestReader. How can I write a loop to execute up to the number of rows/records of the CSV file which is being read?
This is the error:
android.database.sqlite.SQLiteException: attempt to write a readonly database
This is my code:
SQLiteDatabase db = mDatabase.getWritableDatabase();
db.beginTransaction();
try {
// add new records
ContentValues newRecord = new ContentValues();
newRecord.put(Emergencydetails.EMERGENCYNUMBER, emergencyNumber.getText().toString());
db.insert(Emergencydetails.EMERGENCY_TABLE_NAME, null, newRecord);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
In other words, is the following "cursoring" approach guaranteed to work:
retrieve rows from DB
save the largest ID from the returned records for later, e.g. in LastMax
later, "SELECT * FROM MyTable WHERE Id > {0}", LastMax
In order for that to work, I have to be sure that every row I didn't get in step 1 has an Id greater than LastMax. Is this guaranteed, or can I run into weird race conditions?
I have a C# function that does some processing and needs to return figures about what it has processed, success, failure, etc.
Can anyone tell me if there are any standard framework classes that will handle this (for example, number of records processed, number successful, failed, etc) ?
Alternatively, can anyone say how they usually handle this? Is the best way to create a class, or to use out parameters?
Is it possible to use a subform's 'current' record set as the domain argument to DAvg() (etc.)?
Basically, I have a subform that displays a subset of records from a query. I would like to run DAvg() over this subset. This is how I've gotten around it:
=DAvg([FieldToAvg], [SubformQuery], "ChildField=Forms.MasterForm.MasterField And FieldToAvg > 0")
but what I actually want is something like:
=DAvg([FieldToAvg], [SubformCurrentlyDisplayedData], "FieldToAvg > 0")
Is this possible in Access 2007?
By default it's like this:
select * from main_table where match(col1,col2) against('search_item');
but what I want to fetch is the reverse,
say,I've restored all the search_item(1000 records,for example),
and I want to see which of them matches a specified row in main_table.
Is that doable?
I am not sure if you can post revision programming questions in here but i am stuck with some algorithms revision
If an algorithm is quadratic it takes time proportional to the number of n^2 ?
So if the slides say its almost 1/2 the square of n records is this the same as saying (n^2 * 0.5)
Thanks
I have a table with 42 million records. 32 million have a null value and I would like to generate a new guid for each one. Should I do this in batches?
Also, going forward, I would like a new guid added to the field on the insert of a new record. What is the best way to do this?
The field is not the primary key, which is an auto-incrementing integer.