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

Net work control file

$
0
0
I am trying to set up Paradox 8 on a new Windows 8 PC which is on a network. Does someone know how to change location of the Network pdoxusuerslock file. The new computer is pointing to a lock file on the C drive (local machine) it should be pointing to the F drive (network server).

Help with update

$
0
0
I'm trying to run the following script and will not:

update COR_DOF
set VL_ALIQ_PIS = 0.01,
VL_IMPOSTO_PIS = 1.12
from COR_DOF B
JOIN
COR_IDF A ON A.DOF_SEQUENCE = B.DOF_SEQUENCE AND
A.CFOP_CODIGO IN ('1.202', '1.411')
where DOF_IMPORT_NUMERO = 'cef622de-e29b-4f2d-ad4d-1e6ad1c2df66'
and a.MERC_CODIGO = 259314
and A.CFOP_CODIGO = '1.202';


below error:


Error starting at line 52 in command:
update COR_DOF
set VL_ALIQ_PIS = 0.01,
VL_IMPOSTO_PIS = 1.12
from COR_DOF B
JOIN
COR_IDF A ON A.DOF_SEQUENCE = B.DOF_SEQUENCE AND
A.CFOP_CODIGO IN ('1.202', '1.411')
where DOF_IMPORT_NUMERO = 'cef622de-e29b-4f2d-ad4d-1e6ad1c2df66'
and a.MERC_CODIGO = 259314
and A.CFOP_CODIGO = '1.202'
Error at Command Line:55 Column:12
Error report:
SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:

Please can you take a look and reestablish the import for the order_item table

$
0
0
We have an automated import tool that automaticllay imports data from the IMS MySQL data base to Zoho reports. One of the tables has not updated since the 18th of July (this is odd as there have been no changes to the table and other tables have updated correctly).We did manually import a record without any data configuration changes and it imported successfully.
Please can you take a look and reestablish the import for the order_item table

How to structure a weird relationship

$
0
0
Hello,

I'm new, recent softdev grad and I'm working on a project with a weird relationship. Trying to figure out the best way to structure a couple of tables. I feel like it's pretty easy but I can't quite wrap my head around it. Any help would be appreciated. This structure will be used to store classical music.

So I have four things, a songs, works, albums and playlists.

A song is the base.
A work is made up of multiple songs.
An album is made up of multiple songs and/or a work.
A playlist is one or a combination of any of the previous.

I keep trying to do it with a recursive M2M with a song grouping type or something.

syntax error in sql subquery

$
0
0
Hey, I cant seem to find where the syntax error is in this SQL subquery.

Code:

(SELECT Peak
FROM qryPrep AS Alias
WHERE MonthlyDate =
(SELECT Max(MonthlyDate)
FROM qryPrep AS Alias2
WHERE Alias2.MonthlyDate < qryPrep.MonthlyDate
AND Alias2.ProductID = qryPrep.ProductID) ) As Prior

thanks,

excel query

$
0
0
i am trying to replace a cells contents based upon the contents of another cel so if d1='absent' i want cell a1 to be "A" and fill red any ideas please?

Acc4000 question

$
0
0
Is it possible to program motorola dct2524 with a acc4000?

Troubleshooting from an error message

$
0
0
Hello DB2 friends.

I have a terrible confession, I'm not good at reading an application error message and deriving what the problem with the database is.

I am administering an old DB2 8 database running on AIX and an application is throwing this error message:

2013-08-22 09:51:32.378 [WebContainer : 0] ERROR - com.reeng.resultsportal.motorists.life.web.utils.D bQueryManager: SQLException
java.sql.SQLException: 2;-440;42884;SYSIBM.SQLCAMESSAGECCSID|PROCEDUREDSRA00 10E: SQL State = 56098, Error Code = -727

I know this is a super basic question, but what pieces should I took from this as the potential source of the problem? Any help or suggestions would be great appreciated.

Run-time error -2147024809 (80070057)

$
0
0
I get the preceding error message when trying to open a specific report. below is the VB code with the highlighted (problem) text;

