440 Posted Topics

Member Avatar for Bruynz

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 …

Member Avatar for Bruynz
0
229
Member Avatar for imavp2

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

Member Avatar for imavp2
0
122
Member Avatar for vavazoom

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

Member Avatar for mike_2000_17
0
216
Member Avatar for maliy0

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

Member Avatar for maliy0
0
165
Member Avatar for yusuf.business

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

Member Avatar for yusuf.business
0
171
Member Avatar for DOdom75

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 …

Member Avatar for tesuji
0
95
Member Avatar for peter_budo

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

Member Avatar for tesuji
0
393
Member Avatar for blueman:-0

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

Member Avatar for tesuji
0
105
Member Avatar for gmunk

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

Member Avatar for aryan79
0
1K
Member Avatar for lukefuller

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 …

Member Avatar for tesuji
0
159
Member Avatar for imperator

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 …

Member Avatar for waphon
0
549
Member Avatar for bleedi

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

Member Avatar for bleedi
0
140
Member Avatar for tiwas

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

Member Avatar for tesuji
0
2K
Member Avatar for jeffsbaker

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 …

Member Avatar for jeffsbaker
0
356
Member Avatar for Taichi56

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 …

Member Avatar for Stylish
0
359
Member Avatar for VJTechno

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

Member Avatar for VJTechno
0
157
Member Avatar for drspock

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

Member Avatar for tesuji
0
248
Member Avatar for vavazoom

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

Member Avatar for mike_2000_17
0
733
Member Avatar for alkeshtech

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 …

Member Avatar for griswolf
0
106
Member Avatar for andrewktmeikle

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 …

Member Avatar for andrewktmeikle
0
536
Member Avatar for Tommy.b

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 …

Member Avatar for Tommy.b
0
154
Member Avatar for kymarscheng

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 …

Member Avatar for urjapandya
0
152
Member Avatar for manibest

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

Member Avatar for tesuji
0
185
Member Avatar for sivak

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 …

Member Avatar for tesuji
0
58
Member Avatar for ThrasherK

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

Member Avatar for ThrasherK
0
212
Member Avatar for swi2

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 …

Member Avatar for keval_hack
0
785
Member Avatar for trashed

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

Member Avatar for Jayavardhan
0
461
Member Avatar for canadian_angel

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 …

Member Avatar for tesuji
0
84
Member Avatar for VBNick

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 …

Member Avatar for VBNick
0
142
Member Avatar for seger

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

Member Avatar for tesuji
0
143
Member Avatar for weasel7711

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

Member Avatar for tesuji
0
234
Member Avatar for acidhax

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 …

Member Avatar for tesuji
0
128
Member Avatar for SWEngineer

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 …

Member Avatar for Swede1875
0
596
Member Avatar for vibhaJ

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

Member Avatar for tesuji
0
313
Member Avatar for xyzxyzxyx

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 …

Member Avatar for tesuji
0
95
Member Avatar for GWalk612

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

Member Avatar for tesuji
0
175
Member Avatar for breakid

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

Member Avatar for tesuji
0
158
Member Avatar for +_+man

As StuXYZ already suggested, drop these lines: 10. do 11. { 22. } 23. while (true); // endless loop

Member Avatar for tesuji
0
158
Member Avatar for canadian_angel

hi angel We are just discussing similar stuff on another thread. What about your former problems, alreday solved? -- tesu

Member Avatar for d5e5
0
147
Member Avatar for Yaserk88

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

Member Avatar for tesuji
0
631
Member Avatar for keval_hack

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

Member Avatar for tesuji
0
2K
Member Avatar for Srcee

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 …

Member Avatar for tesuji
0
109
Member Avatar for Srcee

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

Member Avatar for tesuji
0
522
Member Avatar for tammy2512

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 …

Member Avatar for tesuji
0
616
Member Avatar for vinotharan

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

Member Avatar for tesuji
0
336
Member Avatar for cristi08

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 …

Member Avatar for tesuji
0
144
Member Avatar for Virangya

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 …

Member Avatar for tesuji
0
94
Member Avatar for sreenadhs

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

Member Avatar for tesuji
0
95
Member Avatar for cktbrd

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

Member Avatar for kings_mitra
0
270
Member Avatar for MichaelWClark

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 …

Member Avatar for 1stDAN
0
167

The End.