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

DB2 running out of space

$
0
0
Hi,

I had an issue this morning with my DB2 server running out of space. I was not able to find the root cause but the issue was with a trigger on a table. The trigger was created AFTER UPDATE on TABLE X. It checks the new value and performs some logic. If the logic satisfies, inserts a new row to table Y.

Problem here was the new table Y might already have the same row inserted. If present, the TRIGGER will throw an error due to primary key constraint. So trigger failed. But why would it create the transaction logs every minute and run out of space? After dropping the trigger, the logging stopped. Any help in this is greatly appreciated.

Thanks
Anis GovindaRao

ReName all Charts in a WorkBook

$
0
0
He some code

A workbook I was given Gots Over 150 charts I need to update the Boards for Each Chart

after Many Right Click

Got me thinking

Code:

Sub Build_Chart_List()
Dim Thischart As ChartObject
Dim ThisSheet As Worksheet
Dim MyRows As Long
Application.Calculation = xlManual
MyRows = 0
For Each ThisSheet In Worksheets
    Debug.Print ThisSheet.Name
    'ActiveWorkbook.Sheets(ThisSheet.Name).Activate
    For Each Thischart In Sheets(ThisSheet.Name).ChartObjects
        Thischart.Name = Thischart.Chart.ChartTitle.Text 'make the object the same name as the TITLE of the Chart I hate seeing Chart 1 .. Chart 2..
        Range("Chart_Names").Offset(MyRows, 0).Value = Thischart.Name
        Range("Chart_Names").Offset(MyRows, 1).Value = ThisSheet.Name
        MyRows = MyRows + 1
    Next
Next
Application.Calculation = xlAutomatic
End Sub

Know Update the Charts Borders base on a cell

Code:

Sub Set_Border_Colour()
Dim MyRows As Long
Do Until Range("Chart_Names").Offset(MyRows, 0) = ""
        This_Chart = Range("Chart_Names").Offset(MyRows, 0).Value
        This_Sheet = Range("Chart_Names").Offset(MyRows, 1).Value
        ActiveWorkbook.Sheets(This_Sheet).Activate
        ActiveSheet.ChartObjects(This_Chart).Chart.ChartArea.Border.Color = Range("Chart_Names").Offset(MyRows, 2).Value
        MyRows = MyRows + 1
Loop
End Sub

How the Delete the list just case hes added some NEW ones LOL


Code:

Sub Clear_Chart_List()
Range("Chart_names").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.Offset(0, 1)).Select
Selection.Clear
Range("Chart_names").Select
Call Build_Chart_List
End Sub

if the User add more charts I can rebuild the List and

run the Set_Boarder_Colour Sub Job Done :)

Problems with Brilliant Database

$
0
0
Hi all
I have a few problems and tried to solve it myself and at this stage I would appreciate if I could get some help.

The hardware that I use is of a good quality and I have more than enough memory and speed.

1. If I share the database to the other 5 users and I want to move or delete a record then the database through all the connected users from the database.
I do not get any error on the server, only the users get a run time error.

2. If I run small queries and print it is not a problem but when I tried to print two bigger queries one after the other then the database just closed.
The queries run without a problem, the problem is when I click the print button the processing then starts for a while and then it seems it ran out of memory.
If I print and close the database and restart the database and print again then it's working fine.

Hope I can get someone to help me in this regard

Hennie

db2 process elapsed time zero

$
0
0
Hi All

Log utilization kept on increasing

we found the oldest entry has zero elapsed time

Can we safely remove this process by killing at database level

Regards
Krishna

SUB form adressing in VBA

$
0
0
So, i try to put in a msg box warning when somebody clicks the save button, when they have marked yes for "REK" but forgot to fill in the "RekNr"

Problem is, the save button is in the main form, and "rek" and "reknr" is in a sub form. So how do I adress this right?

This code below did not work, but any suggestions? :p

Code:
If Me.sub-form.Rek And Len(Me.RekNr.Value & " ") = 1 Then