Private Sub cmdOpenReport_Click()
Dim stDocName As String
astrParams (0) = "'" & Me.cboAirspace & "'"

stDocName = "rptActsSpecial"
DoCmd.OpenReport stDocName, acViewPreview
Me.Visible = FALSE

End Sub

Any Ideas?

How to derive this column for immediate duplicates?.

$
0
0
I have a requirement to derive a column based on the key columns by sorting the UPDATED_DT column.

The key columns are DEPT_CD,STATUS,START_DT. I have tried all the Analytic functions but couldn't get to that. any help would be greatly appreciated.

Note:- the Column DUPL in output need to be derived.

Input

Code:

DEPT_CD,STATUS,START_DT,UPDATED_DT
100,Active    ,Jan 10 2013,Jan 10 2013 9:56:18 AM 000000
100,Pending  ,Jan 10 2013,Jan 10 2013 9:56:19 AM 000000
100,Pending  ,Jan 10 2013,Jan 10 2013 9:56:20 AM 000000
100,Queued    ,Jan 10 2013,Jan 10 2013 9:56:21 AM 000000
100,Closed    ,Jan 10 2013,Jan 10 2013 9:56:22 AM 000000
100,Pending  ,Jan 10 2013,Jan 10 2013 9:56:23 AM 000000
100,Pending  ,Jan 10 2013,Jan 10 2013 9:56:24 AM 000000

Output

Code:

DEPT_CD,STATUS,START_DT,UPDATED_DT,DUPL
100,Active    ,Jan 10 2013,Jan 10 2013 9:56:18 AM 000000, 1
100,Pending  ,Jan 10 2013,Jan 10 2013 9:56:19 AM 000000, 1
100,Pending  ,Jan 10 2013,Jan 10 2013 9:56:20 AM 000000, 2
100,Queued    ,Jan 10 2013,Jan 10 2013 9:56:21 AM 000000, 1
100,Closed    ,Jan 10 2013,Jan 10 2013 9:56:22 AM 000000, 1
100,Pending  ,Jan 10 2013,Jan 10 2013 9:56:23 AM 000000, 1
100,Pending  ,Jan 10 2013,Jan 10 2013 9:56:24 AM 000000, 2

Cheers,
Laknar

229 - Could not open or create a temporary file.

$
0
0
Hi I have a Informix 11 running on linux and I am trying to run below command

dbschema -d db01 > t

and getting below error and I did grant dba to the mentioned user

DBSCHEMA Schema Utility INFORMIX-SQL Version 11.70.FC5DE
grant dba to "user01";

-229 - Could not open or create a temporary file.
-131 - ISAM error: no free disk space


How to fix this

Thanks and Regards

Generate common sequence for a group of records

$
0
0
I'm trying to create a common sequence for a group of records by calling a database sequence. Sequence need to be generated based on DEPT_CD column.

Input
Code:

DEPT_CD,STATUS,START_DT
100,Active    ,Jan 10 2013
100,Active    ,Jan 10 2013
100,Active    ,Jan 10 2013
100,Active    ,Jan 10 2013

Expected Output
Code:

DEPT_CD,STATUS,START_DT, SEQ
100,Active    ,Jan 10 2013 , 1
100,Active    ,Jan 10 2013, 1
100,Active    ,Jan 10 2013, 1
100,Active    ,Jan 10 2013, 1

So far what i have tried is

Code:

WITH
        SOURCE AS (
                        SELECT DEPT_CD,STATUS,START_DT FROM TABLE1
                        ),
GENSEQ AS          (
                        SELECT DEPT_CD,SCHEMA.TESTSEQ.NEXTVAL AS SEQ
                        FROM
                        (SELECT DEPT_CD,ROW_NUMBER() OVER(PARTITION BY                      DEPT_CD ORDER BY START_DT) as DUP FROM SOURCE) A
                        WHERE A.DUP=1
                        )
SELECT DEPT_CD,STATUS,START_DT,SEQ FROM SOURCE B LEFT JOIN GENSEQ C ON B.DEPT_CD=C.DEPT_CD

