Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all 13329 articles
Browse latest View live

How to list user and password

$
0
0
Hi all,

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| bible |
| dbwordpress |
| hymn |
| mysql |
| performance_schema |
| phpmyadmin |
+--------------------+

How to list the user and password of the databases, bible and hymn? There is only one user on each of these databases.

Thanks

Regards
satimis

Access Database file "disappeared"

$
0
0
Hello everyone!
My Access MDB file has "disappeared" from his documents folder. I haven't deleted it, I have checked recycle bin, system restored, searched and so on. No luck!

Any suggestions on what else I could do to recover the file?

DB2 and SSD

$
0
0
Hi,

Has anyone tried DB2 backed by SSD drives ? - I am getting strange results, here is what I have tested.

I have 2 set of harware - one with HDD and the other with SSD (100%) - same amount of RAM on both, one both the servers there are 4 X 500 GB drives in RAID 5 configuration

Both are on RHEL/DB2 10.5, created a sample database and run following script just to do some basic red/write test. This below test script takes about a minute on the server that is backed by HDD and I was expecting this to run faster on the server with SSD, but it was worst..took 4 minutes !!!

/*******************************

#!/bin/bash
# script - activesim.sh
#
db2 connect to SAMPLE >>/dev/null
db2 "create table xTEST like syscat.tables"
for COUNT in {1..100}
do
echo $COUNT
db2 "insert into xTEST select * from syscat.tables"
db2 "insert into xTEST select * from xTEST"
db2 "delete from xTEST"
db2 "reorg table xTEST"
done
db2 "drop table xTEST"
db2 "connect reset"

*******************************/

Any reason why server with SSD won't performance better in this case ?

Are SSD storage not worth much for database activities, specifically when database is small and mostly all the data is in Bufferpool/memory ?

Thanks.

ADP file format and 2013

$
0
0
I understand that the ADP file format is no longer supported in 2013 - but does that mean the file will not even launch and work in its present state without additional modifications? And if this is bad news - I guess a could convert (manually I assume ) to an accdb file format and work out the kinks - Is this correct?

Stop Early Case Termination DB2

$
0
0
Question:
How would I stop early termination of the case statement?
In particular, what would be the correct way to write the query below?

Description:
When I run the following query, "myCode" is never populated with 'VAL4', 'VAL5', or 'VAL6' because Table1 allways contains either an 'F' or and 'M' and thus the case statement terminates after the GENDER is found.

SELECT
CASE
WHEN TABLE1.GENDER = 'F' THEN 'VAL1'
WHEN TABLE1.GENDER = 'M' THEN 'VAL2'
WHEN TABLE1.AGE BETWEEN '00' and '29' THEN 'VAL3'
WHEN TABLE1.AGE BETWEEN '30' and '39' THEN 'VAL4'
WHEN TABLE1.AGE BETWEEN '40' and '999' THEN 'VAL5'
END "myCode"
.....

Thanks.

Treasury roles in Chester - european language speakers needed

$
0
0
Our Global Technology & Operations division seeks a professional Technical Helpdesk Advisor to join their team in Chester. Ideally you will have some client facing technical support experience, preferably gained within financial services. Due to our global client base this is a role with enormous potential for someone who is fluent in English and one of the following languages: French, Spanish, German, Dutch or Italian

As Technical Helpdesk Advisor you will support the on-boarding of client treasury products, and interact with corporate clients providing telephone and email support throughout the EMEA region. You’ll be joining a dynamic, supportive team, with access to ongoing training and opportunities for career development.

Apply here: https://express.candarine.com/campai...d/f74acd4b31cd

MS Access Convert Rows to Columns and avoid null so that you can Group into 1 record

$
0
0
Greetings!,

In Microsoft Access i am trying to make Columns into Rows from a table and avoid getting null so that I can group according to Dept all the other Attribute Fields into 1 row by Dept. If I use iif() function and pull each attribute into separate field I end up with the below format with null values. I would like everything in one row according to Dept.

Is there sql that can do this efficiently? I could create 6 alias tables and link to table itself and pull each of the 6 Dept attributes separately in each alias table to get desired result. I am looking for a more efficient way if possible. Anyone know what better sql would look like?

ThanksA0003.PNG
Attached Images

DB2 Select Problem

$
0
0
Hi,

