Write a view with function in oracle
Dear all,
I have a table named borders, contains borders of some countries.
and then i made a view, to have symmetric data , meaning if i have a record {ch,DE} then i should have { DE,ch}.
then i want another view, preferably with the help of functions , to show me these results, the first view should be used , not the main table , to create this view.
de,fr,1
de,pl,1
de,ru,2
de,lu,2
de,lu,3
it means between these countries, we have these amount of bordes, but we just want to see these up to 3 borders, not more.
thank you for you answers.
im using oracle 10 g and linux ubuntu 12.
First i have a table,illustrating the countries
{code}
-- File created - Sunday-November-24-2013
-- DDL for Table BORDERS
CREATE TABLE "borders" ("COUNTRY1" CHAR(2), "COUNTRY2" CHAR(2), "LENGTH" NUMBER)
REM INSERTING into borders
SET DEFINE OFF;
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('de','fr',381);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('de','ch',494);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('de','pl',148);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('ch','fr',608);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('ch','it',318);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('ch','li',240);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('it','si',306);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('it','sm',584);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('fr','lu',549);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('fr','de',1000);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('pl','ru',628);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('pl','sk',126);
Insert into borders (COUNTRY1,COUNTRY2,LENGTH) values ('ru','ua',1800);
{code}
and then i have a view to have symmetric data :
{code}
SELECT B.COUNTRY1 , B.COUNTRY2
FROM BORDERS B
UNION
SELECT B.COUNTRY2 , B.COUNTRY1
FROM BORDERS B
{code}
Something like this will be a good starting point...
col path format A60
> with t as (
select country1, country2, level lvl , length , SYS_CONNECT_BY_PATH(country2, '/') "Path"from borders
start with country1 = 'de' connect by nocycle country1 = prior country2 )
select * from t where lvl < 4 ;
COUNTRY1 COUNTRY2 LVL LENGTH Path
de ch 1 494 /ch
ch fr 2 608 /ch/fr
fr de 3 1000 /ch/fr/de
fr lu 3 549 /ch/fr/lu
ch it 2 318 /ch/it
it si 3 306 /ch/it/si
it sm 3 584 /ch/it/sm
ch li 2 240 /ch/li
de fr 1 381 /fr
fr de 2 1000 /fr/de
de ch 3 494 /fr/de/ch
de pl 3 148 /fr/de/pl
fr lu 2 549 /fr/lu
de pl 1 148 /pl
pl ru 2 628 /pl/ru
ru ua 3 1800 /pl/ru/ua
pl sk 2 126 /pl/sk
17 rows selected
VR,
Sudhakar
Similar Messages
-
Oracle Version:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64
Hi Experts,
Is it possible to write a view with input and with IN clause in where cluase ....For Example I want to create a view like Below ..
The below query may be syntactically wrong , but my intension of writing is similary to this. And the query should contain a IN caluse and A union as below...
create or replace VIEW view_name (col1,col2, P_inputparam VARCHAR2)
as
SELECT Col1,Col2
FROM table_name1
where any_column11 in (
&P_inputparam
UNION
SELECT Col1,Col2
FROM table_name2
where any_column22 in (
&P_inputparam
Thanks In advance.
Edited by: 883279 on May 10, 2013 1:41 AM883279 wrote:
Oracle Version:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64
Hi Experts,
Is it possible to write a view with input and with IN clause in where cluase ....For Example I want to create a view like Below ..
The below query may be syntactically wrong , but my intension of writing is similary to this. And the query should contain a IN caluse and A union as below...
create or replace VIEW view_name (col1,col2, P_inputparam VARCHAR2)
as
SELECT Col1,Col2
FROM table_name1
where any_column11 in (
&P_inputparam
UNION
SELECT Col1,Col2
FROM table_name2
where any_column22 in (
&P_inputparam
Thanks In advance.
Not like that... no.
What you're using as "input" there are SQL*Plus substitution variables. Those values are requested by SQL*Plus before the code is sent to the database and compiled. Code that runs on the database has no way of interacting with a client keyboard or screen, so you cannot get stored code to prompt for user input.
See: {message:id=10744582}
It's possible to use SYS_CONTEXT to get a view to pick up a value that has been previously assigned before the view is used, though I rarely find a need to do this myself. -
Subpartition with MOD Function in Oracle 11g
Hi All,
Can we create Subpartition based on MOD Function in Oracle 11g ?Hi!
What are you refering with "MTS"? Anybody knows a term like this (except MultiThreaded Server). -
Create a View with Aggregation Function (COUNT)
I've been looking up and down for a way to create a view with a few basic fields and some other fields containing aggregation function.
For instance:
To display a view that contain all the Contract Agreement and the corresponding count of the PO releases.
Agreement Nbr, Total PO releases
I need this view so that I can create a search help with this view.
I found something about the "CREATE VIEW" statement, but I don't have any idea how to use it.
Any helps toward this matter is very much appreciated, thanks.Hello Aldern
I guess you have read about the SQL statement "CREATE VIEW". When we create a view in the dictionary this SQL statement is finally called to create the view on the DB. Thus, since we do not have any aggregation options in views you cannot achieve what you want using views.
The solution for your problem is to create a <b>search help</b> having a <b>search help exit</b>. Within the exit you can do your aggregation functions and add these values to the displayed search help data.
Regards
Uwe -
How I work with MS-SQL function in oracle
I’m working in oracle now but I don’t know how can I use following function in oracle.
convert, dateadd, datediff, fetch_status, isnumeric, reverse, str and stuffAlso available in 10g, the model clause version, taken from this How to display text in reverse order ?.
WITH t AS (SELECT 'abcdefg' col1
FROM DUAL
UNION
SELECT ''
FROM DUAL )
SELECT col1
, new_col1
FROM t
MODEL
PARTITION BY (ROWNUM rn)
DIMENSION BY (0 dim)
MEASURES (col1, CAST ('' AS VARCHAR2(255)) new_col1)
RULES ITERATE(99) UNTIL (LENGTH(new_col1[0]) = LENGTH(col1[0]))
(new_col1[0] = SUBSTR(col1[0], ITERATION_NUMBER + 1, 1) || new_col1[0])
COL1 NEW_COL1
abcdefg gfedcbaC. -
Rename view,procedure,function,trigger in oracle.
hi all,
Just i am thinking a concept in oracle.
can i rename view,procedure,function,trigger in oracle. i know it is not possible bcos it is a script.
can u please confirm meYou can rename View
http://download.oracle.com/docs/cd/B12037_01/server.101/b10759/statements_9019.htm
You can rename Trigger
http://www.ss64.com/ora/trigger_a.html
Well there we go. Having never had a need to do it myself (I put it down to good design and coding standards!) I never knew it was possible.
;-)) -
Materialized View with OLAP table function
Hi,
I am trying to materialize OLAP cubes into relational materialized views which works quite fine. After a few loadings in background in parallel with Database Jobs and DBMS_MVIEW package the peformance is getting poor. Steps I am performing:
1. Generate materialized view as DEFERRED and COMPLETE refresh
2. Generate database Jobs for refreshing views with DBMS_MVIEW.REFRESH function
3. Running Jobs in background
I have loading times the first time 10min after then over 4 hours. I also tried with ATOMIC_REFRESH=FALSE but the same result. Database is running in ARCHIVE LOGGING. Can this degrade the performance?
Any ideas?
Thanks,
ChristianHi,
yes thats correct. I am creating MVs in 10.2.0.3
Here is an example:
CREATE MATERIALIZED VIEW "FCRSGX"."MV_F_ICCC_C11"
ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 COMPRESS NOLOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "FCRSGX_CONSO_RELATIONAL"
BUILD DEFERRED
USING INDEX
REFRESH COMPLETE ON DEMAND
USING DEFAULT LOCAL ROLLBACK SEGMENT
DISABLE QUERY REWRITE
AS SELECT ENTITY, REVE_ICC, RP_ICC, MV_ICC, PERIOD, MEASURE, AMOUNT, R2C
FROM TABLE(OLAP_TABLE('FCRSGX.CONSODATA DURATION SESSION',
DIMENSION ENTITY as varchar2(8) FROM ENTITY
DIMENSION REVE_ICC as varchar2(8) FROM REVE_ICC
DIMENSION RP_ICC as varchar2(8) FROM RP_ICC
DIMENSION MV_ICC as varchar2(8) FROM MV_ICC
DIMENSION PERIOD as varchar2(8) FROM GMONTH
DIMENSION MEASURE as varchar2(30) FROM EXPR
MEASURE AMOUNT as number FROM ICCC.C11
LOOP CMPE.ICCC.C11
ROW2CELL R2C '))
WHERE OLAP_CONDITION(r2c, 'lmt entity to CMPE.ICCC.C11')=1
AND OLAP_CONDITION(r2c, 'lmt reve_icc to CMPE.ICCC.C11')=1
AND OLAP_CONDITION(r2c, 'lmt mmonth to sapload.per eq y')=1
AND OLAP_CONDITION(r2c, 'lmt gmonth to charl(mmonth) ')=1
AND OLAP_CONDITION(r2c, 'lmt rp_icc to CMP.ICCC.C11 ')=1
AND OLAP_CONDITION(r2c, 'lmt mv_icc to CMP.ICCC.C11 ')=1
AND OLAP_CONDITION(r2c, 'lmt expr to ''F.ICCC.C11'' ')=1
MODEL
DIMENSION BY(ENTITY,REVE_ICC,RP_ICC,MV_ICC,PERIOD,MEASURE)
MEASURES(AMOUNT,R2C)
RULES UPDATE SEQUENTIAL ORDER()
; -
Oracle doc inconsistent on materialize view with union all and self joins
First of all, I can't seem to create a materialized view containing self-joins AND union all. Is it possible?
I checked Oracle 9i (my version: PL/SQL Release 9.2.0.4.0 - Production) documentation and I get different answers (or so it seems to me).
First I saw this: "The COMPATIBILITY parameter must be set to 9.0 if the materialized aggregate view has inline views, outer joins, self joins or grouping sets and FAST REFRESH is specified during creation..."
Did you see the part about 'self joins' in there? I did and I was pumped because that seems to say that you CAN have 'self joins' (and my compatibility is 9.2...)
BUT
In the very same document I also found "Oracle does not allow self-joins in materialized join views." (rage)
You can see the document I am speaking of here: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96520/mv.htm#574889
Whenever I try to create the mview I get the following error. (
In any caseORA-01446 cannot select ROWID from view with DISTINCT, GROUP BY, etc.First of all, I can't seem to create a materialized view containing self-joins AND union all. Is it possible?
I checked Oracle 9i (my version: PL/SQL Release 9.2.0.4.0 - Production) documentation and I get different answers (or so it seems to me).
First I saw this: "The COMPATIBILITY parameter must be set to 9.0 if the materialized aggregate view has inline views, outer joins, self joins or grouping sets and FAST REFRESH is specified during creation..."
Did you see the part about 'self joins' in there? I did and I was pumped because that seems to say that you CAN have 'self joins' (and my compatibility is 9.2...)
BUT
In the very same document I also found "Oracle does not allow self-joins in materialized join views." (rage)
You can see the document I am speaking of here: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96520/mv.htm#574889
Whenever I try to create the mview I get the following error. (
In any caseORA-01446 cannot select ROWID from view with DISTINCT, GROUP BY, etc. -
Replicate an oracle view with SLT
Hi -
Using Oracle 11g and SLT 2011_1_731 Patch 7 with Hana rev 82
I am trying to replicate oracle views in hana through SLT
Scenario 1:
tables T2 and T3 with View T2_T3_view
If I follow this thread SLT view replication
It creates the view as a table in hana but does not populate it with any data.
Scenario 2 -
I have 2 oracle tables - T4 and T5. I have a view T4_T5_VIEW that joins the 2 tables.
I followed steps in a document I received to replicate the view syntax as well as the tables.
1) replicated both tables T4 and T5 - success
2) stopped replication on T4
table exists in hana with data but no replication
3) using LTRS, assigned the view T4_T5_VIEW to table T4
4) changed the performance option
5) restarted replication on T4
The view gets created as a table, but table T4 gets and error and does not replicate.
The view gets no data
What is the proper process for an oracle table?
I have a very complex view with 5 source tables I want to replicate.
Thanks
Dianesorry,
with the query
SELECT TAB2.COD_M ,
COUNT(TAB1.COD_MAT) count_mat
FROM TAB2,
TAB1
WHERE TAB2.COD_R (+) = TAB1.COD_MAT
AND TAB1.COD_R IN ('1','3')
GROUP BY TAB2.COD_M
I get:
COD_M..........COUNT_MAT
00114940...........1
00116220...........1
00116300...........2
00119320...........1
00119450...........1
...................0
but I'd like to get this output:
COD_M..................count_mat
00114940...................1
00114949...................0
00116220...................1
00116300...................2
00119324...................0
00119450...................1 -
Scroll Bar not functioning in Grid View with All Photographs selected
LR 4.3 on Windows 7
I can scroll through a bunch of photos while in grid view with the right side slider when I am looking at a folder with 15,000 images or less, but when I click the All Photographs, there is no little slider button. The slider tray is visible, but no button to drag. The catalog has 180,000 images now. Any suggestions would be appreciated.
I tried using a text search within my All Photographs which brought up 71,000 images. The slider showed up fine with that many images.
M. JacksonOkay, I will answer my own question in case anyone else sees the problem.
When I am viewing my large catalog with only three thumbnails across in LR, I lose the little button to slide up and down. When I change Grid View to show four or more thumbnails, the button reappears. I'd suggest this is a bug needing fixing. -
Import Functionality in Oracle ADF BC with Jdeveloper 11.1.1.2
Hi all,
I am using Jdeveloper 11.1.1.2 and I am trying to import functionality in my application.
I am following the steps of: http://andrejusb.blogspot.com/2008/07/import-functionality-in-oracle-adf-bc.html
I have 2 data model and I would like to import the functionality of one data model, in the other.
My problem is when I tried: myModel2-->right click-->project properties-->deployment-->edit
I don't see nothing to filter myModel2, I see only Library Dependencies, Connections, JAR Options ADF Validation.
If I tried : myModel2-->right click-->project properties-->deployment-->new-->filters
I see only the folders: Merged Contents of this file Group's contributor, .data, 00000000
But I can't see the folders I have (mypackage.test.model.entities).
Where I can found them? Is there a workaround?
Any suggestions?
Thanks
AndreaOk, but I taught that after importing myModel2 in myModel1, Jdeveloper realise a merge and it visualizes a unique package, even if it is splitted on two or more projects/models.
So that, it seems to me this procedure is useful for importing jar file, but not for splitting a very big project in a lot of smaller projects, doesn't it?
Thanks for your opinion
Andrea -
Materialized views with GROUP by ROLLUP
I am trying to created Materialized view (snapshot) using group by rollup functionality.
The idea is to use snapshot with all subtotals already calculated in place.
For example average group by rollup (columns of the time dimension).
The idea is to use "query rewrite" Oracle functionality and snapshot with calculated subtotals.
Does anybody have experiance with this method ?
Thank you
MichaelThe query rewrite is an internal function of Oracle. Normally, you have nothing to do than verify that the query that perform OBIEE is rewrited.
In any other way, you can in OBIEE define that you have create an aggregate and OBIEE will (re-)write the query.
http://www.rittmanmead.com/2007/10/26/using-the-obiee-aggregate-persistence-wizard/
Regards
Nico -
Hello Experts,
I'm tryng to develop my first application for EP (v7 SP12) with NWDS (without NWDI).
This application has to read and write data in the EP DB (oracle v10).
I'm using:
<u>a Dictionary Project</u> (define the DB Tables)
<u>a Java Project</u> (define class as DAO, DBManager etc)
<u>a Library Project</u>
<u>an EJB Project</u>
<u>an EAR Project</u>
With these projects I can deploy a <u>webService</u> in my EP server.
BUT I have some problem with a query that I'm tryng to sent to my DB through a DAO Class called by my WebService.
The query is simple and correct but it does not work...
This is the error message returned (the query id in bold)
(column names: GIORNO, NOMEDITTA, NOMEAREA, NOMESETTORE)
<i>HTTP/1.1 500 Internal Server Error
Connection: close
Server: SAP J2EE Engine/7.00
Content-Type: text/xml; charset=UTF-8
Date: Fri, 21 Sep 2007 14:29:57 GMT
Set-Cookie: <value is hidden>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>java.sql.SQLException: com.sap.sql.log.OpenSQLException: The SQL statement <b>"SELECT NOMESETTORE, MIN(? - "GIORNO") AS GIORNI FROM SRS_DATEINFORTUNI WHERE NOMEDITTA = ? AND NOMEAREA= ? GROUP BY NOMESETTORE ORDER BY NOMESETTORE"</b> <u>contains the syntax error[s]: - 1:25 - the arithmetic expression >>? - "GIORNO"<< contains a host variable (parameter marker)</u></faultstring><detail><ns1:getGiorniSettori_com.akhela.giorniSenzaInfortuni.ejb.exception.GiorniSenzaInfortuniException xmlns:ns1='urn:GiorniSenzaInfortuniWSWsd/GiorniSenzaInfortuniWSVi'></ns1:getGiorniSettori_com.akhela.giorniSenzaInfortuni.ejb.exception.GiorniSenzaInfortuniException></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope></i>
The variable '?' is the today date, the difference <b>"(?-GIORNO)"</b> is an int..
Moreover in my DAO class the query is <b>"SELECT NOMESETTORE, MIN(? - GIORNO) AS GIORNI FROM SRS_DATEINFORTUNI WHERE NOMEDITTA = ? AND NOMEAREA= ? GROUP BY NOMESETTORE ORDER BY NOMESETTORE</b>", instead in the error message is reported <b>MIN(? - "GIORNO")</b>...
We have tryed also with alternative query, for example we used <b>"MIN(SYSDATA - GIORNO)"</b> but <b>SYSDATA</b> was interpreted as column name and not found....
Any help???
Best RegardsHi, I found something about the Host Variable (http://help.sap.com/saphelp_nw70/helpdata/en/ed/dbf8b7823b084f80a6eb7ad43bdbb9/content.htm), there explain that if you want to use an host variable you have to put ':' as prefix..
My problem is that <u>I need to extract the minimum of the subtraction between two dates:</u>
Query <b>MIN(? - GIORNO)</b> --> <i>Error: the arithmetic expression >>? - "GIORNO"<< contains a host variable (parameter marker)</i>
So I tried to use the ':' as indicated in the manual..
<b>MIN:(? - GIORNO)</b> --> - <i>SQL syntax error: the token ":" was not expected here
- expecting LPAREN, found ':'</i>
<b>MIN(:(? - GIORNO))</b> --> <i>- 1:25 - Open SQL syntax error: :PARAMETER not allowed
- 1:26 - SQL syntax error: the token "(" was not expected here
- 1:26 - expecting ID, found '('</i>
Then I tried to avoid the MIN() function and I tried to do just the subtraction:
<b>? - GIORNO</b> --><i> - 1:21 - the arithmetic expression >>? - "GIORNO"<< contains a host variable (parameter marker)</i>
<b>:(? - GIORNO)</b> --> <i>- 1:21 - Open SQL syntax error: :PARAMETER not allowed
- 1:22 - SQL syntax error: the token "(" was not expected here
- 1:22 - expecting ID, found '('</i>
<b>'2007-09-24' - GIORNO</b> --> <i>- 1:34 - SQL syntax error: first argument of operator "-" must be a number, date/time or interval
- 1:43 - SQL syntax error: arguments of operator "-" do not have correct types
- 1:43 - SQL syntax error: derived columns in SELECT list with AS must be values</i>
<b>GIORNO - GIORNO</b> --> <i>- 1:21 - the group by list and the select list are inconsistent: the column >>"GIORNO"<< is neither grouped nor aggregated
- 1:30 - the group by list and the select list are inconsistent: the column >>"GIORNO"<< is neither grouped nor aggregated</i>
Why these parts of query are not accepted???
I don't understand why... I hope you can help me.
Best Regards
Alessandro -
Use T-SQL functions in ORACLE too, so you can write one script version that works in SYBASE, SQLSERVER and ORACLE when need to use the following functions:
ceiling, charindex, dateadd, datediff, datename, datepart, day, db_id, db_name, getdate, host_id, host_name, left, len, month, replicate, right, space, str, str_replace, stuff, substring, suser_id, suser_name, user_id, user_name and year.
The file [comp_tsql_ORA_schema.txt|http://forums.databasejournal.com/attachment.php?attachmentid=564&d=1258547015] creates the tablespace and schema to put the objects, and the file [comp_tsql_ORA.txt|http://forums.databasejournal.com/attachment.php?attachmentid=569&d=1259256898] creates the functions into the new schema. They will be avaliable for any schema of the oracle instance.
Hope this help!
Any suggestion please contact.
aklein2003
Edited by: user1958693 on 26/11/2009 10:16jgarry wrote:
J2EE beta released around 1999. Religious programming wars far preceded that. Here's but [one example|http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/1c50bc13e9302f00/34bb8f3ac77e2388?q=programming+language+religion#34bb8f3ac77e2388] from a quick google. I'm no longer convinced that elegance is a desirable trait for a language. So call me a heretic.
Ever tried XLISP? :-)
It's different. Back then it was simply the language itself. And it was not really a religious kind of battle, but more a mine-is-bigger-and-better-than-yours one.
With Java, it is all about The Acrhitecture and the blessed language of Java. ;-)
I wouldn't so much blame J2EE believers for that. I think there is a fundamental complexity to web type paradigms that hasn't been described in a precise and encompassing enough manner to enable correct project planning.The basic problem is that the database is treated as a persistent storage layer only. A bit bucket. And that is exactly what a database is not.
But as it is used that, loads of database features now need to be duplicated in the application layer. Which is done. Very poorly.
Heck, I've even been told that J2EE's 3-tier architecture is not client server. Such ignorance is really unbelievable. Or is it pure stupidity?Until you just made me look it up, I would have thought that too, I'm sure I saw client/server defined as two-tier in the last century. But I have much more stupid misdefinitions to deal with on a daily basis, simply from the multiplicity of paradigms. I tend to retreat into my shell. Hehehe. Know that feeling... These days I rather run away, or set shields to full power, than try to get in yet another frustrating, fruitless and futile discussion with a Java head about the wonders of the J2EE architecture. Or trying to explain that this "new" architecture is predated with what we used in the 80's on mainframe systems with transaction monitors, block devices (the 80's web browsers) and databases - which software layer for software layer was almost identical to "+The Great Architecture+" of today. (and we did it without buzzwords too) ;-)
Client-server is a software architecture and in essence describes 3 basic software components. The User Interface (UI), the Application (APP) and the Database (DB). And there are various ways to put these components together in a client-server architecture. The mistake that the Java fanbois make is thinking that client-server means having the client as the UI and APP as a single component (so-called fat client) and then the DB component as the server.
There are numerous versions of these - including the APP component being a server component (as we now these days more commonly used in over the web).
My beef with the J2EE "+religion+" always has been that client-server is client-server. The fundamentals stay the same. -
it's posible create a view with parameters?
i want to create a view and pass it parameters, in the same way when i create a procedure or function.
i never have seen it, but i would like to know if that's posible
thanksYou cannot create a view with parameters. The only way is to use a stored proc to dynamically create the sql statement. The substitution variable approach does not work. SQL*Plus will prompt for the value of the variable at compile time (i.e. when you create the view) and use the value you provide in the view's query.
SQL> create or replace view jws_test_v as
2 select * from jws_test where flag = '&flg'
3 /
Enter value for flg: AA
old 2: select * from jws_test where flag = '&flg'
new 2: select * from jws_test where flag = 'AA'
View created.
SQL> select * from jws_test_v
2 /
no rows selected
SQL> select text from user_views where view_name = 'JWS_TEST_V'
2 /
TEXT
select "LEV1","LEV2","LEV3","LEV4","LEV5","LEV6","FC","FLAG","ONAFT","ONAPT","CU
PEFT","CUPEPT" from jws_test where flag = 'AA'This makes sense, since substitution vartiables are a sqlplus construct, not a sql or Oracle construct. A view constructed in this way would not be callable from anywhere other than sqlplus.
Maybe you are looking for
-
How do I access my family's library to put it on my ID now I have one of my own?
Hi. I have just created my own apple id to separate myself from my mum's iphone. How do I move songs from our library over to my account so I can still have access to them for my Ipod?
-
How do I add rules to a folder in iCloud mail service?
I have mail organized into an automatic spam filter in icloud mail that tosses it into a folder already. What I want to do is move some mail on a conditional rule statment like "If from: [email protected]" Move to "folder1" if mail from [email protec
-
Hi, I was purchasing the material from vendor with number 82000 with description glycol 45. Now vendor has changed the description to glycol but the material is exactly the same. What shall we do now? Change the description of material 82000 from gly
-
NAC 4.7.2 upgrade to 4.7.5 - How to Lab.
I will (finally) be upgrading to NAC 4.7.5 from 4.7.2. Before I do it in my production environment I want to lab it, just to practice and have some expectation of will happen. My production environment is an OOB VG build and is highly available. For
-
Setting the number of copies to be printed through crystal reports?
I posted this in another section and got redirected to this one. So I'm working with some software that utilizes Crystal Reports 10, and am looking for a method where through Crystal Reports I can take a user entered parameter value and set that as