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

Search Page help

$
0
0
I have a search page and whenever I search once it works but then I try to change the criteria and the search doesn't work the second time, what am I doing wrong? Any help would be appreciated.

C precompiler, multiple source files

$
0
0
I want to write an application using the C precompiler, with the code organized into several separate files. One of the .pc files will configure error and warning handlers and connect to the database. Another .pc file will have the routines to define a cursor, open it with specific parameters, fetch from it, close it and dispose of it; each cursor should go onto a separate .pc file.

I have been unable to make this run. The error and warning handlers that I define in the first .pc file (which definition gets called before any other DB-related functions) are only used for that one .pc file; any errors triggered from the other .pc files are not funneled through these handlers.

I believe this is related to the INCLUDE SQLCA instruction; I guess I should only use that in a single .pc file, and do some other incantation from the other .pc files, but I have been unable to make this work. The only way everything compiles and runs is to have an INCLUDE SQLCA in each .pc file; since that generates an "SQLCA sqlca;" line in each generated .c file, it seems that, unless I am mistaken, each .c file is getting a separate instance of SQLCA.

Any help greatly appreciated. Thanks in advance.

Sybase DBA training

$
0
0
Hi All,

I am looking for some good Sybase DB admin training (spefically for Sybase 15).

I am basically a c/c++ programmer who has been thrown in to the role of also being DBA for the underlying sybase DB with our project. Since the project moved from Sybase 12 to Sybase 15 we have encountered all sorts of performance issues. I have done some on-line reading and have tried different suggestions (setting cpu's from 1 to 2, setting compatibility mode on) but I really dont have the skills to further analyze why the DB is sluggish and why inserts/deletes take so darn long.

Does anybody have any good suggestions on where I can get good Sybase DBA training? I appreciate it.

Bill

Get tables involved in operation

$
0
0
Hi

Say I have app, I want to know when I perform any operation like logging, changing username etc, can I get all the tables involved for that particular operation.

Thanks
Vineet

Using COBOL to programmatically dump all data

$
0
0
I have a COBOL that basically gets all columns, all rows from a table. I need to use a program to basically do some massaging of the data prior to writing out to a sequential file.

Here are my questions:
1.) I am using ROWSET to get 500 records by FETCH. I have yet to find a good formula for this number other than trial and error. 500 seems to be the sweet spot, at least for this table. Does a formula exist?
2.) I don't have an ORDER BY because I don't care what order they come out in. Anything else that should be specified on the OPEN such as OPTIMIZE to improve it's performance?
3.) I am using FOR FETCH ONLY, anything else? I believe FOR READ ONLY and FOR FETCH ONLY are basically the same thing.
4.) Does DB2 Z/OS V.10 have a TRIM function? I need to remove leading zeros from integers etc. and trailing spaces from alphanumerics.

A Loop function to be wrapped around a function

$
0
0
Hello

I was wondering if someone can help me with some VBA

I have a sub which updates a pivot table and then sends an e-mail

I have a second sub which loops round each name

However, what I need to do is for the Code to send the e-mail and then loop round until there are no more e-mails to send

I cannot seem to fit the loop statement around the initial statement

I am attaching the code, I do not think you need to necessarily need to know what the bulk of the code is doing,

It is just a case of getting the lines of code which states
" LOOP STARTS HERE" = 1 Line
"LOOP IS HERE ALSO" = Last several lines

around my code that I know works.

Any help would be greatly appreciated

Thanks
Helen

Attached Files
File Type: txt SQL Code for emails (2).txt (5.0 KB)

SSIS - OLE DB Source to Flat File SLOW

$
0
0
So I have this SSIS package - nothing too clever - it basically just dumps a load of data out to text files.

Step 1: bit of scripting to create a folder and change the connection managers for the destination files to be within this new folder.

Step 2: dump out lots of data using Data Flow Tasks

Each data flow task follows the same format:
OLE DB source (a single SQL view)
Flat File Destination (pipe delimited CSV)

However, one of my steps seems to run stupidly, painfully slow compared to the others!

Two comparable steps have the same format (same columns, same data types, same everything) just different data.

One step returns ~3M rows and in SSMS executes in about a minute.
Another step returns ~1M rows and in SSMS executes in around 25 seconds.

In SSIS the 3M step takes almost no time to dump out.
The smaller data set (1M) dumps out about 10K rows every 30 seconds. I have yet to let it finish.

Any ideas on the cause?

