Databases

57K

Solutions

40K

Contributors

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.

Share tech news, updates, or what's on your mind.

Sign up to Post

Good day everyone....I have a problem with an Oracle (SQL) query and Coldfusion. I'm basically trying to query an Oracle database from multiple tables and build a new table. With that new table I want a sequential number in the ID field, starting at 1 and I want to start off slow to verify my data as I add more fields. So I have a simple piece of code below that does a count on my main table, and then I can add the data (count) to my ew table:

<cfquery name="getArt" datasource="PDBDEV">
    SELECT COUNT(*) AS numItems
    FROM BUDGET_MIPRS_SENT
</cfquery>

<cfloop from="1" to="#getArt.numItems#" index="i">

<cfquery name="qrySubmitForm" datasource="PDBDEV">
 INSERT INTO WATERFALL_DATA (WATERFALL_DATA.ID) VALUES (#i#)
 </cfquery>

But now, I want to add a field from the same table...and that fails so I believe I'm missing something. If I add the PROJ_NO field from the BUDGET_MIPRS_SENT table, it makes me add a grouping. And then if I add a group to the query, all I get is one record when I should get about 2000.

<cfquery name="getArt" datasource="PDBDEV">
    SELECT COUNT(*) AS numItems,
   PROJ_NO
    FROM BUDGET_MIPRS_SENT
   GROUP BY PROJ_NO
</cfquery>


So I'm guessing its not as simple as adding data fields?? Any guidance would be greatly appreciated.
0
Price Your IT Services for Profit
Price Your IT Services for Profit

Managed service contracts are great - when they're making you money. Yes, you’re getting paid monthly, but is it actually profitable? Learn to calculate your hourly overhead burden so you can master your IT services pricing strategy.

Hello,

I have a SQL Replication problem. I added some tables in an existing replication and I don't know what tables they are. Is there any way to see the history of tables I have added? (SQL 2008 R2)

I hope u can help me!
JN
0
I have an issue that just started happening with an ODBC Connection on a Windows 2003 Server (VP1) failing to connect to a database on remote Windows 2008 R2 SQL Server (SQL1).

I received the following error:
ERROR ODBC Database Datasource 'D4TN' [][Named Pipes Provider: Could not open a connection to SQL Server[2], while SQLConnect 08001
Failed to connect to Database using DSN 'D4TN' Err -1


I also noticed that the network shares of the SQL Server are not accessible anymore from 'VP1', I receive the following errors when trying to browse or clicking on the mapped drives:
An error occurred while reconnecting J: to \\SQL1\share
Microsoft Windows Network: The local device name is already in use
This connection has not been restored:


I am still able to browse network shares on 'SQL1' from all other Servers and also have successful ODBC connections to the database D4TN.

I can't ping the 'SQL1' server from 'VP1' and can't ping 'VP1' from 'SQL1', but I can ping 'VP1' and 'SQL1' successfully from other servers.

Please advise on how I can resolve this issue.
0
One of our junior DBAs added a series of Bitmap Indexes 6-months ago, that may have been ill-advised.  Based on recommendations from the SQL Tuning Advisor, as the Lead DBA, I approved and agreed with this change.   At the time our J2EE developers consistently complained about performance of our 3-node Oracle 12.1c database, and I was looking for something to hopefully improve query performance.

Currently we are experiencing very consistent Ora-2047 errors; "Distributed transition waiting for lock" issues.  I wonder if the Bitmap Indexes have contributed to the table locks?  Upon further review I have read that, bitmap indexes are better only when used for Datawarehouse applications; where tables are guaranteed to be read-only?  Is it true that typically bitmap indexes are frequently rebuilt, and it requires a full table lock?
0
Hello,
I get this error message, when I want to connect to MariaDB via FireDAC.
Where can I download the needed dll's?

I have downloaded the "MariaDB Connector/C x.x Series"  zip-file from this website https://downloads.mariadb.org/. But the dll's were not there.
My program is a 32-Bit application

Error message
0
In my SSIS for each loop...
It is grabbing each file in the folder and running the processes
Then moving the file just completed into an archive folder
My problem is that it is running the processes nN times depending on number of files remaining

So... if I start with 8 files...
It inserts the first file 8 times and runs the processes that many times
Moves that file
And then does the next file 7 times
And so in

Any ideas?

SSIS
For Each Loop Properties
0
I have a simple form that posts to a page that process the information and inserts it into a database table.
for some reason some of my people are coming through duplicated exactly .

After much narrowing down the problem, and tracking the browser in the table, I see it's only happening in chrome. all other browsers are coming through once.

i looked in the network tab and the page is only being called once.
i put a die(); right after the insert so make sure it's not doing anything else, and the page stops, but I still get 2 inserts

What else might this be?  My page was working fine for months, and suddenly last week this just started.
 try {

    $dbh = $conn->prepare("INSERT INTO dbo.[ ... ] ( ........) VALUES (?, ?,?,?,?,?, ?,,?)");
	$dbh->bindParam(1,  $firstname);
    $dbh->bindParam(2,  $lastname);
    $dbh->bindParam(3,  $address);
    $dbh->bindParam(4, $_POST['city']);
.....
	

 
	 $dbh->execute();
 			}

			//catch exception
			catch(Exception $e) {
		var_dump($e);
			}
die();

Open in new window

0
Hi,

In current production database of Mcirosoft sql server 2008, we recently performed maintenance activity of truncating log table that consumed 110 gb of storage space.
After truncate job is complete, we ran reorganize task for tables and indexes plus update statistics job on the table and indexes (full scan). The job was successfully complete
Even after performing the above task, the application performance had degraded.  
New to the Microsoft sql server world, please recommend any pointers to improve the performance.

Regards
0
hi,

I am MS SQL DBA and I am now going to study Sybase feature.

1) did sybase has horizontal scale out feature like MS SQL always on?
2) what is the tools (cost/free) tools that detect problematic query ? slowest query at run time?
3)  any tools to detect which part of the slowest query cause the problem?
4) what is the monitoring tools you all use can monitor most of the Sybase problem.
5) any tools help on detecting Sybase query anti pattern ?
6) any tools help on checking missing index and unused index?
7) what is the best backup tools for Sybase.
8) any read only round robin load balancing operation across sybase node?
9) admin and developement tools usually used by sybase DBA and why that?
0
Very rough start getting getting our practice upgrade from Oracle RAC 12.1 to 12.2 started.  After getting all the patches, finally successfully patched system.  We want to run clusvfy before proceeding to "gridSetup.sh".  However, we are failing to get through clusvfy, as it fails checking "resolv.conf" file with integrity issues and hangs forever.  There are also some PRVGg errors, but dont immediately have them with me at home. Anyone out there had similar experiences.

