» Home » Record » Page 1
Factory Girl: How to associate a record to another record without creating a new record?
Category : Programming Languages

I'm using Factory Girl/Rspec2/Rails 3.


In factories.rb, I have:


Factory.define :user do |user|
user.name 'Some guy'
user.email 'some_guy@somewhere.org'
user.password 'password'
end
Factory.define :org_admin, :parent => :user do |user|
user.email 'org_admin@somehwere.org'
end
Factory.define :user_with_memb

View Replies


Mysql Automatically insert specific record if doesn't exist or inserts new record if a specific record is update
Category : Programming Languages

I'm using php and mysql to develop an application; A little background data about it,it's a login system which stores usernames and passwords and all the works that a login system does. However I have ran into a problem when it comes to deleting users, the function for deleting users works fine but the problem is For example the administrator can delete himself leaving the database with no use


View Replies


How can i create a trigger that will only update a record if the new record is different from the old record?
Category : Databases

Question is create a trigger that will only update a record if the old record is different from the new. Can i get some help please i don't even know how to start the syntax apart from


CREATE TRIGGER update_marketingliste
ON marketing_list FOR UPDATE
AS
BEGIN
SELECT * FROM INSERTED
END

View Replies


Left Join to select all record from table1 and single (optional) record of table2
Category : Databases

In my database i have to table with one to many(optional) relationship 1....0,*


Table1:
+--+---------+
|id| name |
+--+---------+
| 1| user1 |
| 2| user2 |
| 3| user3 |
+--+---------+



Table2
+--+------+-------+
|id|tb1_ID|city |
+--+------+-------+
| 1| 1 |

View Replies


Django: Duck typing-friendly way of accepting record or slug of record for input
Category : Web Design

I have a function like this:


def foo(bar):
...

Now bar can either be a Django record or the slug pointing to a record. I need this flexibility so that I can call this function when I have the actual record at hand or am calling this from a more generic function that only has bar available as a string (pulled from a database).



View Replies


Access sometimes jumps to existing record on save new record - Access2k FE/SQL2005 BE
Category : Databases

this is my first question on SO, am really posting this out of desperation after searching around a lot for an answer and trying a few different things with no success.


I have an Access database where I have recently migrated the tables to SQL 2005, Access continues to function to the users as a front-end providing forms, reports, and queries.


However, since moving to


View Replies


Rails 3, how add a associated record after creating a primary record (Books, Auto Add BookCharacter)
Category : Programming Languages

Rails newbie... trying to understand the right way to do things...


In my app users can create a Book ( I have that working)


What I want to happen is when a user creates a book, a record is added to the BookCharacters Table, something like (id, book.id, user.id, characterdescription.string.)


When the book is created, the user who created it should automaticall


View Replies


How to update a record on another table based on the values of the record being modified using a trigger
Category : Programming Languages

I have two simple (only for explain my problem) tables


X with columns (among others): IDX,CODE,NUMBER
Y with columns (among others): CODE,NUMBER,id_fromX

I want to (after insert or update table X) update table Y using variables from actual record from X.
To do this I try to use trigger (in table X) like below:


SET TERM ^^ ;
CREATE TRIGGER XYZFOR X

View Replies


Checking values in a database table to see if a new record would conflict with an existing record
Category : Programming Languages

I have a Detailsview with multiple fields, always set to be in insert mode. Of those fields I wanted to check before the user inserted a new record to see if that user has already entered a record for that date.


I really needed to figure a way to check multiple requirements, like if the date requested is a holiday, or if there are already two different requests made from differen


View Replies


iBatis.NET to insert record with Oracle stored procedure, return record ID
Category : Programming Languages

I am attempting to insert a record in an Oracle table with a Function, which would be called through iBatis.NET. Function works as expected in Oracle when called directly.


I have tried using <statement> and <insert> SqlMap but I can't get iBatis.NET to call the function, and Oracle doesn't support returning anything from Stored Procedure.


View Replies


Next
2012 / 2017 Copyrights BigHow , All Rights Reserved .