Feilstreng = Feilstreng + "- Du har glemt å fylle ut RekNr" + vbNewLine


Me.sub-form.RekNr.SetFocus

End If

Dcount on a Report to get specific records

$
0
0
MS Access 2007

Hello,

I am trying to get a report to count the number of questions that were answered yes to by different store numbers on a report.
I created a query that shows the unique store numbers and filtered by "Yes". (stores can have more than one entry but I don't need to report a single store 10 times)

Here is what the report looks like

Store Question # of ques (yes) Report Page Header
200 Yes text box Report Detail
205 Yes text box
210 Yes text box

I can get the dcount to work if I specify the store number in the formula. The only issue with that is that every store shows the same result.

Store field is named Store
Tbl is named Data
text box is named Result

dcount("*","Data","[store]='210'",)
This gives me the number of results for store 210 but not the Yes ones.

dcount("*","Data","[q1]='Yes'")
This gives me all the Yes results for Question 1.

I need to know if I get set it up to look at the store field and give me the result based on that value so each store is different.

Store Question # of ques (yes) Report Page Header
200 Yes 2 Report Detail
205 Yes 5
210 Yes 17

Any thoughts, suggestions or answers are greatly appreciated.

Thanks in advance for your help.

Wood from the trees

$
0
0
Hi.

I want to build a database with Access to manage volunteers who will be helping out at a number of events. The data-entry will be contact-centric, with contacts/volunteers assigned to one or more events.

I've previously done similar using a one-to-many: the main volunteer/contact form contains an event-subform. It's simple enough then to query all contacts assigned to any particular event.

What I really want is to understand how using a many-to-many relationship (which I guess could equally apply) would add power or flexibility to what I could do or how I could query the tables. I have the feeling it must offer advantages - but I'm not quite sure what these are.

Many thanks for your help with this one.

Cheers - Jol

Help Creating A Grid

$
0
0
I want to be able to create a grid where you input someones ID and it gives you a listing of all the cookies available for sale and beside it show a Yes or No value as to whether or not the ID has sold them. I have successfully written queries which will show all cookies for sale, and the cookies that a user has sold or has not sold, but I can not figure out how to put that into 1 easy to read grid. I would want to show something like this:
userID = 1
Cookies ...... Sold ...... Not Sold
sugar Yes
choc chip No
thin mint Yes
sprinkles No

This is what I have so far, but how can I put that into the grid like I need?

Code:

--This gives a list of all of the cookies available to sell
Select cookies from tbl_CookiesForSale2015
Order By cookies ASC

--This shows what the specific person has sold
Select cookies as 'Has Sold' from tbl_CookiesForSale2015
where cookies IN (Select cookieID from tbl_userCookies where gsID = @gsID AND HasSold = 1)
Order By [Has Sold]


--This shows what the specific person has not sold
Select cookies as 'Not Sold' from tbl_CookiesForSale2015
where cookies IN (Select cookieID from tbl_userCookies where gsID = @gsID AND HasSold = 0)
Order By [NotSold]




tbl_CookiesForSale2015
(
        cID int,
        cookie varchar(100)
)

tbl_userCokies
(
        gsID int,
        cID int,
        HasSold int
)


Query to Return Only Most Recent Entry

$
0
0
I have a data base in Access 2010 that supports an annual sailing regatta. There are three tables that are relevant to this question; 1) tblSkippers, containing a key field skipperid, name, address, phone numbers, email addresses etc.; 2) tblBoats, containing a key field Boatid, boat name, boat type, sail number, etc.; and 3) tblEntries, containing a key field Entryid, the regatta year, Skipperid, Boatid, and other data not relevant to this question such as fleet entered and handicap rating. In essence an entry consists of a year, boat ID and skipper ID. It is common for skipper ID and boat ID to be used regatta after regatta, with only the regatta year making the entries unique.

