How to have a unique value for each record??
could any 1 help me out in this...
I want to have a column name 'Order No' which should be unique.
How to generate a unique value for each record.??
could any 1 help me out in this...
I want to have a column name 'Order No' which should be unique.
How to generate a unique value for each record.?? If you are using SQL PLUS to create the table try something like
this:
CREATE TABLE ORDER_TEST (
ORD_NO NUMBER (8) NOT NULL PRIMARY KEY,
ORDERDATE DATE,
CUSTID NUMBER (8) NOT NULL,
SHIPDATE DATE,
TOTAL NUMBER (8,2) CONSTRAINT TOTAL_ZERO CHECK
(TOTAL >= 0),
CONSTRAINT ORD_FOREIGN_KEY FOREIGN KEY (CUSTID) REFERENCES
CUSTOMER (CUSTID),
CONSTRAINT ORD_UNIQUE UNIQUE (ORD_NO)
-- or a simpler table example
DROP TABLE ORDER_TEST;
CREATE TABLE ORDER_TEST (
ORD_NO NUMBER (8),
ORDERDATE DATE,
CUSTID NUMBER (8) NOT NULL,
SHIPDATE DATE,
TOTAL NUMBER (8,2) CONSTRAINT TOTAL_ZERO CHECK
(TOTAL >= 0),
CONSTRAINT ORD_UNIQUE UNIQUE (ORD_NO)
note: ORD_NO can also be a primary key
If you are doing the INSERT during runtime from a form first
create a sequence in SQL PLUS to handle the ORD_NO value:
Create SEQUENCE ORDERNO_UNIQUEVAL_sqnc
START WITH 000001
NOMAXVALUE
NOCACHE;
and reference it as the ORD_NO parameter in your INSERT
statement:
ORDERNO_UNIQUEVAL_sqnc.NEXTVAL
note: to maintain data integrity you must use the sequence
everytime you insert a new order to table. To start a new
sequence drop the sequence and re-create it with whatever "START
WITH" value you want.
Hope this helps
Kevin
Similar Messages
-
How to get Privacy Policy value for each userprofile in sharepoint 2010?
In userprofile application, we have defined Privacy Policy of mobilephone feild as optional, so every user has option to choose visibility scope of this property to "Everyone/My Manager/my colegues/Only Me" .
Now I am trying to get mobilephone value and their selected visibility option for each user.
I am able to get mobilephone value but I could not get "what each user has chosen as their visibility scope"?Hi,
According to your post, my understanding is that you want to get Privacy Policy value for each userprofile in sharepoint 2010.
You need to use RunWithElevatedPrivileges method to impersonate user.
To get the get mobilephone policy, you can use user["CellPhone "].Privacy.
For more information, you can refer to:
c# - Getting property privacy with Sharepoint 2010
How to Programmatically Impersonate Users in SharePoint
Managing Sharepoint 2010 Profiles Programmatically
Thanks,
Linda Li
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Linda Li
TechNet Community Support -
How to Genarate a Unique ID for each Payload in XI
Hi,
My Question is How to Genarate Unique ID for each Paylod that we send in a particular Interface.
Is that we can do it in Mapping...If Yes, How its possible...
Thanks
AmareshHi Amaresh !
XI generates and stamps a messageID to each message header. That ID is unique. You could use that one. To get that number from inside message mapping to put it in the payload, you could use a java UDF with this code:
String msgid;
java.util.Map map;
map = container.getTransformationParameters();
msgid = (String) map.get(StreamTransformationConstants.MESSAGE_ID);
return msgid;
Of course you can generate another number, but maybe you will need to use a common storage to avoid repeating the assigned numbers, and that will require more work.
Regards,
Matias. -
How to append parameter with URL for each record in table control?
Hi,
I have one table control which contains 5 columns.
(tripno, startdate, destination, reason, activities)
In 5th column, i need to display URL for each record.
for ex:
www.abc.com/test?tripno=1
www.abc.com/test?tripno=2
www.abc.com/test?tripno=3
when user clicks a particular hyperlink, it navigates to another page/component thru URL with one key field(tripno) to retrieve related records in next page.
1) i am not able to assign tripno to each record. when i assign tripno, its taking the last value which i assigned. ie. tripno=3 only.
How to assign URL to Reference field of LINK_TO_URL element at run time?
OR
2) we can do like this.
Simply assign url to reach record without key field.
www.abc.com/test
www.abc.com/test
www.abc.com/test
when user clicks a particular link, we can assign corresponding key field to the URL.
Where should i write this event? Bcoz, LINK_TO_URL doesnot have event.
how to do?Hi MOg.
Not sure whether I understand you .. but in the 5th column you want to have the reference URL. Is this the activities columen from you example?
Nevertheless, you need a attribute (String) in your context node which contains the URL. Bind this to the reference filed of linktourl. If you can not extend the structure you can create a sub node (cardinality 1:1) which contains the refernce attribute.
Then loop over all elements and concatenate www.abc.com/test?tripno= with the tripno of the current element into the reference field.
Hope tis helps,
Sascha.
Bind the -
How to have a unique requestId for a Page for multiple users
Hi,
Can someone please tell me how to get a unique RequestId whenever a page is visited. I need to have a unique RequestId generated for each user if they are on some specific
page. Whenever a users refreshes a page or come to the page by clicking back button want to have a unique requestId always.
Can I use sessionRequestId or something for HttpServletRequestObject that always gives me a unique Id.
ThanksUnique for how long?
Eternally unique ?
unique until the server restarts?
Most simplistic approach would be to have a static/singleton counter. It wouldn't work perfectly in high volume sites, but should work well enough for smaller ones. Including a timestamp in the key makes it fairly unique.
This would handle both initial requests and refreshes of the page.
There is nothing you can do about users hitting the back button. If the page gets served from the client cache, the server knows nothing about it, and can not issue a unique id.
Why the requirement? What are you trying to accomplish by doing this? -
How to specify a unique integer for each local variable defined in TestStand?
I have a .net application that reads all TestStand local variables, but for the .net application each local variable should have a unique integer number. Iterating through the locals and storing the index is not a good solution, because if a local variable is moved or deleted, the index will change.
Does anyone know how to do this in TestStand or having an idea how to this in my .net application?
Thanks.Thanks Doug for your reply. Using a GUID is not an option because this ID is too long. I will try to explain why I need this ID for. I have a lot of C# code that generates code to deal with a lot of instruments. For example to configure a device, user defined variables can be used to specify some settings or to store results. These variables are not stored in the generated code with a name but with an integer number. Now I want to try to be use all our existing device driver code with the TestStand sequencer. So, I need a translation between the name of a TestStand local variable and an integer number. After constructing the interface to my code I want to read all the variables from TestStand and now I need the integer ID to do the mapping to my variables. I know that I can use use your proposition 2 by encoding the unique ID into the name of the variable and parse the name of the variable to get it back, but this is not an automated way. This will be rather difficult if there are several hundreds of variables. For this reason I am looking for an alternative way. Looking forward for your response. Best regards
-
How to have a duplicate values for jtree components..
i'm trying to create a swing application with jtree.i'm getting the data from database in a single stretch.plz have a look at the below tree structure.
fint3
fint1
fint2
fint3
fint7
fint4
fint5
fint3
here the problem is i want to add a child under the last fint3.
fint3
fint1
fint2
fint3
fint7
fint4
fint5
fint3
fint8
my tree needs to be look like the above tree strucure.but i'm noy able to do that.instead of this
fint3
fint1
fint2
fint3
fint8
fint4
fint5
fint3
itz populating the tree shown above.
kindly guide me how to assign the hidden duplicate unique name for original data to insert the nodes properlyin my below post the structure of the tree is not populated properly.first fint3 is the root node
fint3
fint1
fint2 -
How to have a common value for a column using sql loader
Hi Have a sql loader file which looks like below. But I am not getting how insert the same value for the column in all rows.
id,
crt_user_id
BEGINDATA
1;"system"
2;"system"
3;"system"
So, instead of entering the crt_user_id as system in all rows, can we place the value at the top after the column name?Thanks Srini. your hint/suggestion helped me in finding the solution.
LOAD DATA
INFILE *
BADFILE './TEST.BAD'
DISCARDFILE './TEST.DSC'
APPEND INTO TABLE TEST_TABLE
Fields terminated by ";" Optionally enclosed by '"'
ID,
crt_user_id CONSTANT 'SOME CONSTANT VALUE'
BEGINDATA
1
2
3
so by using CONSTANT key word, we can avoid tying the same value in the data -
Insert three values for each record
I have a very complex Data Flow, with several joins, splits, etc.... once all of this logic is completed, I need to insert the values 2013, 2014, and 2015 for a Derived Column (called Year). Each record that comes through this data flow needs to have
a duplicated entry three times, and insert these values for the year.
Here's a simple example source:
Key Name
1 Brandon
2 Thomas
So the target should end up being:
Key Name
Year
1 Brandon
2013
2 Brandon
2014
3 Brandon
2015
4 Thomas
2013
5 Thomas
2014
6 Thomas
2015
Can anyone help?
There are only 10 types of people in the world... those who know binary, and those who don't.Hi,
Try this,
1. Load the data into your destination with 2013 as a derived column.
2. Have an another Dataflow task to load one more time. (Select the distinct record from dest table - have an id key and take distinct based on that or please check for your data nature). After selecting the distinct records, have 2014 as derived column
in that DFT.
3. Again have another DFT to load for 2015.
This is a static method since you have only 3 years to insert. If you have more years like this, do a loop to achieve this logic.
--------------------Mark as Answered or Vote as helpful if this solves your problem.------------------ -
Fetching unit_of_meaurement value for each item
Hi ,.
I want to fetch the value unit_of_measurement (MSEHI) value from table T006
for each items
I havent find any linakage
How can i read these values for each item
Thanks
AnilI have a material number say, Grumpy. The report that I have shows the total sales for Grumpy for $13,000.00. Grumpy has other submaterials number says Grumpy_1, Grumpy_3, Grumpy_4, Grumpy_5. The report only shows the total quantity sold for each of these submaterials. Say
Grumpy_1 = 800
Grumpy_3 = 70
Grumpy_4 = 1
Grumpy_5 = 33
I want to find a way to get an IO that tells me a price sold for 1 quantity, so that I can use it to find the total sold for Grumpy_1, Grumpy_3, Grumpy_4, Grumpy_5 that will add to equal $13,000.00
Thanks
"<i>Sometimes I need what only you can provide: your absence.</i>" ~ Anonymous -
How to genarate Primary Key for each record in XI Mapping
Hi,
I need to genarate primary key for each record in the paylod in mapping..
Eg: if i have a 10 reacords i need to have a primary key for each record..starting with the
Record Primary key
First 001
Secound 002
Tenth 010
If i need to write any user defined funtion... can any one provide the code for it.
Thanks
AmareshHi Bavesh,
I will explain with the example:
XML:
<Record 1>
<Primary key>
<value1>
<value2>
</Record 1>
<Record 2>
<Primary Key>
</Record 2>
like above i will be getting n number of recored and in each record i need to genarate primary key in XI.and the key sould be in sequence...
like for the first record 1 secound 2 like that primary key should add to the privous Primary key.
and this is for each payload.
Thanks
Amaresh -
Multiple parameters one row for each record
I have this query I want the user to be able to allow the user to enter multiple MATL_CODE_MOD as a parameters, the problem is that the GURMAIL table have multiple records one for each GURMAIL_MATL_CODE_MOD, so it will give me duplicates.. How I can code this, so I can allow the user to enter multiple MATL_CODE_MOD codes, and have only one row for each record...
and GURMAIL_MATL_CODE_MOD in ('8IBC','8IBD')
select
spriden_id,
spbpers_name_suffix name_suffix,
spbpers_name_prefix name_prefix,
spriden_last_name last_name,
spriden_first_name first_name,
spriden_mi mi,
srbrecr_term_code,
srbrecr_majr_code,
srbrecr_program_1,
saturn_midd.utlq.f_matl_code_type(srbrecr_pidm)
FROM
saturn.srbrecr,
saturn.spriden,
saturn.spbpers,
SATURN.SPRADDR,
general.gurmail
WHERE
spriden_pidm = srbrecr_pidm
and gurmail_pidm = spriden_pidm
AND spriden_pidm = spraddr_pidm
--and srbrecr_term_code = decode(p_term ,'%',SRBRECR_TERM_CODE,p_term)
and spbpers_pidm = spriden_pidm
and spriden_change_ind is null
--and gurmail_matl_code_mod
and SRBRECR_PROGRAM_1 = 'CMQ'
and GURMAIL_MATL_CODE_MOD in ('8IBC','8IBD')
--AND SPRADDR_ATYP_CODE = 'CM'
AND SPRADDR_STREET_LINE1 IS NOT NULL;Hi,
SELECT DISTINCT ...will keep duplicate rows out of the result set.
Depending on your data, another possibility might be to not join the table that contains GURMAIL_MATL_CODE_MOD. Do an EXISTS sub-query on that table instead.
If you need more help, post some sample data from all the tables, and the results you want from that data.
Simplify, if possible, You can probably post a problem with 2 or 3 tables, each with 2 or 3 columns, that will have the same answer.
Edited by: Frank Kulash on Apr 22, 2009 2:28 PM -
I have 3 iphones, an ipod touch and an Ipad on the same itunes account. should I have a different account for each device? If so how do I get all my purchases, like music on all the devices?
You can sync as many devices as you want to the same iTunes account, there is no limit. You can have the same content on each device or different content, the choice is yours. iTunes will keep everything straight, by device, including separate backups. I'd suggest giving each device a unique name, to make things easier.
-
How to create an array of ring with a different items/values for each
Hi All,
i want an array of text ring with different items and values for each text ring. Do you have other solution if it does not work?
thanks by advance0utlaw wrote:
Hello Mnemo15,
The properties of elements in an array are shared across all controls or indicators in an array, so there is no way to specify unique selectable values for different text rings in an array. It sounds like what you are looking for is a cluster of ring controls, where each control can be modified independently.
Could you provide a more descriptive overview of the sort of behavior you are looking for? Are these ring elements populated at run time? Will the values be changed dynamically? Will the user interact with them directly?
Regards,
But the selection is not a property, it is a value... I just tried it and you can have different selections. Just not different items.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
If I have two email accounts, one personal hotmail account and one MS Exchange work account on my iPhone 4s, How can I setup individual notifications for each account? Fore example, if I get a work email, I want to hear a DING, DING....If I get a personal email, I want to hear a BEEP, BEEP. Right now, any email from any account has the same notification. I want work incoming email notification to be different than personal incoming notification. The only semi-workaround I've seen is just disable any notification for the Hotmail account, so only work emails would notify. But then I don't know when I get a personal email. Even the lowely Blackberry Torch 9800 has this feature..not iPhone 4s??
ThanksSorry you get only one notification sound for all email accounts. you can send a suggestion to apple here http://www.apple.com/feedback/
Maybe you are looking for
-
Dear All, I am working on Mixed Signal Graph with Multi plot cursor. My target is to move the cursor on X axis time scale and get the y axis values of all the plots. i got some ex. on forum but i am facing a typical problem explained as follows: By c
-
How to use USEREXIT_FIELD_MODIFICATION ?
hi there how can i implement USEREXIT_FIELD_MODIFICATION in va02? do i need acess key for that?
-
IDOC sender/receiver partner type LS?
Hi, I am in need of advise if SAP 5.0 can be configured for ORDERS outbound (PO NEU) to pick up receiver (KU) partner type by standard config? I understand that there's exit available but would like to utilise standard application config method. Rega
-
Unable to connect to environment after migrating Security from BPC 7.5 to BPC 10.1
Hi Experts, We are working on BPC 7.5 to BPC 10.1 NW migration and after migrating the environment, we are unable to connect to environment. While trying to access, we are getting the following error: After taking a backup of the necessary environmen
-
After Effects error: crash accurred while invoking rendering plug-in "Advanced 3D"
Hi all, i keep having the error message, After Effects error: crash occurred while invoking rendering plug-in "Advanced 3D", in the mids of my render. I tried rendering the individual composite effected in the final comp, they were came out fine. Wou