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

NUM_LOG_SPAN usage in db2

$
0
0
Hi All,

I am new to DB2 admin. In our production database using below configuration parameter.Please explain what is the purpose of NUM_LOG_SPAN and MAX_LOG file usage.

NUM_LOG_SPAN :120

MAX_LOG : 40

Primary Log:200

Secondary Log:50

Regards,
Raj

Logfilsiz: 262144

rows fetched based on dates

$
0
0
Hi all,

ID_LOC CHAR(3)
ID_NO CHAR(5)
ID_NAME CHAR(5)
ID_QNTY INTEGER
ID_DATE DATE
ID_SURNAME CHAR(5)

DB2 9.1/ZOS



Ex1:

If there is any data change compare to first row(other than ID_DATE),
query has to fetch that row
ID_LOC and ID_NO should not be the compare key

Row1 is compared with next row ROW2,nochange
Row2 is compared with next row Row3,no change

SO Row1 is the valid record
Code:

ID_LOC  ID_NO    ID_NAME ID_QNTY  ID_DATE    ID_SURNAME

AAA      WE-RE    A1111    10    2009-09-09  A1111---row1
AAA      WE-RE    A1111    10    2013-03-11  A1111---row2
AAA      WE-RE    A1111    10    2015-12-23  A1111---row3

Ex2:
Row1 is compared with next row ROW2,nochange
Row2 is compared with next row Row3,change in ID_NAME and
ID_SURNAME
Row3 is compared with next row ROW4,nochange

sO Row1 and Row3 are valid

Code:

AAA      T11-T    B1111    10    2013-12-31  B1111
AAA      T11-T    B1111    10    2014-03-21  B1111
AAA      T11-T    C2222    10    2014-12-31  C2222
AAA      T11-T    C2222    10    2015-03-11  C2222

Ex3:
Row1 is compared with next row ROW2,change in ID_NAME,SURNAME

Row2 is compared with next row Row3,change in ID_NAME,SURNAME and ID_qnty
Row3 is compared to next row Row4,no change

So Row1,Row2,Row3 are valid
Code:

AAA      XX-XT    D1222    05    2009-03-31  D1222
AAA      XX-XT    E2322    05    2009-03-31  E2322
AAA      XX-XT    R1212    10    2013-01-31  R1212
AAA      XX-XT    R1212    10    2014-07-12  R1212

Ex4:
Row1 is compared with next row ROW2,change in ID_SURNAME

Row2 is compared with next row Row3,no change
Row3 is compared to next row Row4,change in ID_NAME,SURNAME,ID_QNTY
Row4 is compared to next row Row5,change in ID_NAME,SURNAME,ID_QNTY


So Row1,Row2,Row4,Row5 are valid
Code:

AAA      S-ERS    F1234    10    2014-02-21  F1234
AAA      S-ERS    F1234    10    2014-05-23  G1111
AAA      S-ERS    F1234    10    2014-12-24  G1111
AAA      S-RES    X3333    03    2015-03-21  X3333
AAA      S-RES    Z3243    07    2015-03-21  Z3243

Code:


EXPECTED RESULT SET


AAA      WE-RE    A1111    10    2009-09-09  A1111
   
AAA      T11-T    B1111    10    2013-12-31  B1111
AAA      T11-T    C2222    10    2014-12-31  C2222

AAA      XX-XT    D1222    05    2009-03-31  D1222
AAA      XX-XT    E2322    05    2009-03-31  E2322
AAA      XX-XT    R1212    10    2013-01-31  R1212

AAA      S-ERS    F1234    10    2014-02-21  F1234
AAA      S-ERS    F1234    10    2014-05-23  G1111
AAA      S-RES    X3333    03    2015-03-21  X3333
AAA      S-RES    Z3243    07    2015-03-21  Z3243

Thanks,

how to find the file name format in the current directory

$
0
0
I have a requirement to find out the file name format .

I had to look for a file in the current directory which is in the format YYYYMM_PI_710_AT.dat

Got to write a shell script on this ..

Need your help


Thanks in advance !!

Advanced query with nested iffs

