|
||||||
| Database & Database Programming MySQL, Oracle, SQL, PL/SQL, ABAP, Smart Forms, and other databases and languages. A database is an organized body of related information used in many websites (including CC). |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hello Everyone,
I am new to the forum and a bit wet behind the ears when it comes to SQL programming Below is a sample script I have generated and I am looking for some constructive criticism on the code. SQL Code:
In addition to any criticism I also have a quick question. As seen above my intentions are to set the value of the PHYSICAL_COUNT_DATE field = to a given date based on a few conditional clauses. Lets say I had 100 total "ODB"."PN_INVENTORY_DETAIL"."BIN" values and wanted to set the PHYSICAL_COUNT_DATE by incriments of 30 days on 10 percent of the bins at a time. Is it possible using SQL to loop the above code to incriment the date and bin values by 30 days and 10 bins at a time. I was thinking something like reading the date and bin value from a txt file and looping until the end of file. Thanks for your time in reading and posting in advance. Last edited by polisasimo; 01-17-2008 at 11:47 AM. Reason: removed " " from objects for readability and added the to_date function. |
| Sponsored Links |
|
|
|
|||||
|
One observation is that it appears that ODB.PN_INVENTORY_DETAIL.BIN contains numeric data, but you are doing a string comparison. That seems likely to give interesting results if your DB platform doesn't support automatic conversions or does the wrong type of conversion. For example, '2' > '10', even though 2 < 10.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Make a script vulnerable to SQL injection? | shibbythestoner | PHP Forum | 7 | 12-15-2007 08:56 PM |
| Best program for SQL database manipulation | Rhadamanthys | Database & Database Programming | 3 | 07-02-2007 02:32 PM |
| Executing SQL Server 2k DTS Package via Visual Basic | Joemama | Visual Basic Programming | 0 | 04-09-2007 06:21 PM |
| Question: free webhosting with PHP, SMTP, and at least one SQL database | skilletsteve | Hosting and Registrars | 5 | 12-08-2006 04:36 AM |
| Oracle has more Flaws than MS SQL? | Jordan | Database & Database Programming | 9 | 12-05-2006 09:39 AM |
Goal: 100,000 Posts
Complete: 68%