We are on Solaris 11, and we have a 3-node RAC 12.1 database.  Also, we are in a Solaris Zone Cluster environment.
0
Expert advice: How to get hired in cyber security
Expert advice: How to get hired in cyber security

Phil Richards knows cyber security. He’s the Chief Information Security Officer for Ivanti—and he has great advice for anyone looking to build a career in cyber security.

Hi Experts,

I am in need of some help in order to convince manager to agree on designing a table in a normalized manner.

Attaching two versions of the form, the first one is a none normalized version, while the second is in normalize state.
Also attaching how table definitions would be according to each of those forms.

Basically would need a list of advantages vs. disadvantages we are to expect by choosing each path, in this case in particular.

Since users are used to enter data manually in sheets in a weekly bases (similar look to the denormalized version) they have preference on taking that route.

FYI-Table in question is PatientsMedications (posting test data).

Thanks
Untitled.png
Untitled1.png
Untitled2.png
Untitled3.png
0
Hi,

I'm trying to change a Table-Valued Function to improve the performance of a Store Procedure but I can't get the same result.  Can you tell me where I'm going wrong?

Original:

USE [SIGTB_DATA_PROD]
GO

/****** Object:  UserDefinedFunction [dbo].[fun_eess1]    Script Date: 3/12/2019 6:17:19 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


--00
create FUNCTION [dbo].[fun_eess1]
(
    @institucion int ,
    @disa int,
    @red int,
    @mred int
)
RETURNS @tbl TABLE (idlista [int] IDENTITY, institucion [int], disa [int], red [int], mred [int], establecimiento varchar(10))
AS
BEGIN
    IF (@institucion=1)
    BEGIN
        INSERT INTO @tbl ([institucion], [disa], [red], [mred], [establecimiento])
        SELECT DISTINCT [c_institucion], [c_disa], [c_red], [c_microred], [codrenae] FROM [dbo].[RENAE]
        WHERE 
		
		[c_institucion]=@institucion AND [c_disa]=(CASE @disa WHEN -1 THEN [c_disa] ELSE @disa END)
        AND [c_red]=(CASE @red WHEN -1 THEN [c_red] ELSE @red END)
        AND [c_microred]=(CASE @mred WHEN -1 THEN [c_microred] ELSE @mred END)
	END 
    ELSE
    BEGIN
	IF (@institucion=15)
	BEGIN
		INSERT INTO @tbl ([institucion], [disa], [red], [mred], [establecimiento])
        SELECT DISTINCT [c_institucion], [c_disa], [c_red], [c_microred], [codrenae] FROM [dbo].[RENAE]
        WHERE [c_institucion]='1' AND [c_disa]=(CASE @disa WHEN -1 THEN [c_disa] ELSE @disa END)
        AND [c_red]=(CASE @red WHEN -1 THEN [c_red] ELSE @red END)
   

Open in new window

0
I have been using Crystal Reports to report data from DB2 tables on an iseries for a long time, both using the database wizard and writing my own SQL commands. What I would now like to do is to call a utility program on the Power 9 and retrieve the output and incorporate it into a Select statement in CR to then display in a report. I will need to pass a number of values including both strings and numbers. My first thought was that maybe there is a way crystal can use a stored procedure syntax to call an rpgle program, but I have no idea how this will work, and I have not been able to find an example or two. Can you point me in the right direction? One of my goals is to utilize programs for calculating shipping & tax charges that already exist on the power 9 box by passing in customer numbers and shipping terms and methods, and order info.
0
Kindly correct me if I’m wrong on the Less DSN File:
(1)      Once the ODBC string is done and tested from the developmental computer, that ODBC less DSN File will move with the application where it goes, the only thing to be done is install the correct ODBC version on each work station AND install the database on central place while the work station will either have full Ms Access or Runtime + ODBC.
Questions
(1)      What about those who are using VPN can the same ODBC mentioned above work since this is just a network or an extension of the local network as long as the server instance name is correct
(2)      Instead of hard coding the server name, I want to create an extra table to be storing the server names so that if the user is using the application for first time then they need to key in the server name which must off course be stored in the table. For example, the table will look like below:
SQlID (PK)
ServerName (Txt)

Path: Driver={ODBC Driver 13 for SQL Server};server=localhost;database=WideWorldImporters;trusted_connection=Yes;


In VBA how do I reference the server name control where it says server=localhost
Currently I always ask the clients to give me the server name and manually type in the connection string in the development computer and compile the app before sending, for sure it does give an error after compiling due to change of the server name, but where it goes it never give any error because it will be pointing to the correct server, for example if the …
0
Hi,
I have an Access 2016 database which is split into backend and frontend databases which are linked (originally to a local network drive).
I also have a mapped drive to a folder on the internet (using cloudnetworkdrive)
When I try to link the frontend to the backend (stored on the internet mapped drive) is get the message "You cannot use an internet address here. Enter a path that points to a location on your computer or on the network".

This may well be an annoying limitation of Access but if anyone has met and overcome the problem before, I would be grateful of any assistance.

Thanks
0
Sharing the Ms SQl Server database using virtual private network (VPN), I would like to find out the correct procedures or some supporting note on how to connect the aforesaid database through VPN.

My understanding of VPN is as below:
When two computers are connected, they make a network.  When they connect over the internet, they make a virtual network, and when that connection is secured, you have a virtual private network (VPN).
 
In most ways, a VPN will look just like a LAN.  Your computers will all be shared on a network, with the only difference being that the network involves remotely connecting through the internet.

But we have to subscribe for a software that secures the VPN, so far the cheapest is around $50.00 per year.

Questions
(1)      To those who have gone through this:
•      How do we enable connection to server?
•      What happens with the window firewall?
•      Do we have to install this VPN software on every computer that will be required to be on the network?
I’m sure some senior members have gone this process and have full notes, kindly share with me as well.

Regards

Chris
0
Hi Experts,
I'm working on Oracle database server 11g release 2, I've 2 Oracle databases and there is a function which produce the following error message when trying to compile it:

PL/SQL: ORA-00904: "ISNULL": invalid identifier

While same function on the another database is compiling normally. Is there an Oracle parameter which allow using ISNULL identifier?

Thanks in advance,
Daniel Mina
0
hi,

Any one can tell me what kind of HA , DR solution Sybase is using ? only replication  ?

latest version of Sybase I tried is ASE 15.7!

What monitoring tools , admin and development tools you guys can introduce  for Sybase ?
0
sql server 2008 r2
Oracle query to sql server equivalent

I have an oracle query that starts out like this: i will be putting this on sql server and need it linked to an oracle server.(using   OPENQUERY)

SELECT reportsTo Supervisor,
  racfid,
  FIRSTNAME,
  LASTNAME,
  CalenderDate,
  NVL(leaveReason,'Available') LeaveReason,
  NVL(OVERALL_POST,0)OVERALL_POST,
  NVL(TOTAL_ONSITECOUNT,0) TOTAL_ONSITECOUNT,
  NVL(ONSITE_MANUAL_POST,0) ONSITE_MANUAL_POST,
  NVL(ONSITE_BATCH_POST,0) ONSITE_BATCH_POST,
  NVL( DESKTOP_MANUAL_POST,0) DESKTOP_MANUAL_POST
FROM
  (SELECT 

Open in new window


Is there a way to write the same thing in sql server ?

MY guess is :
SELECT * FROM OPENQUERY
(
XREF_PROD,
'SELECT reportsTo Supervisor,
  racfid,
  FIRSTNAME,
  LASTNAME,
  CalenderDate,
  ISNULL(leaveReason, ''Available'') as LeaveReason,
  ISNULL(OVERALL_POST, 0) as OVERALL_POST,
  ISNULL(TOTAL_ONSITECOUNT, 0) as TOTAL_ONSITECOUNT,
  ISNULL(ONSITE_MANUAL_POST, 0) as ONSITE_MANUAL_POST,
  ISNULL(ONSITE_BATCH_POST, 0) as ONSITE_BATCH_POST,
  ISNULL(DESKTOP_MANUAL_POST, 0) as DESKTOP_MANUAL_POST
  FROM
  (SELECT   etc....

Open in new window




Thanks
fordraiders
0
Active Protection takes the fight to cryptojacking
LVL 2
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

i have sql table with field named arabdes with type nvarchar (100) and with arabic letter entries, i'm trying to retrieve via visual foxpro, but i keep getting ????? instead of the data itself, and the field type on my query is only character and not varchar, can anyone help me with to correctly retrieve this information correctly, thanks in advance
0
SQL Server Configuration Manager question

I installed SSMS last week but did not install SQL Server. I never tried to connect to any database.

Today, I tried to install SQL Server but got a network connections error. When I opened SSMS and tried to connect to either of the two databases, I got the same error.

What step(s) do I need to follow in SQL Server Configuration Manager?

Thanks

SQL Server installation error
SSMS error
Clearly, critical services are Stopped, but which ones do I turn On?

Services Are Off
0
I need to compare the Stored Procedures between two different Databases on two different servers.

I have already created the linked server and have been using it for writing queries between the two servers to do some comparison between the tables with no problems.

Now I need to check the stored procedures between the two servers to see what stored procedures are missing.


This is how I am trying to call the sysobjects in the second database.

select *
from [server/instance].database.sys.sysobjects as so (Please note that I am using the correct  [server/instance].database in my query.  this is just for public consuption.)
where so.xtype = 'P'


When I run this I get this error:  Msg 7202, Level 11, State 2, Line 11
Could not find server 't-dev/tessi' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.

What am I doing wrong in the from section of my SQL Statment?

Thank you,

Rich
0
creating Indexes to boost query performance

Please provide me some examples where indexes and clustered indexes would help to boost performance of a database query.

Thanks
0
What is Spectrum as it relates to SQL Server?

I was given this name about improving performance on database queries but can not find a software product.

Please advise...

Thanks
0
I have a sheet ("DATA") containing table of data in Excel that is pulled in from an Access database.

Then I have another sheet ("LIST") in the same workbook that repeats that data, but in a more user-friendly format.

My formula in LIST deals with blanks on the DATA sheet e.g. =IF(NOT(DATA!C31=""),DATA!C31,"")

All is well, until I refresh the data and there are less rows in the table in DATA.  

That then screws up my formulas in LIST to resemble this: =IF(NOT(DATA!#REF!=""),DATA!#REF!,"")

In the interests of keeping things as simple as possible I would prefer not to use VBA to pull the data through from DATA to LIST.

Any ideas how this could work without it messing up my formulas when there are less rows in the data after refreshing?

Many thanks!
0

Databases

57K

Solutions

40K

Contributors

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.