$
0
0
Hey everyone,

Background:
So I an equipment database. Part of that database tracks maintenance on equipment.

What I have:
Okay, bear with me here... I have a form, frmMainMenu. frmMainMenu has a navigation control for various sections of my database, one of which is maintenance. This navigation section has another navigation control within it with each of the headers as a due date (Today, this week, etc.). Each of those tabs has a maintenance report as its target, which has a query of all of the maintenance tasks on the tasks table as its source.

Where I'm stuck:
A field in that query takes the difference between the current data and the due date of a task

Code:

Days Left: DateDiff("d",Now(),[DueDate])
I am trying to get this query to filter based on the tab that I have selected on the form. For example, if "Due Today" is selected, I want the criteria to be <=1.

I tried using an iff statement with no luck. To test for functionality I tried a due <=1 else >1.

Here is the equation:

Code:

Iff([Forms]![frmMainMenu]![NavigationSubform].[Form]![nbtnToday].[Enabled],(DateDiff("d",Now(),[DueDate]))<=1,(DateDiff("d",Now(),[DueDate]))>1)
I'm not sure why it isn't working... Appreciate any input.

Query Help

$
0
0
To All--

I have a table where there are integers stored by low number and high number (a range in other words). For instance:

Field1, LowNum, HighNum
Red, 1, 3
Blue, 4, 6

I would like a query to return a row for each number between LowNum and HighNum. Like this.

Field1, Number
Red, 1
Red, 2
Red, 3
Blue, 4
Blue, 5
Blue, 6

Anyone have any good tricks for this one? Thanks.

C

Table Structure for Tracking Data over Time

$
0
0
I am in the process of setting up a database to log and analyze data regarding our 'clients.' Right now I have approximately 1,000 clients.

I am using access to create the tables, I need something easy to use as I will be having multiple people enter data.

I'm unsure how to structure the table, because I am looking to analyze the data over time. For example, we may measure the weight of 1,000 people. Then at various other times we will take their weight again.

I want to be able to compare the weights for each individual over time. Meaning client 1 weight xxxlbs on January 1st and then weight xxxlbs on July 1st.

What would be the best way to create the table so that I can easily keep track of the data points, but make sure they are able to be matched to the specific client id and show the date that the data was acquired? I appreciate any help, and please let me know if more information is needed to clear up what I'm trying to do.

Combining multiple tables in Access 2007

$
0
0
Hello group! I'm a very new user to Access and databases in general. I've only taken a few basic classes in Access 2007 and they didn't cover SQL at all.

I've imported data from three different Excel spreadsheets into three new Access tables. Now I want to combine the three new tables into one main existing table in my database. The existing table already has 2040 records, so I'm hoping it can add the rows from the three new tables into the existing table starting from a new row 2040 and go up from there.

The only way I've found to add data from a new table(s) into the existing table is to first go into the existing table and add new rows, ONE BY ONE, making sure to number them correctly. Then I copy the data (column by column) from the new table and paste it into columns in the existing table.

I know this is the totally wrong way to import data into an existing table, and it takes too long to add numerous blank rows as you can imagine. Is there an easier way to import table from Excel into Access? Or from one table to another in Access when the columns in each table don't necessarily have the same names? I hope so because adding 1500 blank rows manually is the worse! :eek:

2012 SSRS: Unchangeable Dimension Populated Parameter

$
0
0
After passing one dimension populated parameter (not cascading) to another report in the same solution with same datasource I can't change the parameter. Report allows user to pull down parameter and pick another selection (multi-value) however when press 'view report' it resets to the parameter value that was passed.

MYSQL or SQL Server???

$
0
0
I will quickly outgrow Access 2010 capacity and need to move to either SQL Server or MYSQL. Which is advisable considering ease of use and continuing with the Access Front-end forms and reports? MYSQL appears to be a logical solution and without having to invest in SQL Server (??) - Thanks - dd

Online restore doubts

$
0
0
Hi,

I have to restore a backup of an existing database in one more server.
I also have the archive logs copied to the destination server
I have a online backup taken at 10:30PM yesterday.
I need to restore the database to 4 AM today.

