SQL Questions


Random number generation
Hi, I have a 6 digit number. I need to make this as a 10 characters with those 6 digits within it. For eg, if my input number is 123456, the result should be a4y2d365p1. some combination of characters with the original 6 digit numbers. Please do let me know if this could be done [...]

Answer Question   |  May 20, 2008  6:44 PM
Random Number Generator, SQL, SQL Server
asked by:
5 pts.

Index Tuning Wizard shows error occurred while executing SQL statement but I can’t find the problem
I am facing a strange problem while using the Index Tuning Wizard (ITW) in SQL Server 2000. It shows error occurred while executing a SQL statement. I’ve checked every thing like trace is okay, as they show no problem with SQL Server 2005. Kindly give me some solution, URGENT.

Answer Question   |  September 28, 2008  3:36 AM
Index Performance, Index Tuning Wizard, ITW, SQL, SQL Server errors, SQL Server performance tuning
2,585 pts.

How to install a passive node on an active/active SQL Server cluster
We have a SQL cluster server running with SQL Server 2005 Enterprise Edition SP2 on Windows 2003 Enterprise Edition. Currently the cluster has 2 nodes with Active/Active. Now I need to add a new node as a Passive node. So once I’m done, the cluster will be a Active/Active/Passive cluster. Because the cluster is a [...]

Answer Question   |  May 14, 2008  3:09 AM
Installation, SQL Server 2005, SQL Server availability, SQL Server clustering
2,585 pts.

“GET DIAGNOSTICS” SQL Procedure
I am currently writing an SQLCBLLE Program on a V5R2 box. I would like to use the SQL Procedure “GET DIAGNOSTICS”, however each time I enter it into my code the both SEU and the compiler complain about it. I receive the message GET was not expected. I know the procedure was supported in V5R2 [...]

Answer Question   |  May 13, 2008  2:37 PM
COBOL, GET DIAGNOSTICS, SQL, SQLCBLLE
asked by:
200 pts.

Combined Address
I have one tblContacts that has “Home” and “Work” address included within it, I also have an option button 1=”Work” and 2=”Home”. I need to prepare a mailling report, but only for the defaut address. Someone suggested that I create a calculated field. I tried this but all that it is doing is pulling the [...]

Answer Question   |  May 12, 2008  5:29 PM
Microsoft Access, Query, SQL
asked by:
10 pts.

date functions using Oracle
Hi, I need to display the benefits paid for the current year using SQl,but the year is filtered using the year which is previous year for the current year.the date is in ‘yyyymm’ format. ex, select year_mnth,benefits_paid from tablename where year_mnth in (’200603′,’200602′,’200601′) note:it is in ‘yyyymm’ format group by year_mnth the benefits paid must [...]

Answer Question   |  September 22, 2008  6:59 AM
Oracle, Oracle development, Oracle SQL, SQL
asked by:
15 pts.