But this query returns unique Sequence no for each number. Can anyone throw some light on this?.

This query output

Code:

DEPT_CD,STATUS,START_DT, SEQ
100,Active    ,Jan 10 2013 , 1
100,Active    ,Jan 10 2013, 2
100,Active    ,Jan 10 2013, 3
100,Active    ,Jan 10 2013, 4


Thanks,
Laknar

Ascending order in numeric with char in db2

$
0
0
Hi,

How can i numerical order in db2 database. for example i am using that format for

Field1 Filed2
20AC PRO
299AC PRO
322AC PRO
49AC PRO
5AC PRO

I would like to receive the numbers in the following order:

Field1 Filed2
5AC PRO
20AC PRO
49AC PRO
299AC PRO
322AC PRO


pls help?

Thanks

Not all the time Multipartition Tablespace better performance

$
0
0
Hi All,
I have a shell script where a lot of batch job processing involve, such load into a temporary table, comparison and update and so forth.
Once of the temporary table initially I created using single partition tablespace but due to timing I want to test to put this temp table into multipartition to gain performance. But, I can't imagine with multipartition table loading and reading... it cause 8 hours whereas I recreated the table into single partition tablespace, it only took only 30min to complete. Is this contention happen in multi-partition tablespace? What are the condition does not recommend to use multi-partition tablespace?

Thanks.

HOw to avoid deadlock,lockwait,locktimeout

$
0
0
Hi,
This is narasimha how to avoid deadlock,lockwait,locktimeout in db2 ese 9.7.
in my production server i am getting these types of errors.
please provide solution for me


Thanks and Regards
Narasimha A

OUTER JOIN in Microsoft Query Using Multiple Tables

$
0
0
I am trying to create a query in Microsoft Query to return data to Excel. My query has 9 tables and I need to perform an outer join on one of the tables. I get an error message saying I cannot perform an outer join with more than two tables but that I can do it in SQL. I am not very good at writing SQL. The table I need the OUTER JOIN on is TW_V_CAIR_QR.

Here is my code
SELECT PR.id, Division_Type.name, TW_V_RESPONSIBLE_DEPARTMENT_UN.s_value, PR.name, TW_V_ISSUE_DESCRIPTION.text, TW_V_ACTUAL_RESOLUTION.text, TW_V_PREVENTATIVE_ACTION.text, TW_V_ISSUE_CLASSIFICATION.s_value, TW_V_CAIR_QR.s_value
FROM comdev.CMADM.Division_Type Division_Type, comdev.CMADM.PR PR, comdev.CMADM.project project, comdev.CMADM.TW_V_ACTUAL_RESOLUTION TW_V_ACTUAL_RESOLUTION, comdev.CMADM.TW_V_CAIR_QR TW_V_CAIR_QR, comdev.CMADM.TW_V_ISSUE_CLASSIFICATION TW_V_ISSUE_CLASSIFICATION, comdev.CMADM.TW_V_ISSUE_DESCRIPTION TW_V_ISSUE_DESCRIPTION, comdev.CMADM.TW_V_PREVENTATIVE_ACTION TW_V_PREVENTATIVE_ACTION, comdev.CMADM.TW_V_RESPONSIBLE_DEPARTMENT_UN TW_V_RESPONSIBLE_DEPARTMENT_UN
WHERE PR.project_id = project.id AND Division_Type.id = project.division_type AND TW_V_RESPONSIBLE_DEPARTMENT_UN.pr_id = PR.id AND PR.id = TW_V_ISSUE_DESCRIPTION.pr_id AND PR.id = TW_V_ACTUAL_RESOLUTION.pr_id AND PR.id = TW_V_PREVENTATIVE_ACTION.pr_id AND PR.id = TW_V_ISSUE_CLASSIFICATION.pr_id AND TW_V_CAIR_QR.pr_id = PR.id AND ((PR.date_created Between ? And ?) AND (project.name='Reportable Issue'))Any help would be appreciated.

