Data model - dynamic query with parameters
Hi friends, is it possible to dynamically call a query using the parameters of the data models?I try to have a BEEP report with data model something like that
Data model
Param1
Q1 = Select * from table 1
Q2 = Select * from table 2
If Param1 = X then
FinalQuery = Q1
On the other
FinalQuery = Q2
End
Any help is greately appreciated.
Thank you
SAI.
Take a look at the following:
http://www.Oracle.com/global/de/community/BIP/tipps/dynamische_queries/index_en.html
http://blogs.Oracle.com/XmlPublisher/files/BIPublisher_dynamic_column%20Blog.PDF
Thank you!
Tags: Business Intelligence
Similar Questions
-
Hello
I have a table1 as below
ID (NUMBER), keyword (VARCHAR2)
----------------------------------------------------
1, HAS
2, B
3, C
Another table2
Name (VARCHAR2)
--------------------------
Alice
Bob
Jack
I need to write a stored procedure to check if the 2 mactched of the char keyword table1 table name. How to write the dynamic query in my PL/SQL in a stored procedure so that I can generate query similar to
SELECT * from table2 where name like '%x %' where I need to replace X by the tank in table1
Help, please.
Thanks in advance,
MarryI need to write a stored procedure to check if the 2 mactched of the char keyword table1 table name
You could simply join the tables:
SQL> with table1 as ( select 1 id, 'A' keyword from dual union all select 2 id, 'B' keyword from dual union all select 3 id, 'C' keyword from dual ), table2 as ( select 'Alice' name from dual union all select 'Bob' name from dual union all select 'Jack' name from dual ) -- -- select * from table1, table2 where name like '%' || keyword || '%' ID KEYWORD NAME ---------- ------- ----- 1 A Alice 2 B Bob 2 rows selected.
-
Hello world
I hope someone can point me in the right direction.
I have the SQL code following in the type of SQL query data model.
Select * from ap_invoices
The following select statement is not to return all the rows in the view, but the fact of sqlplus.
I have setup the EBS security model uses BEEP 10.1.3.4.1.
What I do wrong, is there some setting I'm missing?
Do I need to use a different security model to BEEP?
Help, please
Thank you.Hello
AP_INVOICES is a view as you know, sound based on the ORG_ID set when you select from it. IM thinking that when you use just select * from AP_INVOICES at RANDOM. Its not abreast of your org id and its is not defining for you when you run a query, so its not rehired data. Two options:
1. use a data model and in the pre-reading trigger set the context of the org. As you may be in an Oracle report. Data models are very powerful and offer everything that OReports done in EBS incl. triggers flex extensions
2 use the AP_INVOICES_ALL table and set the org id in the query where clause.
Both approaches need so that you know the id org that you want to set. The integration of the security that you won't it's to say it does not pass it when the user opens a session. I suppose you have a report folder for every responsibility you could hardcode the org id in the reports in a given folder. Or you can add it as a parameter to the user to fill out report.
Integration level just does not quite go enough away for the time to manage the org and, therefore, the views of the org.hope this is clear
Concerning
Tim
-
How to write the query with parameters below and is null
Hi, I need to recover the data if the parameter is passed on the ground, else retrieve all records where the field is nullExample of
CREATE TABLE DEPT
(DEPTNO NUMBER (2),)
DNAME VARCHAR2 (14).
LOC VARCHAR2 (13));INSERT INTO DEPT VALUES (10, 'ACCOUNTING', 'NEW YORK');
INSERT INTO VALUES DEPT (20, 'SEARCH', 'DALLAS');
insert into dept values (30, 'SALES', 'CHICAGO');
INSERT INTO VALUES DEPT (40, 'OPERATIONS', 'BOSTON');ALTER table dept add (object_id number);
insert into dept values (50, 'OPERATIONS', 'BOSTON', 1);
insert into dept values (60, 'OPERATIONS', 'BOSTON', 1);
INSERT INTO VALUES DEPT (70, 'OPERATIONS', 'BOSTON', 2);Select * from Department where object_id =: p_object_id
If I pass the object_id 1, it shloud retrieve the values of dept with object_id 1, but if I don't pass the object_id, it must retrieve all records where object_id is null
IF 1 is passed as the id of the object, he must recover, 50, 60, if 1 is not passed as object_id it should 10,20,30,40 retive
It works fine for me separately as,.
Select * from Department where object_id =: p_object_id - 1
Select * from Department where the object_id is null;
Is it possible to do in a single query.
Thank you
SELECT * FROM dept WHERE object_id = :p_object_id OR (object_id is null and :p_object_id is null)
is an approach. It's a little talkative, but the meaning is clear. If you can identify a value that would never appear in the data (for example-1)
WHERE nvl( object_id, -1 ) = nvl(p_object_id, -1 );
Justin
-
Structure of the query with parameters
Hello
Consume the web service, the results in a file xml with complex structures.
The function below the structure of the query
< TemplateName CcResultItems = "CgrInfo_1" >
My question is how to reorganize the query to obtain the results of the structure
< TemplateName CcResultItems = "CgrOwners_4" >
which should return three rows.Kind regards
Kostadincreate or replace
FUNCTION WS_SELECT_XML RETURN VARCHAR2 AS
XML_VAR XMLTYPE: = XMLTYPE)
"" ' < soap envelope: xmlns:soap = 'http://www.w3.org/2003/05/soap-envelope"" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" container = "http://www.w3.org/2001/XMLSchema" >. "
< soap: Header >
"< XmlSoapHeader xmlns ="https://test.wstestx.com/XWS2/ "/>"
< / soap: Header >
< soap: Body >
"< ProcessRequestResponse xmlns ="https://test.wstestx.com/XWS2/">."
< ProcessRequestResult > <! [CDATA [< CcResponse >
< TemplateName CcResultItems = "CgrInfo_1" >
< CcResultItem > < InfoMessage > < / InfoMessage > < IsitTerminated > 0 < / IsitTerminated > < IdObject > 365124 < / IdObject > < sanctuary ObjectlName > < / ObjectlName > < ObjectTaxNumber > 305089321502 < / ObjectTaxNumber > < / CcResultItem >
< / CcResultItems >
< TemplateName CcResultItems = "CgrUnits_2" >
< / CcResultItems >
< TemplateName CcResultItems = "CgrActors_3" >
< CcResultItem > < IdObject > 365124 < / IdObject > < UnitNo > 0 < / UnitNo > < EntityTYPEcode > 1 < / EntityTYPEcode > < EntityTYPEdesc > person < / EntityTYPEdesc > < / CcResultItem >
< / CcResultItems >
< TemplateName CcResultItems = "CgrOwners_4" >
< CcResultItem > < IdObject > 365124 < / IdObject > < EntityTYPEcode > 1 < / EntityTYPEcode > < EntityTYPEdesc > person < / EntityTYPEdesc > < OwnerID > 610697843014 < / OwnerID > < OwnerName > ALEX < / OwnerName > < / CcResultItem >
< CcResultItem > < IdObject > 365124 < / IdObject > < EntityTYPEcode > 1 < / EntityTYPEcode > < EntityTYPEdesc > person < / EntityTYPEdesc > < OwnerID > 840645947005 < / OwnerID > < OwnerName > JOHN < / OwnerName > < / CcResultItem >
< CcResultItem > < IdObject > 365124 < / IdObject > < EntityTYPEcode > 2 < / EntityTYPEcode > < company EntityTYPEdesc > < / EntityTYPEdesc > < OwnerID > 703454 < / OwnerID > < OwnerName > BROWN < / OwnerName > < / CcResultItem >
< / CcResultItems >
< TemplateName CcResultItems = "CgrActivities_5" >
< / CcResultItems >
< TemplateName CcResultItems = "CgrMembership_6" >
< / CcResultItems >
< TemplateName CcResultItems = "CgrFounding_7" >
< CcResultItem > < IdObject > 365124 < / IdObject > < FoundingDate > 2007-08-16 13:53 < / FoundingDate > < Total > 146701.00 < / Total > < / CcResultItem >
< / CcResultItems >
[[< / CcResponse >]] > < / ProcessRequestResult >
< / ProcessRequestResponse >
< / soap: Body >
< / envelope soap: >
');
BEGIN
FOR R IN)
WITH T AS (SELECT (XML_VAR) DOUBLE COLLAR)
SELECT x2.*
FROM XMLTable)
XMLNamespaces)
' http://www.w3.org/2003/05/soap-envelope ' LIKE 'SOAP'
, by default ' https://test.wstestx.com/XWS2/ '
)
, ': soap envelope / soap: Body/ProcessRequestResponse/ProcessRequestResult '
by the way XML_VAR
path of CcResponse clob columns '.'
) x 1
XMLTABLE)
' / CcResponse/CcResultItems.
XMLPARSE PASSAGE (DOCUMENT X 1.) CCRESPONSE)
COLUMNS
TemplateName VARCHAR2 (140) path "@TemplateName"
, IDOBJECT VARCHAR2 (140) PATH "CcResultItem/IdObject.
, PATH of VARCHAR2 (340) OBJECTLNAME ' CcResultItem/ObjectlName '.
, PATH of VARCHAR2 (140) VRSKA 'CcResultItem '.
) X 2
WHERE X 2. TemplateName = "CgrInfo_1."
-WHERE X 2. TemplateName = "CgrActors_3."
-WHERE X 2. TemplateName = "CgrOwners_4."
) LOOP
DBMS_OUTPUT. Put_line (' IdObject: ' |) R.IDOBJECT | ' ObjectlName: ' | R.ObjectlName | "TemplateName ' |" R.TemplateName);
END LOOP;
DBMS_OUTPUT. Put_line ("- end -");
RETURNS A NULL VALUE.
END WS_SELECT_XML;Based on your query, I'll assume that you started with
Extract data from webservice response
In my opinion, it comes of the change you are looking for
FOR R IN ( SELECT x2.TemplateName, x3.idobject, x3.OWNERID FROM XMLTable( XMLNamespaces( 'http://www.w3.org/2003/05/soap-envelope' AS "soap" , default 'https://test.wstestx.com/XWS2/' ) , 'soap:Envelope/soap:Body/ProcessRequestResponse/ProcessRequestResult' passing XML_VAR columns CcResponse clob path '.' ) x1 , XMLTABLE( '/CcResponse/CcResultItems[@TemplateName="CgrOwners_4"]' PASSING XMLPARSE(DOCUMENT X1.CCRESPONSE) COLUMNS TemplateName VARCHAR2(20) PATH '@TemplateName' , ItemXML XMLTYPE PATH 'CcResultItem' ) X2 , XMLTABLE( '/CcResultItem' PASSING x2.itemXML COLUMNS IDOBJECT VARCHAR2(20) PATH 'IdObject' , OWNERID VARCHAR2(20) PATH 'OwnerID' ) X3 )
As Odie post pointed out. The first (x 1) XMLTable retrieves the content of ProcessRequestRequest and by doing this, delete the CDATA tag. We now have a CLOB that resembles XML. The second XMLTable (x 2) converts this CLOB into an XMLType and looking for the node that matches the XPath expression. It's where I've hardcoded in your query to search for a specific node. As you want node has a repeated structure that you want to retrieve each row, I spent structures repeatedly in the third XMLTable (x 3) so he could analyze. You could combine x 2 and x 3 using XQuery, but I suggest starting by this method I found that it's easier to understand what is happening.
To test out your code, simply replace the line
by the way XML_VAR
with
from XMLTYPE ("... the content of the SOAP Message...")
and run the query. You can do this to debug the query as you and just do a SELECT * to see what all went from XMLTable to XMLTable, so went to check the correct data.
-
How to pass parameters to Date on the data model
Hi all
I try to pass parameters of date on the data model and unable to pull all the data. When I tried hard-coded in the SQL query, it works. Here is the data model, can I pass parameters directly to the dataquery?
I searched a lot but couldn't find it. Any help is greatly appreciated.
<? XML version = "1.0" encoding = "WINDOWS-1252"? >
< name of dataTemplate = "AIMS_VDIS_VALIDATION_REPORT" description = 'Invalid records in the GOALS and for the given date VDIS' version = "1.0" >
< Parameters >
< name of the parameter = "p_start_date" dataType = "date" / >
< name of the parameter = "p_end_date" dataType = "date" / >
< / Parameter >
< dataQuery >
< SQLStatement instance name = "T4" >
<! [CDATA [SELECT pgw_custom. Account_Validate (acct_new) invalid,
acct_new,
DECODE (pgw_custom. Account_Validate (acct_new), 0, 'ACCOUNT OF OBJECTIVES not VALID', 'VALID OBJECTIVES ACCOUNT') message
Of
(SELECT DISTINCT SUBSTR (acct, 1, 3) |) JE_CAP | SUBSTR(ACCT,8) acct_new
Of
(SELECT the jav.jav_hours hours,
ACCT GCC.concatenated_segments,
GCC.code_combination_id ccid,
$ (bua.hourly_rate * jav.jav_hours);
CASE WHEN (um.class2 IN (' a ',' B', 'C', d ', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', ',' n, 'O', 'P', 'Q', 'R', 't')) THEN '3201'
WHEN (um.class2 IN ('Z', "ZA", "ZA1', 'W', 'U', 'V', 'X', 'Y',"ZA2","ZB","ZC","ZD", the from ')) THEN '3301 '."
END je_cap
OF pgw_custom.jems_aims_vehicle jav,.
Apps.mtl_generic_dispositions mg/d,
Apps.gl_code_combinations_kfv gcc,
mfour.unit_main@m4prg01 uh,.
BUA mfour.bill_unit_acct@m4prg01
WHERE jav.jav_glaccount = mgd.segment1 AND
MGD.distribution_account = gcc.code_combination_id AND
JAV.jav_vehicle = um.unit_no AND
UM.unit_id = bua.unit_id AND
JAV.jav_project IS NULL AND
JAV.jav_task IS NULL AND
JAV.jav_charge_date BETWEEN: p_start_date AND: p_end_date AND
GCC.detail_posting_allowed = 'Y' AND
GCC.enabled_flag = 'Y' AND
NVL (gcc.end_date_active, TO_DATE('31-DEC-4720','DD-MON-YYYY')) > = SYSDATE AND
SUBSTR (bua.billing_code, 1, 1) = "I" AND
((bua.eff_dt < = (SELECT date_fin)))
OF apps.gl_periods
WHERE period_name = (SELECT TO_CHAR(:p_end_date,'MON-RRRR') FROM DUAL)) AND
BUA.end_dt IS NULL)
OR
(bua.end_dt >(SELECT start_date)
OF apps.gl_periods
WHERE period_name = (SELECT TO_CHAR(:p_end_date,'MON-RRRR') FROM DUAL)))
ORDER BY valid, acct_new]] >
< / sqlStatement >
< / dataQuery >
< dataStructure >
< group name = "G_ACCTS" source = "T4" >
< element name = "VALID" value = "valid" / >
< element name = "NEW_ACCOUNT" value = "acct_new" / >
< element name = "MESSAGE" value = "message" / >
< / Group >
< / dataStructure >
< / dataTemplate >the parameter name must be
p_start_date
p_end_dateAnd when the report is run, a value must be selected in the settings. Try this default sysdate.
-
XML with a member does not properly in the data model
I use XmlDataAccess class to load an XML list in GroupDataModel. Everything works fine if the XML file has more than one Member, however, it does not load if the list contains a single member. I use the following code to get the XML content:
QVariant list = xda.load(home.absoluteFilePath("MembersList.xml"),"/members/member");
I need to know if the list has only one or 2 + members, so I can direct the data model to load with the appropriate settings. Can I know the number of members in the list?
This problem is closely related to this question, where a solution QML is given.
Hi Mitch99,
Please see this forum post for a workaround for this problem. I tested it and confirm that it works as with QML.
-
assistance in case of data model BI Publisher
Hi all
I created the data model of BI Publisher,
< Parameters >
< name of the parameter = 'documents' dataType = 'character' defaultValue = "" / >
< / Parameter >
< dataQuery >
< SQLStatement instance name = "Q1" >
<! [CDATA]
If (: documents == "s") then {}
Select "ihbojnlj" double s; }
else {}
Select "ffffffj" double s;
}
[]] >
< / sqlStatement >
< / dataQuery >
I am facing problem how to use in case of syntax, if the value of documents = initiative so I'll run A query
If the value of documents = pr, then I'll start query B and so on.
do you have any idea?
Thanks in advanceYou can use something like
Select "ihbojnlj" s where double: documents == "s".
UNION
Select "ffffffj" s where double: documents == 'a '. -
How to map Dynamic Query columns on variables of forms.
Dear all,
This is a correct code for executing a dynamic query and display data.
In this program that I have defined variables ("BOLD" of police) later I binds these with the query (in the second code "BOLD").
How I can map a column in the query, in which case I don't know that the surveyed fields type?
GetData PROCEDURE IS
EXEC_SQL connection_id. PORT;
cursorID EXEC_SQL. CURSTYPE;
sqlstr VARCHAR2 (1000);
loc_ename VARCHAR2 (30);
loc_eno NUMBER;
loc_hiredate DATE;
nIgn PLS_INTEGER;
BEGIN
connection_id: = EXEC_SQL. DEFAULT_CONNECTION;
cursorID: = EXEC_SQL. OPEN_CURSOR (connection_id);
--
-assuming empno is a primary key for the table emp, where clause ensures
-only 0 or 1 row is returned
--
sqlstr: = "select ename, empno, hiredate from emp;
-sqlstr: = sqlstr. 'where empno =' | input_empno;
EXEC_SQL. PARSE (connection_id, cursorID, sqlstr, exec_sql. V7);
-EXEC_SQL. Bind_variable (connection_id, cursorID, ': bn', input_empno);
EXEC_SQL. DEFINE_COLUMN (connection_id, cursorID, 1 loc_ename, 30);
EXEC_SQL. DEFINE_COLUMN (connection_id, cursorID, 2, loc_eno);
EXEC_SQL. DEFINE_COLUMN (connection_id, cursorID, 3, loc_hiredate);
--
-do execute_and_fetch after the analysis of the statement and calling bind_variable and
-If necessary define_column
--
nIgn: = EXEC_SQL. EXECUTE_AND_FETCH (connection_id, cursorID);
IF (nIgn = 0) THEN
TEXT_IO. Put_line ('not Rec');
ELSE IF (nIgn = 1) THEN
TEXT_IO. Put_line ('found an employee');
END IF;
--
-get the values of this line
--
WHILE (EXEC_SQL. FETCH_ROWS (connection_id, cursorID) > 0) LOOP
-nRows: = nRows + 1;
EXEC_SQL. COLUMN_VALUE (connection_id, cursorID, 1, loc_ename);
EXEC_SQL. COLUMN_VALUE (connection_id, cursorID, 2, loc_eno);
EXEC_SQL. COLUMN_VALUE (connection_id, cursorID, 3, loc_hiredate);
MESSAGE(loc_ename||) e '|| loc_eno | » '|| loc_hiredate);
END LOOP;
END IF;
END;If you want to use EXEC_SQL and a dynamic query with unknown data types, but the known table name,
Then you can declare a rowtype variable
for example;NOT TESTED ---A ROUGH IDEA m_emp_row employee_master%rowtype; m_col_cnt number := 0; So when you define collumn, create a procedure to find the column name and its width if it is varchar2 with respect to the column name . Find the column details from the user_tab_columns table ... --------------------------------------------------------------------------------------------------------------------------------------------------- while m_col_cnt < 3 loop m_col_cnt := m_col_cnt +1; proc_find_col_name_width(p_qry ,p_col_no=>m_col_cnt , p_col_name,p_col_width); If p_col_name = 'EMPCODE' then EXEC_SQL.DEFINE_COLUMN(connection_id, cursorID, m_col_cnt , m_emp_row.empcode , p_col_width); elsif p_col_name ='EMPNAME' then EXEC_SQL.DEFINE_COLUMN(connection_id, cursorID, m_col_cnt , m_emp_row.empname , p_col_width); ----- ------- end if; end loop; --------------------------------------------------------------------------------------------------------------------------------------------------- --Your procedure will look like this procedure proc_find_col_name_width(p_qry varchar2,p_col_no number, p_col_name out varchar2,p_col_width out number) is m_col_name varchar2(30); Cursor c1 is Select data_length from user_tab_columns where table_name = 'yr_tab_name' and column_name = m_col_name; m_lastpos number ; m_nxtpos number ; Begin m_lastpos := instr(p_qry,',',1,p_col_no-1); m_nxtpos := instr(p_qry,',',1,p_col_no); If m_lastpos = 0 then --- if only one col m_col_name := substr(p_qry,instr(upper(P_QRY),'SELECT') + 6, instr(upper(P_QRY),'FROM') -1); else If m_nxtpos = 0 then ---if last column m_nxtpos := instr(upper(P_QRY),'FROM') -1; end if; m_col_name := substr(p_qry,m_lastpos+1,m_nxtpos); End if; m_col_name := ltrim(rtrim(m_col_name)); open c1; fetch c1 into p_col_width; close c1; p_col_name := m_col_name; END;
same thing you must apply when retrieving values using exec_sql.column_value
concerning
DoraPublished by: Dora on December 7, 2009 12:20
Published by: Dora on December 7, 2009 12:20
-
Calling stored procedures with parameters with the database connectivity Toolkit
Hi all
I'm new to the forum and struggling to find a solution to a particular problem I have in this respect, using the LabVIEW Database Connectivity Toolkit on a project, I am currently working on my work. I have a database in which I tables and stored procedures with parameters. Some of these stored procedures have input, output and return parameters.
I tried to follow this example, but to no avail: http://digital.ni.com/public.nsf/allkb/07FD130746083E0686257300006326C4?OpenDocument
Such a stored procedure I am working on the implementation is named "dbo.getAllowablePNs", running "SELECT * from DeviceType" (DeviceType is the table). In this case, it requires no input parameter, it has an output parameter that generates the table [cluster] and has a return parameter that returns an integer value (status code for execution) to show if an error occurred. The DeviceType table has 3 columns; ID (PK, int not null), PN (nvarchar ((15), null) and NumMACAddresses (int, null).) I have surpassed many examples and I talk to the support OR try to implement this and similar procedures stored in LabVIEW but have not been successful. I am able to connect to the database with the VI of open connection without error, but spin in some confusion as a result of this step. I then try to use the VI of parameter query create to call the stored procedure and set the parameters. I guess I would then use the Set parameter value for each parameter that is connected to the entry of parameters on the previous query with parameters VI VI? I am also having some confusion during and after these steps as well. I would greatly appreciate advice or suggestions that anyone could have in this situation because I am not a SQL expert. Also, I would be happy to provide more information that might be useful.
Kind regards
Jon
Here's what I use to do this. I think I had to change him create parameterized query VI for him to work. There is a post on the forum about this somewhere.
-
Hello
I am trying to understand the procedure and on the inside, I have a dynamic query with where clause:
"Select."
tables
where 1 = 1
and instr (decode (nvl (' | nvl(pCATEG,'') |))) (("*"), "*", pb.categ, upper (' | nvl(pCATEG,'') |), pb.categ) > 0'
|| NVL(pEMP_GROUP_CODE,'') |
"and p.emp_group_code = g.emp_group_code';"
For it, clause make sense (parameter pEMP_GROUP_CODE is not connected to any condition, or I missed something)?
The procedure is works and connected to the application.
Please notify
Thank you
Daniel
Has been confused by "p.emp_group_code".
What you see is probably a lexical parameter, for example the value passed on s pEMP_GROUP_CODE a condition itself as 'and table.column = 'constant', which can be zero, so if you have a value, it adds a condition, otherwise just empty space and the condition is spared.
-
Oracle SQL Developer Data Modeler 4.1 problem
Hello:
I m trying to use the new version 4.1 (BETA) of Datamodeler, but I have a problem at the time wherever I run the program.
When I work the datamodeler.exe the console show me:
UIDefaults.getUI () failed: no class ComponentUI for: oracle.ide.controls.StatusBarControl$ JDevStatusBar [, 0,0, 0 x 0, invalid...]
Can you help me?
Thank you.
Hello
Data Modeler 4.1 requires Java 1.8 can run correctly.
If you try to run Data Modeler 4.1 with Java 1.7 it gets stuck in "Save the Extensions", and this error in the console log.
When you try to start with Java 1.7 it normally gives a "JDK Version not supported" warning, which identifies the file that needs to be updated to refer to a jdk Java 1.8.
Under Windows, this will normally be C:\Users\
\AppData\Roaming\datamodeler\4.1.0.866\product.conf, But if you start from the console using the datamodeler64.exe it will use the file
C:\Users\
\AppData\Roaming\datamodeler64\4.1.0.866\product.conf instead. You can change this file. Alternatively, if you delete the file, it should display the dialog box asking for the location of the JDK next time.
David
-
SQL developer data modeling (Access in PB table?)
Hi guys,.
the sql Data Modeler is able to connect to a database?
I'm a relational design I need to use an EXISTING table in my table of production...
He has a lot of columns...
so, I don't want to create a new table to imitate this existing table in the database...
anyway I can do?
Thank you.
Published by: OracleWannabe on January 1st, 2009 22:45Hello
Yes, you can import from the database - use "file > import > data dictionary" menu option. You can import the following databases:
-Oracle 9,10,11;
-MS SQL Server - 2000, 2005;
-IBM DB2 - for OS/390 and LUW (Linux, Unix, and Windows) - 7.8
-a database using the JDBC/ODBC bridge - results depends on the implementation of ODBC drivers, used.Data modeling Oracle comes with drivers for the Oracle database. Please read the release notes to see how to extract and add drivers from IBM and Microsoft http://www.oracle.com/technology/products/database/sql_developer/files/releasenotes525.htm
Best regards
Philippe -
How to store the result of a query in a variable in the data model
In a model of date I want to do something like this
< name of dataTemplate = than one dataSourceRef "HURDetail" = "BRM_DATA_SOURCE" >
< Parameters >
< parameter name = "PARAM_THRESHOLD_VALUE" dataType = "number", defaultValue = "0" / >
< / Parameter >
< SQLStatement instance name = "Q1" >
<! [CDATA]
SELECT count (*) FROM TABLE_NAME
[]] >
< / sqlStatement >
-I want to assign the output of the above query to PARAM_THRESHOLD_VALUE so I can use it in future requests...
-My query is complex, for reason of performance I want to store the output of the query.
Please suggest how do...
Made a package with the PARAM_THRESHOLD_VALUE parameter and the function value entry assigns the done variable to work?
Thank you
ShivaHey Shiva,
If you want to use the value of the counter in the other queries in the data model, you can have an alias for the extraction of County and use it as a bind variable in other queries as
SELECT count (*) PARAM_THRESHOLD_VALUE
FROM TABLE_NAME
]]>
and can use it in another query as
SELECT XYZ
FROM TABLE_NAME2
WHERE XXX = *: PARAM_THRESHOLD_VALUE *.
]]>
Hope this is what you want.
Thank you. -
Hello OTN.
I don't understand why my sql query will pass by in the data model of the BI Publisher. I created a new data model, chose the data source and type of Standard SQL = SQL. I tried several databases and all the same error in BI Publisher, but the application works well in TOAD / SQL Developer. So, I think it might be something with my case so I'm tender hand to you to try and let me know if you get the same result as me.
The query is:
SELECT to_char (to_date ('15-' |)) TO_CHAR(:P_MONTH) | » -'|| (To_char(:P_YEAR), "YYYY-DD-MONTH") - 90, "YYYYMM") as yrmth FROM DUAL
Values of the variable:
: P_MONTH = APRIL
: P_YEAR = 2015
I tried multiple variations and not had much luck. Here are the other options I've tried:
WITH DATES AS
(
Select TO_NUMBER (decode (: P_MONTH, 'JANUARY', '01',))
'FEBRUARY', '02',.
'MARCH', '03'.
'APRIL', '04'
'MAY', '05'.
'JUNE', '06'.
'JULY', '07',.
'AUGUST', '08'.
'SEPTEMBER', '09'.
'OCTOBER', '10',.
'NOVEMBER', '11'.
"DECEMBER", "12."
'01')) as mth_nbr
of the double
)
SELECT to_char (to_date ('15-' |)) MTH_NBR | » -'|| (TO_CHAR(:P_YEAR), 'DD-MM-YYYY') - 90, "YYYYMM")
OF DATES
SELECT to_char (to_date ('15-' |: P_MONTH |)) » -'|| ((: P_YEAR, 'MONTH-DD-YYYY')-90, "YYYYMM") as yrmth FROM DUAL
I'm running out of ideas and I don't know why it does not work. If anyone has any suggestions or ideas, please let me know. I always mark answers correct and useful in my thread and I appreciate all your help.
Best regards
-Konrad
So I thought to it. It seems that there is a bug/lag between the guest screen that appears when you enter SQL in the data model and parameter values, to at model/value data.
Here's how I solved my problem.
I have created a new data model and first created all my settings required in the data model (including the default values without quotes, i.e. APRIL instead "Of APRIL") and then saved.
Then I stuck my sql query in the data model and when I clicked ok, I entered my string values in the message box with single quotes (i.e. "in APRIL' instead of APRIL)
After entering the values of string with single quotes in the dialog box, I was able to retrieve the columns in the data model and save.
In the data tab, is no longer, I had to enter the values in single quotes, but entered values normally instead, and the code worked.
It seems the box prompted to bind the values of the variables when the SQL text in a data model expects strings to be wrapped in single quotes, but no where else. It's a big headache for me, but I'm glad that I solved it, and I hope this can be of help to other institutions.
See you soon.
Maybe you are looking for
-
After reading the various posts, I solved the problem. I disconnected the power and removed the battery. I then reinsert the battery connected the power cord and press the power button. Update the BIOS 'recovered', continued, and the system finall
-
Hello I use a code with occurrences and I went to the examples to learn how they work. However, I added an extra while loop and the VI must press the stop button twice to exit the loop. Is an explanation for this? I guess that after pressing stop the
-
How to turn off Wi - Fi and Bluetooth on IdeaPad U510?
Hello! I want to activate Bluetooth and Wi - Fi to save battery, but I just can't find the way to do it. There is no button or sth like that. No one knows how to do?
-
I have a problem of two USB ports that do not work. In Device Manager, they are questioning two points and it is written for universal serial bus. They are both the following ID each: PCI\VEN_1022 & DEV_7812 & SUBSYS_1849103C & REV_03 PCI\VEN_1022 &
-
Why my game MP3 of Vista disc used?
Windows Media Player cannot play the file. The player might not support the file type or does not support the codec used to compress