Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Oracle Database and i want to use resident with a nickname.
Something like this
select *
from table1 t1
Resident [table2] t2
where t2.id = t1.id
How can i do this?
You can JOIN your tables:
JOIN (table2)
SELECT *
FROM table1;
QV will perform the join using common field names as keys, assuming the only common field name is id, it should work as expected. See also the HELP for JOIN prefix and possible further join prefixes, INNER, OUTER, LEFT, RIGHT.
ok, but is it not a problem if this is oracle?
In oracle you can't use this statement. you have to use select ... from .... where
And i want to mention the common fields. then it is clear on which columns it joins.
If both table1 and table2 are within your Oracle DB, you can let the DBMS join your tables, this would even be better than doing in within QV.
I've understood that table2 is not in Oracle DB, but it's a resident table in QV data model.
The JOIN prefix should be handled by QV, not by the Oracle DBMS. I think the syntax is correct, but you can also try.
JOIN (table2)
LOAD *;
SELECT *
FROM table1;
to make it more clear. And if re-reading your SQL join statement, you probably want an INNER JOIN:
INNER JOIN (table2)
LOAD *;
SELECT *
FROM table1;
Indeed, the JOIN prefix works both with a SELECT statement and with a LOAD statement. It will always be handled by the QV Script engine. The preceding LOAD isn't required, as it is implied anyway.
Peter
You are correct!