Update SQL queries through a browser
Hi
I am trying to develop the functionality for a user to modify
a query through a browser. bacically i have the query SELECT * FROM
tbProjMonth WHERE ID= "%VALUE%. I want the user to be able change
the WHERE value, without loading the page up in dreamweaver. the
VALUE has to be stored until the user wants to change the ID VALUE
again.
hope im making sense.
do anyone know any ideas on how to do this??
thanks for your help.
kamesh
This is a security headache, just waiting for a hacker to do
sql injection. If you don't know what that is, check out
http://www.unixwiz.net/techtips/sql-injection.html
for nice tutorial.
Similar Messages
-
How to execute sql-queries through shell scripting in linux?
How to execute sql-queries through shell scripting in linux?
http://www.oracle.com/technology/pub/articles/saternos_scripting.html
Two simple examples:
#!/usr/bin/env bash
set_orafra () {
orafra=`echo 'set heading off
select name from v$recovery_file_dest;
exit' | sqlplus -s / as sysdba`
set_orafra
echo $orafra
#!/usr/bin/env bash
export ORACLE_SID=instance_name
export ORACLE_HOME=/path_to_oracle_home_directory
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=/$ORACLE_HOME/bin/$PATH
$ORACLE_HOME/bin/sqlplus -s <<EOF
connect scott/tiger@my_instance_name
INSERT INTO table VALUES (sysdate);
exit
EOFEdited by: Markus Waldorf on Sep 17, 2010 12:19 AM -
Running SQL queries through Xpress code
Hi,
Please give an idea to run the sql select, update queries through Xpress code.
The code may be there in workflows or rulelibs...
Any ideas are appreciated
Thanks,
SantoshanandThere is a set of JDBC methods in the class com.waveset.util.JdbcUtil which certainly allows for selects to take place.
check out the javadocs from the BFE especially the queryList and queryRecords methods.
I guess the sql method could be used to run any sort of sql statement you like if you want to modify the database.
From XPress these methods are invoked
e.g.
<invoke name='queryList' class='com.waveset.util.JdbcUtil'>
</invoke> -
IPhoto library not updated when viewing through web browser, why?
I post a lot of pics to my blog on Tumblr. When I do I go to Tumblr, choose "Photo" and it brings up the screen with the options. I click the universal "browse" button and it brings up the finder. I click on the "Photos" icon under the "Media" section and it brings up my iPhoto library. The problem is it will be missing the newest photos I've imported. I could have imported photos days earlier or just a few minutes ago they just aren't there to choose.
Of course on some days they are available and I can't figure out where the disconnect is. Anyone have a clue? This is not tied to any particular browser either, I've tried them all. I feel like the meta data file iPhoto keeps (is it an xml file or something?) is not being updated? I have no idea. Any help is appreciated. TIA!Have you tried clearing your browser's cache? I find that sometimes (particularly with Safari) it is inclined to retrieve old pages from its cache rather than from the web.
-
SQL Drill-through Password Update
Hello! Is it possible to use a script to update the password defined for the SQL Drill-Through? Our security policy does not allow the use of graphical user inteface at the production environment (Integration Services Console)... And we have to change the passwords monthly...<BR>Thank you!
You can have a "drill thru" defined to give you a view of lower level data that is not stored in your essbase cube.<BR><BR>For example you may store only employee numbers in your essase cube, but from time to time you may need to know all details of an employee. You would setup a drill-thru using employee number to hit an SQL database and find all details for that employee (using the emplyee number).<BR><BR>Its basically just a method of showing very low level data which would not be stored in a cube.<BR><BR>You can define the drill through's using EIS.
-
SQL Queries in Code V/s Stored Procedures
Hi Friend,
Can any one of you guide me with following..
What is faster ? using SQL Queries in Java code or using Stored Procedures which are called from code?
I understnd Stroed Procedures are faster and definitely it provides more maintainability.
If any one can give me any links or resources which outlines pros and cons of using Stored Proc and SQL Queries embedded in Java than it would be a great help..
If there are any articles which proves either of the above is a preferred way, that would also help..
Appreciate the effort in advance !!
Thanks
GurudattWell one benefit of Stored Procs is that you "compile" it on the database whereas you might build your query on the fly in java... test coverage is important in order not to have such things as a typo in a column name....
Still, if you change a table, you have to go through all the procedures in SQL and likely to do so in some of your business object... and trust me, that can be hell!
It all depends on the use of the app...
From my experience, Stored procedure are much faster than built-on-the-fly SQL (and quite faster than prepared statements depending on the JDBC driver, the re-use of connections etc...)....
IMHO, you'd probably be wise to start of with prepared statements, and when the schema seems stable enough (ie unlikely to change), look for the slower queries and convert them to stroed procedures.
If you don't have to support several databases and are tight on performance, you can even include some logic in your stored procedure (e.g. update several tables, based on various selects...etc...). The language is usually quite powerful, and that can save you the run-time of selecting, converting to object , process and update (i.e. several roud-trip between DB and app)...
Tshcuss!
Chris -
Tried sheet to go xls, even through air browser, it just says loading, and never opens. The file works fine on my laptop. Am I doing something wrong?
Here is a link where I'm attempting to use the excel files from.
http://residential.climatemaster.com/dealers_area/tools.html
At the bottom of the left hand column there is a few xls. files. I'm attempting to use the pressure drop calculator and sales proposal.
Please let me know if there is a way to use these on my Playbook.
ThanksSlaes proposal opened for me. The pressure drop one did not open on playbook but did open on my torch 9860
Hope Tuesdays update will allow it to he open.
Click here to Backup the data on your BlackBerry Device! It's important, and FREE!
Click "Accept as Solution" if your problem is solved. To give thanks, click thumbs up
Click to search the Knowledge Base at BTSC and click to Read The Fabulous Manuals
BESAdmin's, please make a signature with your BES environment info.
SIM Free BlackBerry Unlocking FAQ
Follow me on Twitter @knottyrope
Want to thank me? Buy my KnottyRope App here
BES 12 and BES 5.0.4 with Exchange 2010 and SQL 2012 Hyper V -
Unable to update SQL Server thru XI using JDBC Adapter
Hi,
I am trying to update SQL Server. When I run the scenario I get Success status in sxmb_moni, But when I see in SQL server nothing is getting updated. Can anybody let me know where I may be doing wrong?
Thanks In Advance.
Yaseen.Hi Yaseen,
Just go through this link, to see how to install the JDBC drivers,
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10
Regards,
Bhavesh -
Error while running the sql queries in unix as cron job..
Hi,
I've configured some sql queries to run as cronjob from unix,i'm able to excute all the sql queries with out any error,after all the queries are executed,I'm getting the following error message.
ORA-00600: internal error code, arguments: [4080], [1], [131], [], [], [], [],
Could any one advise me why this error is being thrown?
How to avoid this error?
Thanks,
AnilAre you running these queries through TopLink?
If so, the error seems to be occurring on the database, when the query is being executed.
I have never seen that error before. Performing some websearches it seems to be a general database error, potentially something to do with synchronization. Sorry I can't be of more help, perhaps the database forum can provide more insight... -
SQL Developer 1.2.1 Build MAIN 32.13 (Windows XP)
We can't Update SQL Developer with Times Ten in-Memory DB Extension 1.2.1.1.0 :-((
We did the same actions as described in tutorial
http://www.oracle.com/technology/products/timesten/viewlets/tt703_sqldev_install_ext_viewlet_swf.html
In addition to tutorial we have "Log In" window
"To download Oracle Times Ten in-Memory Database Extension
you must enter your Oracle Web Account user name and password"
This window was not displayed in tutorial...
We try to use three our OTN accounts and the result
was the same - we was asked with "User name" and "Password"
again, again, again and again,,, :-(
Is it a bug or a feature?
Mayby we didn't understand something or did something wrong?Hi Simon,
I found cause of update failure! It was the HTTP proxy setting.
I turned off "Use HTTP proxy server" checkbox in SQL Developer -> Tools -> Preferences -> Web Browser and Proxy.
After this action SQL Developer was successfully updated with Times Ten Extension.
Valery Yourinsky -
Named SQL queries without a descriptor in the workbench
Hi,
I want to call some named query SQLs from my DAO by using
result = (ResultSet)Session. executeQuery(String queryName, Vector paramList);
The way I have done it now in the mapping workbench I have defined all named queries and SQL with a class descriptor, even though that class doean't have any mappings. I couldn't find any other way of defining named query SQLs in mapping workbench, other than attaching to a class descriptor. But I think because I'm using this API of calling executeQuery instead of getting the domain class too..I'm running into the following exception -
Exception [TOPLINK-6026] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.QueryException
Exception Description: Query named [FIND_MUTUAL_FUND_SINGLE_SYMBOL] is not defined. Domain class: []
at oracle.toplink.exceptions.QueryException.queryNotDefined(QueryException.java:587)
at oracle.toplink.exceptions.QueryException.queryNotDefined(QueryException.java:580)
at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1020)
What is the proper way of defining a named query with our a descriptor in the workbench, so that I can use above mentioned API from my DAO? Any where in the doc? Is it Session events?
Any sort of sample example would be deeply appreciated.To execute a named query for a paticular class/descriptor you need to call the Session.executeQuery(String queryName, Class descriptorClass, ...) API. The API that does not take a class is only for session-level named queries.
i.e.
List employees = (List) session.executeQuery("findAll", Employee.class);
Currently the Mapping Workbench does not support defining session-level queries, so if you wish to define queries not related to any descriptor, you need to define these through code (if you are using a sessions.xml to define your session, you can add the queries through a SessionCustomizer (10.1.3), or use a SessionEventListener and the preLogin event (9.0.4)).
You can execute named queries on any Session class (ClientSession, UnitOfWork, DatabaseSession, SessionBroker). But you need to define the queries in the ServerSession or DatabaseSession before login.
i.e.
ReadAllQuery query = new ReadAllQuery(Employee.class);
serverSession.addQuery("findAllEmployees", query);
List employees = (List) clientSession.executeQuery("findAllEmployees"); -
Updating Oracle BLOBs through Tomcat's DBCP
Hi, I've been using Tomcat's DBCP and I'm trying to cast my ResultSet to an OracleResultSet so I can use the getBLOB message. I've searched and realized I had to take part of it out of the wrapper, so I got the connection out of the wrapper using:
con = ds.getConnection().getMetaData().getConnection();which returned an OracleConnection. However, when I work through the rest of the code, it finally gets to:
BLOB filedata = ((OracleResultSet)oRS).getBLOB("filedata");and it dies with:
java.lang.ClassCastException: oracle.jdbc.driver.OracleResultSetImplIf I connect using JDBC without the DBCP datasource, this code works fine. I'm not sure why I can't cast it to something I can use. Can anyone provide some insight on this? I've searched and searched for solutions and tried so many things, but nothing has worked so far aside from just connecting using JDBC.
The ResultSet is not a DelegatingResultSet, which had tripped me up originally. Once I removed the wrapper from the connection, it seemed to give me all the correct types (OracleConnection, OracleStatement, & OracleResultSetImpl), but I can't seem to use the OracleResultSetImpl.
Here's my method:
public static int store(InputStream in) throws SQLException,IOException {
Connection con = null;
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/develop");
con = ds.getConnection().getMetaData().getConnection();
int id = 17;
String sql = "SELECT file_id,filedata FROM super_files WHERE file_id = "+id+" for update";
//sql = "SELECT file_id FROM super_files";
Statement stmt2 = con.createStatement();
System.out.println("stmt2 class: "+stmt2.getClass());
ResultSet oRS = stmt2.executeQuery(sql);
int key = 0;
if (oRS.next()) {
/* this next line is where it dies */
BLOB fileData = ((OracleResultSet)oRS).getBLOB("filedata");
int bufferSize = fileData.getBufferSize();
byte buffer[] = new byte[bufferSize];
OutputStream os = fileData.getBinaryOutputStream();
int bytesRead = 0;
while ((bytesRead = in.read(buffer)) != -1) {
os.write(buffer, 0, bytesRead);
in.close();
os.close();
oRS.close();
stmt2.close();
con.commit();
return key;
}Hi, I am having the same problem. Were you able to resolve it? Please let me know. I have searched thru the entire WWW but coulnd't find the solution.
-
[DW 8.02 + PHP] how to use variables in advanced SQL queries
Hi all,
I can't find a way to use variables in an SQL query after
updating
dreamweaver 8.02.
I always get error messages that says: 'missing variable
type:myvariablename', undefined#myvariablename... and so on.
What is the correct way to use variables?
I usually set a variable in a PHP statement (example: <?
$today=date('Y-m-d'); ?>)
and then I compare this variable in the SQL query.
What is the correct syntax for variable in DW 8.02 in
advanced SQL
queries?
TIA
tonysweetman wrote:
> I'm editing a website created with DW 8.01 and MX
Kollection.
>
> I updated DW to 8.02 and now I can't edit an existing
SQL query.
> I always get an error message 'Missing variable type'
and I can't go
> on.
InterAKT released a new version of Kollection to cope with
the 8.0.2
changes. AFAIK, you should be able to download the updated
version from
your InterAKT account area.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Using Bex query through Query Browser - add result set to Cell range?
Hi all,
I have up to now used Xcelsius on NW with BICS connection towards BEx queries.
When I use this connection via Data Manager in Xcelsius, I'm able to use the Cross-table functionality to insert my entire dataset into a cell Range.
But now I have an requirement to save my Dashboards on the BO server, so I need to go through Query Browser to extract data from SAP BW to my Dashboard.
When inserting the query in the Query browser and I want to assign the data to Excel ranges, it seems like I need to do this for each individual Infoobject and Key Figure. Since I have many Key Figures (30-50), this is a lenghty process.
Is there a way to insert the entire dataset from Query into a cell range (both rows and columns), or do I need to do this for each Key Figure as indicated in the screen shot above?
--> I know that the Query Browser flattens my cross-table from the Query, but still, it should be possible to avoid to input all my Key Figures (30-50) individually to corresponding cells in my Excel part of the Dashboard.
regards
Oddmar Lid
asdfasfHi Oddmar,
If you want to display the data retrieved from the query you could map the data using the Query data.
Pull scorecard component (for example) and in properties if you see the Display data click on the dropdown and select Query data.
Hope this helps ! -
Unable to update SQL Developer 4.0 EA1 to EA2
Hi All
Could any one please help me in updating SQL Developer 4.0 EA1 to EA2 using a Local File installation... I have a proxy which is blocking me from updating my SQL Developer..
I would appreciate if any once could share any link which contains a patch to upgrate to EA2 from EA1
Thanks
Regards
AvinashHi Avinash,
as it is mentioned in the official release notes page (Oracle SQL Developer 4.0 Early Adopter Release Notes):
The Check for Updates option to upgrade between releases of SQL Developer is not supported. This utility is provided to install third party extensions, this includes the third party drivers required for migrations and to add additional version control extensions.
All new releases of SQL Developer require a full installation. Download and unzip the file into an empty folder. Ensure the "Use folder names" checkbox is checked when unzipping the file.
Migrating from Previous Releases
After you have installed the product you are asked if you want to migrate from a previous release. This migrates previously set preferences and connections created: By default the Confirm Import Preferences dialog that is displayed selects the latest installation. Select Yes to migrate the settings from that release or click the Show All Installations button to browse to an earlier installation..."
Hope it helps,
Paolo
Maybe you are looking for
-
Spinning Circle interrupts all activities for 2 to 5 seconds
Fixed preferences. No nchange OS X 10.7.4 (11E53), MBP early 2008, 2.4 MHz Intel Core Duo, 4GB 667, 500G HD, 163G free. FFOX 10.0.1, Safari 5.1.7,SOPHOS 7.3.12C Getting worse. THanks, Carl
-
Hi all my macbook hd died and i had to reinstall everything and now i can't connect my iphone to my mac when i load itunes i can't find how to add my phone, can someone help please, so i can update my apps and other things
-
Hi I am pretty comfortable making a Swing GUI...but i was told today by my mentor that he wants the data ( that user puts in Text fields and etc) to be sent to a c program. so JAVA GUI is just there for the user...all the back ground work is done by
-
10.5.6 and DiskWarrior
Hi all, Does anyone know if there is a version of DiskWarrior out that works with OS 10.5.6? I tried someone's version 4.1 and my MacPro won't boot from that disk. I notice on versiontracker that there is a version 4.1.1. Anyone tried it? Thanks. Den
-
I have installed OS X Lion and noticed 2 issues with Quicktime. 1) If I quit Quicktime with cmd+q, the next time I open Quicktime my previous video is loaded again together with the new opened video. Only clicking the close button will prevent the vi