PLS-00103: Encountered the symbol ";" when expecting one of the following: - oracle

I am trying to insert the answer to a user's security question, for use in the pin reset feature.
Ellucian banner v8+ provides an API for running this and I very new to their API and from the looks of the error message below, I am far from running this correctly. Any help is appreciated.
I tried running this in Oracle SQL Developer:
execute gb_pin_answer.p_create(
P_PIDM => 12345,
P_NUM => 1,
p_gobqstn_id => 1,
p_qstn_desc => '',
p_ansr_desc => 'David',
p_ansr_salt => 'A123B456',
p_user_id => 'W:H12345678',
p_data_origin => 'WWW_USER',
p_rowid_out OUT gb_common.internal_record_id_type
);
This is a shot in the dark, but I thought I'd give it a shot, error message that displays when trying to execute that package's p_create function:
Error starting at line 15 in command: execute gb_pin_answer.p_create(
Error report: ORA-06550: line 1, column 30: PLS-00103: Encountered the
symbol ";" when expecting one of the following:
( ) - + case mod new not null table continue avg count
current exists max min prior sql stddev sum variance execute
multiset the both leading trailing forall merge year month day hour
minute second timezone_hour timezone_minute timezone_region
timezone_abbr time timestamp interval date
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
Error starting at line 16 in command: P_PIDM => 12345, Error
report: Unknown Command
Error starting at line 17 in command: P_NUM => 1, Error report:
Unknown Command
Error starting at line 18 in command: p_gobqstn_id => 1, Error report:
Unknown Command
Error starting at line 19 in command: p_qstn_desc => '', Error
report: Unknown Command
Error starting at line 20 in command: p_ansr_desc => 'David', Error
report: Unknown Command
Error starting at line 21 in command: p_ansr_salt => 'A123B456',
Error report: Unknown Command
Error starting at line 22 in command: p_user_id => 'W:H12345678',
Error report: Unknown Command
Error starting at line 23 in command: p_data_origin => 'WWW_USER',
Error report: Unknown Command
Error starting at line 24 in command: p_rowid_out OUT
gb_common.internal_record_id_type Error report: Unknown Command
Error starting at line 25 in command: ) Error report: Unknown Command
This is where I read up on using this function, p_create: http://inb1.banner.ecu.edu:9090/api_erd_index_guide/api/general/gb_pin_answer.html#p_create
UPDATE: code that is erroring out:
SET SERVEROUTPUT ON
declare
l_rowid_out gb_common.internal_record_id_type;
BEGIN
gb_pin_answer.p_create(P_PIDM => 36706, P_NUM => 1, P_GOBQSTN_ID => 1, P_QSTN_DESC => '', P_ANSR_DESC => 'David', P_ANSR_SALT => 'HB123456', P_USER_ID => 'H00036657', P_DATA_ORIGIN => 'WWW_USER', P_ROWID_OUT => 1_rowid_out);
dbms_output.put_line('rowid: ' || l_rowid_out);
END;
Error msg:
Error report: ORA-06550: line 4, column 199: PLS-00363: expression '1'
cannot be used as an assignment target ORA-06550: line 4, column 3:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:

The problem is the execute. That's actually shorthand for a short anonymous PL/SQL block, and cannot be split across lines. (Except maybe with a continuation character, but I can't remember off-hand if I've ever got that to work). Only the first line is translated, so it's effectively trying to run:
begin execute gb_pin_answer.p_create(; end;
/
... and it quite reasonably then doesn't like the command ending as p_create(;. The rest of the procedure call is then treated as 10 separate commands, which generate the other errors you get, and they are also reasonable in that context.
The solution is to either put the entire procedure call on one line, which will make it harder to read; or simply to use your own block, rather than relying on execute:
begin
gb_pin_answer.p_create(
...
);
end;
/
The last parameter isn't right though; the bit from OUT ... needs to be replaced with => some_value, like you've done with the others. But it is an out parameter, so you need something to put the value in. Without seeing what else is in the script you're running I can't tell if you've already taken care of it, but with this pattern you can probably just add a variable to the anonymous block:
set serveroutput on
declare
l_rowid_out gb_common.internal_record_id_type;
begin
gb_pin_answer.p_create(
...
p_rowid_out => l_rowid_out
);
-- optional
dbms_output.put_line('rowid: ' || l_rowid_out);
end;
/

From the last edit, I see that you misstaken 1 for l...
1_rowid_out instead of l_rowid_out.
You cannot start a variable with a number like you tried to.

We got this error when mixing Dapper and native Oracle MDA constructs. Specifically trying to use the WithConnection construct with native Oracle driver. It didn't like that and returned a very similar and nonsensical error message "ORA-06550: line 1, column 259: PLS-00103: Encountered the symbol...blah blah blah"

Related

"Commands out of sync" error when trying to execute a procedure in MySQL 8

When executing below code in phpMyAdmin:
use db;
DELIMITER $$
DROP PROCEDURE IF EXISTS McaTest3$$
CREATE PROCEDURE McaTest3()
BEGIN
SELECT
cl.*
FROM `condition_library` cl
LEFT JOIN condition_custom cc on cl.condition_library_id = cc.condition_library_id
and cc.active = 1
AND (cc.permit_application_id = 20231 OR cc.permit_id = NULL)
WHERE FIND_IN_SET(cl.`condition_library_id`, '13070')
AND cl.active = 1
and cc.condition_library_id IS NULL;
END$$
DELIMITER ;
call McaTest3();
Getting error:
Error
Static analysis:
1 errors were found during analysis.
Missing expression. (near "ON" at position 25)
SQL query: Edit Edit
SET FOREIGN_KEY_CHECKS = ON;
MySQL said: Documentation
#2014 - Commands out of sync; you can't run this command now
This happens when there is no record found in the table which is at LEFT JOIN.
When the same is ran in MySQL Workbench: NO ERROR and return empty dataset.
Same procedure when executed from Application (Appian) is failing as well… Any clues?
Another question on Stackoverflow answered my issue:
link: MySQL error #2014 - Commands out of sync; you can't run this command now

Oracle Datapump: Invalid operation at line 6224

I've a Oracle dump file that I'm trying to import to AWS RDS Oracle 12.1.0.2.v17
database.
The dump file looks like this:
$ strings EXPDP.dmp | head -n 6
_|lM
"PACOPROD"."SYS_EXPORT_SCHEMA_01"
IBMPC/WIN_NT64-9.1.0
unicode
AL32UTF8
12.01.00.00.00
The commands I'm running is:
DECLARE
hdnl NUMBER;
BEGIN
hdnl := DBMS_DATAPUMP.OPEN( operation => 'IMPORT', job_mode => 'SCHEMA', job_name=>null, version=>'COMPATIBLE');
DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => 'EXPDP.dmp', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_dump_file);
DBMS_DATAPUMP.METADATA_FILTER(hdnl,'SCHEMA_EXPR','IN (''PACOPROD'')');
DBMS_DATAPUMP.START_JOB(hdnl);
END;
/
The response is:
Error report -
ORA-39002: invalid operation
ORA-06512: at "SYS.DBMS_DATAPUMP", line 6224
ORA-06512: at line 7
The closes similar issue I've found is this, even though it's not exactly the same error message and in my case both source and target db is running 12.1.
I think the issue is one of the following:
A) The DMP file is corrupt.
B) I'm doing something wrong.
I've no clue how to get further though. Where shall I dig or what should I try to go forward?
Try to add a log file to the operation. It some times contain more information:
DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => 'EXPDP.log', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.KU$_FILE_TYPE_LOG_FILE);

Data assignment error for dbms_xmldom.domdocument