Error when executing RUNSQLSTM from CL program
I am trying to use the RUNSQLSTM command. I get the error message “statement not allowed” Not really trying anything fancy. In CL program RUNSQLSTM SRCFILE(jwe/QCLSRC) SRCMBR(SQL1) + COMMIT(*NONE) In SQL1 I have SELECT mstid, SUBSTR(ftxref,1,1) AS ftxref_1, SUBSTR(HEX(SUBSTR(ftxref,2,7)),1,9) AS char, ftext, ftxtno FROM MEDPDATA/ftxp010 WHERE SUBSTR(ftxref,1,1) NOT IN (‘A’,'M’) AND ftxref NOT IN (SELECT [...]

Answer Question   |  April 20, 2010  3:32 PM
AS/400, AS/400 errors, CL, RUNSQLSTM, SQL
asked by:
5 pts.

SQL DB2 COBOL date reformatting
Hi and thanks in advance, I want to use DB2 SQL in COBOL to reformat a date from CCYY-MM-DD to MM-DD-YY. What is the simplest and most efficient way to do this? Christy

Answer Question   |  July 17, 2008  3:26 PM
COBOL, DB2, SQL
asked by:
10 pts.

Embedded SQL in a Cobol program using a sub-select in the select clause
The following works fine in SQLPLUS: SELECT SOVLCUR_PIDM INTO :STDN-PIDM FROM SOVLCUR WHERE SOVLCUR_PIDM = :HOLD-STU-PIDM AND SOVLCUR_LEVL_CODE = ‘UG’ AND SOVLCUR_LMOD_CODE = SB_CURRICULUM_STR.F_LEARNER AND SOVLCUR_CURRENT_IND = ‘Y’ SSRMEET_ROOM_CODE FROM SSBSECT, SSRMEET, SGRSPRT WHERE SGRSPRT_TERM_CODE = ’200810′ AND (SGRSPRT_SPST_CODE IS NULL OR SGRSPRT_SPST_CODE = ‘ ‘) AND SSBSECT_CRN = SSRMEET_CRN AND SSBSECT_TERM_CODE = ’200810′ AND [...]

Answer Question   |  May 6, 2008  6:58 PM
COBOL, Embedded SQL, SQL, SQLPlus
asked by:
5 pts.

Linux vs Microsoft
what is the Linux equivalent for SQL Server? Also, what is the difference between the two?

Answer Question   |  May 8, 2008  8:47 AM
Linux, Linux databases, SQL
asked by:
65 pts.

SQL linking to database in XP
First of all, I tried to create an ODBC connection to a local SQL database. It successfully created but it does not show up. I know it is there because I can link to it via Access or if I try to create the same one again, it tells me it is already there and [...]

Answer Question   |  May 6, 2008  2:33 PM
Database, ODBC, SQL, Windows XP
asked by:
15 pts.

What are the pros and cons for log shipping vs. replication in SQL Server? When is one favored over the other?
What are the pros and cons for log shipping vs. replication in SQL Server? When is one favored over the other?

Answer Question   |  May 2, 2008  5:21 PM
Log Shipping, SQL Server availability, SQL Server replication
2,585 pts.

sql query
from this table i have to take those records that have common gridcode and then from these records i have to store the records having maximum area in another table… gridcode state area 13013 rajasthan 50000 13013 gujarat 45000 13014 rajasthan 25000 13014 gujarat 25000

Answer Question   |  April 30, 2008  5:50 AM
SQL, SQL Query
asked by:
5 pts.

update a field from a file with a field from a selection from two files
Hi! When I try this: update fileD d set d.value = (select c.value from (select b.key, b.value from fileB b where b.key not in (select a.key from fileA a)) c where d.key = c.key) I get the message “Null values not allowed in column or variable VALUE.” on the other hand, when I do this [...]

Answer Question   |  April 29, 2008  11:03 AM
SELECT statement, SQL, Update
asked by:
Mr.
70 pts.

MOSS 2007 Server Installation and configuration problem
Need to know how I can get SharePoint to recognize a second partitioned drive on the same server where I’ve installed SQL server 2005 and want the SharePoint configuration database and everything held. Server (Mars) is set up with local C drive where I’ve installed Server 2003 OS. Then I have another drive on same [...]

Answer Question   |  April 29, 2008  3:09 PM
Installation, Products and Technologies wizard, SharePoint, SharePoint 2007, SQL
asked by:
5 pts.

Critical error in event logs
Why do I get this message; “SQLVDI: Loc=CVDS::Cleanup. Desc=Release(ClientAliveMutex). ErrorCode=(288)Attempt to release mutex not owned by caller.”?

Answer Question   |  April 29, 2008  2:24 PM
SBS, SBS 2003, SBS 2003 logs, SQL, SQL error messages, SQL Express
asked by:
15 pts.

Sql subquery
how can we use sql subquery in jsp?i am trying to write it but it gives me an error of missing operand?

Answer Question   |  April 29, 2008  1:53 PM
JSP, SQL, Subquery, Web development
asked by:
5 pts.

Moving a SQL database from one host to another
I need to help out in a move of a site coded in ASP/VBScript from one host we’re having major problems with to another host that has been highly reliable for us. They both offer all the same features needed for this site, but we don’t know how to move the SQL database along with [...]

Answer Question   |  May 8, 2008  2:54 AM
ASP, Database migration, SQL, SQL Database, VBScript, Web development
asked by:
10 pts.

IS It Possible to create Recusrive function using sql udf or stored procedures?
Hi i have a scenario of n level tree structure.in order to traverse to my desired node i am using Recursive function until i get my desired node in my vb code but i am getting a performance issue. SO i reckon that this performance can be overcome by using sql udf or stored procedure. [...]

Answer Question   |  April 28, 2008  7:38 AM
Recurive function, Recursion, SQL, SQL UDF, VB, Visual Basic
asked by:
15 pts.

Coding for library in stored procedures
A reader wrote in with this SQL stored procedure question. Our AS/400 experts weren’t as familiar with this topic. So, any SQL experts out there with an answer? Do I have to hard code the library in my stored procedure? I have my procedures in sqltblsrc and have to edit the library to create the [...]

Answer Question   |  April 25, 2008  3:38 PM
SQL, SQL stored procedures
asked by:
490 pts.