I want to send a reminder email message to every skipper who has entered in any of the previous three regattas. I wrote a query that selects the applicable entries and also returns the skipper's name and email address from tblSkippers. The problem is that I get duplicate skipper names and email addresses because many skippers enter every year. I tried setting Unique Values to "Yes" and clearing the "show" check box for the email field. That 1) didn't work, and 2) would defeat the purpose because I need the email address for my mail merge. I've found articles that imply that I should change "Select" to "Select Distinct [email]", but I can't find where I should do that.

Can anyone point me in the right direction?

How to search multiple lines of the same table

$
0
0
Howdy,
New user here, and I have a slight problem. I have a Work Order Records Table, with both parent and child work orders alike. The only parameter that determines if a Work Order is a child is an entry of a Work Order number in a Parent column. I want to write a code that would take the number from that Parent column, then search the document and find the parent work order row and return the corresponding due date.

Here is a quick sample of the table I made in Excel to illustrate the data.. Please note that the tables do NOT have the "Parent Due Date" column, that is what I am trying to create with my report.
Excel Sample Data.JPG

I linked two identical tables together, but I am still not quite sure how to select the record I want. Here is what I have:
IF {JOB_HEADER.PARENT_WO}={JOB_HEADER_1.JOB} AND {JOB_HEADER.PARENT_SUFFIX_PARENT}={JOB_HEADER_1.SU FFIX} THEN
{JOB_HEADER_1.DATE_DUE}
ELSE
"ERROR"
A any help would be hugely appreciated.

Thanks,
Attached Images

How do I load a DB2 table using Data from a note pad on a PC

$
0
0
Hi,
I have a situation whre I need to load data from a note pad to a DB2 table in mainframe. I uploaded the data from PC to mainframe in 79 byte records. But, when I see the coma seperated data in mainframe, the column value is spread in two lines so Db2 can't read data properly.

For instance,
Below is the data in on PC side. Though it apperas here on two lines, it is on a single line in note pad.

Insert into A5555JAS.CXX_DATA values('PQR','*ERRD','CXR001',1,'1970-01-01',1,'ERRP','9999-12-31','C','00','R','H',08005,0,0,'N','','','2015-04-10-13.15.40.000000',90346); Commit;

But when it comes to mainframe as 79 bytes,

Insert into A5555JAS.CXX_DATA values('PQR','*ERRD','CXR001',1,'1970-01-01',1,'ERRP','9999-12-31','C','00','R','H',08005,0,0,'N','','','2015-04-10-13.15.40.000000',90346); Commit;


DB2 can't read data correctly since the column value for the date is split in to two lines,. Is there any way I could spread the data in two or three lines so that a coma will be the end of a line data and DB2 can read the data correctly?

Any suggestion will be greatly appreciated?

Euro Engineering AG sucht einen Softwareentwickler (m/w) C, C++ in Deutschland

$
0
0
Für unsere bundesweiten Standorte suchen wir Softwareentwickler (m/w).

Ihre Aufgaben
In Ihrer neuen Position als Softwareentwickler (m/w) übernehmen Sie die Konzeption, die Programmierung und die Inbetriebnahme von DV-Projekten mit Hilfe des kundenseitigen Prozessleitsystems.
Sie entwickeln Individualsoftware und Applikationen, konzipieren und erstellen Softwarelösungen und integrieren relationale Datenbanksysteme.
Darüber hinaus sind Sie sowohl für die Abbildung und die Dokumentation von Geschäftsprozessen als auch für die Erweiterung, Wartung und den Service bestehender Softwarelösungen zuständig.
Mit Ihrem technischen Know-how unterstützen Sie ein motiviertes Team, und tragen somit langfristig zum Erfolg des Unternehmens bei.