I had this problem in this package in the past with a different step and all I did was recreate it from scratch and that resolved it. I have done this with the slow step to no avail.

Tearing my hair out on this!

Record duplicating Module than VBA delete specific fields in Table

$
0
0
Help please, I have created a form with a sub-form. on the sub-form I have created a button to duplicate the record shown, now I want to delete the DateJobRequested and some other fields so the operator if forced to add up to date info. At the end of my buttons code I am trying to call code, but my VBA code is not working. I am trying to use the command UPDATE. the tables name is JobTable and the fields are JobDateRequested, JobDescription ... I am using = Null
Does this make sense to anyone? Sorry to take up your time with something that should be soooooo simple.

Need procedure that calculate the area of a block

$
0
0
i guys
is there anyone know a procedure that calculate the size or the area of a block?

Thanks

Sharding in DB2

$
0
0
Is sharding possible in DB2? If Yes, Could someone please share link where I can find steps to shard a DB in DB2.

Appliance Warehouse Inventory Database

$
0
0
Hello!

I'm hoping to get some advise regarding the design of an inventory database for large home appliances.

I need to track model, serial, date arrived, arrival number, date delivered, and delivery number.

As you can imagine we often will have one model number with multiple serials. It seems obvious to me that I need a one to many relationship here between the models and serials which I have set up. I have one table that lists the model number and a sub table with the serial, arrival number, and delivery number fields.

When units arrive in our warehouse they are assigned an arrival number based on the date of arrival. There is one arrival number per date and each arrival number can have multiple units. I would like to relate arrival numbers to each serial. Seems like another one to many relationship.

When units are delivered to the customer they are assigned a delivery number. There will be several serials relating to any delivery number.

Our current database simply lists all of this information on one table. This works but is just about as easy to use as a giant spreadsheet. Entering new units is a pain because you have to enter lots of repeated data.

I would like to set up relationships so that I can enter an arrival number and then input the units that have arrived under that number.

Once the units have been entered into the database they will be removed by delivery number (this is essentially an order number). I would like to be able to set up an order and assign multiple units to that order.

My end goal is to make the database easy to use as several people with varying levels of computer skill need to access.

Before I get to far into the design I would like some suggestions or confirmation that I am on the right track!

Does anyone have suggestions or ideas for how best to layout my relationships?

Tip: Same field on select sheets

$
0
0
Hi all.
Here's a little something I managed to do that you might find handy at some point in the future.

Traditionally when you add a field to a sheet, you have the option to have the field visible on all sheets of your form, or only 1 sheet. But what if you wanted the field on more than one sheet, but not on all the sheets.

There's technically no function for that inside brilliant database using the default options, so I had to get a little creative today. The following only works with v10 or higher.

In v10 there's a new option that allows you to run a script when a sheet is selected. You can use that function as a means to let your database know what sheet it's on and weather or not a field should be visible for the selected sheet.

For example.
I have 8 sheets in a form.
I add a Field to my form and I want to only see this field when sheets 3 to 6 are selected. So I add the field to be visible for all sheets.

Now to hide it from sheets 1,2, 7 and 8.
In v10 you have the option to run a script when a sheet is selected. So what I did was to create a global variable called “visibility”. When Sheets 1,2, 7 and 8 are selected, the visibility variable is populated with a 0. When sheets 3 to 6 are selected, the visibility variable is populated with a 1.

So now my database knows what sheet is selected, and now you can use the standard visibility rules to make a field visible or hidden by simply setting that option to check the value stored in the visibility variable.

You need to do a field refresh on sheet select also though to make this work as the visibility rule for the field is not updated automatically when the value in the variable is changed.

Works like a charm.

Regards
James

Create a button on a form that puts a set value into a textbox

$
0
0
How can I nmake a button that puts a value into a textbox on the same form? I want to make it so that the user cant edit the text in the textbox, so that the only options are the buttons that I create.

LEFT JOIN Help Please

$
0
0
Hi all,

I need some help with a left join and I don't even know if this is possible so any guidance would be of help.

I have two tables, Appointments, and Appointee_Costing. Both are joined by EMP_NO, and CONTRACT_NO

What i want to do is take the record in the appointment table, and join it to the appointee_costing table in such a way that I get the related records from the appointee_costing table. To begin with I've used this;

Code:

select                a.emp_no, a.contract_no, b.cost_effective_date, b.cost_code
from                appointments a
left join        appointee_costing b
on                a.emp_no = b.emp_no
and                a.contract_no = b.contract_no