Dynamic Select for Cursor -> %Rowtype not working

$
0
0
Hello,

I'd like to write a procedure, which processes actions (mainly insert/delete), which an autocommit after a defined amount of actions.


Therefore I've created a procedure, which takes a parameter and opens it in a cursor - something like this:

Code:

CREATE OR REPLACE procedure doSomething
(IN sqlstring varchar(200))
LANGUAGE SQL
BEGIN
  DECLARE c1 weakCursorType;
  DECLARE myVar jurlvRow;

  DECLARE lvid varchar(20);

  DECLARE SQL_CURS1 CHAR(100) ;
  --DECLARE STMT_CURS1 CHAR(100);
 
 
  DECLARE CURS2 CURSOR WITH RETURN FOR STMT_CURS1;   

 
  PREPARE STMT_CURS1 FROM sqlstring ;

  OPEN CURS2;

  FETCH CURS2 INTO myVar;

  CALL DBMS_OUTPUT.PUT_LINE(myVar.lvid || '  ' || myVar.bearbid );

  close CURS2;
 
  RETURN 0; 
END
@

SET SERVEROUTPUT ON@

call doSomething('SELECT * from TABLENAME')@

This technically works, but I've to predefine for each table the Type with

Code:

CREATE or replace TYPE jurlvRow AS ROW ANCHOR ROW OF TABLENAME@
I found in various documentations of DB2 (we are using DB2 9.7 on Windows) that there is an equivalent for %ROWTYPE of Oracle - but it's usually used in the block between IS and BEGIN.
I'm not familiar with DB2, but somehow this version doesn't recognise this syntax?

Another question is - is there a possibility to insert the values, which were assigned to a %rowtype-like structure to another table, or is it necessary to do this manually?

Thanks in advance,

Best regards Martin

Correct sequence to reboot servers with HADR

$
0
0
Hi,

9.7.6 / Linux

Our SA needs to upgrade OS and reboot the servers. Two servers have DB2 with HADR setup. We don't need to switch roles, just temporary stop HADR on primary and standby, stop instances, reboot and then restart everything. What is the correct sequence to shutdown HADR & DB2 and reboot the servers and then restart HADR & DB2 after reboot?

TIA

Urgent Help needed

$
0
0
I Have 4 tables and I want to build a form in access in which I want to search for a particular string from all the 4 tables. So how should I build the search query and link the data to be searched from the 4 tables. the 4 tables are by software, by user, component, standard. Also after displaying the particular searched string I want to delete it. Is there any query to directly delete it after it is displayed?? I am an Power electronics student and I am unaware of access, i knw this might be real easy but I have never used access before.

Stored Procedure - Working SQL to Sybase 11

$
0
0
Hi All,

I am needing some help using SYBASE 11 creating a stored procedure. I have a working one in SQL 2005 but having no luck getting one to work in SYBASE. Really need help grasping the different methods.

SQL 2005
Code:

CREATE PROCEDURE [dbo].[get_part_id] @outvar char(9)  output
AS
declare @part_id as decimal


begin transaction
TABLOCKX
select @part_id=fnpartid
from participant_id

if @part_id is null
begin
      set @part_id = 1
      insert participant_id values( @part_id)
end
else
begin
      update participant_id set fnpartid = @part_id + 1
end
select @part_id
set @outvar = @part_id
commit transaction

My Attempt on SYBASE
Code:

CREATE procedure dbo.get_partid @outvar INT OUTPUT
AS

DECLARE @part_id INT

BEGIN TRAN
        DECLARE partid_crs cursor for

    SELECT @part_id=fnPartID FROM participant_id 
   
        IF @part_id IS NULL
    begin
   
        OPEN CURSOR partid_crs
        SET @part_id=1
        INSERT participant_id VALUES(@part_id)
    end
        ELSE
    begin
        UPDATE participant_id SET fnPartID = @part_id + 1
    end


SELECT @part_id
SET @outvar = @part_id
COMMIT TRAN

Thanks in advance
Viewing all 13329 articles
Browse latest View live