I am new to DB2, and have got a connection, via the company DSN to the database.

However, i want to do the following, "Select * from [mc].[agent details]"

[IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "* from" was found following "select ". Expected tokens may include: "<value_expr_primary_or_stub>". SQLSTATE=42601

Can anyone advise, i've looked at the tables schema in ADO and the table name is correct and present.

Thanks

Nathan,

PostgreSQL log auditing

$
0
0
Hi,

We've an application that uses .Net Entity framework (4.5.1) and PostgreSQL (9.4.1), I need to track SQL transactions in the DB for auditing purpose, however even though I think I've turned on everything possible for logging in postgres, I'm not seeing the actual values in the SQL statements, all I'm seeing is just the parameter markers like the following:
Quote:

AUDIT_RECORD_START,2015-05-14 08:36:34.481 UTC,192.168.1.1(54610),postgres,test,828,[unknown],4/167,00000,LOG: execute PRSTMT144390157037054937: INSERT INTO "Clients"("Name", "Description", "UserName", "Code", "Status", "CreateEventId", "UpdateEventId")

VALUES ($1, $2, $3, $4, $5, $6, $7)

RETURNING "Id"
Does anyone know if this is a configuration issue or this is simply because
of the way that data are being handled by the Entity Framework? Is there any other way to print the values of the parameter markers with the underlying query/statement?


Following is the postgres.conf snippet for the "logging parameters":
Quote:

log_destination = 'stderr'
# This is used when logging to stderr:
logging_collector = on
# These are only used if logging_collector is on:
log_directory = 'pg_log'
log_filename = 'postgresql-%Y-%m-%d.log'

#log_file_mode = 0600
#log_truncate_on_rotation = off
log_rotation_age = 1d

#log_rotation_size = 10MB
# These are relevant when logging to syslog:
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
# This is only relevant when logging to eventlog (win32):
#event_source = 'PostgreSQL'

# - When to Log -

#client_min_messages = notice
#log_min_messages = warning
#log_min_error_statement = error
#log_min_duration_statement = -1


# - What to Log -

debug_print_parse = on
debug_print_rewritten = on
debug_print_plan = on
debug_pretty_print = on
log_checkpoints = off
log_connections = on
log_disconnections = on
log_duration = off
log_error_verbosity = terse
#log_hostname = off
log_line_prefix = 'AUDIT_RECORD_START,%m,%r,%u,%d,%p,%a,%v,%e,'

#log_lock_waits = off
log_statement = 'all'
#log_temp_files = -1
log_timezone = 'UTC'
Thanks,
Sally

Relative Subreport Location

$
0
0
Hello,

I am designing a report with multiple subreports on the left and right of the page. I placed the subreports on the left in their own respective group footer sections. However, if the top subreport contain no data and is suppressed, there is still white space showing. I.E.

Subreport1 Subreport2
Subreport3

If Subreport1 does not contain data, it looks like this

White Space Subreport2
Subreport3

I want Subrport3 to move up so it looks like this:

Subreport3 Subreport2

I think it has something to do with underlay, but I can't figure out the formula. Can anyone offer assistance? Thank you.

create event alert

$
0
0
I am trying to create an Event Alert in Data Studio.

It's for DB2 9.5 Windows 2008R2.

There's data:

D:\IBM\SQLLIB\BIN>db2 SELECT log_utilization_percent FROM SYSIBMADM.LOG_UTILIZATION

LOG_UTILIZATION_PERCENT
-----------------------
0.82

1 record(s) selected.
Now, the query for the alert will be:

D:\IBM\SQLLIB\BIN>db2 SELECT LOG_UTILIZATION_PERCENT, CASE WHEN LOG_UTILIZATION_PERCENT > .01 THEN -1 ELSE 0 END AS USEDLOG FROM SYSIBMADM.LOG_UTILIZATION

D:\IBM\SQLLIB\BIN>

As you can see, there's no output.

Sql express 2014

$
0
0
Hello I have a database called Lab Wizard that uses SQL express which is installed on windows 2008 r2 server, I am trying to make it so that the client computers can access the SQL through the ODBC DRIVER but I keep getting a TCP IP connection error. Can anyone tell me what I'm doing wrong, I'm drawing a blank here. I already configured port 1433 in All IPs in the Configurations Manager

NOOb question

$
0
0
I need to get a list of managers from a MYSQL databse

Select * from MyDB where Role=Manager

but dont know the syntax proper

Cheers and sorry, its been a while

Postgresql Case and Total

$
0
0
Hi!

I need help with this query

Select CASE WHEN (lcode = '05' or lcode = '06' or lcode = '08' or lcode = '09' or lcode = '10') THEN 'All Student'
WHEN (L1.code = '05' or Lcode = '06') THEN 'Maths Student'
ELSE 'English Student'
END as Decision,
count(*) as Total
from referral


No record for Math Student are shown. I understand that the condition has been met by the first condition.


If I change this to


Select CASE WHEN (L1.code = '05' or Lcode = '06') THEN 'Maths Student'
WHEN (lcode = '05' or lcode = '06' or lcode = '08' or lcode = '09' or lcode = '10') THEN 'All Student'

ELSE 'English Student'
END as Decision,
count(*) as Total
from referral

The the sum for the 'All Student does not have the 'English student' numbers in it.


How I make Postgresql also show the actual record of 'All Student and 'English student?


Thank you.

David

Way to print all the forms, reports, query VB code?

$
0
0
We are trying to document an Access system that has NEVER been mapped. Many tables, Forms, Views, Reports, Queries.

Many of the VB code scripts has complex SQL select clauses using foreign keys that are not described in the database as foreign keys!

We would like to find out what the foreign keys are and designate them in the tables so the schema shows up correctly.

Any way to get all the VB code printed to a file?

Thanks,

Deaf

How to create a unique Foreign Key?

$
0
0
Hi,
I have a "t_users" table and a "t_departments" table:
Code:

CREATE TABLE `t_users` (
        `userId` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
        `mayLogIn` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
        `userRealName` VARCHAR(50) NOT NULL DEFAULT '' COLLATE 'utf8_general_ci',
        `userLoginName` VARCHAR(50) NOT NULL DEFAULT '' COLLATE 'utf8_general_ci',
        `userPasswordHash` VARCHAR(50) NOT NULL DEFAULT '' COLLATE 'utf8_general_ci',
        PRIMARY KEY (`userId`)
)
ENGINE=InnoDB;
CREATE TABLE `t_user_departments` (
        `id` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
        `parentUserId` MEDIUMINT(8) UNSIGNED NOT NULL,
        `departmentId` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '1',
        PRIMARY KEY (`id`),
        INDEX `FK_user_departments` (`departmentId`),
        INDEX `FK_user_id` (`parentUserId`),
        CONSTRAINT `FK_t_user_departments_t_users` FOREIGN KEY (`parentUserId`) REFERENCES `t_users` (`userId`),
        CONSTRAINT `FK_t_user_departments` FOREIGN KEY (`departmentId`) REFERENCES `t_departments` (`departmentId`)
)
ENGINE=InnoDB;

So a user can be a member of more than one department.
I want to allow a "userLoginName" only once for any given department, and also allow a "userRealName" only once for any given department.

If a user was only allowed to be member of a single department, the table and constraints would look like this:
Code:

CREATE TABLE `at_users` (
        `userId` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
        `departmentId` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '1',
        `userRealName` VARCHAR(50) NOT NULL DEFAULT '' COLLATE 'utf8_general_ci',
        `userLoginName` VARCHAR(50) NOT NULL DEFAULT '' COLLATE 'utf8_general_ci',
        `userPasswordHash` VARCHAR(50) NOT NULL DEFAULT '' COLLATE 'utf8_general_ci',
        PRIMARY KEY (`userId`),
        UNIQUE INDEX `userRealName` (`userRealName`, `departmentId`),
        UNIQUE INDEX `userLoginName` (`userLoginName`, `departmentId`),
        INDEX `FK_departments` (`departmentId`),
        CONSTRAINT `FK_user_departments` FOREIGN KEY (`departmentId`) REFERENCES `t_departments` (`departmentId`),
)
ENGINE=InnoDB;

How do I set this up for multiple departments and foreign keys?

Thanks for any ideas,
Udo

automated query in windows ?

$
0
0
Hello, I registered here hoping someone can help me.

A friend of mine has a small business and got a Sybase Database on a Windows 8 PC.
I have access credentials for a read-only user on that DB.

what I want to do is the following:
- run a daily automated query
- put the resultset into a text file (CSV)
- transfer the text file to my FTP server
- delete the file

The problem is, I am an Linux/webserver programmer, on my server I would have a working script in about 30 minutes to do the above, but I got no idea how to do things in Windows.

I guess I could solve the FTP transfer by using a remote folder sync tool.

But how to automate a query to run on the database and save the result in a file?

Thank you for help.

adjust namespaces in SQL generated XML

$
0
0
Hi,

I'm having trouble getting the namespaces correct in the XML that is generated by SQL. It has a header with some context information, followed by the payload part. The namespace is copied to the payload part.
Code:

CREATE TABLE dbo.context(
        id                int                NOT NULL        constraint pk_dbo_context primary key,
        name        nvarchar(100)        NOT NULL
)

INSERT INTO dbo.context(id, name) VALUES (1, 'Here comes some great context information.')

CREATE TABLE dbo.content(
        id        int        identity        NOT NULL        constraint pk_context primary key,
        context_id        int        NOT NULL foreign key references dbo.context(id),
        question_attribute_1        nvarchar(100)        NOT NULL,
        question_attribute_2        nvarchar(100)        NOT NULL
)

INSERT INTO dbo.content(context_id, question_attribute_1, question_attribute_2) VALUES
(1, 'record1 attribute 1', 'record1 attribute 2'),
(1, 'record2 attribute 1', 'record2 attribute 2')

This is the FOR XML script that generates the XML:
Code:

;WITH XMLNAMESPACES (DEFAULT 'http://services.registersubscription-02_00.a.cool.url.com')
SELECT
          CEXT.name AS [Context/Name],
          (SELECT
                        CONT.id AS [Content/Reference],
                        CONT.question_attribute_1 AS [Content/Attrib1],
                        CONT.question_attribute_2 AS [Content/Attrib2]
                FROM dbo.content as CONT
                WHERE CONT.context_id = CEXT.id
                FOR XML PATH ('Question'), ROOT ('Questions'), TYPE
                )
FROM dbo.context as CEXT
WHERE CEXT.id = 1
FOR XML PATH('Request'), ROOT('RegisterSubscription');

The generated XML :
Code:

<RegisterSubscription xmlns="http://services.registersubscription-02_00.a.cool.url.com">
  <Request>
    <Context>
      <Name>Here comes some great context information.</Name>
    </Context>
    <Questions xmlns="http://services.registersubscription-02_00.a.cool.url.com">
      <Question>
        <Content>
          <Reference>1</Reference>
          <Attrib1>record1 attribute 1</Attrib1>
          <Attrib2>record1 attribute 2</Attrib2>
        </Content>
      </Question>
      <Question>
        <Content>
          <Reference>2</Reference>
          <Attrib1>record2 attribute 1</Attrib1>
          <Attrib2>record2 attribute 2</Attrib2>
        </Content>
      </Question>
    </Questions>
  </Request>
</RegisterSubscription>

While it should be:
Code:

<RegisterSubscription xmlns="http://services.registersubscription-02_00.a.cool.url.com">
  <Request xmlns="">
    <Context>
      <Name>Here comes some great context information.</Name>
    </Context>
    <Questions>
      <Question>
        <Content>
          <Reference>1</Reference>
          <Attrib1>record1 attribute 1</Attrib1>
          <Attrib2>record1 attribute 2</Attrib2>
        </Content>
      </Question>
      <Question>
        <Content>
          <Reference>2</Reference>
          <Attrib1>record2 attribute 1</Attrib1>
          <Attrib2>record2 attribute 2</Attrib2>
        </Content>
      </Question>
    </Questions>
  </Request>
</RegisterSubscription>

The generated XML does not pass the XSD validation.

★ MEGA SALE ★ Alnitech: $90 OFF - Quad Core Xeon E3-1230v3 + 16GB + 2x1T @ $59.99

$
0
0
All of our hardware comes with 24x7 support and well-qualified professional sysadmins available to answer your questions. All server orders are backed by 21-day money-back guarantee.

Our features:
  • 21-day money-back guarantee
  • 5-star support. Try!
  • 24x7 support
  • Professional sysadmins
  • Enterprise-grade hardware


We have many years of experience, with proven record of customer satisfaction:
http://www.serchen.com/company/alnitech/
Order now and join our happy customer's club!

====================================

1. SUPERMICRO X10SLM-F Xeon E3-1230v3 up to 3.7GHz 2x1000GB

CPU: Quad Core Xeon E3-1230v3 3.3-3.7 GHz, 8MB (4 physical Cores, 8 HT cores)
RAM: 16GB ECC DDR3
HDD: 2x1000GB SATA 7.2K Software RAID1, HOT-SWAP!
Location: Asheville, NC / Lombard, IL
Included:
PROACTIVE BMC LOG MONITORING
100Mbps UNMETERED Port
Gold-level power supply
5 IPs for free
DEDICATED IPMI CONNECTED TO SEPARATE NETWORK (KVM over IP, remote media)

REGULAR PRICE: $149.99/monthly
SALE* PRICE (90_OFF coupon): $59.99/monthly WOW!!
order now

(*) New signups only, if you are existing Alnitech client please contact sales for more details.

====================================

2. SUPERMICRO X10SLM-F Xeon E3-1230v3 up to 3.7GHz 2x1000GB

CPU: Quad Core Xeon E3-1230v3 3.3-3.7 GHz, 8MB (4 physical Cores, 8 HT cores)
RAM: 8GB ECC DDR3
HDD: 1x1000GB SATA 7.2K (4 drive bays)
Location: Asheville, NC
Included:
PROACTIVE BMC LOG MONITORING
100Mbps UNMETERED Port
Gold-level power supply
5 IPs for free
DEDICATED IPMI CONNECTED TO SEPARATE NETWORK (KVM over IP, remote media)

PRICE: $129.99/monthly
order now

====================================

3. SUPERMICRO X9SRI-F Xeon E5-2620 up to 2.5GHz 2x1000GB

CPU: Hexa Core Xeon E5-2620 2.0-2.5GHz, 15MB (6 physical Cores, 12 HT cores)
RAM: 32GB ECC DDR3
HDD: 2x1000GB SATAIII WD Black 7.2K Software RAID1, HOT-SWAP!
Location: Asheville, NC
Included:
PROACTIVE BMC LOG MONITORING
100Mbps UNMETERED Port
Gold-level power supply
5 IPs for free
DEDICATED IPMI CONNECTED TO SEPARATE NETWORK (KVM over IP, remote media)

REGULAR PRICE: $229.99
SALE PRICE: $169.99/monthly
order now

====================================

4.SUPERMICRO X9DRD-iF Two Xeon E5-2620 2x1000GB

CPU: Hexa Core Xeon E5-2620 2.0-2.5GHz, 15MB (12 physical Cores, 24 HT cores)
RAM: 64GB ECC DDR3
HDD: 2x1000GB SATAIII WD Black 7.2K Software RAID1, HOT-SWAP!
Location: Asheville, NC
Included:
PROACTIVE BMC LOG MONITORING
100Mbps UNMETERED Port
Gold-level power supply
5 IPs for free
DEDICATED IPMI CONNECTED TO SEPARATE NETWORK (KVM over IP, remote media)

PRICE: $329.99/monthly
order now

====================================

Operating Systems:
CentOS 5
CentOS 6
CentOS 7
Ubuntu 12.04
Ubuntu 14.04
Ubuntu 14.10
Ubuntu 15.04
Debian 6
Debian 7
VMWare ESXi 5.1
VMWare ESXi 5.5
Windows server 2008R2 Standard - $29.99
Windows server 2008R2 Enterprise - $139.99
Windows server 2012R2 Standard - $29.99
Windows server 2012R2 Enterprise - $139.99
XenServer 6

Test IP address: alnitech.com

Extra IPs:
5 Usable IP Addresses (/29) - $5.00
13 Usable IP Addresses (/28) - $13.00
29 Usable IP Addresses (/27) - $29.00

Query gives error "Microsoft access doesn't recognize as valid field or expression"

$
0
0
I have a cross tab query with parameters defined. Query runs fine. However when I run report it give me error "Microsoft access doesn't recognize as valid field or expression". So what's happening is I have 3 fields say A, B, C on the report . A is text fields others 2 are counts. If backend doesn't have data for say either field B or C then it gives me this error. Query is of full page I can post if somebody wants to see.
Viewing all 13329 articles
Browse latest View live