Ihr Profil
Sie haben erfolgreich ein Studium im Bereich Informatik abgeschlossen oder eine Ausbildung zum Fachinformatiker absolviert und konnten bereits mehrjährige Berufserfahrung in DV-Projekten sammeln.
Darüber hinaus verfügen Sie über grundlegende Kenntnisse in der Programmierung im Rahmen der .NET-Entwicklungsumgebung (besonders in den Bereichen in C, C++ und VB) und sind sicher im Umgang mit relationalen Datenbanksystemen (MS SQL-Server und Interbase).
Ihr Profil wird durch eine eigenständige, strukturierte und lösungsorientierte Arbeitsweise , gute Englischkenntnisse in Wort und Schrift sowie eine hohe Bereitschaft zu Reisen abgerundet.

Wir bieten Ihnen ein attraktives Umfeld:
Branchentarifgebundenes Arbeitsverhältnis mit einem hohen Maß an Absicherung
Unbefristeter Arbeitsvertrag mit einem flexiblen Gleitzeitkonto
Breites Aus- und Weiterbildungsangebot
Individuelle Karriere- und Entwicklungsmöglichkeiten
Flache Hierarchien, in denen Sie etwas bewegen


Wissen, Erfahrung, Leidenschaft, Spaß - mehr davon für Sie in unseren anspruchsvollen Projekten, wo Ideen in Serie gehen. Bei der euro engineering AG können Sie gemeinsam mit über 2.100 anderen Profis die Zukunft gestalten. Wir freuen uns auf Sie!

Bitte bewerben Sie sich hier: https://express.candarine.com/campai...d/8415252b282a

select rows from right table based on a column in left table

$
0
0
I have two tables as follows
mysql> desc Accounts;
+---------------+-----------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-----------------+------+-----+---------+----------------+
| id | int(6) unsigned | NO | PRI | NULL | auto_increment |
| Name | varchar(30) | NO | | NULL | |
| Type | tinyint(1) | YES | | 0 | |
| Balance | decimal(10,2) | YES | | 0.00 | |
| Taxes | tinyint(1) | YES | | 0 | |
| Investment | tinyint(1) | YES | | 0 | |
| AccountNumber | int(11) | YES | | 0 | |
+---------------+-----------------+------+-----+---------+----------------+
and the other
mysql> desc Transactions;
+-------------+-----------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-----------------+------+-----+-------------------+----------------+
| id | int(6) unsigned | NO | PRI | NULL | auto_increment |
| Datum | timestamp | NO | | CURRENT_TIMESTAMP | |
| ChequeNo | varchar(12) | YES | | NULL | |
| Description | varchar(30) | NO | | NULL | |
| Notes | varchar(30) | YES | | NULL | |
| Value | decimal(10,2) | NO | | NULL | |
| ToAccount | varchar(30) | NO | | NULL | |
| FromAccount | varchar(30) | NO | | NULL | |
| Cleared | tinyint(1) | YES | | 0 | |
+-------------+-----------------+------+-----+-------------------+----------------+

I want to retrieve all Transaction based on the ID in the Accounts table.

I have tried the following without success.
mysql> select * from Transactions join Accounts on Transactions.FromAccount="Account.Name" where Accounts.ID="30";
Empty set (0.01 sec)

mysql> select * from Transactions left join Accounts on Transactions.FromAccount="Account.Name" where Accounts.ID="30";
Empty set (0.00 sec)

mysql> select * from Transactions left join Accounts on Accounts.ID="30" where Transactions.FromAccount="Account.Name";
Empty set (0.00 sec)

this despite a select * from Transactions where FromAccount="Standard Bank"; returning 130 rows.

In other words what I want is on retrieving the Account row based on its ID I want to use that Accounts Name to retrieve all pertanent records.

Please make suggestions.

How to dynamically adust column heights

$
0
0
I've got a subreport with 2 columns. The data itself consists of GH1 and GH2. When there is a small amount of data (say 4 inches worth on a page), the data only appears in the left column. If there is a larger amount of data (say 16 inches worth on a page), the left column fills up and then begins in the right column. The problem is that the reports often look unbalanced. Sometimes there is only data in the left column, and sometimes there is a full left column of data and just a small amount at the top of the right column.

