org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
I have DATABASE trigger. But when I save object through hibernate session object, Its throws
above exception
My database has a datetime field, and I want to be able to create new entries. Obviously the Rails datetime_select helper isn't the most user friendly thing to have in your form.
I'd rather have a text field for the datetime (or one for the date, and one for the time) and interpret the inputs like PHP strtotime can.
I might just be searching the wrong keywords. Surely this has been discussed in great depth somewhere.
Thanks
:0)
I've noticed that PHPmyAdmin creates the following SQL for table creation:
CREATE TABLE something (
...
) auto_increment=1;
When I write a database creation script I don't use the auto_increment bit. From reading related questions here I understand that it determines the starting value for auto_increment values. But it is good practice to reset it to 1, or should I just leave it out of the SQL so that the default is used?
I would generate entity framework model of my whole database or do it scenario based with 2-5 tables entity model generation? What is the best thing to do
I am using Persistent Storage in Blackberry,now i want to use SQlite Database with Blackberry 4.5.But i didn't get any tutorial for that.Can i use SQlite with Blackberry 4.5 or i need any other version of Blackberry.
I am looking to access an online database of real estate information (e.g. tax information and sales history for a particular address, lot size, square footage, BPOs, etc.).
Companies such as RealQuest offer reports as a subscription service, but I'm looking to download the raw data, preferably in XML format (I don't want to parse the output since the presentation could change without notice).
Are there any such services available?
Is there a SQL statement that will list the names of all the tables, views, and stored procs from MS SQL Server database, ordered by schema name?
I would like to generate an Excel spreadsheet from this list with the columns: schema, type (table, view, stored proc), and name.
Hi. I am creating a Dynamic Data Website. For a particular table, I would like to display only specific rows to the user. Meaning I want to filter the rows displayed to the user. Is there a way to change the query that the framework uses to fetch data from the database?
Does anyone knows how to force WEBrick to process more than one request at a time? I'm using some Ajax on my page for long running database-related tasks and I can clearly see the requests are being processed in a pipeline.
Hi,
I need to transform the rows into columns for the similar ID's in oracle
e.g.
The following is the result I will get if i query my database
Col1 Col2 Col3
1 ABC Yes
1 XYZ NO
2 ABC NO
I need to transform this into
Col1 Col2 Col3 Col4 Col5
1 ABC Yes XYZ No
2 ABC NO NULL NULL
Someone please help me in solving this issue
Thanks,
Siv
I am pulling in all the records from my customer database(mysql) for the last ten days
$offset1 =strtotime("-10 day");
$date3=date("Y-m-d",$offset1);
SELECT * FROM customers WHERE date between '$date3' and '$date' AND customer.custid = '$custid' ORDER by date DESC
I would like to leave out the dates falling on a saturday or sunday and would like to put this in my query rather than the php
If you can help thanks
Hi to All,
I developed an iPhone app which displays iPhone AddressBook contacts list.
I want to add extra fields to the selected contact.
Using AddressBook framework,it was not possible.So,i want to attach those values to the "contacts" table of my database.
How can i store(insert) those existing contacts into contacts(using sqlite3 insert command).
Please,help me with a sample code.
Thanks in Advance,
Ramya.
Hello,
I want to pass data to a server and store the file there in a database as binary data.
NSData *myData = [NSData dataWithContentsOfFile:pathDoc];
pathDoc = [NSString stringWithFormat:@"<size>%d</size><type>%d</type><cdate>%@</cdate><file>%c</file><fname>File</fname>",fileSizeVal,filetype,creationDate,myData];
Any idea about this?
Thanks you,
Milan
Hello everyone, I'm implementing a home screen app widget. I was wondering which is better to store/read data: SharedPreferences or a SQLite database? The data is accessed from an AppWidgetProvider (similar to a BroadcastReceiver), and any given instance of the widget displays different data based on appWidgetId. Is one way or the other frowned upon?
Thanks for your time.
Wonder if there is a parameter I can pass in mmysqldump equivalent for SQL Servery mysqldump that will make the incorrect "DROP TABLE IF EXISTS" statements into "DROP VIEW IF EXISTS", so that populating a database in an automated development environment refresh will work?
Clarification, I'm getting DROP TABLE IF EXISTS statements in my .sql dump file even though they aren't tables.
FYI: This is a Drupal site. The tables in question are ubercart meta statistics tables.
I want to somehow round the numbers for a rating system in php like this:
4.6667 = 4.6
5.0001 = 5.1
is there any way to do that? (BTW i read the datas from a database)
Hai,
I have a radio button list control with open,close as list items.I have two columns in my database as Start Bid and End bid both the columns are datetime datatype.If i select the open list items and click search button it should show only bids that are open else viceversa.
Please suggest me with example.
Regards
Basanth
Is there a pear mail queue reporting script that builds pretty charts and graphs from your MQ database? I have MQ set up on a cron job and I want to tie some reporting into my admin console.
i populate uipicker's datasource from array built with sqlite database stored data. everythiongs works fine.. for a little while. after 6-7 spinnings, the picker freeze, and I get EXC_BAD_ACCESS. debugger indicates the program stopped in the main () function.
so, how could this happen? working for a while, and then, suddenly exit like that?
thanks
I need to create database for SQL Server, what kind of naming convention I sohuld use?
1) Table names could be : customer, Customer, CUSTOMER
2) Field names could be : customer_id, CustomerId, CustomerID, CUSTOMER_ID, customerid, CUSTOMERID and so on...
Is there any official suggestion for naming conventions or what is msot common way to name tables and fields?
I use decodeURIComponent and encodeURIComponent in Javascript.
Before I store this data in a UTF-8-PostgreSQL-Database, I should decode them:
$my_data = pg_escape_string(utf8_encode($_POST['my_data']));
I'm looking for a PostgreSQL-Function to convert Javascript-Encoded Data.
My rails app produces XML when I load /reports/generate_report.xml.
On a separate page, I want to read this XML into a variable and save it to the database.
How can I do this? Can I somehow stream the response from the /reports/generate_report.xml URI into a variable? Or is there a better way to do it since the XML is produced by the same web app?
I am using jquery to set a session, i have a php page which gets the values of the person logging. The value in the session array, is then used in another page where, it is stored in a hidden field for database entry.The problem is, the value is not set unless you refresh the page of which beats the purpose of AJAX and Jquery.Again,the session seems to be one session behind.How can I do this without page refresh/ reload?
Im using c# windows form application. I have a database with many tables. Each table has several columns. I need to populate the combo box with the column names for a selected table.
I'm in the process of implementing an ultra-light MVC framework in PHP. It seems to be a common opinion that the loading of data from a database, file etc. should be independent of the Model, and I agree. What I'm unsure of is the best way to link this "data layer" into MVC.
Datastore interacts with Model
//controller
public function update()
{
$model = $this->loadModel('foo');
$data = $this->loadDataStore('foo', $model);
$data->loadBar(9); //loads data and populates Model
$model->setBar('bar');
$data->save(); //reads data from Model and saves
}
Controller mediates between Model and Datastore
Seems a bit verbose and requires the model to know that a datastore exists.
//controller
public function update()
{
$model = $this->loadModel('foo');
$data = $this->loadDataStore('foo');
$model->setDataStore($data);
$model->getDataStore->loadBar(9); //loads data and populates Model
$model->setBar('bar');
$model->getDataStore->save(); //reads data from Model and saves
}
Datastore extends Model
What happens if we want to save a Model extending a database datastore to a flatfile datastore?
//controller
public function update()
{
$model = $this->loadHybrid('foo'); //get_class == Datastore_Database
$model->loadBar(9); //loads data and populates
$model->setBar('bar');
$model->save(); //saves
}
Model extends datastore
This allows for Model portability, but it seems wrong to extend like this. Further, the datastore cannot make use of any of the Model's methods.
//controller extends model
public function update()
{
$model = $this->loadHybrid('foo'); //get_class == Model
$model->loadBar(9); //loads data and populates
$model->setBar('bar');
$model->save(); //saves
}
EDIT: Model communicates with DAO
//model
public function __construct($dao)
{
$this->dao = $dao;
}
//model
public function setBar($bar)
{
//a bunch of business logic goes here
$this->dao->setBar($bar);
}
//controller
public function update()
{
$model = $this->loadModel('foo');
$model->setBar('baz');
$model->save();
}
Any input on the "best" option - or alternative - is most appreciated.