Error while running Sqlplus from shell
I am trying to run below shell script with ticks('${ORACLE_HOME}/bin/sqlplus) rear the code below when calling sqlplus. When I do it all the next lines after changing red to vi and when I run the script, I get an error like "syntax error: unexpected end of file". may I ask you, please, I know what could be the problem? I suspect that it is perhaps because of EOF, when I have the backticks on it runs very well.#!/bin/bash
logit "Updating the Validation Status Field in ${DBSTGUSER}.FEED_PROCESS_LOG Table as RUNNING With Matching Parameters"
logit "UNINUM :: ${UNINUM} PROVIDER :: ${PROVIDER} EXTRACT_DT :: ${EXTRACT_DT} VER_NUM :: ${VER_NUM}"
`${ORACLE_HOME}/bin/sqlplus ${DBSTGUSER}/${DBSTGPASS}@${DBSRC} <<EOF > ${UPD_FEED_PROC_LOG}
spool ${UPD_SQL1}
UPDATE ${DBSTGUSER}.FEED_PROCESS_LOG SET VALIDATION_STATUS='RUNNING'
WHERE UNINUM='${UNINUM}' and PROVIDER='${PROVIDER}' and EXTRACT_DT='${EXTRACT_DT}'
and VER_NUM=${VER_NUM} and ACT_END_DT IS NULL AND (VALIDATION_STATUS IS NULL OR VALIDATION_STATUS='RUNNING');
spool off;
COMMIT;
EXIT;
EOF`
if grep -q "ERROR" ${UPD_FEED_PROC_LOG}
then
logit "Error While Updating the ${DBSTGUSER}.FEED_PROCESS_LOG Table"
logit "Please Check ${UPD_FEED_PROC_LOG} Log File For Detailed Information"
exit 3
else
logit "Updation Of ${DBSTGUSER}.FEED_PROCESS_LOG Table Completed Successfully"
logit "Please Check ${UPD_FEED_PROC_LOG} Log File For Detailed Information"
fi
Ariean wrote:
I thought that the forum will be people with mixed skills (sql/script) they would be able to quickly direct me towards the right direction. There is no problem, it is with the RDBMS.
I know that EOF is synonymous with end of file and I am piping the data in the program (sqlplus).
You could also just use 'FUBAR' instead of folklore; who is be an arbitrary string of characters.
piping ("" | "") is NOT involved, as in the env. Sorting
you don't know, what you don't know.
Tags: Database
Similar Questions
-
I had an ESXi 4 update 1 host, I used the Update Manager to upgrade to 4.1. To join the cluster, I get a red mark and the host State
"HA agent on contains an error: error when running script control of health."
Two hosts in a separate cluster do not have the same question.
So far, I have
Reconfigured HA
HA HA/Enabled disabled for the cluster
Restart management agents
Server restarts
Put the server on another cluster
.. .the all result in the same error.
Any ideas?
I am also trying to solve this problem, and although I have not found a solution, I started to create an article documenting what I found regarding this error. I think I'm very close to a solution.
UPDATE: I found the solution! Read the article below:
(Solved) VMware HA fails after upgrade to ESXi 4.1
http://www.paulscomputerservice.com/articles/article.php?id=183
-
Getting error while inserting data from source to the target in the procedures?
Hello
I want to insert the data from the source to the target in the procedures, have the same schema.
For this, I did as follows
Command on the source:
Technologies: oracle
Schema: EDWHCMB
Command:
SELECT COMPANY_NAME, COMPANY_CODE OF
EDWHCMB. DWT_COMAPNY
Command on the target:
Technologies: oracle
Schema: EDWHCMB
command:
INSERT INTO EDWHCMB. TEMP
VALUES)
COMPANY_CODE,
COMPANY_NAME)
I have run the procudere then I got error as follows
ODI-1228: SAMPLE1 (procedure) task fails on ORACLE EDWH connection target.
Caused by: java.sql.BatchUpdateException: ORA-00984: column not allowed here.
How to insert the data from the source to the target in the proceedings?
Please send any document to this...
Please help me.
Thanks in advance,
A.Kavya.
Hi Bruno.
If your tables are on the same schema then why do you use command on the source and the command on the target? You can simply do the following on the command on the target
INSERT INTO EDWHCMB. TEMP
SELECT COMPANY_NAME, COMPANY_CODE OF
EDWHCMB. DWT_COMAPNY
If you really want at all to use the command on the source and target both then I think you need to change the following code on your order on the target
INSERT INTO EDWHCMB. TEMP
VALUES)
: COMPANY_CODE,.
(: COMPANY_NAME)
Hope your TEMP table has only these 2 columns.
Thank you
Ajay
-
Hello
I use windows 7 Professional (service pack 1) 64 bit operating system.
After installation by running the file odi_121200.jar of odi 12 c (Enterprise edition), I get the following error when you attempt to run the ua.bat file.
[2013 10-24 T 16: 49:07.861 + 05:30] (Framework) [INCIDENT_ERROR] [UPGAST-00056] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] error of initialization of the plugin update for ODI. ODI1
[2013 10-24 T 16: 49:07.861 + 05:30] (Framework) [INCIDENT_ERROR] [] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] Cause: an unexpected error has occurred a upgrade plug-in initialization.
[2013 10-24 T 16: 49:07.861 + 05:30] (Framework) [INCIDENT_ERROR] [] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] Action: Contact Oracle Support Services. See the secondary error for more details.
[2013 10-24 T 16: 49:07.861 + 05:30] (Framework) [INCIDENT_ERROR] [] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] []
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at oracle.ias.update.plugin.Plugin.instantiatePlugin(Plugin.java:248)
to oracle.ias.update.plugin.Plugin. < init > (Plugin.java:229)
at oracle.ias.update.plugin.Plugin.getPlugin(Plugin.java:180)
at oracle.ias.update.plan.PlanStep.getPlugin(PlanStep.java:335)
to oracle.ias.update.plan.PlanString. < init > (PlanString.java:66)
to oracle.ias.update.plan.PlanCustom. < init > (PlanCustom.java:74)
to oracle.ias.update.plan.PlanStep. < init > (PlanStep.java:189)
to oracle.ias.update.plan.PlanComponent. < init > (PlanComponent.java:203)
at oracle.ias.update.plan.Template.load(Template.java:161)
at oracle.ias.update.plan.Template.loadAllTemplates(Template.java:102)
at oracle.ias.update.UpgradeDriver.loadConfiguration(UpgradeDriver.java:838)
at oracle.ias.update.UpgradeDriver.main(UpgradeDriver.java:257)
at oracle.ias.update.UpgradeDriver.main(UpgradeDriver.java:175)
Caused by: java.util.MissingResourceException: can't find oracle.ias.update.plugin.odi.bundle.ODIResourceBundle bundle
at java.util.logging.Logger.setupResourceInfo(Logger.java:1518)
to java.util.logging.Logger. < init > (Logger.java:265)
to java.util.logging.Logger. < init > (Logger.java:260)
to oracle.ias.update.UpgradeLogger. < init > (UpgradeLogger.java:60)
at oracle.ias.update.UpgradeLogger.getLogger(UpgradeLogger.java:93)
at oracle.ias.update.LoggingManager.create(LoggingManager.java:249)
at oracle.ias.update.plugin.UpgradePlugin.createPluginLogger(UpgradePlugin.java:195)
to oracle.ias.update.plugin.UpgradePlugin. < init > (UpgradePlugin.java:181)
to oracle.ias.update.plugin.odi.ODIPlugin. < init > (ODIPlugin.java:136)
... more than 17
]]
[2013 10-24 T 16: 49:07.869 + 05:30] (Framework) [ERROR] [UPGAST-00259] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] method getInitialValue for plugin ODI. ODI1 will not be called because of a previous error.
[2013 10-24 T 16: 49:07.869 + 05:30] (Framework) [ERROR] [] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] Cause: an error occurred when loading or initializing the plugin that prevents the getInitialValue of execution method.
[2013 10-24 T 16: 49:07.869 + 05:30] (Framework) [ERROR] [] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] Action: review the log file for more details.
[2013 10-24 T 16: 49:07.870 + 05:30] (Framework) [INCIDENT_ERROR] [] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] UPGAST-00251: an error occurred reading file descriptor to upgrade ODI\INSTALLATION\odi12cInstallation_1\odi\plugins\upgrade\odi.xml
[2013 10-24 T 16: 49:07.870 + 05:30] (Framework) [INCIDENT_ERROR] [] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] file is not consistent with the expected syntax.
[2013 10-24 T 16: 49:07.870 + 05:30] (Framework) [INCIDENT_ERROR] [] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] see the secondary message for more information. Contact the Oracle Support.
[2013 10-24 T 16: 49:07.871 + 05:30] (Framework) [INCIDENT_ERROR] [] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] UPGAST-00259: method getInitialValue for plugin ODI. ODI1 will not be called because of a previous error.
[2013 10-24 T 16: 49:07.871 + 05:30] (Framework) [INCIDENT_ERROR] [] [update. Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] []
oracle.ias.update.exception.UpgradeException: UPGAST-00259: method getInitialValue for plugin ODI. ODI1 will not be called because of a previous error.
at oracle.ias.update.plugin.Plugin.getInitialValue(Plugin.java:317)
to oracle.ias.update.plan.PlanString. < init > (PlanString.java:67)
to oracle.ias.update.plan.PlanCustom. < init > (PlanCustom.java:74)
to oracle.ias.update.plan.PlanStep. < init > (PlanStep.java:189)
to oracle.ias.update.plan.PlanComponent. < init > (PlanComponent.java:203)
at oracle.ias.update.plan.Template.load(Template.java:161)
at oracle.ias.update.plan.Template.loadAllTemplates(Template.java:102)
at oracle.ias.update.UpgradeDriver.loadConfiguration(UpgradeDriver.java:838)
at oracle.ias.update.UpgradeDriver.main(UpgradeDriver.java:257)
at oracle.ias.update.UpgradeDriver.main(UpgradeDriver.java:175)
]]
Thanks and greetings
Sunil
OK - I think I did. Seems to be a known issue. You must apply the hotfix p17073913_121200.
Which I downloaded and applied to my version of Linux - then re-directed to the AU. This time the GUI started and now I'm going through the upgrade steps.
The patch is generic, so should work for your windows environment. Good luck.
-
How to run sqlplus from the server
Hello
I have 11g installed on a Linux server by someone.
Could you please help me know...
-How to create a development in there environment?
-How to start SQLPlus not my local machine, but directly by the server?
-How to run any .sql decompressed in the server files?
For your information, I don't know anything on the server and database.
Thank you
GuyLink: Apex 3.1.1 installation / upgrade can help you.
-
Im trying to install Win7 on a new generation of PCs. I have created a bootable USB key as I have no optical drive but when I get to the Setup screen, I get an error saying "needs CD/DVD device driver is missing... »
-I'm using the USB 2.0 ports (not 3.0) and I tried to a switch port to others as some nets has suggested, but that has not worked. (Ref my Mo is a MSI Z170I)
-Ive also confirmed that my BIOS is set to AHCI (non-RAID)
Any ideas of what I could try to fix this or what Im missing drivers?
Also, when I try to review for the drivers I see only a X: drive that does not have the same directories as on my USB key. For example, I downloaded the drivers SATA of MSI and copied on USB to see if that helps. But when I try to search for it I can not even find the files. Does this mean that my USB is not detected?
Thank you
See if that helps the z170 and Skylake use xhci instead of ahci, so you will need a creative tool special iso usb.
https://Forum-en.msi.com/index.php?topic=261560.0
If you do not have a win - 7 iso file you can use Chrome and this to get a
Link was considered as inappropriate by the moderators: p
See also this for a painless as possible install
-
Hello
I have lightroom 5 on PC.
I read it has encountered an error while reading excerpts from the story of cache and must leave the preview.
I have put off several times my computer and try to open several times lightroom but not success.
Thank you
Delete the folder named child Previews.LRDATA shooting. Do not remove anything else.
There is a button to translate each message, you can use it to translate into French.
-
Original title: The system has recovered from a serious error-
The system has recovered from a serious error-
When you work in windows xp home edition, whenever this programe message and stop running and some auto restart machine.
What is the solution for this?
Hi Sandeep,
Thanks for posting your question in the Microsoft Community forum.It seems that you have a problem with the error message "the system has recovered from a serious error," while working on the computer, and the computer restarts automatically.I imagine the inconvenience that you are experiencing. We are here to help and guide you in the right direction.I may need a few more details to better understand the issue.Method 1: I suggest following the steps listed in the article and check if it works.Error message: the system has recovered from a serious problemMethod 2:
I suggest you analyze your computer by using the Microsoft Security Scanner, which would help us to get rid of viruses, spyware and other malicious software.The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software.Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.Important: During the scan of the hard drive if bad sectors are found, the scanner tries to repair this sector, all available on which data may be lost.You can see the article for more information:A "System has recovered from a serious error" message after every restart.Get back to us and let us know the State of the question, I'll be happy to help you. We, at tender Microsoft to excellence.
-
Misdiagnosis: an unexpected error occurred while running the test.
Hello
We get an error when running the diagnostics of the application.
An unexpected error occurred while running the test. Please change in developer mode to diagnose the problem.
When checked the logfile oam... find the error...
[7:46:6:50, 23/10/12] ORA-01653: unable to extend the JTF table. 16 in the APPS_TS_TX_DATA tablespace JTF_DIAGNOSTIC_LOG
[7:46:6:50, 23/10/12] Error occurred: Possible reason could be the problem of database
[7:46:8:807, 10/23/12] oracle.apps.fnd.oam.servlet.ui.util.ICXSessionUtil:... Free WebAppContext. Success! 87001be8b7e98498707a33c28164a8430f84d19173d5fe690c23a04167fb07a7
[7:46:9:100, 10/23/12] - 2c48bb90:13a885214b3:-7fef
[7:46:13:825, 10/23/12] oracle.apps.izu.general.diag.RDAACT.runTest (oracle.apps.fnd.oam.diagnostics.exec.ExecutionContext)
[7:46:13:826, 10/23/12] oracle.apps.izu.general.diag.RDAACT.runTest (oracle.apps.fnd.oam.diagnostics.exec.ExecutionContext)
[7:46:16:45, 10/23/12] - 2c48bb90:13a885214b3:-7fef
[7:46:18:761, 10/23/12] oracle.apps.izu.general.diag.RDAACT.runTest (oracle.apps.fnd.oam.diagnostics.exec.ExecutionContext)
[7:46:18:762, 10/23/12] oracle.apps.izu.general.diag.RDAACT.runTest (oracle.apps.fnd.oam.diagnostics.exec.ExecutionContext)
[7:46:18:762, 10/23/12] oracle.apps.izu.general.diag.RDAACT.runTest (oracle.apps.fnd.oam.diagnostics.exec.ExecutionContext)
Please advise...
Kind regards
Fahim.ORA-01653: unable to extend the JTF table. 16 in the APPS_TS_TX_DATA tablespace JTF_DIAGNOSTIC_LOG
Seems like tablespace APPS_TS_TX_DATA is saturated, you need to add space.
Use script below about the space available in each data file:-
Select substr(df.tablespace_name,1,45) table_space,
Sum (FS.bytes) free,
substr(DF.file_name,45) Name_of_File.
DF.bytes,
substr (DF. Status, 1, 5) stat
from dba_data_files df, dba_free_space fs
where df.tablespace_name = "APPS_TS_TX_DATA."
Group of substr (df.tablespace_name, 1, 45),
substr (DF.file_name, 1, 45),
DF.bytes, substr (DF. Status, 1, 5);ALTER DATABASE DATAFILE '
' RESIZE 3000 M; - increase the size according to your need and availablitiy. Thank you
JD -
Windows vista sys. error message says need to adobe flash player 9.0 or later. I have this already. cannot run videos from internet
Hello
This can help you:
Download and run the Flash Player Uninstaller, as Flash can get damaged.
http://helpx.Adobe.com/Flash-Player/KB/uninstall-Flash-Player-Windows.html
Then download and install Flash Player; After unchecking installing Chrome and Google toolbar option:
http://get.Adobe.com/flashplayer/?promoid=BUIGP
If the problem persists, you may want to ask in the Forums of community Flash Player:
http://forums.Adobe.com/community/flashplayer
See you soon.
-
Good,
Let me explain the whole scenario...
-Installation 11.2.0.3.0 RAC on RHEL 6.5
-Silent Install (GI 4 RAC nodes)
-Every success, except resolve.conf (that we do not use DNS to resolve the scan) prerequisites in the scene runcluvfy.sh - pre...
-Installation launched, remote operations successful, root.sh script prompted and DAMN... gave below error
= o/p of the root.sh on screen script =.
User ignored the prerequisites during installation
/U01/app/11.2.0/grid/bin/sqlplus - V... has no rc = 127 with message:
/U01/app/11.2.0/grid/bin/sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: no such file or directory
Cannot add (property/value): ('VERSION / ") for the control point: ROOTCRS_STACK. Error code is 256
/U01/app/11.2.0/grid/bin/ocrconfig.bin: symbol lookup error: /u01/app/11.2.0/grid/lib/libclntsh.so.11.1: undefined symbol: nnfyboot
Cannot create or upgrade OLR
/U01/app/11.2.0/grid/Perl/bin/perl-I/U01/app/11.2.0/grid/Perl/lib-I/U01/app/11.2.0/grid/CRS/install /u01/app/11.2.0/grid/crs/install/rootcrs.pl execution failed
= root.sh records ends =.
Now, this question is there for nearly 20 hours with Oracle Support and I have tried almost possible workaround suggested by Oracle Support (reboot, reinstall and...)
Well I have no doubt in the Support of Oracle asking here on the issue, but to get chance that someone had already faced this same question.
Now, I wish ultimately I find a culprit who are lower than o/p.
=========================================
[lib root@node1] # ls - ltr libsqlplus.so
-rw - r - r - 1 grid oinstall 1477446 August 5, 2011 libsqlplus.so
[lib root@node1] # ls - ltr libclntsh.so.11.1
-rw - r - r - 1 root oinstall 52697691 December 10, 00:46 libclntsh.so.11.1
[root @node1 lib] # ls - ltr libnnz11.so
-rw - r - r - 1 root oinstall 7955322 August 17, 2011 libnnz11.so
[root @node1 bin] # ls - ltr sqlplus
-rwxr-xr-x 1 grid oinstall 9352 sqlplus August 5, 2011
======
[@node1 grid grid] $ ldd /u01/app/11.2.0/grid/bin/sqlplus
Linux - vdso.so.1 = > (0x00007fff7e72a000)
libsqlplus.so = > not found
libclntsh.so.11.1 = > not found
libnnz11.so = > not found
libdl.so.2 = > /lib64/libdl.so.2 (0x00000031f7400000)
libm.so.6 = > /lib64/libm.so.6 (0x00000031f8400000)
libpthread.so.0 = > /lib64/libpthread.so.0 (0x00000031f7c00000)
libnsl.so.1 = > /lib64/libnsl.so.1 (0x00000031f9c00000)
libc.so.6 = > /lib64/libc.so.6 (0x00000031f7800000)
/lib64/ld-linux-x86-64.so.2 (0x00000031f7000000)
========================================
your questions and comments are welcome...
Re-install gcc libraries and test it.
-
An error occurred while running the installationCheck for "indesign_install" tool
When I try and install local versions of CC products that have been provided for me under license by the company that I work, I get an error:
An error occurred while running the installationCheck for "indesign_install" tool
Screenshot is below. This is a brand new macbook also (screenshot below), so I don't know why this is happening. Help them to do the work of installation, or as to why this is happening would be appreciated.
Thank you!
Hi Todda,
I'm not sure people in the download, installation, commissioning forums will be able to offer a solution, given that most of us know better in individual licenses. There are some members of the Adobe staff who jump in, and they may be able to help. If you don't want to wait, however, I would recommend first investigate with the administrator of your business licenses. You can also get help by contacting Adobe customer service.
-
Hello
I get the error message below.
We have made the correction but the suite spot not be able to start the database.
sqlplus: error while loading shared libraries: /opt/oracle/u01/app/oracle/product/11.2.0.3/lib/libclntsh.so.11.1: ELF file data encoding not little-endian not
Need your help in resolving this issue.
Thank you
Srinivasan R wrote:
Hello
FYI,.
We have applied the fix for database only and there's OS patching.
Thank you
Srinivasan R
Realize that Oracle provides the PATCH of the DATABASE for different versions of the OS & if you apply the patch to the database for the version of Solaris on a HP version.
then the problems will result.
If sqlplus worked without error before applying the patch & now ENDIAN error reports, problem exists between keyboard and Chair!
-
sqlplus from a shell script with the variable in unix
I'm having some trouble calling sqlplus from a shell script... I am basically asking for a path/name of file which I attribute to one to a variable called $code. Then use cp to move the file ($code) to a new directory. I think that there is something wrong with my sqlplus below. echo $code does not work yet. I thought that $code was variable, which I could see, but rather it seems that the script is trying to rerun the SQL command each time.
Any help would be greatly appreciated... condensed version of the code is below. Thank you!
file in $FILES
do
Code =""
code ='sqlplus-s $USER_PWD < < EOF
Set the off position;
set pagesize 0;
Select r.outfile_name OUTFILE
some paintings
where file_name = $file;
EXPRESSIONS OF FOLKLORE"
echo $code
CP $code $newdirHello
I hope code below will help but set feedback off so that he won't be any info if no line selected
echo ${CODE} if [ -z "${CODE}" ] then echo "No rows returned" else echo "Returned" fi
Concerning
CA
uninstall security tool
essential elements of the Security window
Windows startup configuration
the Award bios update -
ORA-900 sql not valid reporting error while calling the optimize_index pl/sql procedure
Hi Experts,I'm on Oracle 11.2.0.3 on Linux and I have installed in my database Oracle text. I want to configure annex dbms_job to optimize my oracle text index. So first, I created a pl/sql procedure to optimize indexes. It gives me error ORA-900, but the sql even if I run in sqlplus works very well! Can you please help me the question is to find:
Here is the procedure:
(Either incidentally CTXAPP role has been granted in the schema where these Oracle text indexes are created and where the below procedure to optimize the index is running.)
CREATE OR REPLACE PROCEDURE optimize_ora_txt_indexes_debug IS CURSOR cur_context_indexes IS SELECT index_name FROM user_indexes WHERE index_type = 'DOMAIN' AND ROWNUM<2 ORDER BY INDEX_NAME; v_user VARCHAR2 (30); v_pod VARCHAR2 (30); v_start_time TIMESTAMP; v_end_time TIMESTAMP; v_elapsed VARCHAR2 (40); v_msg VARCHAR2 (1000); v_error_code NUMBER; v_error_msg VARCHAR2 (1000); v_sql VARCHAR2 (1000); BEGIN FOR c IN cur_context_indexes LOOP BEGIN v_sql:= 'ctx_ddl.optimize_index (idx_name =>'||chr(39)|| c.index_name||chr(39)||', optlevel => '||chr(39)||'FULL'||chr(39)||')'; dbms_output.put_line(v_sql); execute immediate v_sql; EXCEPTION WHEN OTHERS THEN v_error_code := SQLCODE; v_error_msg := SQLERRM; v_msg := 'Error while optimizing the index ' || c.index_name || ' ' || TO_CHAR (v_error_code) || ' ' || v_error_msg; DBMS_OUTPUT.put_line (v_msg); END; END LOOP; EXCEPTION WHEN OTHERS THEN v_error_code := SQLCODE; v_error_msg := SQLERRM; v_msg := 'Error while in the optimize index procedure' || ' ' || TO_CHAR (v_error_code) || ' ' || v_error_msg; DBMS_OUTPUT.put_line (v_msg); END optimize_ora_txt_indexes_debug; / --the procedure compiles successfully. Now when I run it , I get the error: SQL>exec optimize_ora_txt_indexes_debug; ctx_ddl.optimize_index (idx_name =>'ACCESS_CLNT_IDX04', optlevel => 'FULL') Error while optimizing the index ACCESS_CLNT_IDX04 -900 ORA-00900: invalid SQL statement --When I run the same command from sqlplus as execute statement , it works fine: SQL>exec ctx_ddl.optimize_index (idx_name =>'ACCESS_CLNT_IDX04', optlevel => 'FULL'); PL/SQL procedure successfully completed.
If everything runs from sqlplus, but fails in plsql... I'll be very grateful for pointers solve the problem.
Thanks,
OrauserN
Hello
It is a problem of pl/sql syntax. A call with EXEC is the same using BEGIN... Code of... END of block;
SO, you need to include a beginning and an end to your call:
v_sql:= 'BEGIN ctx_ddl.optimize_index (idx_name =>'||chr(39)|| c.index_name||chr(39)||', optlevel => '||chr(39)||'FULL'||chr(39)||'); END;';
That's all.
Herald tiomela
Maybe you are looking for
-
Moving to Thunderbird - I am trying to eliminate my use of WinXP and migrate fully to Mac OSX. I have successfully transferred my many files of dbx (total 3.65 GB of messages) from Outlook Express in TB24.4.0 (such as files with null, msf and sbd) wh
-
Hello I want to buy the computer HP ENVY Phoenix 810 desktop PC - 170st but I want this computer with the Titan Gefroce gtx graphics card. Is this possible?
-
ER komt geen geluid, mijn computer ITU meer niet op Skype, niet bij het van een cd listening, niet op tube you, mijn computer stelt vast clean, alle levels & maximum op geen, maaltijd lukte couriers say perfect. Na een update van windows live essent
-
ProBook 450 g2: support assistant
Hello I'm trying to download on my g2 450 probook (Win7 x 64) support assistant. After clicking on the download link it redirects me to the selection page of country every time I try to download the installer. Please correct the problem or by post th
-
I have lived more than a dozen phones last year. Problem after problem with the 8220. This last time, they (T-Mobile) has decided to help and sent me a new phone. I was actually very happy and said to anyone who would listen that, FINALLY, the phone