440 Posted Topics
Re: Hi andydeans, still having problems? Each select statement is incorrect, for example:[CODE]... UNION SELECT c.ClientID, c.App1FirstName, c.App1LastName, u.FirstName, u.LastName, MONTHNAME(DatePaid) as MonthPaid, YEAR(DatePaid) as YearPaid, [B][U]sum(p.amount)[/U][/B] as sub_amt, DatePaid FROM (clients c JOIN users u on c.ClientUserID = u.UserID) JOIN mortgage p on c.ClientID = p.clients_ClientID WHERE DatePaid IS NOT … | |
Re: [QUOTE] I am making one small application which can store data to my online mysql server. But with c++ win32 how can I do it?[/QUOTE] Hi, a couple of days I posted something about how to handle SQL databases within C/C++ using ODBC. You may look [URL="http://www.daniweb.com/forums/thread290970-3.html"]here[/URL]. If there are … | |
Re: Hi, I suggest to cop a look at open source QT4 (kju:t, really both, the software itself and the generated UI are that cute) which is portable class library for Linux, Windows, Mac. I have been using it for over ten years, and it is a perfect UI tool. QT … | |
Re: Refactoring menu is visible for C# and VB only. Besides primitive search-and-replace, which is incomparable to refactoring, unfortunately, MS do not offer true refactoring for C++. There exist several refactoring tools for C++ from other vendors which can be plug-in in Visual Studio 2008, some of them are freeware (I … | |
Re: Hi, there can be a discrepancy between the innodb data dictionary entry for table assets and additional information still holding separately in assets.frm file (really a mess, mysql should eventually learn not to store information about a table schema in various places! Such data must be hold in data dictionary … | |
Re: You may look there for [URL="http://www.databaseanswers.org"]Data Models[/URL]. Perhaps you find some suitable conceptions/ideas there. -- tesu | |
Re: [QUOTE]...Note the error at: alterInstructor. I create the instructor table then the booking table. The instructor table has book_num FK. After the booking table is created I run the script alterTable to alter the instructor table. Note: the alterPayee script runs fine but the book_num is a different data type. … | |
Re: [QUOTE=akand;1252100]I have some data in a table in mysql. I have written a program which can connect to the database and access all tables and data of mysql. I have a variable in the C program. I want a particular data in one of the tables in the database to … | |
Re: Hi, I had the same problem when I installed new codeblocks version 10.05 recently. I solved it by entering the complete path to kernel32.lib that way: 1. Identify kernel32.lib on my computer, also running visual studio2008, I found complete path: C:\Program files\Microsoft SDKs\Windows\v6.0A\Lib\kernel32.lib 2. on codeblocks v10 choose Settings->Compiler and … | |
Re: Hi >>> if I remove the "employeeNumber into(11) NOT NULL," line completely the same error message returns for the next line. Be that as it may, "into(11)" isn't a datatype --> int(11) seems to be correct. -- tesu | |
Re: hi John A single one-to-many relationship between entity A and B can be expressed by (crowfoot notation) A ------< B. That means the primary key of A is foreign key in B. If there simultaneously exists also a one-to-many relationship between entity B and A like B ------< A the … | |
Re: Hi Borkoff In order to prove 3NF these pieces of Information are necessary and sufficient: 1. All involved tables (relations) 2. All columns (attributes) of those tables 3. Primary keys of all involved tables (necessary to prove 2NF and 3NF) 4. Semantics of the datasets (instances of relations) to determine … | |
Re: Well, no doubt :-/ One should consider some drawbacks of datatype text over varchar, for example attributes of datatype text as well as blobs will be stored separately from all other attributes (they are not stored within contiguous pages!), also if text attributes appear together with other attributes in a … | |
Re: well, it might be very helpful to know all related tables and all properly set-up primary and foreign keys. Without these pieces of information it's rather impossible to help you seriously (but pretty kind of stroking the crystal ball). -- tesu | |
Re: Hi andydeans Still about solving your multi-select problem? I am sure that it can be solved in ways that I already ilustrated in which you should create a view consisting of 6 or 7 selects on your various products and aggregated them by UNIONs. Once the view exists then totals … | |
Re: Hello rain2shine Enormous task! Is this kind of homework, seems to be to big for it, so what else? What do you think of starting ERM design by yourself? You will find good help here - on the basis of your first draft. If you don't already have a drawing … | |
Re: Hi >>> //This continues all the way to a[10], sum == 12 1. why not replacing them all by a single: a[sum]++; ? 2. did you really start with initializing a: for(i=0;i<12;i++)a[i]=0; ? 3. using old compiler where int is 16 bit ? -- tesu | |
Re: Well, primary key, foreign key, not null, unique, check clause, also sometimes triggers etc. are or may define constraints. So which of them are meant? -- tesu | |
Re: Hi, Aggregate functions cannot be used in WHERE clause directly. Instead you can apply HAVING clause to GROUP BY clause. Try this: [CODE]SELECT Table1.Name, Count(Table1.Name) AS NumNames FROM Table1 GROUP BY Table1.Name HAVING NumNames=4;[/CODE] This will select all occurrences of Table1.Name that appear four times in table1 btw, if you … | |
Re: Hi tskellyfla I immediately suggest, don't reinvent the wheel again. For your problem [URL="http://gmplib.org/"]The GNU Multiple Precision Arithmetic Library[/URL] is a MUST ;) -tesu | |
Re: [QUOTE=dansnyderECE;1247995]I have a vector full of decimal values and I want to convert each element of the vector to ASCII represented strings (or char arrays). How do I do this? Each element of the array is 8 hex bits long and has been converted to it's decimal representation. So... HEX(41424344) … | |
Re: hi beaverkill, I am just using MS Visual Studio 2008 (professional edition). Assuming that express edition doesn't differ from my edition that much, it is easy to include header files from directories other then your current project dir. I have a foreign language Visual studio here, I try to translate … | |
Re: Hi seems to be a nice theory where you want to define a recursive relationship which is able to store trees and hierarchies. You should get acquaint with famous Joe Celko, the guy how wrote some important books only about this theory ---> google for Joe Celko's trees and hierarchies, … | |
Re: Hi if i understand you correctly, you would like to delete all duplicate urls and only the url with the maximum pr value should remain.[CODE] /* As for your example after deleting the duplicates the result set should then be: url pr ------- a 6 b 6 c 6 The … ![]() | |
Re: [QUOTE=firstPerson;1247266]To convert from 1 char to an int just subtract '0' from it. For example : [code] char ch = '1'; int i = ch - '0'; //i = int(1); [/code] So just apply that to the whole array.[/QUOTE] So all chars to be possible are numbers (0x30 .. 0x39) … | |
Re: Hi in JavaDB (same as Derby) columns which are foreign keys can be denoted by: CONSTRAINT NameOfConstraint REFERENCES refTable(PK_of_refTable), see Derby manual p.68. There are also conventional table-level foreign key constraints like: FOREIGN KEY (a, b, c) REFERENCES refTable (a, b, c), see Derby manual p.72. btw, I think that … | |
Re: Hi You should do this with BULK INSERT. There you have to choose an appropriate BATCHSIZE, possibly it's a good idea to split 1M records into some smaller portions. Also CHECK_CONSTRAINTS should NOT be used to prevent endlessly lasting checking of FK constraints and check clauses. If there is the … | |
Re: Hi Ryan Try this snippet: [CODE]int splitsum= 0; void splitadd(unsigned int n){ int d = n % 10; n = n / 10; if ( n > 0) splitadd (n); splitsum += d;} ... // in main() add this: splitadd(12345); cout << "Result: " << splitsum << endl; // Result: … | |
Re: hi mimis [CODE]num[i]=1; // maybe if you replace this by num[i]=0x31; //ascii coding for numeric 1 is hex 31 (third column, first row) or simpler num[i]='1'; // it will work[/CODE] (didn't check rest of your code) -- tesu ![]() | |
Re: Hi Possibly you can start designing your triggers with oracle sql developer until they function properly. Then you can insert the final result in your Borland c++ program working together with BDE. By Acting this way you will feel certain that arising problems are only localized at turbo c++ or … | |
Re: Sorry Adak, I have to say that your answer is completely wrong. The hexadecimal number 0xff stands for its decimal equivalent f*16 + f = 15*16 + 15 = 255. Therefore, the decimal value of 0xff is 255! The numerical operator << does left shift. Each left shift by one … | |
Re: :( !!! ??? Are really all Egyptian people mad after speaking with a stammer by repeating those punctuation marks without any ceasing ??? !!! -- tesu | |
Re: Well, I think what manutd4life is looking for is the run-length encoding algorithm, a simple algorithm for lossless data compression in which a sequence of the same character (Byte value) is stored as a single character (Byte value) following by its count, e.g. sequence aaaaaabbbc is RLE-coded by a6b3c1, just … | |
Re: Hi sanagopi I've just answered to your posting dealing with hexadecimal number 0xff where at least left shift operator has been annotated. right-shift operator: that is kind of division by 2, and it functions analogously to left shift. You could understand both operators if you read my posting there. -- … | |
Re: Meaning of "w" is: Create an empty file for writing. If a file with the same name already exists its content is erased and the file is treated as a new empty file. If the file exists and you don't have correct permissions, fopen doesn't erase it and returns null … | |
Re: It's a great thing: INNODB supports FOREIGN KEYS. You may simply add foreign-key clause, [URL="http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html"]http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html[/URL]. One should carfully consider insert/update/delete policies. Recomendation: never ever omit foreign key clauses if attributs refer to other tables. Foreign keys are the only way to guarantee referential integrity. Without that you have to spend … | |
Re: Hi What actually happened? 1. Did you drop table ServerLogonHistory prior trigger? 2. Did you really have write access to table ServerLogonHistory? (if not, you possibly need an "execute as" clause.) 3. Did you already try to drop the trigger via command prompt running sqlcmd? (btw, if 17892 appears, you … | |
Re: hi, at first sight your table may look like: medals (gamename, medal, loage, hiage) Primary key: gamename, loage. The select statement to get the medals for given game and age is: select medal from medals where gamename="Cricket" and :age between loage and hiage; Consider age is not an attribute of … | |
Re: Hi Usually I don't meddle in an advanced discussion, however I've got the feeling that this update problem (may be also other) coheres with the overall design. Could you post all tables which are related to pipeline_commission? Have all primary keys and foreign-key constraints been properly set up? Btw, in … | |
Re: Hi, Say Say Say would Paul McCartney say :) Both variants do not meet c syntax. You may look up [URL="http://www.cplusplus.com/reference/clibrary/cstdio/fopen/"]http://www.cplusplus.com/reference/clibrary/cstdio/fopen/[/URL]. -- tesu | |
Re: Yes, you can use SQL Server Management Studio this way: security --> logins --> new login --> general: create new login --> server roles: mark at least sysadmin (there is no admin, sa is obsolete) etc. -- tesu | |
Re: WOW, Edgar Frank Codd is about turning in his grave speedily ... This monster of table does not even fit first normal form because of its horizontally repeating groups (#1... #15). (for such tables you will never be able to construct effective sql select statements. There may also be a … | |
Re: hi hb25 I think it s a good idea to draw an ERM of your hotel reservation. A very useful tool doing so seems to be mysql workbench (though i don't like to work with that database) -- tes | |
Re: Hi I am using standard ODBC interface to connect to SQL databases from within c or c++ programs. Almost every sql database, e.g. oracle, ms sqlserver, sql anywhere etc, fully supports ODBC, and it runs on windows, mac and unix as well. Here http://www.ianywhere.com/developer/product_manuals/sqlanywhere/0902/en/html/dbpgen9/00000261.htm you will get some information about … | |
Re: hi marcel1, below select with case clause is standard SQL1999. Maybe it works also on MS SQL Server. [code=sql] SELECT x, ( CASE WHEN x = 'AB' and y like 'CD%' then 'CD' WHEN 'ZZ' and y like 'CC%' then 'BA' WHEN x in ('bbb','sss','ddg') then 'BB' ELSE 'unknown thing' … | |
Re: first do you first update, then: update whattable set price = 5 where price IS NULL From now onwards, all goods without price before will now cost 5 yourPriceUnit. Is this really correct? krs, tesu | |
Re: Hi Valdemar Do you mean console window of a running c program? On win XP you can right click on the console window title, then choose properties and simply change the layout to maximize the window. Maybe this also works on Vista? krs, tesu | |
Re: Hello elliaw, [QUOTE=elliaw;644982] SELECT * FROM product x, offer y WHERE x.pid=y.pid AND x.country = 'US' AND x.category like 'auto|accessories' AND y.condition = 'new' AND y.price=( select min(z.price) from pdt_offer z where z.pid=y.pid AND z.quality='new' AND z.stock>0) AND y.stock >0 GROUP BY x.pid [/QUOTE] Actually, this query is wrong! It … | |
Re: possibly #include <iostream> or using namespace std forgotten. That also works: return answer == 'y' ; instead of: if ( answer == 'y' ) return true; else return false; krs, tesu | |
Re: where to get them from? what language, environment? need hacker's snippets? |
The End.