Is there a way to automatically adjust the column heights so that the left and right column always appear to be balanced? For example, if there is only 4 inches worth of data, the left column would be 2 inches in height and the right column would be 2 inches. If there were 16 inches of data, the left column would be 8 inches in height and the right column would be 8 inches.

Columns are such a great tool in Crystal, but having a long column of data on the left side of the page and nothing on the right looks off.

Is there a solution?

Thanks!

Looking for a better solution

$
0
0
I have the following function that exports data from a query. Data was user-entered and saved to a table. The function transport the data into an excel file at specific rows and columns. Please ignore the xlApp and loop stuff, some of which was omitted because it is irrelevant to the question.

strSQLInit: Table RptCardDataCells, rowNumber cooresponds to the row number on the excel sheet

Code:

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim ctl As Control
Dim strSQL(150) As String
Dim strSQLInit As String
Dim varValues As Variant
DestName = "C:\Users\User\Desktop\QID\Reportcard-FY15.xlsx"
strSQLInit = "SELECT rowNumber FROM RptCardDataCells WHERE ctlName = "

'Miles & Minutes
strSQL(0) = strSQLInit & """SumofTotMiles"""
strSQL(1) = strSQLInit & """SumofLdMiles"""
strSQL(2) = strSQLInit & """SumoffltMinutes"""

'Agencies - REFERRING
strSQL(3) = strSQLInit & """SumOfBaptistHealthMadisonville"""
strSQL(4) = strSQLInit & """SumOfBreckenridgeHealthHosp"""
strSQL(5) = strSQLInit & """SumOfCaldwellCountyMedCentHosp"""
strSQL(6) = strSQLInit & """SumOfCarleFoundationHosp"""
strSQL(7) = strSQLInit & """SumOfClarkRegionalMedCentHosp"""
strSQL(8) = strSQLInit & """SumOfClayCountyHosp"""

Set xlApp = New Excel.Application
    With xlApp
        .Visible = True
       
Set xlWB = .Workbooks.Open(DestName)
    With xlWB
        With .Sheets("2003TC")
           
            'Column determination
                Select Case Forms!Reports!txtStart
                    Case "Jul"
                        colValue = "C"
                    Case "Aug"
                        colValue = "D"
                    Case "Sep"
                        colValue = "E"
                    Case "Oct"
                        colValue = "F"
                    Case "Nov"
                        colValue = "G"
                    Case "Dec"
                        colValue = "H"
                    Case "Jan"
                        colValue = "I"
                    Case "Feb"
                        colValue = "J"
                    Case "Mar"
                        colValue = "K"
                    Case "Apr"
                        colValue = "L"
                    Case "May"
                        colValue = "M"
                    Case "Jun"
                        colValue = "N"
                End Select
               

Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL(0))
    rowValue = rs!rowNumber
    varValues = DLookup("SumOfTotMiles", "CAMTS_MilesMinutes")
        .Cells.Range(colValue & rowValue).Value = varValues 'Total Miles


Set rs = db.OpenRecordset(strSQL(1))
    rowValue = rs!rowNumber
    varValues = DLookup("SumOfLdMiles", "CAMTS_MilesMinutes")
        .Cells.Range(colValue & rowValue).Value = varValues 'loaded Miles


Set rs = db.OpenRecordset(strSQL(2))
    rowValue = rs!rowNumber
    varValues = DLookup("SumofFltMinutes", "CAMTS_MilesMinutes")
        .Cells.Range(colValue & rowValue).Value = varValues 'flt Minutes
       
'Referring Agency

Set rs = db.OpenRecordset(strSQL(3))
    rowValue = rs!rowNumber
    varValues = DCount("[refAgency]", "[CAMTS_AgencyMisType]", "[refAgency] = 'Baptist Health Madisonville'")
            .Cells.Range(colValue & rowValue).Value = varValues 'Baptist Health Madisonville
    rs.Close