how can i achieve this?
Any help is appreciated.

stop move

Data mapping & migration tool

$
0
0
Hi Guys,

I am developing one automation tool for data migration from one table to other table, here i am looking for one function or SP for which i will pass source column and destination column as input parameter and want output parameter to return true when source column data is compatible to copy to destination column if not then it should return false.

For example if source column is varchar and destination column is integer, the script should check all the data in source column in good enough to move to integer column or not and return the output flag. I want a script to work this for all types of data types. Any suggestions it will be helpful.

Hello, I'm new and not sure where to post

$
0
0
Hi I am taking online database class and I have no idea what im doing...i hope someone here will be able to help me... we mainly work with access and we learned some SQL as well.
Here are my exercises for this week... I don't even know where to start.. thanks so much for your time.

Attached Images
File Type: jpg IMG_1137.JPG (2.03 MB)

Automotive Parts DB-Primary Key Advice

$
0
0
I'm new here and a little rusty on my database design. I am building a database in MySQL for my friends transmission parts business for use with a cascading drop down menu on his web site. The type where you pick your car's YEAR, then MAKE, MODEL, ENGINE, and then it shows them the TRANSMISSION model number they need for their vehicle(That is the only data I have to work with from the supplier catalogs). That's how they are listed in his suppliers catalogs he has provided me. The infuriating thing is: none of them list bin or sku#'s I could possibly use as a primary key. Thought I might be able to use the transmission model number listed, but it turns out some of them are used on more than one model, and even multiple makes. One can be used by Cadillac, Acura, and Toyota. Its a real headache. What would you guys do? Should I just create my own generic sku/bin for a primary key? Combine two data elements? I haven't built a database in 5 years, so this is a bit of a refresher for me. Any and all advice would be most welcome. Thanks.

Normalization

$
0
0
Hi I am taking online database class and I have no idea what im doing...i hope someone here will be able to help me... we mainly work with access and we learned some SQL as well.
Here are my exercises for this week... I don't even know where to start.. any help will be greatly appreciated

Attached Images
File Type: jpg IMG_1137.JPG (2.03 MB)

Populating MS Access columns

$
0
0
Hello

I have a simple 'new user registration' form that inserts a username and password into a MS Access database.

The table has five columns: username, password, strEmail, fusername, and fpassword. At the moment, only three of those columns are filled when the user presses the 'submit' button on the 'new user registration' form. I would like to populate the fusername and fpassword columns with exactly the same data as in the username and password columns respectively.

My code now looks like this:

Code:

<%
Dim username, password, confirmPassword, strEmail, conn, rs
username = ""
password = ""
confirmPassword = ""
strEmail = ""
ErrorMessage = ""

if request.form <> "" then
username = Request.Form("username")
password = Request.Form("password")
confirmPassword = Request.Form("confirmPassword")
strEmail = Request.Form("strEmail")
.....................

set rs = Server.CreateObject("ADODB.recordset")
    rs.Open "Select * FROM university WHERE strEmail = '" & strEmail & "'", conn

sql="INSERT INTO university ([username], [password], strEmail) VALUES ('" & username & "','" & password & "', '" & strEmail & "')"
     
conn.Execute(sql)
......................
%>

What would be the best way to achieve my aim, please?

Thank you.

Blueie

Table definition for ERD diagram

$
0
0
Hello, I need help with my homework. I am an absolute beginer in this area.
The task says " create a table definition for the ERD diagram "
I am sending the ERD diagram in attachments and here are the criteria :


