Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 25th, 2003, 02:39 PM
gothrog gothrog is offline
Micro Junky
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: NJ
Posts: 80 gothrog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 6 m 43 sec
Reputation Power: 6
Question Sql

I keep getting action failed everytime I try doing this:

UPDATE soft_lic
SET [soft_lic].[used_lic] = [soft_lic].[used_lic]+1
WHERE (
SELECT [soft_lic].[recordnum]
FROM soft_lic
WHERE (
SELECT [PC_Soft].[recordnum]
FROM PC_Soft
WHERE(
SELECT MAX(ID)
FROM PC_Soft)));

If someone could help me it would be greatly appreciated.

Mike

Reply With Quote
  #2  
Old June 25th, 2003, 10:50 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
What database system? What is the error message?

Reply With Quote
  #3  
Old June 26th, 2003, 08:27 AM
gothrog gothrog is offline
Micro Junky
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: NJ
Posts: 80 gothrog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 6 m 43 sec
Reputation Power: 6
I'm using M.S. access 2000 unfortuntely; and this is the "view SQL part of the design query.

I have gotten other joins to work but not an update.

Error:
Action failed

Macro name: add_lic_relationship
Condition: true
action name: open query
arguments: upkeep_lic, datasheet, edit


Last edited by gothrog : June 26th, 2003 at 10:39 AM.

Reply With Quote
  #4  
Old June 26th, 2003, 10:42 AM
gothrog gothrog is offline
Micro Junky
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: NJ
Posts: 80 gothrog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 6 m 43 sec
Reputation Power: 6
Exclamation Help!!!

Does Anybody Have a Clue What is Possibly Wrong, so you can Steer me in the right direction????

Reply With Quote
  #5  
Old June 26th, 2003, 12:22 PM
hedge hedge is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2002
Posts: 692 hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 20 h 2 sec
Reputation Power: 19
That sql looks wrong to me, I have never seen the syntax where= (<subquery>) it is usually where table.column = (<subquery>)... what is it comparing is it just the existance of a row?

Here's how I would expect it to look:
PHP Code:
 UPDATE soft_lic 
  SET soft_lic
.used_lic soft_lic.used_lic+
WHERE soft_lic
.recordnum 
      (
SELECT soft_lic.recordnum
         FROM soft_lic 
        WHERE soft_lic
.recordnum 
              (
SELECT PC_Soft.recordnum 
                 FROM PC_Soft 
                WHERE ID 
= (SELECT MAX(IDFROM PC_Soft)
              )
      ); 


Which simplified I believe is the same as:
PHP Code:
 UPDATE soft_lic 
  SET soft_lic
.used_lic soft_lic.used_lic+
WHERE soft_lic
.recordnum 
      (
SELECT PC_Soft.recordnum 
         FROM PC_Soft 
        WHERE ID 
= (SELECT MAX(IDFROM PC_Soft)
      ) 

Reply With Quote
  #6  
Old June 26th, 2003, 01:03 PM
gothrog gothrog is offline
Micro Junky
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: NJ
Posts: 80 gothrog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 6 m 43 sec
Reputation Power: 6
Smile

Thank you

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Sql


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway