Can I do a query with a varchar2 or other inside OF?
How can I do a query with a Variable (varchar) inside OF?
example:
Select * from: var;
I received the error message: "invalid table name".
declare
n number;
table-name varchar2 (30): = "double";
Start
run immediately 'count (*) select "| table_name in n;
dbms_output.put_line (n);
end;
/
Tags: Database
Similar Questions
-
How can I create a query with the data control to the web service?
I need to create a query with the order of web service data, WSDL, it is query operation, there is a message of parameter with possible query criteria and a return message contains the results. I googled but can't find anything on the query with the web service. I can't find a criterion "named" to the data control of web service as normal data control. Blog of Shay, I saw the topics on the update with the data of web service command. How can I create a query with the data control to the web service? Thank you.Hello
This might help
* 054. Search form using control data WS ADF and complex of entry types *.
http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/index-101235.html
-
Can not do a query with the REST api
Hello
After discovering that the use of the standard SOAP API what is like poking yourself in the eye with a sharp stick, I try to use the REST API. At first, I tried to exercise it through the extension of POSTMAN on Chrome. But I have no joy.
Can I use caller ID to get the URL, so I know that my authentication is OK. But all other calls give me:
Failure of 403 XSRF Protection
Is an example of a call, that I'm trying:
https://secure.Eloqua.com/API/rest/1.0/data/[email protected] & Count = 1
I can't find any reference anywhere to this error 403.
Help!
Thank you
Simon
Hi Simon,.
Looks like you're client (web browser) might have stored credentials for Eloqua, probably in the cookies collection. If you try to delete your cookies and rerun the query API with basic authentication, it should work.
Hope this helps and please let us know if you need more information.
Thank you
Fred
-
I don't mind someone contact me directly, my email address is * address email is removed from the privacy *.
Please be aware that I am not technically excellent, I am in my 50s and gave this computer as a gift, otherwise I would have never had a. Thank you
"sabnazzy" wrote> please be aware that I am not technically excellent, I am in my 50s and has been> given this computer as a gift, otherwise I would have never had a.> Thank youFirst, you will need to explain so a little better the problem I have andothers can understand.What can I do(1) you have a Web site designed for you, that is beingconstruction.(2) somewhere on this site Web is a mailer - is it a form? - or does justlink to the browser's default e-mail program?You are unable to view photos sent in emails or from the siteor other sites?I'm confused-, but we need to know a few things(1) what mail client do you use? Outlook Express? Hotmail? Windows LiveThe post office? something else?(2) what EXACTLY the e-mail looks like when it happens with you? -t - itThere he can't open attachments? or is there another problemreports?with more details and responses above, we can begin to getsomewhere.HTH--NoelNoel Paton | Nil Carborundum Illegitemi | CrashFixPC
-
Write a SQL query with lines in columns
All the
I need help in writing a SQL query with lines in columns, let give u an example...
drop table activity;
CREATE TABLE 'ACTIVITY '.
(
"PROJECT_WID" NUMBER (22.0) NOT NULL,
VARCHAR2 (150 CHAR) "PROJECT_NO."
VARCHAR2 (800 CHAR) 'NAME '.
);
Insert in the ACTIVITY (PROJECT_WID, PROJECT_NO, NAME) values (1683691, '10007', 12-121');
Insert in the ACTIVITY (PROJECT_WID, PROJECT_NO, NAME) values (1684994, '10008', 12-122');
Insert in the ACTIVITY (PROJECT_WID, PROJECT_NO, NAME) values (1686296, '10009', 12-123');
Insert in the ACTIVITY (PROJECT_WID, PROJECT_NO, NAME) values (2225222, '9040', 12-124');
drop table lonet;
CREATE TABLE 'LONET.
(
VARCHAR2 (150 CHAR) "NAME."
NUMBER OF THE "ROOT."
VARCHAR2 (150 CHAR) "ENTRYVALUE".
);
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ("GAC", 1683691, "LDE");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('NAM', 1683691, 'LME');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('BAG', 1683691, 'ICE');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('PAP', 1683691, 'IKE');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('NAM', 1686291, "QTY");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('PAP', 1686291, 'MAX');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ("GAC", 1684994, "MTE");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('PAP', 1684994, 'MAC');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('FMT', 1684994, 'NICE');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('FMR', 1684994, 'RAY');
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ('BAG', 1686296, "CAQ");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ("PAP", 1686296, "QAQ");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ("VANESSA", 1686296, "THEW");
INSERT INTO LONET (NAME, ROOT, ENTRYVALUE) VALUES ("ANDR", 1686296, "REYL");
commit;
Link: activity.project_wid = lonet.root
look like output
Project_wid Project_no NAME GAC NAM BAG RAC 1683691 10007 12-121 LDE LME LCE LKE 1684994 10008 12-122 MTE null null MAC 1686296 10009 12-123 null null CAQ QAQ 2225222 9040 12-124 null null null null two problems, in that I am running
1. I dono how simply we can convert rows to columns
2. for root = 1683691, there are double NAM and RAC in lonet table... ideally these data should not be there, but since its here, we can take a MAX so that it returns a value
3. There are undesirables who should be ignored
Once again my thought process is that we join the activity and 4 alias table lonet.
ask for your help in this
Thank you
Hello
This is called pivoting.
Here's a way to do it:
WITH relevant_data AS
(
SELECT a.project_wid, a.project_no, b.SID
, l.name AS lonet_name, l.entryvalue
Activity one
LEFT OUTER JOIN lonet l.root = a.project_wid l
)
SELECT *.
OF relevant_data
PIVOT (MAX (entryvalue)
FOR lonet_name IN ("GAC" IN the gac
"NAM" AS nam
'BAG' IN the bag
"RAC" AS cars
)
)
ORDER BY project_wid
;
Output:
PROJECT_WID PROJECT_NO GAC NAM BAG RAC NAME
----------- ---------- ---------- ---------- ---------- ---------- ----------
1683691 12 - 10007 121 LDE LME LCE LKE
1684994 MAC MTE 10008 12-122
1686296 12 - 10009 123 QAC QAQ
2225222 9040 12 - 124
To learn more about swivel, see the FAQ in the Forum: Re: 4. How can I convert rows to columns?
Thanks for posting the CREATE TABLE and INSERT statements; It's very useful!
-
Can anyone simplify this query
Here's a DOF from two tables
1. CREATE TABLE (EMPL)
NUMBER OF SNO
ENAME VARCHAR2 (25).
USE VARCHAR2 (25).
KEY ELEMENTARY SCHOOL (SNO)
);
2. CREATE TABLE EMPL_DET)
NUMBER OF SNO
SAL VARCHAR2 (25)
);
Here are tables LMD
INSERT INTO EMPL (SNO, ENAME, JOB) VALUES (1, 'SMITH', 'CLERK');
INSERT INTO EMPL (SNO, ENAME, JOB) VALUES (2, 'SMITH', 'MANAGER');
INSERT INTO EMPL (SNO, ENAME, JOB) VALUES (3, 'TOM', 'CLK');
INSERT INTO EMPL_DET (SNO, SAL) VALUES (1, '1000');
INSERT INTO EMPL_DET (SNO, SAL) VALUES (2, "10000");
INSERT INTO EMPL_DET (SNO, SAL) VALUES (3, '900');
I want to calculate TotalSAL (column: empl_det.) SAL) of each employee (empl.ename) with job-description (empl.job).
Means I want following the lines of output
1.(Job,TotalSAL,Ename)-> (CLERK, 11000, SMITH)
2->.(Job,TotalSAL,Ename) (MANAGER, 11000, SMITH)
3->.(Job,TotalSAL,Ename) (CLK, 900, TOM)
I tried to write down to unique ename
Select JOB, x.sal, ename in empl,
(
Select sum (sal) sal empl_det where sno in
(select sno to empl where ename = 'SMITH')
) x
where ename = 'SMITH '.
order by ename
each ename, I draw from this query. How can I make the ename list (TOM SMITH) to this request?
Or can anyone simplify this query?Hello
in this case, you need to use is analytical functions:
that is to say:
SELECT e.job, SUM (d.sal) OVER (PARTITION BY e.ename) AS "TotalSal" , e.ename FROM empl e, empl_det d WHERE d.sno = e.sno AND e.ename IN ('SMITH', 'TOM') ORDER BY e.ename; JOB TotalSal ENAME ------------------------- ---------- ------------------------- CLERK 11000 SMITH MANAGER 11000 SMITH CLK 900 TOM
Kind regards.
AlPublished by: Alberto Faenza on 27 November 2012 15:34
Corrected query -
Why can't scan my document with my printer hp deskjet 2050A
Dear microsoft, I can't scan a document with me hp 2050 deskfet has.
Hello Ella,.
Thanks for posting your query on the Microsoft Community.
According to the description of the problem, you are unable to scan your document with the HP Deskjet 2050 printer. To scan a photo or a document from the Control Panel on your computer, make sure the computer is turned on, the long printer driver is installed and the HP printer is connected to the computer with a USB cable, a cable network (Ethernet) cable, or on your local wireless network. If one of them is missing then it might be a chance that it will not scan.
I would be grateful if you can provide us with the following information to help us better understand the issue.
- It was working fine before? If Yes, did you significant changes before the show?
- Are all the device drivers and updates of Windows updated?
Try the steps in the following methods and see if it helps you to solve the problem.
Method 1
This tutorial is designed to help you identify and fix common printer problems in Windows, including print errors, print spooler errors, and other issues that could prevent you from printing.
Solve printer problems
Method 2
If the problem persists, I recommend that you completely uninstall the part-time driver that has been installed on your computer and then download the latest driver on the printer again manufacturer site.
Step 1: Try to remove the printer by following the steps described in the following Microsoft Article.
http://Windows.Microsoft.com/en-us/Windows7/install-a-printer
Step 2: Find and install printer drivers in Windows 7.
http://Windows.Microsoft.com/en-us/Windows7/find-and-install-printer-drivers
Additional information:
You can consult the HP article to know how to scan a document.
How to perform a scan: from the control panel
Get back to us with all the required information and the result of proposed suggestion, we will be happy to help you further.
Kind regards
-
Why can't configure my w7 with my 4g hotspot
Why can't configure my w7 with my 4g hotspot
(Moved from: Internet Explorer |) Internet Explore 11 | Windows 7)
Hello Lisa,.
Thanks for posting your query on the Microsoft Community. We are happy to help you.
Before provide you measures to solve this query, I would be grateful if you could answer these questions:
- Mobile device you use to connect hotspot Windows 7 to 4?
- You receive an error message when you connect your computer to 4G hotspot?
- Are you able to connect to any other computer with this 4G hotspot?
- Your computer connects to networks other than the 4 G hotspot?
I suggest you try to run the troubleshooter listed in the link below and get back to us with the results and the answers to the above questions.
Using the troubleshooter from network in Windows 7
http://Windows.Microsoft.com/en-us/Windows7/using-the-network-troubleshooter-in-Windows-7
Post back with the results, so that we can help you further.
Thank you.
-
help me out with a query with an output that has own text.
help me out with a query with an output that has own text.
For example select name from tbl_name
Ben "is my name"-> should be the output
Hello
3cc59f7b-B8C1-4EFA-8385-e0d8720a689c wrote:
help me out with a query with an output that has own text.
For example select name from tbl_name
Ben "is my name"---> should be the output
Sorry, it is not clear what you want.
If the table contains only "Ben", then you can get the output above using a query like this:
SELECT name. '' my name is' ' AS name_plus
FROM tbl_name;
I hope that answers your question.
If this isn't the case, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and the results you want from this data.
Explain, using specific examples, how you get these results from these data.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).
See the FAQ forum: https://forums.oracle.com/message/9362002#9362002
-
Select the query with the level line list where the clause
Hi all
I am creating a tabular presentation based on a SQL query that has a list of selection based on a query with a where clause clause that refers to a column in the original SQL query.
The situation is, I have a table that stores the client_id, source_id, and build_id, lets call it client_source. I have a second table, build_source, containing source_id and build_id, one to many relations between the two (1 source_id could have build_id 1-7).
Using a tabular presentation, I want to select the correspondent build_id to use in client_source, but the selection list should contain only the build_id for this particular source_id of lines.
Here is an example of the SQL source of tabular presentation;
Select
s.ROWID,
s.CLIENT_ID,
s.SOURCE_ID,
APEX_ITEM. SELECT_LIST_FROM_QUERY (1, s.BUILD_ID,)
"Select display b.build_id, b.build_id return.
b build_source where b.source_id = s.SOURCE_ID ') lst
of s client_source
what I want to achieve, it's as source_id "BOLD" match fields. When the query is built this way, I get an error of "invalid identifier" Oracle on s.SOURCE_ID during execution.
Is there some special tags to be used to refer to the external column? I must be missing something because this looks like a pretty mundane problem.
I am running on 4.1.0.00.32, on an Oracle 10 g release 10.2.0.4.0 Server Express request.
I look forward to useful responses!
See you soon,.
Jason
Published by: 1005131 on May 9, 2013 19:02Your selection by query list receives a static SQL. That SQL can't "see" the value of your s.source_id.
But it would work like this:
where b.source_id = ' | s.SOURCE_ID)You would be the value for the SQL concatenation. It is not ideal, but it will work.
Jorge
-
A simple query with as wrong return result
Hello
I run a simple query with like.
If I use the parameter I get incorrect results.
If I use the request without parameter results are ok.
My script:
ALTER SESSION SET NLS_SORT = BINARY_CI;
ALTER SESSION SET NLS_COMP = LINGUISTIC;
-drop table abcd;
create table abcd (col1 varchar2 (10));
INSERT INTO VALUES ABCD ('122222');
insert into abcd values ('111222');
SELECT * FROM ABCD WHERE COL1 LIKE: 1. -bad result with 12%
/*
COL1
----------
122222
* 111222 *.
*/
"Select * ABCD where col1 like 12%; -result ok
/*
COL1
----------
122222
*/
I use Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
and query, run in Oracle SQL Developer 3.1.07.I think it's just a bug, and it is set to 11.2.0.3:
11.2.0.1:
DB11.2.0.1>> select * from v$version where rownum=1; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production 1 row selected. DB11.2.0.1>> ALTER SESSION SET NLS_SORT=BINARY_CI; Session altered. DB11.2.0.1>> ALTER SESSION SET NLS_COMP=LINGUISTIC; Session altered. DB11.2.0.1>> create table abcd (col1 varchar2(10)); Table created. DB11.2.0.1>> INSERT INTO ABCD VALUES ('122222'); 1 row created. DB11.2.0.1>> insert into abcd values ('111222'); 1 row created. DB11.2.0.1>> VARIABLE A1 VARCHAR2(10); DB11.2.0.1>> EXEC :A1 := '12%'; PL/SQL procedure successfully completed. DB11.2.0.1>> SELECT * FROM ABCD WHERE COL1 LIKE :A1; COL1 ---------- 122222 111222 2 rows selected.
11.2.0.3:
DB11.2.0.3>> select * from v$version where rownum=1; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 1 row selected. DB11.2.0.3>> ALTER SESSION SET NLS_SORT=BINARY_CI; Session altered. DB11.2.0.3>> ALTER SESSION SET NLS_COMP=LINGUISTIC; Session altered. DB11.2.0.3>> create table abcd (col1 varchar2(10)); Table created. DB11.2.0.3>> INSERT INTO ABCD VALUES ('122222'); 1 row created. DB11.2.0.3>> insert into abcd values ('111222'); 1 row created. DB11.2.0.3>> VARIABLE A1 VARCHAR2(10); DB11.2.0.3>> EXEC :A1 := '12%'; PL/SQL procedure successfully completed. DB11.2.0.3>> SELECT * FROM ABCD WHERE COL1 LIKE :A1; COL1 ---------- 122222 1 row selected.
Kind regards
Sayan Malakshinov
http://orasql.org -
How can I write a sql with a Union.
How can I write a sql with a Union.
Select emp_name, emp_no, emp_sal of the emp
If show_Less_100000 = "Yes" then emp_sal < 100000 (all values less than 100000)
otherwise the full list.
Thank you
Harsha
Published by: taty on July 31, 2012 11:28SQL> variable show_Less_100000 varchar2(3) SQL> exec :show_Less_100000 := 'Yes'; PL/SQL procedure successfully completed. SQL> select ename, 2 empno, 3 sal 4 from emp 5 where ( 6 :show_Less_100000 = 'Yes' 7 and 8 sal < 2000 9 ) 10 or nvl(:show_Less_100000,'No') != 'Yes' 11 / ENAME EMPNO SAL ---------- ---------- ---------- SMITH 7369 800 ALLEN 7499 1600 WARD 7521 1250 MARTIN 7654 1250 TURNER 7844 1500 ADAMS 7876 1100 JAMES 7900 950 MILLER 7934 1300 8 rows selected. SQL> exec :show_Less_100000 := 'All'; PL/SQL procedure successfully completed. SQL> select ename, 2 empno, 3 sal 4 from emp 5 where ( 6 :show_Less_100000 = 'Yes' 7 and 8 sal < 3000 9 ) 10 or nvl(:show_Less_100000,'No') != 'Yes' 11 / ENAME EMPNO SAL ---------- ---------- ---------- SMITH 7369 800 ALLEN 7499 1600 WARD 7521 1250 JONES 7566 2975 MARTIN 7654 1250 BLAKE 7698 2850 CLARK 7782 2450 SCOTT 7788 3000 KING 7839 5000 TURNER 7844 1500 ADAMS 7876 1100 ENAME EMPNO SAL ---------- ---------- ---------- JAMES 7900 950 FORD 7902 3000 MILLER 7934 1300 14 rows selected. SQL>
SY.
-
Rewrite the query with joins, and group by
Hello
It's an interview question.
Table names: bookshelf_checkout
virtual library
And the join condition between these two tables is title
We need to rewrite under request without using the join condition and group by clause?
When I was in College, I read most of SELECT statements can be replaced by operations base SQL (DEFINE the OPERATORS). Now, I am rewriting the query with SET operators, but not able to get the exact result.SELECT b.title,max(bc.returned_date - bc.checkout_date) "Most Days Out" FROM bookshelf_checkout bc,bookshelf b WHERE bc.title(+)=b.title GROUP BY b.title;
Kindly help me on this.
Thank you
SuriSomething like that?
1 WITH books AS ( 2 SELECT 'title 1' title FROM dual UNION ALL 3 SELECT 'title 2' FROM dual UNION ALL 4 SELECT 'title 3' FROM dual ), 5 bookshelf AS ( 6 SELECT 'title 1' title, DATE '2012-05-01' checkout_date, DATE '2012-05-15' returned_date FROM dual UNION ALL 7 SELECT 'title 1' title, DATE '2012-05-16' checkout_date, DATE '2012-05-20' returned_date FROM dual UNION ALL 8 SELECT 'title 2' title, DATE '2012-04-01' checkout_date, DATE '2012-05-15' returned_date FROM dual ) 9 SELECT bs.title, MAX(bs.returned_date - bs.checkout_date) OVER (PARTITION BY title) FROM bookshelf bs 10 UNION 11 (SELECT b.title, NULL FROM books b 12 MINUS 13* SELECT bs.title, NULL FROM bookshelf bs) SQL> / TITLE MAX(BS.RETURNED_DATE-BS.CHECKOUT_DATE)OVER(PARTITIONBYTITLE) ------- ------------------------------------------------------------ title 1 14 title 2 44 title 3
Lukasz
-
Get data query with java files
Hay,
I'm trying to get a list of data file by a query with CRMI or wcm to java.
My goal is to get list < DataFile > for the content by query server.
I can't find a function or a method to do this, I just success to get the metadata of the cdf fields.
I want to create objects that are customized from the cdf...
Please, can someone help me?
EranWhat service 11g SS_GET_ELEMENT_DATA? It doesn't seem to be documented but must dDocName as a parameter which is the CDF.
Jonathan
http://redstonecontentsolutions.com
http://corecontentonly.com -
AF:query with web services data control
Hi all
I'm very new to using web services as a data source in the ADF. I'm looking to use a component of af: query (with saved searches and advanced mode) with a web service data control.
The doc - http://docs.oracle.com/cd/E24382_01/web.1112/e16182/appendix_datacontrols.htm#CHDGBBIJ - it seems that there is some programmatic application necessary to achieve this goal. I guess that means that you are required to implement a custom QueryModel and related classes. My understanding is correct?
Is there a sample (or documentation) available for this application? I searched the web but can't find anything useful.
Note: For the purpose of learning, I just exposed service interface of the Module of an Application as a web service remote. The web service has my view exposed as an operation criteria.
Thanks in advance,
Bruno GuillaumeHello
the query component does not work out of the box with the DataControl WS that it does not support the named criteria (which will be for a long time in the future). To create a request form, you can drag a WS method as a parameter. If the method has arguments of complext, you will find the complex argument that manufacturers in the Panel DataControl, so you can flatten by drag and drop in the form of parameter
Frank
Maybe you are looking for
-
Irregularly beep on Satellite A210-16f
Hi, I would like to ask the following question: I have Toshiba Satellite A210-16f (since October 2007).I have irregular short beep (ca 1 sec) coming out of the right side of my laptop (near right speaker, key DELETE or DC in...). I hear it very irreg
-
Cannot set up eprint. My printer was working with eprint very well until I got a new router. Since I can't not to use or setup eprint. It is connected to the home network wireless and it works fine for printing documents. I have reset the factory for
-
What is the incoming and outgoing POP3 for AOL?
What is the incoming and outgoing POP3 for aol?
-
Authentication &; roaming
I use autonomous 1142Ns running 12.4 (no WLC, no external Radius Server). They authenticate clients personal connection with WPA2 Mode. Just enter a password, and you are connected. I need to configure the access points for Fast, Secure roaming, but
-
I have a windows 7 64-bit and I am the administrator, but when I try to download flash player, it says that I don't have access to the installation program, now I'm without flash and almost nothing works. Any ideas?