440 Posted Topics
Re: Hello Usually such project is based on OOA/OOD, therefore realising such a design with c++ well structured classes incorporated in convenient design pattern (mvc, facade etc) are a must. How to realize persistently stored data is another question. Stock management requires complex data model and consists of many entities which … | |
Re: Hi there arise two problems with your both single selects when unionizing them together: 1. only the last select is allowed to have an ORDER BY, therefore: [CODE]SELECT a, b, count (c) as "MasterHeadline" ... group by .... union select a, b, count (d) as "not that important name" ... … | |
Re: Hi, glad to see you again I thought her old but similar problem would have already been solved by master mike (Indeed, I had mistaken decomposition with elimination, I say sorry for that.) -- tesu | |
Re: Hi, ...AND (a.category_id [COLOR="Red"]IN ()[/COLOR] OR a.addl_category_id[COLOR="Red"] IN ()[/COLOR]) [COLOR="Red"]IN()[/COLOR] can not be empty. It needs at least one element, for example: ..AND (a.category_id [COLOR="Green"]IN(10)[/COLOR] OR a.addl_category_id [COLOR="Green"]IN(100, 200, 300)[/COLOR]), datatype integer assumed. -- tesu | |
Re: I suggest standard mysql connector c++. [URL="http://dev.mysql.com/tech-resources/articles/mysql-connector-cpp.html"]Here[/URL] is a complete tutorial. [URL="http://www.daniweb.com/forums/thread290970-3.html"]There [/URL] I wrote something about odbc interface. There is also a mysql connector/odbc interface. -- tesu | |
Re: Your problem description is really hardly understood. Can you state examples with meaningful data for all three levels and also one on the result you are looking for? I am vaguely supposing, your problem deals with hierarchies and trees in sql databases. If so, you might search for Joe Celko … | |
Re: Well, I think what he is looking for is to find the longest common substring (LCS) of both strings /system/images/777/medium/[COLOR="Green"]Debrecen_-_[/COLOR]University.jpg?1279547675 [COLOR="Green"]Debrecen_-_[/COLOR]Protestant_Great_Church.jpg where the green marked substrings seems to be such LCS. There is also a longest common subsequence problem where the sequence of chars need not to be contiguously stored. … | |
Re: Well, not sure whether you want to fetch all rows where owner_id contains empty string (where an instance physically exists in table) or where owner_id is NULL (that special value what indicates that instance does not physically exist in table) I state example for both, empty string and NULL value: … | |
Re: [QUOTE] lets say for example I have the following code [CODE]char *fname = "John"; char *lname = "Doe"; char *query = "SELECT fname, lname FROM table_name;"[/CODE] The last statement won't work, so my question is how to pass the fname and lname variables to the query?[/QUOTE] ** deleted ** (got … | |
Re: I can't figure out the backgrounds to the extent, so just out of curiosity, why do you using "left outer joins" everywhere? I am sure, you already know this [URL="http://en.wikipedia.org/wiki/Join_%28SQL%29#Left_outer_join"]definition[/URL] of left outer join:[CODE]/* [I]The result of a left outer join (or simply left join) for table A and B … | |
Re: Hi, obviously your asm is real mode (because of int 10H (= 0x10) then the code for inputting a string terminated by enter key (0DH) could be: [CODE] maxleng equ 100 ; maxleng of inbuffer is 100 chars ;;; not knowing EQU? then replace maxleng of inbuffer by 100. inbuffer … | |
Re: Hi You can convert time string values with stringstream to double values. From double values you can cast hours and minutes: [CODE]#include <iostream> #include <string> #include <sstream> using namespace std; int main(){ stringstream conv; double t; int h,m; conv<<"9.45"; conv>>t; h=(int)t; m = (int)(100*(t-h)+0.5); cout<<t<<" = "<<h<<":"<<m<<endl; // 9.45 = … | |
Re: Well, I am not sure whether you are mistaken about identity and uniqueidentifier. See the difference: [CODE]-- scope_identity(), @@identity and ident_current() are dealing with identities as in: create table t (id integer identity(1000, 1), m varchar(100)) insert into table t (m) values ('sequence number starting from 1000 incremented by 1'); … | |
Re: You didn't tell your database to use eventually existing indexes. Your first explain has kind of join constraint "messages.username = 'johndoe' AND users.username = 'johndoe'". Such similar thing is missing in second explain. I would also suggest always to join tables in such a way: ... FROM messages JOIN users … | |
Re: Hi, student's table is OK (see note below) but classtime table is a bit poor (for theory lovers: it doesnt even fulfill first normal form, 1NF). You can simply try out whether this table functions well or badly by creating a sql query (select) to answering this question: How often … | |
Re: [QUOTE=VJTechno;1281268]write a program that will identify the longest substring in two given strings that is common to both.[/QUOTE] Hi LCS is a famous problem in programming. You my have a look at my posting [URL="http://www.daniweb.com/forums/thread298956.html"]there[/URL] and follow the links you possibly will find solutions. Be aware of that LCS isn't … | |
Re: Well, can you tell me why you want to create a resultset which has pairwise exactly duplicate columns? You need to specify them individually. You know that the resultset of the cartesian product (select * from a,b) is extremely rarely useful. -- tesu | |
Re: Hi vavazoom the only thing what immediately leaped out at me is the line where you determine pivot element: [CODE]if (C[i][j] >= C[k][j]) ... // what should be: if ([B]fabs[/B](C[i][j]) >= [B]fabs[/B](C[k][j])) ... [/CODE] More serious is where you are exchanging rows: [CODE]for(int m = 0; m < N; ++m) … | |
Re: You have column last review type which implies there are diversified last reviews. So they also may differ in their fields/parameters. Obviously this is kind of ISA-relationship (generalization/specialization), therefore I would put the data of last reviews in separate tables. Addition: If your last reviews only differ slightly, gathering all … | |
Re: Hi google docs includes an API which can be used for example from Java. The API offers complete document search facilities. There are various query classes, also for spreadsheets. You may dive into the details [URL="http://code.google.com/intl/de-DE/apis/documents/docs/3.0/developers_guide_java.html#ListDocs"]here[/URL]. Then the form to enter data can be build with Java. However,google offers also … | |
Re: Hi Tommy, greetings from the hood. If I understand you correctly, you want to list all customers which have purchased goods for more than 5000EUR in 2010. This query should solve it (you need to substitute in your appropriate column names): [CODE]WITH totalAmount (Kunder, ID, Amount) as ( SELECT k.kunderName … | |
Re: Hello I was also able to find the answer to Napoleon Bonaparte most impotant statement by means of this code: [CODE]int palindrom(char s[]){ int i,l;for(l=0;s[l]!='\0';l++); for(i=0;i<l/2;i++) if(s[i]!=s[l-i-1])return(0); return(1);} // usage int main(): if (palindrom("able was I ere I saw elba")) printf("Napoleon was right!\n"); else printf("Wrong, wasn't he banned to Santa … | |
Re: [CODE] ALTER PROCEDURE [dbo].[spAdminChangePassword] ( @userName varchar(20), @oldPass varchar(20), @newPass varchar(20), [COLOR="Green"]@ok int OUTPUT[/COLOR] )[/CODE] and drop declare @ok int; Hope, that it will work. -- tesu (I am really astonished that over 15-year old transact SQL from Sybase company is still alive in modern Microsoft SQL Server today.) | |
Re: Hello How should your letter sequences be read? Does "no" belongs to "name" so as "nonname" or is it a single column's name? What are "sub" and "table" ? Maybe these separated words are name of many-to-many linking table? Are there any keys? Most Important: All your four anwsers can … | |
Re: Hi Shall only whole numbers be counted as: [I]myList[placeholder] = number;[/I] (if so, then change 0 into +=). Or shall each digit of an inputed number be counted, e.g. input 33 here 3 counts twice. >> Andreas5: deleted, i got it, sorry -- tesu | |
Re: hi the server mysqld.exe is usually installed as a service on MS XP. You can check it: Start > run > enter: services.msc Examine sevice mysqld whether it is started. If not start it. If already started and error still exists, examine service mysqld again, then click right mouse key … | |
Re: [QUOTE] History: [CODE]operation_id int(6) data timestamp amount float(7,2) customer_id varchar(6) debt_id int(6) optype tinyint(1) PRIMARY_KEY(operation_id) [/CODE] How can I select the date of the most recent record in "history" for each "debt_id"? Thanks[/QUOTE] Hi trashed If you are only interested in getting data and for example debt_id of the most … | |
Re: Hi Despite whether your below select statement meets your requirments, it has a severe fault: [CODE]SELECT city.name, COUNT(flight.id) AS numflight ->FROM city LEFT JOIN flight ON origincityid=origincityid.id ->[COLOR="Red"]GROUP BY destinationcityid[/COLOR]; [/CODE] That is, all selected columns not being parameters of aggregate functions (e.g. count) must be enumerated in GROUP BY … | |
Re: Hi your indirect address modes are wrong. Unfortunately, you won't get any error message. That's life in assembly programming. To fast show you the problem in principle I copied your assembly code inline a C program: [CODE] void myFunc(float *a, float *b, float *result) ; *myFunc not necessary but ok … | |
Re: [QUOTE]let me explain u clearly.. I have a table name product Details I have Pid as a field. then another table name is product order so if i update my Pid in product details simultanoeusly in product order also have pid,it should be also updated...how to do that..hope its clear … | |
Re: Hi, >>> RMA_NUM is the primary key in both tables. This is not true because there are duplicates in RMA_NUM (1,1,1, etc). So what is your primary key ? (As for 3NF you need to check whether transitive dependencies exist. However, pk must be given priorly.) -- tesu | |
Re: Hi In principle, the trigger you imagine may look like this: [CODE] CREATE TRIGGER InsertIntoEponyms AFTER INSERT ON Eponyms REFERENCING OLD AS oldRow NEW AS newRow FOR EACH ROW BEGIN DECLARE Eponyms_CATEGORIES varchar(255); -- further declarations ... set Eponyms_CATEGORIES = newRow.CATEGORIES; -- get current value of Eponyms.Categories /* Here should … | |
Re: Hi SWEngineer Consider these two tables: [CODE] table student: Name ------- Ada Benita Cecile Fatma table subjects_passed: Name subject --------------------------- Ada Relational Algebra Fatma Relational Algebra Ada Databanks Fatma Databanks select name as "No exam passed" from students division select name from subjects_passed; Result: No exam passed -------------- Benita Cecile … | |
Re: I completely agree with tyson.crouch. To guarantee referential integrity, all foreign keys must be correctly defined. Unfortunately, there is a further very serious flaw in below table user_subject: [QUOTE] [CODE] CREATE TABLE `user_subject` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `subject` varchar(255) NOT NULL, PRIMARY KEY (`id`) … | |
Re: Hi, well, two one-to-many relationships of two entities where each entity is related to the other one usually makes up a many-to-many relationship between them. There is also a possibility that both one-to-many relationships are treated separately. In such case the primary key of one entity becomes foreign key of … | |
Re: Hi, Instead of: [CODE] CREATE TABLE STORE ( StoreID Integer NOT NULL AUTO_INCREMENT, StoreName Char (20) NOT NULL, City Char (12) NULL, Country Char (15) NULL, Phone Char (12) NULL, Fax Char (12) NULL, Email Char (20) NULL, Contact Char (15) NULL, CONSTRAINT StorePK PRIMARY KEY(StoreID, StoreName), );[/CODE] try this: … | |
Re: Hi, assuming your data model is correct an owner's event list can be created by select * from event WHERE owner = 'yourOwner'; * should be avoided and replaced by the list of row names you actually need, e.g. select event_from, event_to, description from event WHERE owner = 'yourOwner'; | |
Re: As StuXYZ already suggested, drop these lines: 10. do 11. { 22. } 23. while (true); // endless loop | |
Re: hi angel We are just discussing similar stuff on another thread. What about your former problems, alreday solved? -- tesu | |
Re: Hi I didn't found any error function when I was searching the compilers (gcc, visual c, watcom). Therefore, I took an approximation from Abramowitz/Stegun and wrote my own erf(x). It's approximation error is about 10^(-7). which was almost always sufficient for my apps. erf(x) = 1-erfc(x). [CODE]double erf(double x) { … | |
Re: Hello, 151262 rows are too much, they can hardly be inserted by means of insert statements and php because of too much time consuming. Instead, bulk insert should be done with MySQL LOAD DATA INFILE. -- tesu | |
Re: Hi seems to be a bigger task, not just suitable for first-year students. First, I suppose you want to input two-dimensional matrices (not multi-dim. ones), because of your both loops i,j. If so, you should decide how your 2D matrix is to store. In principle, you can do that column … | |
Re: [QUOTE=Srcee;1277219]Okay, so I have a project activity to find maximum and min elements of a matrix. I kinda know how to make .asm file, but I don't know how to make .exe and .obj. Or are they generating by themselves? How to connect .exe with .asm?[/QUOTE] Hello OKay, that depends … | |
Re: Hi well, understanding a data model only by names of listed tables (entities) and keys where some of them express vague relationships is hardly feasible. You should describe verbally what are client, vendor, employee, what are their relationships? One cannot review your keys without knowing that meta-data. Nobody knows whether … | |
Re: Hi we had similar question recently. You may look [URL="http://www.daniweb.com/forums/thread290970-3.html"]here[/URL]. Possibly you already know this older post by yourself. If you don't like classless plain odbc (mysql: Connector/ODBC) you could make use of mysql: Connector/C++. There are also nice [URL="http://dev.mysql.com/tech-resources/articles/mysql-connector-cpp.html"]tutorials [/URL] on Connector/C++. -- tesu | |
Re: rajarajan07 suggestion on proper NORMALIZATION is the most important and crucial fact when designing databases. Improper or even ignoring normalization always leads to inflexible "bigger" tables which usually suffer from redundancy, inserting, and updating anomalies. To work around such anomalies noticeably additional programming efforts on plain php, c, cpp, java … | |
Re: hi Virangya glad to meeting you again. Do you already solve your other problem? Well, what you want to do with boolean OR does not function for it combines the wrong rows from the three tables, which is kind of cross product, what you might have already noticed. Such an … | |
Re: Before looping, loop instruction decrements contains of cx and jumps to @b: (assuming this label) if contains of cx != 0. Unfortunately, your [B][COLOR="Red"]mov cx, 0ffffh[/COLOR][/B] fills cx with bit pattern 1111 1111 1111 1111B what is decimal[COLOR="Red"][B] -1 [/B][/COLOR](2's complement). Therfore -1 -1 makes -2 etc, what is !=0. … | |
Re: Hello, You can do this converting by means of basic bit operations on "hhmmss.sss" for masking (e.g. '8' = 0x38 --> 0x38&0x0F --> int 8) and then composing the single int digits to short int numbers with Horner method, for example: [CODE]void pasti (char *s, struct stm *st){ st->hh = … | |
Re: Your sql statement seems to be not correct. Probably there will be errors if it is executed. (possible reason: more than one value in resultset of subselects) Most likely the "=" or "!=" in front of the subselects are wrong and should be replaced by "in", or even combined with … ![]() |
The End.