sql query ASAP

pts.
Tags:
SQL
When DWTRXGRP.XGRPG_GROUP_TYPE_CODE in ("IE","IF","II") use GRP_RRE.ELEM_VAL_TXT = 0011 for ELEM_ID = RATPOL now table DWTRXGRP is in schema1 and GRP_RRE is in schema2 UPDATE Schema1.GRP_RRE SET ELEM_VAL_TXT = `0011? WHERE ELEM_ID = `RATPOL? AND ## WHAT ABOUT Schema2.DWTRXGRP.XGRPG_GROUP_TYPE_CODE in (`IE?,?IF?,?II?) ##

Answer Wiki

Thanks. We'll let you know when a new response is added.

If you want people to help you, you need to state the question much more clearly than that. Most people aren’t going to work that hard to understand the question and then work, perhaps, even harder to answer it. That’s asking too much of people.

What DBMS are you using?
What version?
What error or undesirable behavior are you getting?
Are all those ?s supposed to be in your SQL?
Are those #s in your actual SQL?
The problem is in the AND clause?
Does it work if you don’t use an IN clause?

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Oadegoke
    DaveINAz came down a little too blountly on the questioner but he is wright. The question was posed ambigously. We are all here waiting to to help you, please repose your question. ++ Olu
    0 pointsBadges:
    report
  • Sumeet
    the basic aim is to update a column of one table based on values of other column in other table. Its like Update schema1.table1.col1=0011 when schema1.table1.col2=RATPOL And When schema2.table2.col in ("IE","IF","II") i am working on oracle 9.2 database i have tried : 1> update schema1.table1 a set a.col1 = '0014' where a.col2 = 'RATPOL' and schema2.table2.col in ('IE','IF','II') Err: schema2.table2.col invalid identifier 2> update schema1.table1 a set a.col1 = '0014' where a.col2 = 'RATPOL' and b.col = (select b.col from schema2.table2 b where b.col in ('IE','IF','II')) Err: b.col invalid identifier
    0 pointsBadges:
    report
  • DaveInAZ
    Well, that's a bit clearer. It sounds like you're running into permissions issues. You'll need to verify that the user that's trying to execute the query has SELECT privileges on both schemas and tables, as well as UPDATE privs on schema1.table1. If you have access to view the grants on schema2, you can simply look at them to verify this. If not, you can test it with a simpler query. See if you can do something like; SELECT a.col1, b.col2 FROM schema1.table1 a, schema2.table2 b WHERE a.col2 = 'RATPOL' AND a.col? = b.col? You'll need to replace the col?s with the correct columns, of course. (I assume you had a similar link between tables in your original query, that you didn't include in the question. If not, you'll almost certainly want/need to add one.) If this produces the same error, and you're sure the names are correct, it's a lack of privileges on the second schema. By default, no one has privileges on a new schema except the user that created it (and any "superusers", admins, etc.). You (or the dba) need to grant access to it, something like this; GRANT SELECT ON TABLE2 TO SUMEET
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following