Help with a simple select statement
$x = oci_parse($c, "select quantity from balance where item_num=101");
oci_execute($x);
echo "the quant is: ".$x;
I try to run this select statement without success
then I tried...
$x = oci_parse($c, "select quantity from balance where item_num=101");
$y= oci_execute($x);
echo "the quant is: ".$y;
and it didn't work either...
What should I change?
thanks!
The Oracle library operates a bit differently from some other PHP libraries, notably MySQL/MySQLi. With Oracle (OCI8), you have to execute the statement, and then afterward use an oci_fetch...() function to pull things from your $statement variable. Here's a small example that hopefully will illustrate the basic usage:
<?php
$conn = oci_connect('hr','hr','xe');
if(!$conn) {
echo 'Could not connect!';
exit;
$sql = 'select * from jobs';
$stmt = oci_parse($conn, $sql);
if(!$stmt) {
echo 'Could not parse query.';
exit;
$result = oci_execute($stmt, OCI_DEFAULT);
if(!$result) {
echo 'Could not execute query.';
exit;
echo "Query ran successfully.\n";
// Fetch rows as associative arrays, so
// we can ask for values by column name.
// Other options include oci_fetch_row(),
// oci_fetch_array(), and oci_fetch_object().
// Note that oci_fetch_assoc() will create
// an associative array using upper-case
// column names for the keys.
while(($row = oci_fetch_assoc($stmt)) != null)
echo $row['JOB_ID'] . ': ' . $row['JOB_TITLE'] . "\n";
echo "All data returned.\n";
oci_close($conn);
?>When I run this, I get the following:
C:\workspace\php>php select.php
Query ran successfully.
AD_PRES: President
AD_VP: Administration Vice President
AD_ASST: Administration Assistant
FI_MGR: Finance Manager
FI_ACCOUNT: Accountant
AC_MGR: Accounting Manager
AC_ACCOUNT: Public Accountant
SA_MAN: Sales Manager
SA_REP: Sales Representative
PU_MAN: Purchasing Manager
PU_CLERK: Purchasing Clerk
ST_MAN: Stock Manager
ST_CLERK: Stock Clerk
SH_CLERK: Shipping Clerk
IT_PROG: Programmer
MK_MAN: Marketing Manager
MK_REP: Marketing Representative
HR_REP: Human Resources Representative
PR_REP: Public Relations Representative
All data returned.
C:\workspace\php>For more information, take a look at the OCI8 library documentation in the PHP manual online:
OCI8
http://us.php.net/manual/en/book.oci8.php
Some other examples
http://us.php.net/manual/en/oci8.examples.php
Kind regards,
Christopher L. Simons
Similar Messages
-
Help with a update,select statement
Hi all please can you help me with a update statement i am struggling with.
I have 2 tables
Holiday and data
In the Holiday table i have columns for
Machine_ID NUMBER,
date_from DATE,
date_to DATE,
ID NUMBER
Machine column represents a type of machine, the two dates represent the start and end date of a holiday and ID represents the ID of the machines that the holiday effects (as you can have many machines that are the same, so the ID unique field to seperate them.
i.e.
996 25-DEC-08 00:00:00 27-DEC-08 00:00:00 91
996 25-DEC-08 00:00:00 27-DEC-08 00:00:00 92
100 28-DEC-08 00:00:00 29-DEC-08 00:00:00 1
100 28-DEC-08 00:00:00 29-DEC-08 00:00:00 2
In the data table i have the following columns:
DATE DATE
Machine NUMBER
SHIFT1S DATE
SHIFT1F DATE
SHIFT2S DATE
SHIFT2F DATE
CALS DATE
CALF DATE
CAP NUMBER
CALCAP NUMBER
total_hrs_up NUMBER
In here i have data for every date in the calendar. The machines are cross references with the machine in holidays table.
I run two shifts so have shift 1 start, finish. shift 2 start, finish. These are dates with times, so shift1s could be 01-01-08 09:00:00 shift1f could be 01-01-08 17:00:00.
shift2S could be 01-01-08 21:00:00 shift2f could be 01-01-08 23:59:00.
so that machine would be up between them hours of the day.
Other columns include
CALS, ,CALF = calendar start, finish, - This needs to be populated from the holiday table. currently null. So if the date is the 26 DEC and the machine is the same as what is in the holiday table then these two columns should be populated with them data
CAP is the total number of these machines i have available.
CALCAP is the no of machines the holiday affects -currently null
total_hrs_up is the number of hours this machine is up and running -currently null.
So what i need to do is populate the cals, calf calcap, total_hrs_up columns.
total_hrs_up is the important one, this needs to work out based on the two shift patterns the number of hours that the machine is available and then take off the holiday hours to give a final value.
so current data example in data is
date machine shifts shiftf shift2s shift2f cals, calf, cap, calcap, total_hrs
16-JUL-08 100 09:00:00 17:00:00 12:00:00 00:00:00 '','','',1 ,''
16-JUL-08 105 09:00:00 17:00:00 12:00:00 00:00:00 '','','',1 ,''
16-JUL-08 107 09:00:00 17:00:00 12:00:00 00:00:00 '','','',1 ,''
id like to see based on the holiday table if there is a holiday then this data is updated as such and a total_hrs machine is available populated on that date.
Any help is very much appreciated!
ThanksHi,
The following query does what you requested.
It makes the following assumptions:
(a) in data, shift1start <= shift1finish
(b) in holiday, hol_start <= hol_finish
(b) in data, the combination (machine, shift1start) is unique
(c) in holiday, hol_start <= hol_finish
(d) in holiday, rows for the same machine and id never have overlapping dates (including times). For example:
INSERT INTO holiday (machine, id, date_from, date_to)
VALUES (200, 1, '26-DEC-08 07:00:00', '26-DEC-08 09:59:59');
INSERT INTO holiday (machine, id, date_from, date_to)
VALUES (200, 1, '26-DEC-08 09:00:00', '26-DEC-08 09:59:59');will cause a probem. Multiple rows for the same machine and day are okay, however, if the times do not overlap, like the following:
INSERT INTO holiday (machine, id, date_from, date_to)
VALUES (200, 1, '26-DEC-08 07:00:00', '26-DEC-08 08:59:59');
INSERT INTO holiday (machine, id, date_from, date_to)
VALUES (200, 1, '26-DEC-08 09:00:00', '26-DEC-08 09:59:59');Here's the UPDATE statement:
UPDATE data m
SET ( hol_start
, hol_finish
, no_of_available_minutes
) =
( SELECT MIN (date_from)
, MAX (date_to)
, ( MAX (shift1finish - shift1start) -- Total from data
- ( NVL ( SUM ( LEAST (date_to, shift1finish)
- GREATEST (date_from, shift1start)
, 0
) -- Total from holiday
/ MAX (total_no_of_machines) -- Average
) * 24 * 60 -- Convert days to minutes
FROM data d
LEFT OUTER JOIN holiday h ON h.machine = d.machine
AND NOT ( date_from > shift1finish
OR date_to < shift1start
WHERE d.machine = m.machine
AND d.shift1start = m.shift1start
);The subquery has to use its own copy of data (that is, in needs d, not m), since the subquery has to return a non-NULL number of minutes when no rows in h match m. -
Need help with correcting the select statement
I have two tables mkt & error.
The fields of mkt are
app_id (xxx)
c_mkt_id
app_mkt_id
The fields of error table are
mkt_id
intr_id (its in format xxx.yyy or xxx)
xyz
abc
pqr
I have to select * fields from error table such that
->mkt.app_id = error.intr_id (here i am using combination of sbstr & instr to get the part before "." if present)
->mkt.c_mkt_id=error.mkt_id
Where ever the above two conditions match i have to replace the mkt_id field in my select * from error table query with the
app_mkt_id field from mkt table. If the above two condtions dont match my select * from error table should return the original mkt_id present in the error table.
I have presently developed a query(*) which selects the app_mkt_id from mkt table where ever the two conditions match.
How should i go about using this to get my actual requirement.
(*)=select app_mkt_id from mkt where app_id in (select case when case_when=1 then substr(intr_id, 1, instr(intr_id,'.')-1) else substr(intr_id, 1) end from (select intr_id, case when instr(intr_id,'.',1)=0 then 0 else 1 end case_when from error)) and
c_mkt_id in (select mkt_id from error)you wrote:
(*)=select app_mkt_id from mkt where ....What is this?
If you are writing PL/SQL the syntax is:
SELECT ....
INTO ....
FROM ....
WHERE ....This seems to be school work and thus you really need to puzzle this out for yourself. -
Help with a simple SQL statement??
table_a
a_col1
a_col2
a_col3
table_b
b_col1
b_col2
b_col3
SELECT * FROM TABLE_A
WHERE A_COL1 IS NOT NULL AND A_COL1 IN (SELECT A_COL1 FROM TABLE_B);
I don't know why this statement executes without errors? There is no a_col1 in table_b in the sub select.
In my real situation this query works and is actually pulling a_col1 in the sub select from the table in the main query.
If you pull the sub select out and try to run it by itself it will error.
If someone could explain what I'm missing in understanding this it would be appreciated.
Thanks,
WhitneyBecause you aren't aliasing your tables, and Oracle is trying it's darndest to turn your query into something that can compile. You aren't explicitly telling it what you want, so it's left to guessing (it would guess TABLE_B first if the column existed, in absence of that, it's going to TABLE_A for the column).
A reason you should always alias your tables when your query references more than one, you remove the guess work.
SELECT *
FROM TABLE_A a
WHERE a.A_COL1 IS NOT NULL AND a.A_COL1 IN (SELECT b.A_COL1 FROM TABLE_B b); -
Simple Select statement in MS Access
I am not able to get this simple select statement working in MS Access.
"SELECT PhotoLocation from RfidData WHERE TeamID = '"+teamID ;
It is using a variable called teamID which is a string.
The error is java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression
Please Suggest
Thank You...Let's look at your code, shall we?
public String readPhotoLoc(String teamID)
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection(dbURL,"","");
PreparedStatement ps = con.prepareStatement("Select PhotoLocation from RfidData "); // There's no bind parameter here, so setString will do nothing
ps.setString(1,teamID);
ResultSet rs = ps.executeQuery(); // what do you do with the ResultSet? Nothing. //You don't return anything, either. I doubt that this mess even compiles.
}Here's one suggestion for how to write it properly:
public String readPhotoLoc(Connection connection, String teamID)
String photoLoc = null;
PreparedStatement ps = null;
ResultSet rs = null;
try
String query = "SELECT PhotoLocation FROM RfidData WHERE TeamID = ?";
ps = connection.prepareStatement(query);
ps.setString(1,teamID);
rs = ps.executeQuery();
while (rs.next())
photoLoc = rs.getString("PhotoLocation");
return photoLoc;
catch (SQLException e)
e.printStackTrace();
return null;
finally
try { if (rs != null) rs.close(); } catch (SQLException ignoreOrLogThis) {}
try { if (ps != null) ps.close(); } catch (SQLException ignoreOrLogThis) {}
}Make sure that the types of the columns match the Java types.
% -
How to get the inserted row primary key with out using select statement
how to return the primary key of inserted row ,with out using select statement
Edited by: 849614 on Apr 4, 2011 6:13 AMyes thanks to all ,who helped me .its working fine
getGeneratedKeys
String hh = "INSERT INTO DIPOFFERTE (DIPOFFERTEID,AUDITUSERIDMODIFIED)VALUES(DIPOFFERTE_SEQ.nextval,?)";
String generatedColumns[] = {"DIPOFFERTEID"};
PreparedStatement preparedStatement = null;
try {
//String gen[] = {"DIPOFFERTEID"};
PreparedStatement pstmt = conn.prepareStatement(hh, generatedColumns);
pstmt.setLong(1, 1);
pstmt.executeUpdate();
ResultSet rs = pstmt.getGeneratedKeys();
rs.next();
// The generated order id
long orderId = rs.getLong(1); -
Need help with a simple process with FTP Adapter and File Adapter
I am trying out a simple BPEL process that gets a file in opaque mode from a FTP server using a FTP adapter and writes it to the local file system using a File Adapter. However, the file written is always empty (zero bytes). I then tried out the FTPDebatching sample using the same FTP server JNDI name and this work fine surprisingly. I also verified by looking at the FTP server logs that my process actually does hit the FTP server and seems to list the files based on the filtering condition - but it does not issue any GET or RETR commands to actually get the files. I am suspecting that the problem could be in the Receive, Assign or Invoke activities, but I am not able identify what it is.
I can provide additional info such as the contents of my bpel and wsdl files if needed.
Would appreciate if someone can help me with this at the earliest.
Thanks
Jaypersiandude wrote:
Topic: Need help with if, else, and which statements and loops.
How would I display 60 < temp. <= 85 in java
System.out.println("60 < temp. <= 85 in java");
another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
[http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806]. -
Need help with a simple program (should be simple anyway)
I'm (starting to begin) writing a nice simple program that should be easy however I'm stuck on how to make the "New" button in the file menu clear all the fields. Any help? I'll attach the code below.
====================================================
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Message extends JFrame implements ActionListener {
public void actionPerformed(ActionEvent evt) {
text1.setText(" ");
text2.setText("RE: ");
text3.setText(" ");
public Message() {
super("Write a Message - by Kieran Hannigan");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(370,270);
FlowLayout flo = new FlowLayout(FlowLayout.RIGHT);
setLayout(flo);
//Make the bar
JMenuBar bar = new JMenuBar();
//Make "File" on Menu
JMenu File = new JMenu("File");
JMenuItem f1 = new JMenuItem("New");f1.addActionListener(this);
JMenuItem f2 = new JMenuItem("Open");
JMenuItem f3 = new JMenuItem("Save");
JMenuItem f4 = new JMenuItem("Save As");
JMenuItem f5 = new JMenuItem("Exit");
File.add(f1);
File.add(f2);
File.add(f3);
File.add(f4);
File.add(f5);
bar.add(File);
//Make "Edit" on menu
JMenu Edit = new JMenu("Edit");
JMenuItem e1 = new JMenuItem("Cut");
JMenuItem e2 = new JMenuItem("Paste");
JMenuItem e3 = new JMenuItem("Copy");
JMenuItem e4 = new JMenuItem("Repeat");
JMenuItem e5 = new JMenuItem("Undo");
Edit.add(e5);
Edit.add(e4);
Edit.add(e1);
Edit.add(e3);
Edit.add(e2);
bar.add(Edit);
//Make "View" on menu
JMenu View = new JMenu("View");
JMenuItem v1 = new JMenuItem("Bold");
JMenuItem v2 = new JMenuItem("Italic");
JMenuItem v3 = new JMenuItem("Normal");
JMenuItem v4 = new JMenuItem("Bold-Italic");
View.add(v1);
View.add(v2);
View.add(v3);
View.addSeparator();
View.add(v4);
bar.add(View);
//Make "Help" on menu
JMenu Help = new JMenu("Help");
JMenuItem h1 = new JMenuItem("Help Online");
JMenuItem h2 = new JMenuItem("E-mail Programmer");
Help.add(h1);
Help.add(h2);
bar.add(Help);
setJMenuBar(bar);
//Make Contents of window.
//Make "Subject" text field
JPanel row2 = new JPanel();
JLabel sublabel = new JLabel("Subject:");
row2.add(sublabel);
JTextField text2 = new JTextField("RE:",24);
row2.add(text2);
//Make "To" text field
JPanel row1 = new JPanel();
JLabel tolabel = new JLabel("To:");
row1.add(tolabel);
JTextField text1 = new JTextField(24);
row1.add(text1);
//Make "Message" text area
JPanel row3 = new JPanel();
JLabel Meslabel = new JLabel("Message:");
row3.add(Meslabel);
JTextArea text3 = new JTextArea(6,22);
messagearea.setLineWrap(true);
messagearea.setWrapStyleWord(true);
JScrollPane scroll = new JScrollPane(text3,
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
//SpaceLine
JPanel spaceline = new JPanel();
JLabel spacer = new JLabel(" ");
spaceline.add(spacer);
row3.add(scroll);
add(row1);
add(row2);
add(spaceline);
add(spaceline);
add(row3);
setVisible(true);
public static void main(String[] arguments) {
Message Message = new Message();
}persiandude wrote:
Topic: Need help with if, else, and which statements and loops.
How would I display 60 < temp. <= 85 in java
System.out.println("60 < temp. <= 85 in java");
another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
[http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806]. -
Help with a simple 1811 configuration
I have a very basic level of understanding with Cisco products and I need help with what should be simple and even doable by me.
I have a Cisco 1811 integrated router and am simply trying to use it on my home network. I can configure the router with an enable secret password, password encryption, VTY, aux, and cons logins with no issues. The router has 2 Ethernet interfaces, 0 and 1 and 8 switch ports.
The idea is to bring Comcast ISP service into one of the Ethernet ports and then have three machines on the switch ports able to access the Internet. Also I have an off-the shelf wireless router that I thought I would just plug that into an available switch port and allow a wireless AP as well.
This is so simply, that I can't believe I can't figure it out, but I can't.
I set int F1 to DHCP, performed a 'no shut', and connected the ISP's router and have an up and up indication. I have setup a static network with my three machines on the switch ports and enabled all applicable ports and have up and up indications - however, no traffic flow, even amongst my static Layer 2 switched LAN - not even a 'ping'. By my understanding of Layer 2, this should work right now, whether the ISP service is working or not - WHAT AM I DOING WRONG?
The addressing scheme I have ended up on is 172.16.1.0/28
Obviously without the first hurdle cleared, of why the switched LAN doesn’t work, I haven't got any deeper. Do I need to configure NAT? I don't think I would need to in the scenario right?
All of my experience, and none at the CCNA level, has been with larger Cisco equipment. One thing I noticed on the 1811 was that when trying to create a new VLAN, it appears to work yet does not do anything and the 'sh vlans' output returns nothing, not even the VLAN1 I can see with 'sh ip int brief".
Anyway, if anyone has time to help a newbie out I would appreciate it; I’m lost.
Thanks,
JoshThanks for the help Andrew! You know, I think if this was two separate devices (switch and router) I think I would be up and running, but this integrated stuff is throwing me off, not to mention that the IOS is a much older version (I guess) than what I'm used to.
They were throwing this 1811 in the trash can at work, so I just emptied the trash can. I have no documentation at all but I have since found the 1800 series documentation on Cisco.com and have tried to implement the basic configurations cited; with what seems like success, but still no joy. I did have to recover the password and did so with 0x2142, I bypassed the setup and compared the default configuration with what is listed in the documentation and they DO NOT match; I also tried to go through setup mode with the same indications. Additionally I've also learned that the 1800 series is pre-configured on certain options (DHCP, VLAN), which is new to me - I thought Cisco routers were not configured by default - isn't that kind of the point? (By the way, the below port status may not be correct since I now have all the ports unplugged)
Anyway, here is the 'show run' command, the 'sh ip int brief' command, followed by the 'sh version' command:
Show Run
Casino#sh run
Building configuration...
Current configuration : 2006 bytes
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
hostname Casino
boot-start-marker
boot-end-marker
enable secret 5 $1$meWw$nsMTp6US7axi/uE0MWULK.
enable password 7 06535E741C1B584C55
no aaa new-model
ip cef
no ip dhcp use vrf connected
ip dhcp excluded-address 172.16.1.1
ip dhcp pool Casino
import all
network 172.16.1.0 255.255.255.240
default-router 67.165.208.1
dns-server 68.87.89.150
domain-name hsd1.co.comcast.net
no ip domain lookup
ip domain name GinRummy.localhost
ip name-server 68.87.85.102
ip name-server 68.87.69.150
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
multilink bundle-name authenticated
archive
log config
hidekeys
interface Loopback0
ip address 172.16.1.1 255.255.255.240
interface FastEthernet0
no ip address
shutdown
duplex auto
speed auto
interface FastEthernet1
ip address dhcp
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
pppoe enable
pppoe-client dial-pool-number 1
interface BRI0
no ip address
encapsulation hdlc
shutdown
interface FastEthernet2
interface FastEthernet3
interface FastEthernet4
interface FastEthernet5
interface FastEthernet6
interface FastEthernet7
interface FastEthernet8
interface FastEthernet9
interface Vlan1
no ip address
ip nat inside
ip virtual-reassembly
interface Dialer0
ip address negotiated
ip mtu 1492
encapsulation ppp
dialer pool 1
ppp authentication chap
ip forward-protocol nd
no ip http server
no ip http secure-server
ip nat pool Casino 172.16.1.2 172.16.1.14 netmask 255.255.255.240
ip nat inside source list 1 interface Dialer0 overload
access-list 1 permit 172.16.1.0 0.0.0.15
dialer-list 1 protocol ip permit
control-plane
line con 0
password 7 080E5916584B4442435E5C
login
line aux 0
password 7 013C135C0A59475A70191E
login
line vty 0 4
password 7 09635B51485756475A5954
login
end
Show IP Interface Brief
Casino#sh ip int brief
Interface IP-Address OK? Method Status Prl
FastEthernet0 unassigned YES NVRAM administratively down do
FastEthernet1 unassigned YES DHCP up do
BRI0 unassigned YES NVRAM administratively down do
BRI0:1 unassigned YES unset administratively down do
BRI0:2 unassigned YES unset administratively down do
FastEthernet2 unassigned YES unset up do
FastEthernet3 unassigned YES unset up do
FastEthernet4 unassigned YES unset up do
FastEthernet5 unassigned YES unset up do
FastEthernet6 unassigned YES unset up do
FastEthernet7 unassigned YES unset up do
FastEthernet8 unassigned YES unset up do
FastEthernet9 unassigned YES unset up up
Vlan1 unassigned YES NVRAM up up
Loopback0 172.16.1.1 YES manual up up
Dialer0 unassigned YES manual up up
NVI0
'show version'
Casino#sh ver
Cisco IOS Software, C181X Software (C181X-ADVIPSERVICESK9-M), Version 12.4(15))
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Thu 24-Jan-08 13:05 by prod_rel_team
ROM: System Bootstrap, Version 12.3(8r)YH12, RELEASE SOFTWARE (fc1)
Casino uptime is 52 minutes
System returned to ROM by reload at 17:09:25 UTC Fri Jul 1 2011
System image file is "flash:c181x-advipservicesk9-mz.124-15.T3.bin"
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
[email protected].
Cisco 1812 (MPC8500) processor (revision 0x400) with 118784K/12288K bytes of m.
Processor board ID FHK120622J3, with hardware revision 0000
10 FastEthernet interfaces
1 ISDN Basic Rate interface
31488K bytes of ATA CompactFlash (Read/Write)
Configuration register is 0x2102
Thanks again for your help,
Josh -
Help with a large compound statement - sort of
Hi all. Hopefully you can help me. I'm trying to develop a little application in htmldb/ application express and having troubles with one little box.
I have a page item that will have a value between 2003 and 2036. I will be referencing the value of this item from the session state, no worries. The next item in the page will be based on this value and the session state will trigger one of 33 possible queries for this 2nd item. I know that sounds complex but it has to be that way unfortunately, the queries that will be triggered by this :ITEM_1 value are very different so there is no pretty way of doing that bit.
So say the value of Item1 = :ITEM1(session state value)
I need to do something like
IF
:ITEM1 = '2004'
THEN
select column.name from table.name where condition
ELSEIF
:ITEM = '2005'
THEN
select column.name from table.name where condition
ELSEIF
:ITEM = '2006'
THEN
''you get the idea
I need to repeat this the 33 times for 33 different SELECT statements. I've tried to figure out the best way to approach it, whether that is an IF statement, a WHERE statement or similar but am really struggling. I have no training in any of this and am not an IT person or programmer, just a cartograpaher who got an extra job to do :)
Which is the best approach for me here? And what is the syntax I need to use? I tried the IF statements but must be making some really fundamental mistakes in syntax. Forums are the only support available to me. Please help.....
Cheers and thanks for your time. Michael:ITEM1 = '2004' ... :ITEM = '2005'
select column.name from table.name where conditionAssuming ITEM1 and ITEM is just a typo and if the select statement is the same, you can use
if :ITEM BETWEEN TO_NUMBER('2004') and TO_NUMBER('2005') THEN
select column.name from table.name where condition
end if;
HTH
Ghulam -
I am having following records
A,B,C,1
A,B,C,2
A,B,C,3
P,Q,R,1
X,Y,Z,1
M,N,O,1
I,J,K,1
I,J,K,9
L,M,N,1
Now my select statement should give me the following result
P,Q,R,1
X,Y,Z,1
M,N,O,1
L,M,N,1
Basically I need those records where the fourth field should have only 1 and shouldn't have any other value. Here all the fields are Key Fields.
Please help me in getting the result.
Nothing is striking me as I am writing SQL after long gap
Thanking you in advance.Or the same idea as Gabe's, but using analytic function:
SQL> with d as
2 ( select 'A' c1,'B' c2,'C' c3, 1 c4 from dual union all
3 select 'A' ,'B' ,'C' , 2 from dual union all
4 select 'A' ,'B' ,'C' , 3 from dual union all
5 select 'P' ,'Q' ,'R' , 1 from dual union all
6 select 'X' ,'Y' ,'Z' , 1 from dual union all
7 select 'M' ,'N' ,'O' , 1 from dual union all
8 select 'I' ,'J' ,'K' , 1 from dual union all
9 select 'I' ,'J' ,'K' , 9 from dual union all
10 select 'L' ,'M' ,'N' , 1 from dual
11 )
12 select c1, c2, c3, c4
13 from (select d.*, count(*) over(partition by c1, c2, c3) cnt from d)
14 where c4 = 1
15 and cnt = 1
16 /
C1 C2 C3 C4
L M N 1
M N O 1
P Q R 1
X Y Z 1 -
Need help with a simple basketball game.
Hi im new here and I need help with making this simple basketball game.
Im trying to recreate this game from this video. Im not sure if he is using as2 or as3
Or if anyone could help me make a game like this or direct me to a link on how to do it It would be greatly appreciated.If you couldn't tell whether it is AS2 or AS3, it is doubtful you can turn it from AS2 into AS3, at least not until you learn both languages. There is no tool made that does it for you.
-
Slow query results for simple select statement on Exadata
I have a table with 30+ million rows in it which I'm trying to develop a cube around. When the cube processes (sql analysis), it queries back 10k rows every 6 seconds or so. I ran the same query SQL Analysis runs to grab the data in toad and exported results, and the timing is the same, 10k every 6 seconds or so. r
I ran an execution plan it returns just this:
Plan
SELECT STATEMENT ALL_ROWSCost: 136,019 Bytes: 4,954,594,096 Cardinality: 33,935,576
1 TABLE ACCESS STORAGE FULL TABLE DMSN.DS3R_FH_1XRTT_FA_LVL_KPI Cost: 136,019 Bytes: 4,954,594,096 Cardinality: 33,935,576 I'm not sure if there is a setting in oracle (new to the oracle environment) which can limit performance by connection or user, but if there is, what should I look for and how can I check it.
The Oracle version I'm using is 11.2.0.3.0 and the server is quite large as well (exadata platform). I'm curious because I've seen SQL Server return 100k rows ever 10 seconds before, I would assume an exadata system should return rows a lot quicker. How can I check where the bottle neck is?
Edited by: k1ng87 on Apr 24, 2013 7:58 AMk1ng87 wrote:
I've notice the same querying speed using Toad (export to CSV)That's not really a good way to test performance. Doing that through Toad, you are getting the database to read the data from it's disks (you don't have a choice in that) shifting bulk amounts of data over your network (that could be a considerable bottleneck) and then letting Toad format the data into CSV format (process the data adding a little bottleneck) and then write the data to another hard disk (more disk I/O = more bottleneck).
I don't know exedata but I imagine it doesn't quite incorporate all those bottlenecks.
and during cube processing via SQL Analysis. How can I check to see if its my network speed thats effecting it?Speak to your technical/networking team, who should be able to trace network activity/packets and see what's happening in that respect.
Is that even possible as our system resides off site, so the traffic is going through multiple networks.Ouch... yes, that could certainly be responsible.
I don't think its the network though because when I run both at the same time, they both are still querying at about 10k rows every 6 seconds.I don't think your performance measuring is accurate. What happens if you actually do the cube in exedata rather than using Toad or SQL Analysis (which I assume is on your client machine?) -
Retrieve floating point data with an sql select statement
Hi
I'm quite new to using sql but I have a system working where I can read and write strings to an access database.
Now I want to retrieve a a float, from a field where another field in the same post corresponds to a specified float, with a select statement.
When using strings I wrote
SELECT column_name FROM [table_name] WHERE column2_name='value'
in my query.
But instead of getting the desired value I get an error message telling me that I have a
"Data type mismatch in criteria expression".
I think I understand why but does anybody know what I should have written instead?Is the data type of column2_name String? If it's not, I think the single-quotes you have around 'value' will cause that error.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice -
Can someone help with this simple application
I am taking my first java class and there are limited resourses for the class as far as getting help with coding.
Any hoo if any one can point me in the correct direction from the following information listed below I would be greatfull. I am trying to use the set and get methods on the instance veriables and then I am goign to post the results once I get them workign to a JOption pane window.
examples are most welcome thanks
// Invoice.java
// Homework assignment 3.13
// Student Arthur Clark
public class Invoice // public class
String partNumber;// instance veriable quantity
String partDescription;// instance verialbe partDescription
//constructors
public void setpartNumber( String number, String description )
partNumber = number; //initalize quantity
partDescription = description; // initalize partDescription
}// end constructors
//method getpartNumber
public String getpartNumber()
return partNumber;
}//end method getpartNumber
public String getpartDescription()
return partDescription;
}// end method getpartDescription
public void displayMessage()
//this is the statement that calls getpartNumber
System.out.printf(" part number # \n%s!\n the description", getpartNumber(), getpartDescription() );
} // method displaMessage
}// end method main
// Fig. 3.14 InvoiceTest.java
// Careate and manipulate an account object
import java.util.Scanner;
import javax.swing.JOptionPane;//import JOptionPane
public class InvoiceTest{
// main method begins the exciution of the program
public static void main ( String args [] )
// create Scanner to obtain input from mommand window
Scanner input = new Scanner ( System.in );
// create a Invoice object and assig it to mymethod
Invoice myMethod = new Invoice();
Invoice myMethod2 = new Invoice();
// display inital value of partName, partDescriptoin
System.out.printf( "inital partname is %s\n\n", myMethod.getpartNumber() );
// prompt for and read part name, partDescription
System.out.println( "please enter the Part Number:" );
String theNumber = input.nextLine(); // read a line of text
myMethod.setpartNumber( theNumber ); // set the part name with in the parens
System.out.println();// outputs blank line
myMethod.displayMessage();
System.out.println( "please enter the Part Description" );
String theDescription = input.nextLine(); // read a line of text
myMethod2.setpartDescription( theDescription );// set the part description
System.out.println();// outputs blank line
myMethod2.displayMessage();
}// end main mehtod
}// end class//constructors
public void setpartNumber( String number, String description )
partNumber = number; //initalize quantity
partDescription = description; // initalize partDescription
}// end constructorsThe above code is not a constructor. You do not include a return type, void or anything else. Also, the constructor should be called the same as your class.
public Invoice( String number, String description )
partNumber = number;
partDescription = description;
} Another thing, comments should only be used when it isn't bleedingly obvious what your code is doing.
P.S. is your middle initial C?
Maybe you are looking for
-
My ipod shows up in my computer but is not recognized by itunes
I have an Ipod touch 5th generation and I seem to be having problems with it not being recognized in Itunes. When i connect my ipod to my computer it automatically opens my computer(file explorer) on Windows 8. But, when i open Itunes it does not re
-
Para entender todo o contexto, antes deem uma olhada na discussão abaixo. Production in specific plant O cenário da discussão anterior funcionou. Agora preciso saber se é possível configurarmos o material para se comportar da seguinte forma: Obs.: pa
-
Using lightning to SD Card Camera Reader with iPhone 6 plus
Using lightning to SD Card Camera Reader with iPhone 6 plus gives me the message that it is incompatible. Is that correct?
-
Preview doesn't open updated pdf on last viewed page
Hello. I use a program called LaTex to create pdf's which I view in the Preview app. Aesthetically I prefer Preview and don't want to change pdf viewers. However, after changing to Yosemite recently, whenever I make a change in my file and then recom
-
We still can't print an invoice of our Creative cloud. There's a failure in the system FOR 8 MONTHS NOW. Why can't this be solved ??????????