Skip to main content

Hello,

I'm extracting data from a Oracle table to create a new table with codes such as:

Table name: Routers

Desc

Router Hall

Router Room156

Router Shelter

...

I want to add a unique key to identify the separate routers.

(I have tried COUNTER, CRCCalculator, attributecreater etc). Is there a simple way to create unique number these routers?

You can use the SQLCreator instead of an Oracle reader and have the database create the unique number using a SQL statement like:

Select rownum, desc, router hall etc from Routers;

The rownum will give you a sequence number per records.


 

I am wondering. What part was not simple when using the Counter?

 


 

I am wondering. What part was not simple when using the Counter?

 

I agree. If neither the Counter or the CRCCalculator works, it seems we're missing some info. What is the error message? What data type should the unique id have?

Hi all, thanks for your input.

I'm extracting data from sqlserver.

Sqlcreator ic ROWNUM will give an error

 

'Provider error `(-2147217900) Invalid column name 'ROWNUM'.

I'm trying to make a table as follows:

 

TYPE ID(number) DESC

 

RESULT 0 FORCED NOT READY

 

RESULT 1 ABANDONED

RESULT 2 ANSWERED

 

RESULT 9 ONBEKEND

 

EVENT 0 CallEnd

 

EVENT 1 FNR

 

EVENT 2 Incoming

.....

 

I use several SQLCREATORS to extract data from sqlserver.

Type: a new attribute I create

ID: a unique number per TYPE

DESC: the data I extract from several dbo,e] from the sqlserver.

CRCCalculator will not give me an ID as specified and I did not succeed with Counter.

Perhaps there is a better way to do this?


Hi all, thanks for your input.

I'm extracting data from sqlserver.

Sqlcreator ic ROWNUM will give an error

 

'Provider error `(-2147217900) Invalid column name 'ROWNUM'.

I'm trying to make a table as follows:

 

TYPE ID(number) DESC

 

RESULT 0 FORCED NOT READY

 

RESULT 1 ABANDONED

RESULT 2 ANSWERED

 

RESULT 9 ONBEKEND

 

EVENT 0 CallEnd

 

EVENT 1 FNR

 

EVENT 2 Incoming

.....

 

I use several SQLCREATORS to extract data from sqlserver.

Type: a new attribute I create

ID: a unique number per TYPE

DESC: the data I extract from several dbo,e] from the sqlserver.

CRCCalculator will not give me an ID as specified and I did not succeed with Counter.

Perhaps there is a better way to do this?

Your previous question mentioned Oracle and in that case rownum can be used.

 

I do not know the SQL Server equivalent.

 

 


does row_number() over() work?

That should give you a unique value for every row.


YES !!!

I made the following query on SQL server and this works good:

SELECT 'EVENT' as TYPE,

 

ROW_NUMBER() OVER (ORDER BY EventType] ASC) AS ID,

 

pEventType] AS DISCRIPTION

 

from

 

dbo.dRawHistData_RouterAgentDataView]

 

group by pEventType]

 

order by 1

Thank you all for the great help.


Reply