Home » Database

check constraint using SELECT from lookup table sql server 2005

Question:
Hi Experts,
Just wondering if this is A possible and B the right thing to do if it is.
Or what is best practice when you have lots of small (count) variable constraints.
I would like to use a constraint on a table field, as a lookup from another table, tblConstraints.
So for example see code attachment
Code Snippet:
–Table for [...]

SQL Loader Problem

Question:
When I try to run SQL Loader, it has an error…
Anyone knows how to solve it?
Solution:
Hi,
You need to set the ORACLE_BASE in path.
This link should help you
http://www.orafaq.com/forum/t/51572/2/

redundant_tables

Question:
is there a way/method to identify or remove redundant/unused tables in a production database?
would there be any harm of leaving those tables there.
Solution:
1 – if you only turn auditting on for tables you think are good candidates then no, it shouldn’t affect performance,  if you are right and they aren’t used, then it will have [...]

bounce_instance

Question:
Does anyone know the pros/cons of bouncing a production instance every weekend?
Is this a normal or bad practice for oracle databases.
My understanding it is not good. however, our DBA does it every weekend to take a cold backup of the database. Oracle then seems to lose all the cache advice statistics after that.
Solution:
1st  – you [...]

Working with search table

Question:
My db has a mysql backend and MSAccess frontend. Currently I am using a temporary table (created from query of multiple tables with some concatenate and calculated fields) as the record source for a search form. Problem is that it takes about 10 sec to create the temporary table and this delay is set to [...]

Need help configuring new install of phpmyadmin

Question:
I just installed phpmyadmin version 3.2.2 with mysql 5.1.40 and Apache 2.2 on Windows. When I goto the index page, I get the normal phpmyadmin login screen. I put my username and password in and it hangs for about a minute and then I get a blank page. I tried an invalid password and it [...]

How to store a file path in MySQL?

Question:
I know this must be very simple, but I cannot make this work – I am trying to store a simple file path in a MySQL database from my PHP web page. But the backslashes get lost when I write the update statement (it’s an existing record).
$sPath = “c:\\mypath\myfile.jpg”;
$sSQL = “UPDATE mytable SET filepath=’” . [...]

Dim/Fac Vs FK/PK

Question:
What is the basic difference between Dimension/Facts relationship and PK/FK realtionships?
Thanks
Solution:
No difference that I can think of.
OLAP doesn’t necessarily imply “dimensional”. If by “OLAP” you just mean a database used for business intelligence / decision support purposes then that could also be a normal form model. But either way a foreign key means the same [...]

Mysql select every two months

Question:
Hi everybody.
I have an application that send emails to subscribers every week, every 14 days and every month, I select this information using an sql script every day.
Now i need to implement the two months subscription.
I like to make an sql select that retrieves this information and send the newsletter (for months with more than [...]

auto matic backup mysql table

Question:
please suggest the method to back up my sql automatic ly to flash drive or another server
Solution:
http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
If you are in a *nix environment, write a cronjob to run at the times you want, get it to mysqldump the databases you need, tar them up (optional) then either scp them to another server or cp them [...]