cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching single record from Table

Former Member
0 Kudos

Hi Friends,

How can we fetch a single record from a table and later on update the flag of same record after processing ?

Regards,

Accepted Solutions (0)

Answers (10)

Answers (10)

Former Member
0 Kudos

Varun,

Though yet no concrete req has come from client side just being proactive..

Points awarded...not sure about the table fields currently..

Regards,

Former Member
0 Kudos

Hi Amir,

Points awarded..:-)...still a query isn't there any other way to proceed in this scenario ?

Regards,

former_member192892
Active Contributor
0 Kudos

Hey santhosh, if you have some field like an updated date or somethin, you can use select top 1 * from tablename order by updated_date desc

Former Member
0 Kudos

Hi Amir,

You got me right...but still few doubts remaining...like what is singleton select...? and from your reply can i make this point that in XI we can't handle this type of scenario but for making this type of scenario work we will have to write a code (stored Procedure may be) at RDBMS level..

Points awarded..:-)

Regards,

Former Member
0 Kudos

Hey

as far as i know,it might not work in XI coz of the syntax

see the syntax is

select into <parameters> from <table> <condition>

now this <parameter > is basically list of variables which needs to be declared before in the program ,so in my knowledge stored procedure is the best way to handle this.

Thanx

Aamir suhail

Former Member
0 Kudos

Hi Friends,

I don't want to use <b>select * </b> while selecting the record...as there will be n no. of records with flag value Y or N ...and definitely i can update the record also....

but out of n records( lets suppose which we will get for a flag value "y") i want to select 1 record from table and then want to process and finally want to update it and then again i want to select another record and do the same......similarly further records ...one by one for all records having flag value 1.

Hope my question got more clearer.

Regards,

Former Member
0 Kudos

Hey

to select single row you need to use use Singleton select but this is allowed only as a part of stored procedure or pre-compiled program,but its not allowed in interactive SQL.

the syntax for singleton select is

select into <parametrs> from <table name> <condition>

Thanx

Aamir

Former Member
0 Kudos

Hi Friends,

We want to fetch single <b>SINGLE RECORD</b> from table and want to update that record only after getting processed using flag attribute

Definitely i am talking about sender communication channel only when i am talking about fetching ....else i would have used "Pushing the record in table" for receiver side..

Still waiting for point zero answer..:-)

Regards,

Former Member
0 Kudos

hey

>>Definitely i am talking about sender communication channel only when i am talking about fetching

you can also use the word fetch if ur doing a synchronous scenario with Database:)

Thanx

Aamir

Former Member
0 Kudos

Hey

well as everybody is assuming that ur doing this on the sender side,lemme assume the same:)

have a look at the following blog

/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter

Thanx

Aamir suhail

Former Member
0 Kudos

Hi Santosh,

I guess you are referring to sender JDBC adapter.

you can use update sql statement in the sender comm channel to update that flag of the same record.

Regards

Pushkar Anand

Former Member
0 Kudos

hi santosh,

u can easily do it using a sender jdbc adapter.

during configuration: specify the complete query in Query SQL statement using a where clause so that a specific record is fetched.

Then in Update SQL Statement give the appropriate statement. it will update that record.

[reward if helpful]

regards,

latika.

Former Member
0 Kudos

Use <i><b>SQL Query statement</b></i> for selecting the record and then use <i><b>update SQL query</b></i> for updating the flag in sender JDBC Adapter of processing parameters....

Former Member
0 Kudos

Hey

you want to fetch from sender side or receiver side?

Thanx

Aamir

Message was edited by:

Aamir Suhail