440 Posted Topics

Member Avatar for andydeans

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 …

Member Avatar for andydeans
0
568
Member Avatar for svr2009wwe

[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 …

Member Avatar for tesuji
0
250
Member Avatar for iqra123

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 …

Member Avatar for iqra123
0
111
Member Avatar for gidireich

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 …

Member Avatar for gidireich
0
211
Member Avatar for wish02

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 …

Member Avatar for wish02
0
171
Member Avatar for sanz

You may look there for [URL="http://www.databaseanswers.org"]Data Models[/URL]. Perhaps you find some suitable conceptions/ideas there. -- tesu

Member Avatar for tesuji
0
202
Member Avatar for ceyesuma

[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. …

Member Avatar for tesuji
0
263
Member Avatar for akand

[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 …

Member Avatar for tesuji
0
547
Member Avatar for iamcreasy

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 …

Member Avatar for iamcreasy
0
2K
Member Avatar for mattyd

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

Member Avatar for mattyd
0
165
Member Avatar for dthung

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 …

Member Avatar for tesuji
0
176
Member Avatar for Borkoff

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 …

Member Avatar for tesuji
0
119
Member Avatar for andydeans

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 …

Member Avatar for andydeans
0
5K
Member Avatar for andydeans

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

Member Avatar for andydeans
0
242
Member Avatar for andydeans

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 …

Member Avatar for andydeans
0
112
Member Avatar for rain2shine

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 …

Member Avatar for tesuji
0
265
Member Avatar for ryan461

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

Member Avatar for ryan461
0
111
Member Avatar for homeryansta

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

Member Avatar for homeryansta
0
133
Member Avatar for remshadm

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 …

Member Avatar for rohinireddy
0
86
Member Avatar for tskellyfla

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

Member Avatar for tesuji
0
106
Member Avatar for dansnyderECE

[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) …

Member Avatar for daviddoria
0
208
Member Avatar for beaverkill

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 …

Member Avatar for n30h4x
0
7K
Member Avatar for protocode

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, …

Member Avatar for tesuji
0
67
Member Avatar for Dieuz

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 …

Member Avatar for nileshgr
0
109
Member Avatar for dj_saxy

[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) …

Member Avatar for mrnutty
0
236
Member Avatar for ceyesuma

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 …

Member Avatar for ceyesuma
0
1K
Member Avatar for seebharath

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 …

Member Avatar for tesuji
0
327
Member Avatar for Ryan61343

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: …

Member Avatar for Ryan61343
0
77
Member Avatar for mimis

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

Member Avatar for iamthwee
0
142
Member Avatar for az7_neli

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 …

Member Avatar for az7_neli
0
587
Member Avatar for sanagopi

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 …

Member Avatar for Banfa
0
2K
Member Avatar for eng hassan

:( !!! ??? Are really all Egyptian people mad after speaking with a stammer by repeating those punctuation marks without any ceasing ??? !!! -- tesu

Member Avatar for eng hassan
0
84
Member Avatar for manutd4life

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 …

Member Avatar for manutd4life
0
165
Member Avatar for sanagopi

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. -- …

Member Avatar for sanagopi
0
130
Member Avatar for tomtetlaw

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 …

Member Avatar for tomtetlaw
0
2K
Member Avatar for tyson.crouch

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 …

Member Avatar for tyson.crouch
0
120
Member Avatar for Nitin Daphale

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 …

Member Avatar for tesuji
0
415
Member Avatar for kishanvkumar

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 …

Member Avatar for kishanvkumar
0
182
Member Avatar for andydeans

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 …

Member Avatar for tyson.crouch
0
168
Member Avatar for toddermohan

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

Member Avatar for tesuji
0
118
Member Avatar for ChPravin

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

Member Avatar for ChPravin
0
80
Member Avatar for fizanos

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 …

Member Avatar for tyson.crouch
0
187
Member Avatar for HB25

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

Member Avatar for tesuji
0
845
Member Avatar for daviddoria

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 …

Member Avatar for tesuji
0
235
Member Avatar for marcel1

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' …

Member Avatar for teezecrost
0
171
Member Avatar for guptaalok12

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

Member Avatar for smitha86
0
123
Member Avatar for Valdemar009

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

Member Avatar for jephthah
0
162
Member Avatar for elliaw

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 …

Member Avatar for petsol
0
121
Member Avatar for sam1

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

Member Avatar for somemnguy
0
532
Member Avatar for tactfulsaint

where to get them from? what language, environment? need hacker's snippets?

Member Avatar for truth4life
0
173

The End.