"• Each animal must have a unique identification number.
• Each animal must undergo a medical examination when it arrives at the shelter.
• When an animal comes into the shelter, we assign it an id and collect information
• We need to track animals in our shelters.
• Even though we did not require employees of the shelter to be part of the design, we do need to know which employee received the animal at the shelter. No need to tie it to our employee system - we just want to capture the name.
• We also need to know the date and time the animal was taken in at the shelter.
• We also need to know special information about the date the animal is adopted (was the date a holiday?) and special notes about the date.
• For special notes, we'd like to know things such as, "general weather conditions" or "schools finish this week for summer."
• We're trying to find trends that affect animal adoption. We need this information so that we can give good reports to our staffing manager about the number of employees needed for each shift and on special days of the year. You don't need to design information about "shifts" (we already have that in the other system).
• We'd also like to capture data on the days that animals are brought to the shelter. Does it happen more after holidays? On rainy days? This will help us staff the shelter more appropriately if we anticipate a large number of animals being dropped off.
Biznis needs:
• The animal shelter would like to track animals in their shelters.
• Keep track of who has adopted their animals.
• For all animals, track name, approximate age, health, whether they're vaccinated, spayed or neutered, reason being given up, whether good with children, trained, person giving it up or a rescue.
• For cats, identify long-haired or short-haired.
• For dogs, identify the breed and the size: small, medium, or large
• For animal adopters, track name, address, phone number, email, dog/cat preference, animal adopted, and number of children in their house.
• For non-adopters who would like to receive the newsletter, track name, address, email, and phone number.
• Track in which cage an animal is.
• Obtain a list of all unadopted cats and dogs.
• Send only dog information to people who like dogs and cat information to people who like cats.
Procedural biznis rules:
• When an animal comes into the shelter, it is assigned an ID and a temporary collar. After the required information is noted, the animal is assigned to a cage.
• A non-adopter who comes into the shelter can fill out a card to receive the newsletter.
• Each week, a list of all cats and dogs that are not adopted are posted online in the respective “Cat Lovers” and “Dog Lovers” pages of the website. "
can you people please help me with creating the table ?
thank you

Attached Images
File Type: jpg oracle.jpg (87.9 KB)

Transfer an Advantage Database's Schema/Data to a PostgreSQL Platform Using C# Progra

$
0
0
I am currently in the process of writing a .NET program with C# to transfer a database on a Sybase/Advantage 9.1 platform to a PostgreSQL 9.3.4 platform. I am doing this transfer in two stages - transfer all the tables/schema without the data and then transferring the data. I was able to transfer the schema without much of a problem; however, I am having issues with transferring the data (mainly performance issues as there are multiple tables with over 4 million entries).

My current approach for the data transfer is as follows...

-Establish an ODBC connection to the Advantage database -Create an ODBC Data Adapter -Fill a Data Table with the data entries using the method DataAdapter.Fill() -Write the contents of the Data Table to a CSV file -Establish an ODBC connection to the PostgreSQL database -Use the COPY query to upload the CSV file into the database

This current method works and correctly transfers the data. However, I calculated that it would take 45 minutes to transfer a table with 5 million entries. I need this to work much faster. The longest portion of my current method is the DataAdapter.Fill().

Does anyone have any suggestions on how to do this transfer more efficiently and in less time? Either a suggestion to improve my current method or a different approach entirely. I would like to stick to using C# and the .NET platform to write a program for this transfer.

DB2 - CPU to MSU (??)

$
0
0
Hi,
I am working to improve the performance on some queries on DB2, but all the information are given in CPUs. I have DB2 CPU usage, and by Query Monitor, how many each program is spending CPU time.

However, as the measure is MSU, I am not able to see, how many MSUs I am saving with the improvement.

Does anyone know how can I do to calculate this convertion?

I know that I need to have more information to reach to the value, such as, the model of the hardware, how many processors are being used, maybe SU/CP, etc..

I found the address: https://www-304.ibm.com/servers/reso...x?OpenDocument and this document gives me some information about the hardware used.

So, it seems that I also need a formula - a calculation, to get the final value. Does anyone could send to me? If there are other information that I need to get, please, let me know how I can get it as well.

I would appreciate any information.

Tks

Call Procedure in cursor declaration

$
0
0
Hi,

How do I use a Call procedure instead of a select statement in DB2 cursor declaration??

This is what I did but it didn't work.. Any sugestions..

declare C1 cursor with return for
call ACHINST1.ReportD010 (MISDATE,start_date,end_date,sender_name,receiver_ name);

open c1;
Viewing all 13329 articles
Browse latest View live