10
Views
6
Comments
Solved
Alterar apenas o selecionado
Hello !!

I'm having a hard time making a change.

I'll try to explain

that I have 2 entities

would like to change a certain number save data belonging to another entity.

Be an Example of How YOU SHOULD.

example
example upgrad









Rel.
Client Nuber
Rel.
Client Nuber
2
C0
2
C0
2
C0
2
C0
4
B0
4
B0
4
B0
4
B0
4
B0
4
B0
4
B0
4
B0
5
C0
5
C0
5
C0
5
C0
5
C0
5
C0
5
C0
5
C0
2
B0
2
B1
2
B0
2
B1
2
B0
2
B1










Rank: #515
Solution

Hi Jone,

You can use @input, like this: 

UPDATE {Scheduling}
SET {Scheduling}.[Reportid] = @NewReportid
FROM 
    {Scheduling} INNER JOIN {Report} ON {Scheduling}.[Reportid] = {Report}.[Reportid]
                 INNER JOIN {Client} ON {...}.[ClientId] = {Client}.[ClientId]
WHERE
    {Reports}.[...] = @inputReport AND {Client}.[...] = @inputClient

It is important to know that the syntax is database dependant. 

Hope it helps.

mvp_badge
MVP
Rank: #17

Rank: #86

Hello Jone,

Hope you're doing well.


As far as I understood, you want to change the value for Nuber column in your entity for those specific records.

It seems that your entity has a composite key (Rel + Cliente attributes), so you need to filter by those 2 fields.


So you can use an SQL tool for that:

Something like this should do the trick:

UPDATE your_entity
SET nuber = 1
WHERE rel = 2 and Client = 'B'


Kind regards,

Rui Barradas

Rank: #2544
Thanks for the tip

how can I search for typed variables

UPDATE {Scheduling}. *
SET Reportid = ???
WHERE {Reports}. = ??? and {client}. = ???
Rank: #515
Solution

Hi Jone,

You can use @input, like this: 

UPDATE {Scheduling}
SET {Scheduling}.[Reportid] = @NewReportid
FROM 
    {Scheduling} INNER JOIN {Report} ON {Scheduling}.[Reportid] = {Report}.[Reportid]
                 INNER JOIN {Client} ON {...}.[ClientId] = {Client}.[ClientId]
WHERE
    {Reports}.[...] = @inputReport AND {Client}.[...] = @inputClient

It is important to know that the syntax is database dependant. 

Hope it helps.

Rank: #86

Hello Jone,

Can you share your data model?

So we can check your entities, fields and foreign keys.


It would be also a good help for us if you can send us some insights of what you are trying to achieve.


Kind regards,

Rui Barradas

Rank: #2544
Good afternoon


entity (Programming)
Entity (Report)

the table where the programming entity appears is already stored the data

when i will save the report i have to assign the report number for each schedule that is already linked.