How to get the SQL if I get exception
I get this exception and do not know what was the actual sql with the variables of liaison who was executed.sqlmesg = error in the select query to retrieve the segment associated with a pair of cables: ORA-01006: there is no bind variable
y at - it a way to get the real sql executed so I know what mistake I did.
I thought your question was about how to view the SQL statement and bind variables in the exception. The answer to that is to put variables in the exception message.
The root cause of the problem seems to be that your dynamic SQL statement may require 3 or4 variable bind but your USING clause specifies always 4 values if the underlying SQL statement has 3 positions, it will lead to an error.
Justin
Tags: Database
Similar Questions
-
How to import the .sql file in oracle apex?
I am new to oracle apex...
How to import the .sql file in oracle apex?
I have to import a table in apex...
This script I have to write in the .sql file...
pls help...
Published by: 794244 on January 31, 2011 21:31Hi Manu
You can import and browse workshop SQL, SQL Scripts .sql files. If you have multiple SQL statements in your script, make sure that they are separated by the / character
Andy
-
How to format the sql format GET easily in sqlplus
Hello
I use TOAD to format my sql always (to help shift + ctrl + F). It's really frustrating because I have to format the sqls a lot all the time. I have recently joined a successful dba team and need to quickly understand the sqls.
A member of the forum can you please suggest me a way to do it quickly in sqlplus itself?
Thanks & take care,.
MalikaAnthony wrote:
But there are situations where I have to work on machines where I can't access the internet because of procedures/etc security problems, that's why I need to find a way to quickly put the sqls in sqlplus/unix itself.
SQL * Plus is not an editor does not support formatting of unformatted existing SQL code. It uses an external editor - and formatting you want to, must be a function or feature of the external editor. The Unix/Linux default editor is vi or vim. Emacs, kate and others can also be configured (using the EDITOR environment variable) for use with SQL * more.
Formatting manual is often a 'good' thing that it forces you to slow down and look at each line (when the manual formatting) in the code. So they identify issues and problems that could be missed when looking at already formatted code.
-
How to detect the SQL type to avoid SQL injection
Hello
I work in a company of gsm and we develop a program for analysis of trends. Users of this program can write SQL statements. I want to write sql statements specific as my program input statement (SELECT... from...). Instructions to SELECT most. I have dynamic SQL and PL/SQL blocks in my program. I get user-defined SQL statements and execute dynamic Sql code.
Here's the problem: I need to understant what type of SQL, they give as my program input parameter to avoid wrong operations (DELETE, TRUNCATE, DROP...)
First of all I thought to the RegExp to understant if a SELECT SQL or SQL DELETE...
Is there a recommended on this problem? Oracle has any procedure to detect?
Thank youHi a_yavuz,
We had to solve the same problem while we work a project that receives user sql statements, we check the sql as follows:
lb_bool: = regexp_like (upper (pv_sql),'^ (-() * *(SELECT|))) (WITH)');
-
How to run the SQL...
Hello
It's embarrassing... I've been around my old files post v2 migration SQL encoding problems... but now the statements will not work! In fact I don't get the run option in the spreadsheet at all. With this newly created net of such statements will run. The options at the top of the tab are grayed out. I tried to highlight the SQL, the F9 shortcut block, pull down menus, etc.. No luck.
Any comment appreciated... Please be kind :-)
AIt is something that they went out in 2.1 and there is now an enhancement request to add it to (see Re: 2.1EA2: dialog box connection select is no longer used if no connection).
theFurryOne
-
How to remove the sql statement in the output of the coil?
Hi gurus,
If my spool request is like that
I get my file csv as like this:set feedback off set verify off set trimspool on set heading off spool c:\test\test.csv select * FROM test; spool off
What should I change in my SQL query such that I won't include these lines:SELECT * FROM test1 SSO -------------------- shsrgh dehrerdh wtw55hd dhdfhdfh hdhdh SET SPOOL OFF;
Thank youSELECT * FROM test1 SSO -------------------- SET SPOOL OFF;
user10679113 wrote:
What should I change in my SQL query such that I won't include these lines:
SELECT * FROM test1 SSO -------------------- SET SPOOL OFF;
You cannot change anything in your SQL query to exclude these lines.
These lines refer to the client you are using i.e. SQL * more and have nothing to do with the SQL language as such.You could put all of these SQL * more commands in a script file and run this SQL script file *, as shown below:
test@ORA10G> test@ORA10G> -- show contents of the script: c:\test.sql test@ORA10G> host type c:\test.sql set feedback off set trimspool on set heading off set echo off spool c:\test.log select ename from emp; spool off set echo on set heading on set feedback on test@ORA10G> test@ORA10G> -- run the script test@ORA10G> @c:\test.sql SMITH ALLEN WARD JONES MARTIN BLAKE CLARK SCOTT KING TURNER ADAMS JAMES FORD MILLER test@ORA10G> set heading on test@ORA10G> set feedback on test@ORA10G> test@ORA10G> -- show contents of the spooled file: c:\test.log test@ORA10G> host type c:\test.log SMITH ALLEN WARD JONES MARTIN BLAKE CLARK SCOTT KING TURNER ADAMS JAMES FORD MILLER test@ORA10G>
HTH,
isotope -
How to execute the sql statement in the file beats?
I want to execute after the statement
C:\ > sqlplus/nolog
SQL > conn scott/tiger
SQL > select * from tab;
I know I can achieve it following test.bat and testdb.sql file
test.bat is:
sqlplus/nolog @testdb.sql
TestDB.SQL is:
Conn scott/tiger
Select * from tab;
Now I don't want to use the sql file, I want only use bat file, as follows:
test.bat is:
sqlplus/nolog
Conn scott/tiger
Select * from tab;
When I run test.bat, I find only one sqlplus /nolog execute statement, do not execute other statements.
(1) I want to know if there is a method to run the SQL file by fighting without a sql file? How to make it happen?
(2) if I call the sql file, how to hide the password of user? Because I don't want other people to know scott password, if I use conn scott/tiger in testdb.sql, other person can see testdb.sql and the password. Is there a good way to avoid?
Thank you!It works a bit different in Windows. Create a file is like this:
( echo conn scott/tiger@orcl echo spool c:\temp\list.txt echo select sysdate from dual; echo spool off echo exit ) | sqlplus -s -l /nolog
-
How to write the sql command in the batch file
Jin
I m using oracle 9i on windows. I want to know how I can write the sql on the command file command. I want to use a batch file to use the sql like shutdowm command & start command and any select command too.
so please tell how can I do?
thxsTried looking for what he superdba.
Can't connect to sqlplus using sys using a batch file
HTH
Aman... -
How to see the sql on the tables verified statements?
Hi all
I just check schema as the following comment run
AUDIT UPDATE TABLE DELETE TABLE INSERT TABLE BY user1, user2 BY ACCESS;
However, I could not find the SQL statements.
SELECT A.TIMESTAMP, A.* DE DBA_AUDIT_TRAIL A
OÙ
Username = ' USER1'
Also, this does not work, it shows empty
select sql_text from sys. aud$ où obj$ nom = « TAB_PROJELOG »
Oracle Database 11 g Release 11.2.0.4.0 - 64 bit Production
db
Redirect audit records to the database audit trail (the
SYS.AUD$
table), except for records that are always written in the track operating system audit. Use this setting for a general database for administration.If the database is started in read-only mode with
AUDIT_TRAIL
defined ondb
, then affects the Oracle database internallyAUDIT_TRAIL
toos
. Check the log of alerts for details.db, extended
Performs all the actions of
AUDIT_TRAIL
=db
and fulfills also the bind SQL and SQL CLOB type text columns of theSYS.AUD$
table, when it is available. These two columns are filled only when specified.If the database is started in read-only mode with
AUDIT_TRAIL
defined ondb, extended
, then affects the Oracle database internallyAUDIT_TRAIL
toos
. Check the log of alerts for details.
https://docs.Oracle.com/CD/E11882_01/server.112/e40402/initparams017.htm#REFRN10006
-
How to find the sql queries executed in one day with the sql and runtime text
Hi Experts,
Please tell me the sql query to find out the queries executed on a particular day and the runtime and the sql text of the query.
Please reply urgent.
Thanks in advance
Database instance 'A' may have run 100 SQL queries today. As for the instance of database 'B' could have exploited queries SQL 1 million today. Instance of database 'B' to 'keep' the 1 million SQL statements - in memory or on disk do you expect? Of course not. There the age or flush or invalidate memory SQL statements. He can't keep them on the disk (imagine running a completely different set of 1.2million SQL statements tomorrow and 1.3 the next day).
AWR and StatsPack can make counts the number of "n" top of the page ("n" default to 30) SQL statements which are still present in the cache of the library (not years, rinsed, invalidated) when a snapshot was taken. They can't declare "all" SQL statements.
To return to your needs. WHY do you need all the SQL statements? Or are there only certain operations specific SQL would you be interested? Could they have been treated by allowing audit (for example, UPDATE and DELETE with EXTENDED verification instructions)?
Hemant K Collette
-
How to extract the sql text with SID and SERIAL No.
Hello
I am new to oracle database and recently I started my journey in the optimization of the performance.
I need to retrieve the sql text that is triggered by the user in function were SID and SERIAL No.
Thanks in advance...
PrabhaSelect
a.SID,
a.Serial #.
b.sql_text
Of
session v$ a.
v$ sqlarea b
where
a.sql_address = b.Address
and
SID = 43; -
How to store the SQL in the oracle table?
I tried this way:
SQL > insert into sql_text values ('select invoice, invoice_dt, DT_INVOICED from PS_BI_HDR where DT_INVOICED = 21)
(Jan - 2010' and BILL_STATUS ='INV ");
Insert in sql_text values ('select invoice, invoice_dt, DT_INVOICED from PS_BI_HDR where DT_INVOICED = 21 - JAN-)
010' and BILL_STATUS ='INV ")
*
ERROR on line 1:
ORA-00917: lack of comma
Please help to solve, I can't use the concatenation (|)
coz
It is dynamic.'select invoice,invoice_dt,DT_INVOICED from PS_BI_HDR where DT_INVOICED= '21-JAN-2010' and BILL_STATUS='INV' '
user2060331 wrote:
No sql statement is a dynamic value inserted by a user to execute on the SQl prompt.Then use q-literals:
SQL> ACCEPT stmt PROMPT "Enter statement: " Enter statement: select invoice,invoice_dt,DT_INVOICED from PS_BI_HDR where DT_INVOICED= '21-JAN-2010' and BILL_STATUS='INV' SQL> insert into sql_text values('&stmt'); old 1: insert into sql_text values('&stmt') new 1: insert into sql_text values('select invoice,invoice_dt,DT_INVOICED from PS_BI_HDR where DT_INVOICED= '21-JAN-2010' and BILL_STATUS='INV'') insert into sql_text values('select invoice,invoice_dt,DT_INVOICED from PS_BI_HDR where DT_INVOICED= '21-JAN-2010' and BILL_STATUS='INV'') * ERROR at line 1: ORA-00917: missing comma SQL> insert into sql_text values(q'[&stmt]'); old 1: insert into sql_text values(q'[&stmt]') new 1: insert into sql_text values(q'[select invoice,invoice_dt,DT_INVOICED from PS_BI_HDR where DT_INVOICED= '21-JAN-2010' and BILL_STATUS='INV']') 1 row created. SQL>
SY.
-
How to write the Sql values in the Application Engine
I am trying to write dynamic sql statements in AE
E.g.
I have SQL n Action
DELETE
OF %Table(%BIND(RECNAME))
WHERE Bind (FIELDNAME) = % (AMIT_VALUE_TO_DEL) Bind %;
at runtime, it converts into
DELETE
OF PS_TABLE1
WHERE 'EMPLID '=' AJ23;
THE QUOTATION MARK SINGLE AROUND EMPLID IN WHERE CLAUSE CREATES PROBLEM BCZ, IT IS A COLUMN NAME, IS THERE A SOLUTION THIS?Add NOQUOTES to your % Bind(). For example, % (FIELDNAME, NOQUOTES) Bind.
I must warn you however. When generating dynamic SQL, make sure that you have absolute control over the input text used to generate the SQL statement. For example, make sure that you, not a user, determines the value of RECNAME and FIELDNAME. It is too easy to create a SQL Injection flaw in converting the values entered by the user in SQL statements.
-
How to monitor the sql commands?
Hello
Are there opportunities to control all the SQL commands (ddl, dml) run from all the tools of database (sqlplus, sqldeveloper, Toad, etc.)? Precisious more... Is there something like .bash_history in Linux operating system?
Best.Hello
Reference: http://www.juliandyke.com/Diagnostics/Trace/EnablingTrace.html
http://download.Oracle.com/docs/CD/B19306_01/server.102/b14211/SQLTrace.htm#PFGRF01010It's an additional reference.
http://download.Oracle.com/docs/CD/B10501_01/EM.920/a88748/otdv.htm-Pavan Kumar N
-
How to stop the Action method when an Exception occur in another method
Hi all
{} public void action (event clientEvent)
startAction();
JOptionPane.showMessageDialog (null, getDocumnetId());
}
How to stop the action of the method ("action"), if an exception occurs in the method ("startAction")
(if the exception to happen we didn't need to show the JOption Message)Hello
Try FacesContext.getCurrentInstance () .renderResponse ();
Frank
-
Hi, I tried to figure out how to extract data from my SQL Server databases and reading messages and to do some tests with examples, I can get data connection type in my SQL server, but so far nothing helps. Is it possible to get data from a SQL Server database without using the database connectivity Toolkit? and if so, how? are there whitepapers and/or examples of this? So far, I can't find something that works. Thank you.
Jesse - what is your reason for not using the database connectivity Toolkit? It is by far the best way to recover the data.
Maybe you are looking for
-
Connect the Tecra M11 to high fidelity
I have a Tecra M11 which I want to connect to my onkyo AV 7:2 receiver so that I can listen to music through my stereo and watch movies on my TV.The amplifier has a range of input - RCA, hdmi, vga ports, digital coaxial and optical jacks. What happen
-
Impossible to send e-mails through Hotmail to Outlook Express
Original title: "Email from outlook Express 6, do not know how? I have an outlook Express 6 to send emails from, but don't understand how to use the thing. And used my email via hotmail, until last night when I finally got a call saying that Hotmail
-
Microsoft says find & rename "folders.dbx". Search "folders.dbx" on C, D & F drives hard but nothing turned up. What now?
-
Windows Defender Software Explorer
I had performance problems and has been advised by the community to use Windows Defender to determine what was running on my computer. In the Windows Defender Software Explorer, I currently have five Windows Internet Explorer running. All versions
-
For AP in FlexConnect CLI commands
Hello world Just as the title says, as much as I Googled it I can't seem to find what are the CLI for AP in FlexConnect commands I know that we can telnet/ssh to the AP in flexConnect, but what are the possible commands that we run on the AP?Hope som