Search Results

Search found 4815 results on 193 pages for 'parameterized queries'.

Page 8/193 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Parameterized include in Classic ASP with VBScript

    - by Thom Smith
    I want to write a function that will include an external file, much like Server.Execute, but will pass along parameters. I'm aware that Server.Execute will pass along query parameters, but I'd like to pass data more generally. For instance: ' main.asp MyInclude("external.inc", Array("mykey", "myval")) ' external.inc Response.Write mykey I doubt I can get quite that far without reading the external fine, twiddling it, and executing, but I'd like to get as close as reasonably possible. Also, if possible, I'd prefer avoiding using the query passing option for security reasons.

    Read the article

  • Using a ICollection Value in sqlite SELECT parameterized statment

    - by case23
    Im trying to get all the entrys from a sqlite Database which have the same name as the keys in a Hashtable. My Statement looks like this. // the keys from the hashtable are names equivalent // to name entrys in the SomeTable Names Collumn Hashtable names; String query = "SELECT Id, Name FROM SomeTable WHERE Name LIKE (@Names)"; SQLiteCommand command = new SQLiteCommand(query, _databaseConnection); command.Parameters.AddWithValue("@Names", names.Keys); SQLiteDataReader reader = reader.ExecuteReader(); while(reader.Read()) { Console.WriteLine("Name: {0}, ID: {1}", reader[1].ToString(), reader[0].ToString()); } Im totally sure there are similar values in the Database, but i get nothing back and the reader does not execute. Is it impossible to add a ICollection as a Parameter Value so i need to start the reader only one time?

    Read the article

  • Java - Iterator: "Syntax error, parameterized types are only available if source level is 5.0"

    - by Helpme
    Hi! I'm purposely targeting Java OS 1.4.2 I'm trying to use an iterator combined with apache's POI to read an excel spreadsheet. The code runs perfectly in java 1.5, but in the 1.4.2 version I get the error listed in the question subject. the code is: Iterator myIter = null; it breaks on that line of code, which is clearly at the beginning of the application. I dont understand what needs to be done to correct this issue. Please let me know if you have any insight!

    Read the article

  • how to use a parameterized function for the Default Binding of a Sql Server column

    - by Walt Gaber
    I have a table that catalogs selected files from multiple sources. I want to record whether a file is a duplicate of a previously cataloged file at the time the new file is cataloged. I have a column in my table (“primary_duplicate”) to record each entry as ‘P’ (primary) or ‘D’ (duplicate). I would like to provide a Default Binding for this column that would check for other occurrences of this file (i.e. name, length, timestamp) at the time the new file is being recorded. I have created a function that performs this check (see “GetPrimaryDuplicate” below). But I don’t know how to bind this function which requires three parameters to the table’s “primary_duplicate” column as its Default Binding. I would like to avoid using a trigger. I currently have a stored procedure used to insert new records that performs this check. But I would like to ensure that the flag is set correctly if an insert is performed outside of this stored procedure. How can I call this function with values from the row that is being inserted? USE [MyDatabase] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[FileCatalog]( [id] [uniqueidentifier] NOT NULL, [catalog_timestamp] [datetime] NOT NULL, [primary_duplicate] nchar NOT NULL, [name] nvarchar NULL, [length] [bigint] NULL, [timestamp] [datetime] NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[FileCatalog] ADD CONSTRAINT [DF_FileCatalog_id] DEFAULT (newid()) FOR [id] GO ALTER TABLE [dbo].[FileCatalog] ADD CONSTRAINT [DF_FileCatalog_catalog_timestamp] DEFAULT (getdate()) FOR [catalog_timestamp] GO ALTER TABLE [dbo].[FileCatalog] ADD CONSTRAINT [DF_FileCatalog_primary_duplicate] DEFAULT (N'GetPrimaryDuplicate(name, length, timestamp)') FOR [primary_duplicate] GO USE [MyDatabase] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[GetPrimaryDuplicate] ( @name nvarchar(255), @length bigint, @timestamp datetime ) RETURNS nchar(1) AS BEGIN DECLARE @c int SELECT @c = COUNT(*) FROM FileCatalog WHERE name=@name and length=@length and timestamp=@timestamp and primary_duplicate = 'P' IF @c > 0 RETURN 'D' -- Duplicate RETURN 'P' -- Primary END GO

    Read the article

  • Java compiler rejects variable declaration with parameterized inner class

    - by Johansensen
    I have some Groovy code which works fine in the Groovy bytecode compiler, but the Java stub generated by it causes an error in the Java compiler. I think this is probably yet another bug in the Groovy stub generator, but I really can't figure out why the Java compiler doesn't like the generated code. Here's a truncated version of the generated Java class (please excuse the ugly formatting): @groovy.util.logging.Log4j() public abstract class AbstractProcessingQueue <T> extends nz.ac.auckland.digitizer.AbstractAgent implements groovy.lang.GroovyObject { protected int retryFrequency; protected java.util.Queue<nz.ac.auckland.digitizer.AbstractProcessingQueue.ProcessingQueueMember<T>> items; public AbstractProcessingQueue (int processFrequency, int timeout, int retryFrequency) { super ((int)0, (int)0); } private enum ProcessState implements groovy.lang.GroovyObject { NEW, FAILED, FINISHED; } private class ProcessingQueueMember<E> extends java.lang.Object implements groovy.lang.GroovyObject { public ProcessingQueueMember (E object) {} } } The offending line in the generated code is this: protected java.util.Queue<nz.ac.auckland.digitizer.AbstractProcessingQueue.ProcessingQueueMember<T>> items; which produces the following compile error: [ERROR] C:\Documents and Settings\Administrator\digitizer\target\generated-sources\groovy-stubs\main\nz\ac\auckland\digitizer\AbstractProcessingQueue.java:[14,96] error: improperly formed type, type arguments given on a raw type The column index of 96 in the compile error points to the <T> parameterization of the ProcessingQueueMember type. But ProcessingQueueMember is not a raw type as the compiler claims, it is a generic type: private class ProcessingQueueMember <E> extends java.lang.Object implements groovy.lang.GroovyObject { ... I am very confused as to why the compiler thinks that the type Queue<ProcessingQueueMember<T>> is invalid. The Groovy source compiles fine, and the generated Java code looks perfectly correct to me too. What am I missing here? Is it something to do with the fact that the type in question is a nested class? (in case anyone is interested, I have filed this bug report relating to the issue in this question) Edit: Turns out this was indeed a stub compiler bug- this issue is now fixed in 1.8.9, 2.0.4 and 2.1, so if you're still having this issue just upgrade to one of those versions. :)

    Read the article

  • Creating parameterized type object using annonymous class

    - by Andrei Fierbinteanu
    This might be a stupid question, but I just saw a question asking how to create a Type variable for a generic type. The consensus seemed to be that you should have a dummy method returning that type, and then use reflection to get it (in this case he wanted Map<String, String>). Something like this : public Map<String, String> dummy() { throw new Error(); } Type mapStringString = Class.forName("ThisClass").getMethod("dummy").getGenericReturnType(); My question is, not having used reflection that much, couldn't you just do something like: Type mapStringString = new ParameterizedType() { public Type getRawType() { return Map.class; } public Type getOwnerType() { return null; } public Type[] getActualTypeArguments() { return new Type[] { String.class, String.class }; } }; Would this work? If not, why not? And what are some of the dangers/problems if it does (besides being able to return some Type like Integer<String> which is obviously not possible.

    Read the article

  • pl/sql creating a function with parameterized cursor with return date

    - by user3134365
    create or replace FUNCTION get_next_sch_date(cert_id VARCHAR2,test_id VARCHAR2) RETURN DATE AS CURSOR next_sch_date(pb_id number,test_no varchar2) IS SELECT Sch_Controls,PBY_FRQ,START_AFTER__CAL_DAYS,PBY_DUE_BY,PBY_NEXT_SCH_TEST_DATE FROM ms_cmp_plan_pby WHERE pby_id=pb_id AND test_plan_id=test_no; l_new_date DATE; l_new_sch number; sch_ctrl VARCHAR2(100); pb_frq VARCHAR2(100); start_days NUMBER; due_days NUMBER; test_date DATE; pb_id NUMBER; test_no NUMBER; BEGIN OPEN next_sch_date(pb_id,test_no); loop FETCH next_sch_date INTO sch_ctrl,pb_frq,start_days,due_days,test_date; SELECT DISTINCT pby_rec_id INTO l_new_sch FROM ms_cmp_assignment_log WHERE ASSIGNMENT_ID=cert_id AND PLAN_ID=test_id; exit; end loop; CLOSE next_sch_date; RETURN l_new_date; Exception WHEN others THEN RETURN NULL; end; this is my function but i dont getting excepted result

    Read the article

  • Mysql queries stuck in "sending data" state

    - by MarkPW
    I'm running a Litespeed web server and a database server (2 x Clovertown 5335) with MySQL 5.1.52-log (running on Cent OS 4.5 and 4.6 32bit respectively). Last week, I upgraded from 5.0.51a-community-log and since then I've been having a problem whereby my database server's load starts increasing for no apparent reason. Running SHOW PROCESSLIST; I see all of my SQL_CACHE queries that use a wildcard in WHERE, backing up and getting stuck in "sending data" state. However, other queries that use SQL_CACHE but no wildcard do not get caught up in this. To get things going again, the first time it happens (after about 24 hours), I have to restart mysql. 4/5 times it will re-occur after about 20 minutes or so and this time and for subsequent occurrences it is not necessary to restart mysql. Simply stopping the web server for a few minutes will suffice while I allow the stuck queries to clear themselves up. I had no such problem with the the previous mysql install. What could be causing the issue and how do I resolve it? Thanks

    Read the article

  • Does MySQL log successful or attempted queries?

    - by Nathan Long
    I'm trying to track down a hit-or-miss bug in a web application. Sometimes a request completes just fine; sometimes it hangs and never finishes. I see that Apache now has several requests listed on the server-status page as "sending reply," and that doesn't change. I'm testing on localhost, so there shouldn't ever be more than one. Out of curiosity, I set MySQL to log all queries and I'm tail -fing the log file. When things go OK, I see a pattern like this: 20 Connect root@localhost on dbname 20 Query (some query #1) 20 Query (some query #2) (etc) 20 Quit 21 Connect (etc) When it hangs, I see a pattern like this: 22 Connect root@localhost on dbname 22 Query (some query #1) //nothing happens, so I try the post again 23 Connect root@localhost on dbname 23 Query (some query #1) //nothing happens; try again 24 Connect (etc) Here's my question: is MySQL logging attempted queries, or successful queries? In other words, if the last line I see is query #1, does that imply that query #1 or query #2 is hanging? My guess is that the one I don't see is the problem, because the last one I see looks fine, but maybe the one I don't see is too screwed-up for MySQL to process. Thoughts?

    Read the article

  • Automating Access 2007 Queries (changing one criteria)

    - by Graphth
    So, I have 6 queries and I want to run them all once at the end of each month. (I know a bit about SQL but they're simply built using Access's design view). So, in the next few days, perhaps I'll run the 6 queries for May, as May just ended. I only want the data from the month that just ended, so the query has Criteria set as the name of the month (e.g., May). Now, it's not hugely time consuming to change all of these each month, but is there some way to automate this? Currently, they're all set to April and I want to change them all to May when I run them in a few days. And each month, I'd like to type the month (perhaps in a textbox in a form or somewhere else if you know a better way) just once and have it change all 6 queries, without having to manually open all 6, scroll over to the right field and change the Criteria. Note (about VBA): I have used Excel VBA so I know the basics of VBA but I don't really know anything specific to Access (other than seeing code a few times). And, others will use this who do not know anything about Access VBA. So, I think I have found a similar question/answer that could do this in VBA, but I'd rather do it some other way. If the query needs to be slightly redesigned later, probably by someone who doesn't know Access VBA at all, it'd be nice to have a solution not involving VBA if that is even possible.

    Read the article

  • Putting indexes in separate filegroup kills our queries

    - by womp
    Can anyone shed some light on this? On our dev boxes, our database resides entirely in the PRIMARY filegroup, and everything works fine. On one of our production servers, recently upgraded from 2005 to 2008, we noticed it was performing slower than it should. On this machine, there are two filegroups - PRIMARY and INDEXES. Both filegroups contain 1 file per logical volume, one logical volume per CPU, (and each logical volume is a RAID 10 of 4 physical disks). We isolated a few queries that were performing fast on the dev boxes and slow (up to 40x slower) on the production machine. Turned out these queries were using the non-clustered indexes that resided in the INDEXES filegroup. Tweaking some of the queries to only use clustered indexes that were in the PRIMARY filegroup dropped their times back to normal. As a final confirmation, we redeployed the same database on the same machine to have everything in PRIMARY, and things went back to normal! Here's the statistics output of one of the queries, run identically on the machine with different filegroup configurations (table names changed to protect the innocent): FAST (everything in PRIMARY filegroup): (3 row(s) affected) Table '0'. Scan count 2, logical reads 14, ... Table '1'. Scan count 0, logical reads 0, ... Table '1'. Scan count 0, logical reads 0, ... Table '2'. Scan count 2, logical reads 7, ... Table '3'. Scan count 2, logical reads 1012, ... Table '4'. Scan count 1, logical reads 3, ... SQL Server Execution Times: CPU time = 437 ms, elapsed time = 445 ms. SLOW (indexes split into their own filegroup): (3 row(s) affected) Table '0'. Scan count 209, logical reads 428, ... Table '1'. Scan count 0, logical reads 0,... Table '2'. Scan count 1021, logical reads 9043,.... Table '3'. Scan count 209, logical reads 105754, .... Table '4'. Scan count 0, logical reads 0, .... Table '5'. Scan count 1, logical reads 695, ... **Table '#46DA8CA9'. Scan count 205, logical reads 205, ...** Table '6'. Scan count 6, logical reads 436, ... Table '7'. Scan count 1, logical reads 12,.... SQL Server Execution Times: CPU time = 17581 ms, elapsed time = 17595 ms. Notice the weird temp table and extra tables involved in the slow query. It seems clear that having a second file group is making SQL Server batty with choosing an execution plan. What the heck is going on?

    Read the article

  • MySQL queries - how expensive are they really?

    - by incrediman
    I've heard that mysql queries are very expensive, and that you should avoid at all costs making too many of them. I'm developing a site that will be used by quite a few people, and I'm wondering: How expensive are mysql queries actually? If I have 400,000 people in my database, how expensive is it to query it for one of them? How close attention do I need to pay that I don't make too many queries per client request?

    Read the article

  • Codeigniter: Combining activeRecord with manual queries?

    - by Industrial
    Hi everybody, I've though a bit about the activerecord vs. manual queries in Codeigniter. ActiveRecord is awesome when it's all about standard queries and holds development time really low. However, when there's a need to add some complexity to the queries, the ActiveRecord gets quite complicated to work with. Sub queries or complex joins gives atleast me a lot of headache. Since the current "$this-db-query" -call immediately executes the set query, it can't be combined with normal activeRecord calls. So, what can I do to combine the two methods? Thanks!

    Read the article

  • What are logical and path queries

    - by NomeN
    I'm reading a paper which mentions that a language for refactoring has three specific requirements. functional features (like ML) logical queries (like Datalog) path queries (like Datalog) I know what they mean by functional features, but I'm not totally clear on the latter two and can't find a clear explanation either. Although I have a good idea after what I could find on the subjects, I need to be sure so here goes: Could the SO-community please clearly explain to me what logical queries and path queries are? Or at the very least what the people from the paper meant?

    Read the article

  • Mysql: ROLLBACK for multiple queries

    - by Raj
    Hi I have more than three MySql queiries in a PHP script triggered by scheduled task. If a query catch an error, script throw an exception and rollback that Mysql query. It works fine. However if first query works fine, but not 2nd query, throw an exception, it rollback 2nd one but not 1st query. I am using begin_trans(), commit and rollback() for individual queries because Sometimes i need to rollback one query, sometimes all queries. Is there any way to rollback one query or all queries? Thanks in advance UPDATE: I got it working, there was no problem with in begin_trans(), commit and rollback(), the database connection config was different for one query from other queries, crazy code without any comments!!!

    Read the article

  • Setting wildcard queries as default for QueryParser

    - by user46703
    When my users enter a term like "word" I would like it be treated as a wildcard query "word*" so all terms beginning "word" are found. Is there a way to tell the QueryParser to automatically create wildcard queries or do I have to parse the query myself? This shouldn't be a problem for simple queries but it may become tricky for more complex queries.

    Read the article

  • Web Search API which allows automated queries

    - by Spi1988
    I need to develop a java desktop application which sends queries to a search engine in order to obtain the very first highest ranked pages (Example: the first 4 pages only). Some heavy processing needs to be performed on the retrieved pages, so the time between a query and another won't be less then a minute. I would like to know whether there is any web search API for java, suitable for my situation, i.e. which allows the use of automated queries? (since in my case, the queries are generated programatically, and not through user interaction) I have checked Google's AJAX Search API and also Yahoo's Search Boss, however they only allow queries triggered by direct user interaction.

    Read the article

  • Queries stuck in "copying to tmp table"

    - by Parik
    I am running some sample tests against mysql, and finding that there are a bunch of queries which are stuck in "copying to tmp tables". They remain stuck in the same state. They are usually aggregate queries and I can kill those queries. But how can I find out what is causing them to be stuck? I am using mysql 5.1.42 with the innodb plugin.

    Read the article

  • Execute multiple queries

    - by smartali89
    I am using OleDB for executing my queries in C#, Is there any way I can execute multiple queries in one command statement? I tried to separate them with semi-colon (;) but it gives error "Characters found at the end" I have to execute a few hundreds of queries at once.

    Read the article

  • Slow IE8 Start-up due to LDAP DNS queries

    - by MikeJ-UK
    Recently (in the last few days), my installation of IE8 has been taking 15 to 20 seconds to load my home page. Specifically, the sequence of events (as reported by WireShark) is:- Browser issues a DNS A query to resolve the home page server's IP address. Browser then spends the next 15-20 seconds broadcasting DNS SRV _LDAP._TCP queries, (roughly on a 2 second tick) to which it receives no answer (we have no LDAP servers). Browser re-issues the DNS A query and resolves the server's IP address again. Finally, the browser issues an HTTP GET for the home page. Does anyone know why this is happening? Possibly related to this question EDIT: @Massimo, LDAP query is :- Domain Name System (query) Transaction ID: 0x11c5 Flags: 0x0100 (Standard query) Questions: 1 Answer RRS: 0 Authority RRS: 0 Additional RRS: 0 Queries _LDAP._TCP: type SRV, class IN Name: _LDAP._TCP Type: SRV (Service location) Class: IN (0x0001)

    Read the article

  • moved wordpress site to rackspace cloud, now custom queries breaks code

    - by nikki
    Moved a wordpress site onto a rackspace account from a linux server. Everything is working except for any custom post queries that I programmed. these were working just fine before, and I have tested to make sure it is these queries that is breaking the code. For example here is a snippet that will make the page not load <?php query_posts( "p=215" ); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <? the_content(); ?> <? endwhile; endif; wp_reset_query(); ?> Does anyone have any insights? My thoughts are that the switch to Rackspace account has something to do with it.

    Read the article

  • MySQL returning slow queries with result sets bigger than 30 rows

    - by josephs8
    When ever I run a query that exceeds 30 queries the time for the query to run goes from less than a second to over 10 seconds to get data. Example I run a query to return 29 rows, it takes .1 seconds, I run a query to return 31 rows it takes 11.2 seconds. I am running mySQL on Windows 2008 Server Dual Core 2.6Ghz with 3GB of Memory. The machine doesn't run anything else. It does have a instance of MSSQL running on the server but that does not get used at all. This only happens via PHP right now, If I manually run the query on the server it returns it in less than a second. The queries are not complicated either I have included one below: SELECT Name, Value FROM `bis_co`.`departments` LIMIT 31 What would be causing this issue and how can I correct this? Am I missing a configuration setting in MySQL or something. Thanks

    Read the article

  • MySQL server simple insert/update/delete queries are taking a long time to execute

    - by ElGabbu
    We have a VPS hosting server with a MySQL server running on it. We host several databases for client's websites. Recently we have noticed that insert/update and delete queries are taking a long time to execute sometimes as close as 30 seconds. I use the following command to see these queries being executed: watch -n1 mysqladmin proc stat We have still not been able to track the root of this problem. I would apprecite if anyone had any pointers as to what we can check or improve to resolve the issue. Thanks

    Read the article

  • How do I make complex SQL queries easier to write?

    - by DragonLord
    I'm finding it very difficult to write complex SQL queries involving joins across many (at least 3-4) tables and involving several nested conditions. The queries I'm being asked to write are easily described by a few sentences, but can require a deceptive amount of code to complete. I'm finding myself often using temporary views to write these queries, which seem like a bit of a crutch. What tips can you provide that I can use to make these complex queries easier? More specifically, how do I break these queries down into the steps I need to use to actually write the SQL code? Note that I'm the SQL I'm being asked to write is part of homework assignments for a database course, so I don't want software that will do the work for me. I want to actually understand the code I'm writing. More technical details: The database is hosted on a PostgreSQL server running on the local machine. The database is very small: there are no more than seven tables and the largest table has less than about 50 rows. The SQL queries are being passed unchanged to the server, via LibreOffice Base.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >