Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: mbabcock
  • Content: Threads
  • Order by date
  1. mbabcock

    Trigger code doesn't seem to attach to table (MySQL5)

    Here's my trigger code: DELIMITER $$ DROP TRIGGER /*!50032 IF EXISTS */ `piecerate`.`spUpdate_Queue`$$ create trigger `piecerate`.`spUpdate_Queue` AFTER UPDATE on `piecerate`.`queue` for each row BEGIN call spUpdateQueueCounts(new.iorderid); insert into crap (iid,iorderid) values...
  2. mbabcock

    Need help with MySQL5 trigger calling procedure syntax

    I have an UPDATE trigger on my inventory_transactions table, set to call the spUpdateInventoryCounts procedure for the iInventoryID (FK) record being modified. Here's the code for my update trigger: DELIMITER $$ DROP TRIGGER /*!50032 IF EXISTS */ sp_IT_Update$$ create trigger sp_IT_Update...
  3. mbabcock

    Problem with UPDATE trigger code in MySQL5

    MySQL5 doesn't like my UPDATE trigger: DELIMITER $$ DROP TRIGGER /*!50032 IF EXISTS */ `tiremate`.`sp_updatetrans`$$ CREATE TRIGGER `tiremate`.`sp_updatetrans` AFTER UPDATE on `tiremate`.`inventory_transactions` FOR EACH ROW BEGIN update inventory set iqtyinstock = (select sum(nqty) from...
  4. mbabcock

    Want to programatically call MYSQLDUMP from VFP9

    My VFP9 app uses a MySQL5 database. I've reviewed the syntax of the MYSQLDUMP command but I'm unsure of how to invoke that from my VFP9 app. I'd basically like to have a simple option on my app's menu that says "Backup database" whereby my code then runs something like...
  5. mbabcock

    OPTION value used from Visual Foxpro SQLSTRINGCONNECT

    Here's the connection string I use commonly with my VFP9 apps connecting to a MySQL5 backend: DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;UID=mike;PWD=foxrocks;DATABASE=mydb;option=131609 I was wondering what other values for the OPTION parameter folks use? Sometimes, I get some...
  6. mbabcock

    OPTION values for MySQL5 SQLSTRINGCONNECT

    Here's the connection string I use commonly with my VFP9 apps connecting to a MySQL5 backend: DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;UID=mike;PWD=foxrocks;DATABASE=mydb;option=131609 I was wondering what other values for the OPTION parameter folks use? Sometimes, I get some...
  7. mbabcock

    When designing tables, do widths with multiples of 8 fair better?

    I had heard a rumor (perhaps about MySQL) that if you design tables to have field widths of multiles-of-8 (like varchar(8), varchar(16), varchar(64)) that they'd perform better (perhaps due to internal optimizations based on computer-word lengths). Any truth to that? tia, --Michael
  8. mbabcock

    multiple key indexing

    I created a simple lookup table with these columns: iid = auto-inc, primary key cReference = varchar(30), reference to owner/entity cCode = varchar(16), abbreviation used as FK in other tables cDescription = varchar(64), description for cCode I've got a primary index on iid (obviously), and I...
  9. mbabcock

    DISTINCT vs GROUP BY

    Assuming an index on cCustNum field, which would be better in terms of performance? 1) select distinct cCustNum from MyTable where <somecondition> 2) select cCustNum from MyTable where <somecondition> GROUP BY cCustNum QA's estimated execution plan seems to show that these are identical, but...
  10. mbabcock

    Problem with Temp table created in IF block

    I get the following error when checking syntax of my stored proc: Microsoft SQL-DMO (ODBC SQLState: 42S01) --------------------------- Error 2714: There is already an object named '#TempReps' in the database. ...but the temp table DOESN'T exist!!!!!!! I checked TempDb and it's not there. I...
  11. mbabcock

    Data type choice: float or decimal

    What are the ramifications of choosing the specific data type of these two (float or decimal)? I need to store numerics with known decimal widths, and then do calculations on them later (multiplying and adding specifically) inside UDFs/stored procs. Tia! --Michael
  12. mbabcock

    getting records from 'n' days ago against datetime field

    I've got a table with a datetime field, and I want to create a Stored Proc that retrieves records 'n' days back using an input parameter. Kind of like this: input parameter: @tiPastDays INT declare @dPastDate @dPastDate = CURRENT_DATE - @tiPastDays select * from MyTable where...
  13. mbabcock

    Creating a temporary table with a variable name

    I have a VFP9 app that runs a SQL Server stored procedure. That stored procedure creates a temporary table (among other things). Right now, I've hardcoded it as ##TempTable, but I want to pass a unique name from my VFP app to the SQL Server proc. That way, I avoid problems by other concurrent...
  14. mbabcock

    Simple math operation in SQL fails...why?

    I'm trying to get a percentage based on one column divided by another. I do this in VFP easily but need to do it now in a SQL Server 2000 stored proc. Here’s the output from the SP: cSalesRepID iTotQtyStatused iTotQtySold iTotQtyFinalSold iTotQtyCancelled nPctSold nPctCancelled...

Part and Inventory Search

Back
Top