set @sqlt = concat("select", @rowname_date," from syslog_data.syslogs_index_1 "); prepare stmt from @sqlt; execute stmt; deallocate prepare stmt; gives me a eeror 1064 in the prepare statement? Any ...
SELECT COLUMN_NAME into columnname_date FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='syslog_data' AND `TABLE_NAME`='syslogs_index_1' AND ordinal_position = forder_date+2; When I ...
I have a PostgreSQL 9.1 database where part of it handles agent commissions. Each agent has his/her own formula of calculation how much commission they get. I have a function to generate the amount of ...
I have a function that has one parameter of a table type, i want to loop through all the fields and return the column that has a null or empty value. CREATE OR REPLACE FUNCTION ...
This question regards the proper use of NULL and utilizing CHECK constraints for business logic vs stored procedures. I have the following tables setup. I normalized the tables to avoid using ...
While answering this question How to add a Primary Key on a Oracle view? A lot of questions popped in my mind. 1. Is it advisable to have primary key in a view. 2. Why anybody be intrested in ...
What's the best paradigm or design pattern for exception handling in a mission-critical DB driven web application?
I want to design a bullet-proof, fault tolerant, DB driven web application and was wondering on how to architect it. the system will have a asp.net UI, web services middle tier and SQL2005 back end. ...
I am making a database for an accounting/sales type system similar to a car sales database and would like to make some transactions for the following real world actions: salesman creates new product ...