This works, However there may be dozens of entries in the appointee_table for the appointment but I only want the current one. I then modified the join to work only on the maximum effective_date in the appointee_costing table...

Code:

select                a.emp_no, a.contract_no, b.cost_effective_date, b.cost_code
from                appointments a
left join        appointee_costing b
on                a.emp_no = b.emp_no
and                a.contract_no = b.contract_no
where                a.cost_effective_date =
        (
                select        max(bb.cost_effective_date)
                from        appointee_costing bb
                where        bb.emp_no = b.emp_no
                and        bb.contract_no = b.contract_no
        )

Now the problem. This gave me what I wanted for everyone where there was a costing entry, but what I need, is to display NULL where there is no associated costing record and that's the bit where I'm having trouble.

What I am getting is this...

EMP_NO, CONTRACT_NO, COST_EFFECTIVE_DATE, COST_CODE
210000, 1, 2014-04-01, AAAABA
202000, 1, 2014-01-01, AAABAA
200300, 3, 2014-02-01, AABAAA
200005, 1, 2014-06-01, BAAAAA

What I want, is this...

EMP_NO, CONTRACT_NO, COST_EFFECTIVE_DATE, COST_CODE
210000, 1, 2014-04-01, AAAABA
202000, 1, 2014-01-01, AAABAA
200300, 3, 2014-02-01, AABAAA
200040, 1, NULL, NULL
200005, 1, 2014-06-01, BAAAAA

Is this possible? Can someone offer some suggestions?

Christy

sybase sql anywhere dbf file

$
0
0
What tools to do I need to open and work with a sybase sql anywhere .dbf file??

Many Thanks,
Elias

DSum between access & Excel

$
0
0
Hello there,

I'm stuck on a problem and not sure where to go for help.

I want to take an existing excel spread sheet, select a singular cell, and build a Dsum function that will look inside an access database and pull out the sum of a "cost" field based on the criteria of a seperste field in that same access table.

Is this possible?

Removing duplicate delimited values from a single column

$
0
0
I've searched the web, but most everything is about removing duplicate *rows* from a result set...which is not my issue. I have a stored procedure that returns a single row based on a parameter of employee ID. This particular procedure uses a CTE to traverse our org structure. One of the columns is returning a delimited string of Windows login values and due to the business rules, it can contain duplicate values. I need to have that column contain only unique values - no dupes.

For example, this one column could contain something like this:

domain\user1;domain\user2;domain\user2;domain\user 3;

The need is to convert to this:
domain\user1;domain\user2;domain\user3;

I know that's a tall order. Appreciate any assistance.

IBM end of support date for Informix database

$
0
0
All,

I have some queries regarding informix.

Does anyone know when IBM updates the end-of-support for Informix database ? (Like version 11.50,11.70 and 12.10)

Also how to verify if our database runs work group edition or enterprise edition?

Parent/Child/Grandchild DB Design

$
0
0
Hi everyone,

I am having a design fart and could use some help.

I am tracking equipment and I essentially have three tiers. I have a parent, a child, and a grandchild. Each of these are pieces of equipment and they all have the same metadata associated with them. For simplicity sake, let's say that each piece of equipment has a name and a description. I am trying to use proper database design, and I am seeing something that looks troubling.

Currently, I have a parent table with the equipment name and a description. I also have a child table with a parent ID (w/ 1-many), equipment name, and description. And finally, I also have a grandchild table with a childname (1-many to the childID--note that htis is the child of the parent, not the grandchild) and a description.

In my experience, having any kind of repeating data is not good practice, but I don't know how to separate things out. I would love to just have one table that has all of the equipment and then just say if it is a parent, child, etc. and list what it is, but how would you reference that from the same table? I thought of having a metadata table to house all of the meatadata and then have a "Type" column with it to say if it is a parent, child, etc, but then how would I properly reference the parent data and associate them together? Keep in mind too, while each parent, child, etc has the same metadata fields, the metadata for a parent would be different than that of the child (parent has a different description than child, etc.). My brain hurts :confused:

Appreciate any and all input. If you need any clarification, please let me know. Thanks.

sybase bcp errors

$
0
0
I get errors when I try to upload a datafile using bcp.
CSLIB Message: - L0/O0/S0/N36/1/0:
cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.

I had to painstakingly examine my data to figure out what was causing the data.
Why is sybase bcp so bad at reporting error info?
Is there a way to get a line and column number? That shouldnt be that hard Im guessing.
Viewing all 13329 articles
Browse latest View live