User Profile

Collapse

Profile Sidebar

Collapse
SLauren
SLauren
Last Activity: Aug 16 '11, 10:38 AM
Joined: Feb 16 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Class not registered for "this user" context using dcomcnfig in Windows 7!

    Hi All,
    I have two com server .exes let say COM1 and COM2 which are respectively implementing two interfaces say I1 and I2. Now i am invoking the components using
    Code:
    CoCreateInstance(...)
    one after another. When i say
    Code:
    CoCreateInstance(Com1,..)
    it returns S_OK, but it returns class not registered for
    Code:
    CoCreateInstance(Com2,..)
    . Again here i am registering the first Com but not the second one as the flow is like when the server .exe is up with the...
    See more | Go to post

  • SLauren
    replied to Select query between two tables
    You can try this:

    Code:
    SELECT	DISTINCT TABLE1.*
    FROM		TABLE1
    LEFT JOIN 	TABLE2
    ON		TABLE1.usr = TABLE2.usr AND TABLE1.value = TABLE2.value WHERE TABLE2.usr is null AND TABLE2.value IS NULL;
    Hope this could help.

    Thanks,
    Lauren
    See more | Go to post

    Leave a comment:


  • You can use "SQL_CALC_FOUND _ROWS" to get the number of rows being resulted out of the query executed and after executing the query assign "FOUND_ROWS ()" to your out parameter which will hold the number of records resulted. You can use the LIMIT keyword on the whole query.

    For example:

    Code:
    SELECT SQL_CALC_FOUND_ROWS DISTINCT ID,Name FROM Table1 WHERE <Condition>
    UNION
    SELECT DISTINCT
    ...
    See more | Go to post

    Leave a comment:


  • You can try like:

    Code:
    SELECT state, sum( IF( PASS_FAIL = 'P', 1, 0 ) ) AS tp 
    FROM ( 
      
      
    SELECT inst.state, res. *  
    FROM institute inst
    INNER JOIN result res ON inst.centrecode = res .original_c 
    ) 
    AS val
    group BY state 
    LIMIT 0 , 30;
    See more | Go to post

    Leave a comment:


  • SLauren
    started a topic Trigger on Transaction and Lock !!!!

    Trigger on Transaction and Lock !!!!

    Hi All,

    I have a post insert trigger for Table ‘A’ that will insert data into Table ‘B’. My question is once the data being inserted into Table ‘A’ through a transaction from Business layer, Whether the after trigger will get executed once the transaction gets committed or the trigger will get executed once the data get inserted into table ‘A’ (Before the transaction gets committed)? If it is the later case then, what...
    See more | Go to post

  • SLauren
    replied to Help with SELECT id IN query
    Thanks mwasif for providing this nice snippet :-).

    Cheers,
    Lauren....
    See more | Go to post

    Leave a comment:


  • SLauren
    replied to Help with SELECT id IN query
    Find the sum of all the selected values as you mentioned (1,5,13) and use the sum in the below query along with all the selected values:
    // Assume total = 1 + 5 + 13 = 19
    // First_Val = 1, Second_Val = 5 and Third_Val = 13

    Code:
    SELECT * FROM products WHERE products.productid IN (SELECT products_categories.productid FROM products_categories GROUP BY products_categories.productid HAVING SUM(IF(products_categories.categoryid
    ...
    See more | Go to post

    Leave a comment:


  • SLauren
    replied to mysql counting occurances in a table
    You can try something like:

    Code:
    SELECT person FROM my_table GROUP BY person HAVING COUNT(has) = (SELECT COUNT(DISTINCT has) FROM my_table);

    Hope this could help.

    Thanks,
    Lauren
    See more | Go to post

    Leave a comment:


  • SLauren
    replied to Create Cursor from prepare statement!!!!
    I could be able to do this with the help of "View". I created a view by selecting the required columns from the dynamic query and then created the cursor from the view.

    Thanks,
    Lauren
    See more | Go to post

    Leave a comment:


  • SLauren
    started a topic Create Cursor from prepare statement!!!!

    Create Cursor from prepare statement!!!!

    Hi Friends,
    I want to create a cursor which will get filled up from a dynamic query. For example:

    Code:
    SET @sqlQuery := CONCAT('SELECT <field1> FROM <table> WHERE <field2> = <some_value>');
    PREPARE stmt FROM @sqlQuery;
    Where <some_value> will be decided based on some input value to the procedure.

    Can i create a cursor from the above PREPARE statement??
    ...
    See more | Go to post

  • SLauren
    replied to Query with Quarter !!!!
    I worte a customized Quarter function which will take care of the financial year issue.

    Thanks,
    Lauren
    See more | Go to post

    Leave a comment:


  • SLauren
    replied to Query with Quarter !!!!
    I have written the following query for retrieving sum of amounts based on quarter if the financial year starts with Jan:-

    Code:
    SELECT  SUM(MSB.NetQnty) Total 
    FROM
    	MSA
    INNER JOIN 
    	MSB
    ON 
    	MSA.ID = MSB.RefID
    WHERE
    	MSA.Anchor_ID = intAnchorID
    AND 
    MSA.Org_ID = intOrgInstance
    AND
    MSA.InvoiceDate >= DATE_SUB(CURDATE(),INTERVAL 4 QUARTER)
    AND
    ...
    See more | Go to post

    Leave a comment:


  • SLauren
    started a topic Query with Quarter !!!!

    Query with Quarter !!!!

    Hi Guys,
    I have a query to write which will return the sum of amounts for different quarters in a year.But the problem is, the financial year may start from any of the months, not necessarily from Jan always.

    I have already written the query for finding these amounts if the financial year starts from January. Can anyone please help me to achieve this?

    Thanks in advance,
    Lauren
    See more | Go to post

  • SLauren
    replied to Error while restoring TRIGGERS
    I am able to restore tables,procedur es and functions.... the error only occurs while restoring triggers.

    Thanks,
    Lauren
    See more | Go to post

    Leave a comment:


  • SLauren
    started a topic Error while restoring TRIGGERS

    Error while restoring TRIGGERS

    Hi,
    I am getting the following error while restoring triggers from one db to another db in Windows XP using Mysql Administrator GUI Tool:
    Access denied for user 'User1'@'%' to database 'TestDB1'.

    Can anyone please suggest me what i have to do?

    TIA....
    Lauren
    See more | Go to post

  • SLauren
    replied to How to count frequen data in database
    Can you add one more column to your table, say "occurrence " with a default value of zero.
    If you already have the result with you, then you can try the following query which will update your occurrence column and get the phone number which will have maximum number of occurrences for the result:

    Code:
    UPDATE participate SET occurrence = IF(vote1 <=  result,vote1 div result,0) + if(vote2 <=  result,vote2 div result,0)
    ...
    See more | Go to post

    Leave a comment:


  • SLauren
    replied to How to count frequen data in database
    If you already have the result, then the following query might help:

    Code:
    SELECT phone_no FROM Participate WHERE status = 5 and result IN (GREATEST(vote1,vote2,vote3,vote4,vote5));
    Hope this could help.

    Thanks,
    Lauren
    See more | Go to post

    Leave a comment:


  • SLauren
    replied to Sql Wildcards Select HAS
    You can execute the sample query, which i posted, from mysql command line or query browser(Windows ).

    The query can be written as:

    Code:
    SELECT * FROM `commentary` WHERE `comments` LIKE '%e%i%p%x%w%r%a%';
    Thanks,
    Lauren
    See more | Go to post

    Leave a comment:


  • SLauren
    replied to Sql Wildcards Select HAS
    I tried with spaces also as an example and it worked.
    You can try running the below sample query:

    Code:
    SELECT IF('lllle!g g ipg  ggxgg!wfff!rggg!affffx' like '%e%i%p%x%w%r%a%','eesde','nothing');
    I put spaces in between also.

    Thanks,
    Lauren
    See more | Go to post

    Leave a comment:


  • SLauren
    replied to Sql Wildcards Select HAS
    If you are specific to "e i p x w r a x" and maintain the order of the characters as you specified in the given word then, the following query might help:

    Code:
    SELECT * FROM tablename WHERE columnvalue LIKE  '%e%i%p%x%w%r%a%';
    Thanks,
    Lauren
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...