In DB2 when I’m giving a select statement its taking lot of time, the reason is like the table is a very huge table. As a result some times it is locking the table. Can any one help me for executing the select query with any option which would not lock the table. Thank you [...]
I want to pass the result of a sql query as the column name in another query eg. (note there will be a single result for the first query) SELECT CASE WHEN fld_type1 = ‘A’ THEN ‘VAL_ALPHA1′ WHEN fld_type1 = ‘D’ THEN ‘VAL_DATE1′ ELSE ‘VAL_NUM1′ END AS FIELDNAME FROM TABLE1 I want the result of [...]
Is there a way to configure SQL Server to not lock tables where I am using the SELECT statement, so as to not have to writte “with NOLOCK” every time I use SELECT?
I am experiencing slow views on my database. If I create a view and run it, then use the same select statement from the view and run. They both return the same data, but View runs slower. My expectations was that since views are compiled, they should run faster. Could some one clearify this for [...]
Hey guys!!! I’m quite new to VB.NET 2005. I need to know how to add, update and retrieve data manually using VB.NET 2005. In the software which I’m trying to implement, data is entered in text boxes and then they are updated/added into an SQL table. When retrieving the data, for example: A student is [...]
Hi, The below inner SELECT returns huge amount of rows (1000000+) and the outer SELECTs(alpha BETWEEN #startRec# AND #endRec#) is used for PAGINATION to display data with 25 in each page. Issue is:-This PAGINATION done below is very slow and slows the entire display of data.So could all please help me on doing this below [...]
How do you write a SQL query to find a specific word in a SQL column. Example: I want to show all records that have the word Bob in it but do not want to include records that are Bobby or Bobble etc., only the exact word Bob. Hope that makes sense.
Sorry if the title is a bit vague but its almost what am I trying to solve. The best way to explain my issue is this. If I have a table which takes the format.. user_id, error_code. (and other values also). The problem is that the same user_id is listed multiple times for each error_code [...]
Hi experts, I am getting this error when I run my test case for my PL/SQL procedure, which has select and insert statements only. Not clear where I would have went wrong, Please guide me where should I check exactly. Its popping up with this error message which i caught in a exception piece after [...]
HI Experts, I have a OUT parameter in my procedure(whihc performs INSERT data into a table),how to handle this OUT parameter (primary key of table) — Will Insert statement inside the PL/SQL block should include this parameter or we should use SELECT stm after Insert to add this attribute ,i am unclear on this please [...]
Please can someone tell me how I can save the output from an SQL select statement to a spool file. Thanks, Tom
I’d like to conditionally control the host variable into which the data from an SQL select statement is retrieved. This is for flexibility, so that I can use the same code in my program more than once. Here is a code sample: C/EXEC SQL C+ If :ResultName = ‘AgtMaster’ C+ Then C+ Fetch Next From [...]
Hi Experts, Pls hlp me with my query How can i join 3 tables using JOIN Keyword inside PL/SQL block in SELECT … WHERE clause Query 3 Tables namely Reg,ROOTS,ME and the select statement takes both parameter variable and local variable Thanks!!!!!
I have two tables DETAIL and USER. Detail table have two columns (projectid and projectdetail). Projectid is a primary key in DETAIL table. USER table have two columns (projectid and Userid). User table is like more than one userid can be under each projectid, one user can access more than one projectid. like the following [...]
SELECT obj.object_type FROM apps.opt_log_issue log, discov.opt_changed_database_objects obj WHERE –(UPPER(log.resolution(+)) like ‘%’||obj.object_name||’%’ – and trunc(log.resolution_date(+)) – trunc(to_date(substr(obj.last_ddl_time,1,11),’dd-mon-yy’)) <=5 – and trunc(log.resolution_date(+)) – trunc(to_date(substr(obj.last_ddl_time,1,11),’dd-mon-yy’)) >=0) OR (UPPER(log.resolution(+)) like ‘%’||obj.object_name||’%’ and log.resolution_date(+) is null) /
Where can I find information about the advantages and disadvantages of using SQL commands like BCP, BULK INSERT, SELECT INTO, etc.?
Hi All, I have a select statement that stores the result in a variable,this works fine if there is only one condition and field in the clause.How do I go about it if there is more than one? For example (Working one) SELECT @Variable = (SELECT [Field] FROM [Table] WHERE [FIELD] = Value) But I [...]
I am using OPENROWSET to output the result of a number of SQL SELECT statements into a spreadsheet. It works for most of the SELECT statements, but there are 4 random queries out of 82 that take more than an hour to execute. This is the code: insert into OPENROWSET(‘Microsoft.Jet.OLEDB.4.0′, ‘Excel 8.0;Database=D:MGTempESWIConvAuditQueriescnvWriteOff.xls;’, ‘SELECT Phone, Member, [...]
I am using SQL to code a select statement. If the result of the statement = count(*)=0, I want to put a message out on a report.
I need to eliminate duplicate records by comparing two fields, if the data is the same, I only want it to appear once. “Select Distinct” report option compares the complete record. Please help





