Click here to Skip to main content
15,920,111 members
Home / Discussions / Database
   

Database

 
GeneralRe: Evaluating decimal type Pin
Colin Angus Mackay18-Nov-04 1:37
Colin Angus Mackay18-Nov-04 1:37 
GeneralParadox Binary Blob Pin
elapid18-Nov-04 0:53
elapid18-Nov-04 0:53 
GeneralUpdate Pin
vuthaianh17-Nov-04 16:56
vuthaianh17-Nov-04 16:56 
GeneralRe: Update Pin
Edbert P17-Nov-04 19:18
Edbert P17-Nov-04 19:18 
GeneralMultiple INSERTs in a Stored Procedure Pin
Luis Alonso Ramos17-Nov-04 6:58
Luis Alonso Ramos17-Nov-04 6:58 
GeneralRe: Multiple INSERTs in a Stored Procedure Pin
Edbert P17-Nov-04 19:31
Edbert P17-Nov-04 19:31 
GeneralRe: Multiple INSERTs in a Stored Procedure Pin
Luis Alonso Ramos18-Nov-04 6:59
Luis Alonso Ramos18-Nov-04 6:59 
GeneralWHERE X IN QueryY - Parameters Pin
Tristan Rhodes17-Nov-04 3:11
Tristan Rhodes17-Nov-04 3:11 
I have the following section of code

str_SQL = "(SELECT Description.DescKey " _
& "FROM (Category INNER JOIN SubCategory ON Category.CategoryKey = SubCategory.CategoryKey) " _
& "INNER JOIN Description ON SubCategory.SubCategoryKey = Description.SubCategoryKey " _
& "WHERE (Category.CategoryDescription)='" & GetCurrCategory & "')"

'TO REMOVE
CurrentDb.QueryDefs.Delete "qdf_q"

'Create sub query
Dim qdf_Query As QueryDef
Set qdf_Query = CurrentDb.CreateQueryDef("qdf_q", str_SQL)
DoCmd.OpenQuery ("qdf_q")

'Build base action
str_SQL = "DELETE FROM Description " _
& "WHERE DescKey " _
& "IN (qdf_q)"

'Execute Query
CurrentDb.Execute (str_SQL)


The queries with code format removed are:

SELECT Description.DescKey
FROM (Category INNER JOIN SubCategory ON Category.CategoryKey = SubCategory.CategoryKey)
INNER JOIN Description ON SubCategory.SubCategoryKey = Description.SubCategoryKey " _
WHERE (Category.CategoryDescription = GetCurrCategory())

DELETE FROM Description
WHERE DescKey
IN (qdf_q)


Now, the problem I have is, the first query generates the correct table, which contains all the items I want to remove. But when I try and run the second query, It displays an error saying "Too few parameters, expected 1"

I have all the single parameter covered already, so why is it doing this?

Cheers

Cata

(Sorry, SQL n00b Poke tongue | ;-P )
GeneralRe: WHERE X IN QueryY - Parameters Pin
Mike Ellison17-Nov-04 6:30
Mike Ellison17-Nov-04 6:30 
GeneralRe: WHERE X IN QueryY - Parameters Pin
Tristan Rhodes17-Nov-04 22:31
Tristan Rhodes17-Nov-04 22:31 
GeneralRe: WHERE X IN QueryY - Parameters Pin
Mike Ellison18-Nov-04 8:41
Mike Ellison18-Nov-04 8:41 
GeneralRe: WHERE X IN QueryY - Parameters Pin
Tristan Rhodes18-Nov-04 23:39
Tristan Rhodes18-Nov-04 23:39 
Generalcannot execute dts packages with asp.net Pin
steven_wong16-Nov-04 16:38
steven_wong16-Nov-04 16:38 
GeneralRe: cannot execute dts packages with asp.net Pin
minhpc_bk16-Nov-04 18:56
minhpc_bk16-Nov-04 18:56 
GeneralRe: cannot execute dts packages with asp.net Pin
steven_wong17-Nov-04 22:16
steven_wong17-Nov-04 22:16 
GeneralRe: cannot execute dts packages with asp.net Pin
minhpc_bk18-Nov-04 22:54
minhpc_bk18-Nov-04 22:54 
GeneralRe: cannot execute dts packages with asp.net Pin
steven_wong20-Nov-04 16:27
steven_wong20-Nov-04 16:27 
GeneralRe: cannot execute dts packages with asp.net Pin
minhpc_bk21-Nov-04 23:16
minhpc_bk21-Nov-04 23:16 
GeneralRe: cannot execute dts packages with asp.net Pin
minhpc_bk25-Nov-04 13:44
minhpc_bk25-Nov-04 13:44 
GeneralCRecordset Edit Pin
Shotgun16-Nov-04 14:45
Shotgun16-Nov-04 14:45 
GeneralSQLDataReader for image type Pin
mysorian16-Nov-04 12:09
professionalmysorian16-Nov-04 12:09 
GeneralRe: SQLDataReader for image type Pin
Luis Alonso Ramos21-Nov-04 15:25
Luis Alonso Ramos21-Nov-04 15:25 
GeneralRe: SQLDataReader for image type Pin
mysorian21-Nov-04 18:18
professionalmysorian21-Nov-04 18:18 
GeneralRe: SQLDataReader for image type Pin
Luis Alonso Ramos21-Nov-04 18:44
Luis Alonso Ramos21-Nov-04 18:44 
GeneralRe: SQLDataReader for image type Pin
mysorian22-Nov-04 0:33
professionalmysorian22-Nov-04 0:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.