Set rs = db.OpenRecordset(strSQL(4))
    rowValue = rs!rowNumber
    varValues = DCount("[refAgency]", "[CAMTS_AgencyMisType]", "[refAgency] = 'Breckenridge Health Inc.'")
        .Cells.Range(colValue & rowValue).Value = varValues 'Breckenridge Health Inc.
    rs.Close
Set rs = db.OpenRecordset(strSQL(5))
    rowValue = rs!rowNumber
    varValues = DCount("[refAgency]", "[CAMTS_AgencyMisType]", "[refAgency] = 'Caldwell County Medical Center'")
        .Cells.Range(colValue & rowValue).Value = varValues 'Caldwell County Medical Center
    rs.Close
Set rs = db.OpenRecordset(strSQL(6))
    rowValue = rs!rowNumber
    varValues = DCount("[refAgency]", "[CAMTS_AgencyMisType]", "[refAgency] = 'Carle Foundation Hospital'")
        .Cells.Range(colValue & rowValue).Value = varValues 'Carle Foundation Hospital
    rs.Close
Set rs = db.OpenRecordset(strSQL(7))
    rowValue = rs!rowNumber
    varValues = DCount("[refAgency]", "[CAMTS_AgencyMisType]", "[refAgency] = 'Clark Regional Medical Center'")
        .Cells.Range(colValue & rowValue).Value = varValues 'Clark Regional Medical Center
    rs.Close
       
       
       

Set rs = Nothing

There is more code below that ends with statements and closes stuff out...like I said, irrelevant.

I'm looking for a more compact way of doing this. I would like to avoid writing 150+ SQL statements and just being so repetitive.

Ideas?

help with gett current time in textbox after a command button is pushed

$
0
0
Hello I am new to the forums. I used to work with access a while back and when I changed career goals I stopped using it and forgot most of what I knew.

I don't know if this question has been asked if it has please point me in the right direction. What I am trying to do is when I press a command button I need it to get the current system time and display it hh:mm in a textbox on a form. I have tried googling it but can't seems to locate what I am looking for.

database 9i gone extremely slow over night...help please

$
0
0
Hi all, I am no DBA so please be gentle.. I have a 9i 9.2.0.1.0 and literally I added an additional 12 columns to my Table (my table now has 263 columns and 880,000 records) and the very next day after turning on my stand alone windows machine a script that would usually take 2minutes is now taking 2 hours. I am extremely concerned I have checked table spaces and increased all table spaces to have at least 40% free this has not affected matters, still dog slow.. My windows machine is XP service pack 3, (I hear you all gasp). Please can anybody give me some assistance in getting my antiquated system running back at full speed..

DB2 deadlock

$
0
0
1 quick question, I have found the SQL statements which is creating the deadlock. But I can't kill those statements as both of them is running from a long time and i can't afford to kill them. So, What could be the possible solution to solve this problem.:beer:

Userform updating but not Access column

$
0
0
I have a user form where I have three fields for numerical values. I want to subtract field 2 from from field 1 and show results in field 3. I use the expression builder and do the following in the control source of field 3:

Code:

[txtFallHrsCompleted] - [txtFallHrsUsed]
The value shows up in the User form in the txtFallHrsBalance textbox but will not show up in the database. So I read that it will not show up in the database if you use a calculated value. That you have to use VBA. So I did the following in the Afterupdate field using the Code builder:


Code:

txtFallHrsBalance.Text = txtFallHrsCompleted.Text - txtFallHrsUsed.Text
Now I don't get anything in the User Form txtFallHrsBlance and still don't get anything in the database. What am I doing wrong?

Normalizing an invoice

$
0
0
I am a beginner. I have this form to normalize. I tried to normalize watching various tutorials . but i am still confuse with the process. please help me out normalizing it to 3NF. :confused:databse.PNG
Attached Images
Viewing all 13329 articles
Browse latest View live