I'm trying the example in the link below
http://www.dba-oracle.com/t_packages_dbms_xmldom_xmlparser.htm
but I get errors on this line
v_doc := dbms_xmldom.cument(v_variable);
how can I solve this problem
ORA-06550: satır 31, sütun 25:
PLS-00302: component 'CUMENT' must be declared
ORA-06550: satır 31, sütun 3:
PL/SQL: Statement ignored
#Alex Poole is correct.
It is not CUMENT. It is NEWDOMDOCUMENT
Try with this: V_DOC := DBMS_XMLDOM.NEWDOMDOCUMENT(V_VARIABLE);
Thanks

How to properly use Alias in Codeigniter

Here is my code:
$this->db->select('course_name AS Course Name,course_desc AS Course Description,display_public AS Display Status',FALSE);
$this->db->from('courses');
$this->db->where('tennant_id',$tennant_id);
$this->db->order_by('course_name','ASC');
$query = $this->db->get();
and I got an error:
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Name, course_desc AS Course Description, display_public AS Display Status FROM (' at line 1
and I got an error:
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Name, course_desc AS Course Description, display_public AS Display Status FROM (' at line 1
SELECT course_name AS Course Name,
course_desc AS Course Description,
display_public AS Display Status
FROM (`courses`) WHERE `tennant_id` = 'elicuarto#apploma.com'
ORDER BY `course_name` ASC
Filename: C:\wamp\www\coursebooking\system\database\DB_driver.php
Line Number: 330
Try
$this->db->select('course_name AS `Course Name`, course_desc AS `Course Description`, display_public AS `Display Status`', FALSE);
It's the space in your alias that is messing with you.
UPDATE
I'm not sure why you would want to, but I see nothing preventing you from writing
$this->db->select("course_name AS `{$variable}`", FALSE);
(showing just one field for simplicity)
UPDATE 2
Should be standard string conversion so I don't know why it doesn't work for you.. there's always split strings...
$this->db->select('course_name AS `' . $variable . '`', FALSE);

BCB: from BDE to dbexpress, BCD exception

I'm having some problem about TSQLStoredProcedure. Here is the code:
storedproc->ParamByName("A")->AsInteger = adataset->FieldByName("AA")->AsInteger;
storedproc->ExecProc();
param "A" is declared integer in the form (and it's 29 in the program). Also the stored procedure has no errors. I'm sure of it. Database is Oracle 11g. By the way, as storedproc is executed an exception occurred:
...
EBcdException with message '<0000001:000000010000000:00000063612>' is not a valid BCD value
...
All was working fine with BDE but now, using dbexpress, there is this problem. I searched over the internet for some days and I did not find an answer.
I thank you in advance and beg a pardon for my English.
Francesco
Update
I searched over the web. I found something interesting at:
https://forums.codegear.com/thread.jspa?messageID=43223&tstart=0
http://www.delphigroups.info/2/8/750511.html
I decide to make some test:
SQLQuery->ParamByName("f1")->AsString = Edit1->Text;
SQLQuery->ExecSQL();
It works. Not the same for
SQLQuery->ParamByName("f1")->AsInteger = StrToInt(Edit1->Text); //ERROR DBX Error: Invalid Field Type.
SQLQuery->ParamByName("f1")->AsFloat = StrToFloat(Edit1->Text); //ERROR DBX Error: Invalid Field Type.
SQLQuery->ParamByName("f1")->AsBCD = StrToInt(Edit1->Text); //ERROR ORA-06502: PL/SQL: error: ... ORA-06512: at line 1.
SQLQuery->ParamByName("f1")->AsFMTBCD = StrToBcd(Edit2->Text); //ERROR ORA-06502: PL/SQL: error: ... ORA-06512: at line 1.
or by using TSQLStoredProc.
So now I call my pl/sql stored proc by TSQLQuery. I use "AsString" to pass values to parameters. Weird. How does dbexpress map types? Thanks in advance.

Resources