Need help....question about transit procedure ..
Hello gurus
Can somebody help me understand the transit procedure ?
my question is
if we are implementing GTS for a company in US and its not a global implementation . and the company does
only exports to the EU customers for example to France
Is it necessary for us to file a transit declaration ?
If yes to which customs offices we have to send the EDI for declaration ?
Does the american company have to follow NCTS?
and if we are like importing goods from EU to USA what is the process?
Is NCTS strictly for the companies which operates in EU and EFTA?
thanks alot for the help
hi,
transit declarations are only for processes within a customs union (NAFTA or EU).
However if you export to or import from the EU you have to file customs declarations. With GTS you can do this all electronically in the US (with AES and ABI) and in many european countries. (Germany, NL, CH, FR etc.).
Balazs
Similar Messages
-
Need help: question about itunes update problem
I started up iTunes yesterday and a window popped up saying there was a new version of iTunes to update, so I did it, and now I can't save equalizer presets! The feature doesn't work at all anymore, and it used to work great. It just goes back to Manual every time, and just won't save anything you put in. This really frustrates me, as it was one of my fave things about iTunes. Can anybody tell me what happened? Can I fix it or go back to my old version without losing my library?
CheersHow do I make sure I don't lose my library? if i uninstall and then re-install an older version (which I have on disc), how do I make sure my library comes with me?
-
Need Help With a Stored Procedure
Help With a Stored Procedure
Hi everyone.
I am quite new relative to creating stored procedures, so I anticipate that whatever help I could get here would be very much helpful.
Anyway, here is my case:
I have a table where I need to update some fields with values coming from other tables. The other tables, let us just name as tblRef1, tblRef2 and tblRef3. For clarity, let us name tblToUpdate as my table to update. tblToUpdate has the following fields.
PlanID
EmployeeIndicator
UpdatedBy
CreatedBy
tblRef1, tblRef2 and tblRef3 has the following fields:
UserName
EmpIndicator
UserID
In my stored procedure, I need to perform the following:
1. Check each row in the tblToUpdate table. Get the CreatedBy value and compare the same to the UserName and UserID field of tblRef1. If no value exists in tblRef1, I then proceed to check if the value exists in the same fields in tblRef2 and tblRef3.
2. If the value is found, then I would update the EmployeeIndicator field in tblToUpdate with the value found on either tblRef1, tblRef2 or tblRef3.
I am having some trouble writing the stored procedure to accomplish this. So far, I have written is the following:
CREATE OR REPLACE PROCEDURE Proc_Upd IS v_rec NUMBER;
v_plan_no tblToUpdate.PLANID%TYPE;
v_ref_ind tblToUpdate.EMPLOYEEINDICATOR%TYPE;
v_update_user tblToUpdate.UPDATEDBY%TYPE;
v_created_by tblToUpdate.CREATEDBY%TYPE;
v_correct_ref_ind tblToUpdate.EMPLOYEEIDICATOR%TYPE;
CURSOR cur_plan IS SELECT PlanID, EmployeeIndicator, UPPER(UpdatedBy), UPPER(CreatedBy) FROM tblToUpdate;
BEGIN
Open cur_plan;
LOOP
FETCH cur_plan INTO v_plan_no, v_ref_ind, v_update_user, v_created_by;
EXIT WHEN cur_plan%NOTFOUND;
BEGIN
-- Check if v_created_by has value.
IF v_created_by IS NOT NULL THEN
-- Get the EmpIndicator from the tblRef1, tblRef2 or tblRef3 based on CreatedBy
SELECT UPPER(EmpIndicator)
INTO v_correct_ref_ind
FROM tblRef1
WHERE UPPER(USERNAME) = v_created_by
OR UPPER(USERID) = v_created_by;
IF v_correct_ref_ind IS NOT NULL THEN
-- Update the Reference Indicator Field in the table TRP_BUSPLAN_HDR_T.
UPDATE TRP_BUSPLAN_HDR_T SET ref_ind = v_correct_ref_ind WHERE plan_no = v_plan_no;
ELSIF
-- Check the Other tables here????
END IF;
ELSIF v_created_by IS NULL THEN
-- Get the EmpIndicator based on the UpdatedBy
SELECT UPPER(EmpIndicator)
INTO v_correct_ref_ind
FROM tblRef1
WHERE UPPER(USERNAME) = v_update_user
OR UPPER(USERID) = v_created_by;
IF v_correct_ref_ind IS NOT NULL THEN
-- Update the Reference Indicator Field in the table TRP_BUSPLAN_HDR_T.
UPDATE TRP_BUSPLAN_HDR_T SET ref_ind = v_correct_ref_ind WHERE plan_no = v_plan_no;
ELSIF
-- Check the Other tables here????
END IF;
END IF;
END;
END LOOP;
CLOSE cur_plan;
COMMIT;
END
Please take note that the values in the column tblToUpdate.UpdatedBy or tblToUpdate.CreatedBy could match either the UserName or the UserID of the table tblRef1, tblRef2, or tblRef3.
Kindly provide more insight. When I try to execute the procedure above, I get a DATA NOT FOUND ERROR.
Thanks.Ah, ok; I got the updates the wrong way round then.
BluShadow's single update sounds like what you need then.
I also suggest you read this AskTom link to help you see why you should choose to write DML statements before choosing to write cursor + loops.
In general, when you're being asked to update / insert / delete rows into a table or several tables, your first reaction should be: "Can I do this in SQL?" If you can, then putting it into a stored procedure is usually just a case of putting the sql statement inside the procedure header/footers - can't really get much more simple than that! *{;-) -
A question about sleep procedure
I want to create a process that will call a function periodically with a certain repeating time which is decided by another process.
I write a process with a infinite LOOP, then I use DBMS_LOCK.sleep() to control the repeating time of that function. So I wonder how accurate the sleep() is? I know the accuracy is hundredth of a second. If I set the time is 1.99, will this process really sleep exactly for 1.99 second and then be invoked? Thnaks.Hi,
I don't know the exact accuracy and I suspect that no guarantees are made. However, simple tests show that dbms_lock is accurate to about +/- .01 seconds.
e.g.
sqlplus
SQL> set timing on
SQL> exec dbms_lock.sleep(1.5555)
SQL> exec dbms_lock.sleep(1.5555)
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.57
You should dismiss the first result since this includes overhead to cache some stuff (although maybe you need to take that into account too).
Hope this helps,
Ravi. -
New Oracle DBA - Need help with backup & restore procedure via RMAN
Hello everyone,
I've been a SQL Server DBA for 12 years now, but new to the Oracle space. My first assignment at work was to refresh our training environment with production. So with that said, I took a full backup of our production database via RMAN and backed up the Control File. I then copied both the Control File and full backup from our production environment to training. I followed the procedures listed in the URL below:
http://www.dba-oracle.com/t_rman_clone+copy_database.htm
I then connected to RMAN and executed a 'show all' which is as follows:
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
The CONFIGURE CONTROLFILE AUTOBACKUP was set to ON but received a message that the database needed to be mounted, so, I mounted the database and made the changes, but when I shutdown the database and performed the startup nomount again, the settings were gone. Are these settings valid only when the database is mounted? How can I successfully refresh this training environment with production data? I'm at a standstill here so any help would be very much appreciated.
Thank you,
PeteThe CONFIGURE CONTROLFILE AUTOBACKUP was set to ON but received a message that the database needed to be mounted, so, I mounted the database and made the changes, but when I shutdown the database and performed the startup nomount again, the settings were gone. These settings are persistent settings.So these information retain in control files.To reading information from control files database instance must be MOUNT or OPEN stage.Due to you have mount instance and try SHOW ALL command through RMAN.
Are these settings valid only when the database is mounted? Not only MOUNT also OPEN stage.
How can I successfully refresh this training environment with production data? I'm at a standstill here so any help would be very much appreciated.
There are several ways like duplication.But you take full backup from production database using BACKUP DATABASE through rman.In this case you will get also AUTOBACKUP for controlfiles/spfiles.Then copy these backup files and all available archive logs to training server and perform below steps.
1) You have set properly ORACLE_HOME and ORACLE_SID environment variable.After that first need restore spfile as
rman target /
startup force nomount;
restore spfile from 'autobackup_location';
startup force nomount;2) Now you have to restore controlfiie as
rman>restore controlfile from 'autobackup_location';
rman>alter database mount;
3) Now need catalog(it means register) all backup files and archivelogs in new restored controlfile as
rman>catalog start with 'backuplocation';
4) Finally you can restore and recover your database as below
rman>restore database;
rman>recover database;
rman>alter database open resetlogs;
If you want restore database to new location then before executing RESTORE DATABASE command you can use SET NEWNAME FOR DATAFILE clause.Firstly refer backup recovery guide in online documentation. -
Need help here about how to upgrate new version to...
it say that i need the code than can upgrate version i type the code aready the press get it to the lastest version but my handphone semm like never recieve any installin thing about the latest version how can someone help me here..
Install this piece of software:
http://europe.nokia.com/softwareupdate
It will tell you if there's any new firmware for your phone or not.
If your phone model isn't listed then it cannot be upgraded using this software. You will need to visit a care point to upgrade it. -
I need Help with the stored procedure
Hello, I new with VS.Net
I'm tring to call a stored procedure, but when i try to retrive the data don't return nothing.
my VB code is the follows
ocm_comando.Connection = ocn_coneccion
ocm_comando.CommandText = "WPROC_PRUEBA"
ocm_comando.CommandType = CommandType.StoredProcedure
ocm_comando.Parameters.Add("PNI_ID_ESTUDIO", OracleDbType.Decimal).Direction = ParameterDirection.Input
ocm_comando.Parameters("PNI_ID_ESTUDIO").Value = CType(vc_id_estudio, Integer)
ocm_comando.Parameters.Add("pco_precalificada", OracleDbType.Varchar2).Direction = ParameterDirection.Output
ocm_comando.Parameters.Add("pco_resultado", OracleDbType.Varchar2).Direction = ParameterDirection.Output
Txb_empresa.Text = ocm_comando.Parameters("pco_precalificada").Value
My stored procedure only take the parameter that I sent and make a simple select and return the value in the variable pco_precalificada
thank for your help
**** Sorry for mi EnglishYou forgot to actually execute the command. Before the last line, where you ask for the value of pco_precalificada, you need to:
1. Open the connection (if it's not already open)
2. Call ocm_comando.ExecuteNonQuery()
HTH,
Tom -
Need help in tuning a procedure
DECLARE
CURSOR Cur_sub_rp IS
SELECT A.SUB_ACCOUNT, B.PH_basic_srv,B.PH_Salesman,A.SUB_SSN
FROM STG_SUB_MASTER_MONTH_HISTORY A, STG_PHN_MASTER_MONTH_HISTORY
B
WHERE A.SUB_ACCOUNT = B.PH_ACCOUNT (+)
AND A.MONTH_ID = B.MONTH_ID ;
TYPE t_values_tab IS TABLE OF cur_sub_rp%rowtype ;
values_tab t_values_tab := t_values_tab() ;
BEGIN
OPEN Cur_sub_rp ;
LOOP
FETCH Cur_sub_rp BULK COLLECT INTO Values_tab
LIMIT 1000;
EXIT WHEN Cur_sub_rp%NOTFOUND ;
END LOOP ;
CLOSE Cur_sub_rp;
FORALL i IN VALUES_TAB.first..values_tab.last
INSERT INTO SUB_PHN_1 VALUES VALUES_TAB(i);
commit;
END;
The tables used here has 9 million records each.
The total process takes around 19 minutes.
Need your help in optimizing the process.i have tried using
Create table as SELECT A.SUB_ACCOUNT, B.PH_basic_srv,B.PH_Salesman,A.SUB_SSN
FROM STG_SUB_MASTER_MONTH_HISTORY A, STG_PHN_MASTER_MONTH_HISTORY
B
WHERE A.SUB_ACCOUNT = B.PH_ACCOUNT (+)
AND A.MONTH_ID = B.MONTH_ID (+);But still taking long time(apprx 15 min).
so used this...
help me in tuning the query in either of this.
DECLARE
CURSOR Cur_sub_rp IS
SELECT A.SUB_ACCOUNT, B.PH_basic_srv,B.PH_Salesman,A.SUB_SSN
FROM STG_SUB_MASTER_MONTH_HISTORY A, STG_PHN_MASTER_MONTH_HISTORY
B
WHERE A.SUB_ACCOUNT = B.PH_ACCOUNT (+)
AND A.MONTH_ID = B.MONTH_ID (+);
TYPE t_values_tab IS TABLE OF cur_sub_rp%rowtype ;
values_tab t_values_tab := t_values_tab() ;
BEGIN
OPEN Cur_sub_rp ;
LOOP
FETCH Cur_sub_rp BULK COLLECT INTO Values_tab
LIMIT 1000;
EXIT WHEN Cur_sub_rp%NOTFOUND ;
END LOOP ;
CLOSE Cur_sub_rp;
FORALL i IN VALUES_TAB.first..values_tab.last
INSERT INTO SUB_PHN_1 VALUES VALUES_TAB(i);
commit;
END;Message was edited by:
Vakeel
Message was edited by:
Vakeel -
Need help to fix the Procedure
I found a procedure in the forum. I think Vikash posted this. I update and it is working for comma delimiter records but I want to work it for TAB delimiter. I edited many ways but no luck. If any body fix it, please help so.
Thanks,
Lubna
create or replace PACKAGE htmldb_tools
AS
PROCEDURE parse_textarea (
p_textarea IN VARCHAR2,
p_collection_name IN VARCHAR2
PROCEDURE parse_file(
p_file_name IN VARCHAR2,
p_collection_name IN VARCHAR2,
p_headings_item IN VARCHAR2,
p_columns_item IN VARCHAR2,
p_ddl_item IN VARCHAR2,
p_table_name IN VARCHAR2 DEFAULT NULL
create or replace PACKAGE BODY htmldb_tools
AS
TYPE varchar2_t IS TABLE OF VARCHAR2(32767) INDEX BY binary_integer;
PROCEDURE delete_collection (
p_collection_name IN VARCHAR2
IS
BEGIN
IF (htmldb_collection.collection_exists(p_collection_name))
THEN
htmldb_collection.delete_collection(p_collection_name);
END IF;
END delete_collection;
PROCEDURE csv_to_array (
p_csv_string IN VARCHAR2,
p_array OUT wwv_flow_global.vc_arr2,
p_separator IN VARCHAR2 := 'chr(09)'
IS
l_start_separator PLS_INTEGER := 0;
l_stop_separator PLS_INTEGER := 0;
l_length PLS_INTEGER := 0;
l_idx BINARY_INTEGER := 0;
l_quote_enclosed BOOLEAN := FALSE;
l_offset PLS_INTEGER := 1;
BEGIN
l_length := NVL(LENGTH(p_csv_string),0);
IF (l_length <= 0)
THEN
RETURN;
END IF;
LOOP
l_idx := l_idx + 1;
l_quote_enclosed := FALSE;
IF SUBSTR(p_csv_string, l_start_separator + 1, 1) = '"'
THEN
l_quote_enclosed := TRUE;
l_offset := 2;
l_stop_separator := INSTR(p_csv_string, '"', l_start_separator + l_offset, 1);
ELSE
l_offset := 1;
l_stop_separator := INSTR(p_csv_string, p_separator, l_start_separator + l_offset, 1);
END IF;
IF l_stop_separator = 0
THEN
l_stop_separator := l_length + 1;
END IF;
p_array(l_idx) := (SUBSTR(p_csv_string, l_start_separator + l_offset,(l_stop_separator - l_start_separator - l_offset)));
EXIT WHEN l_stop_separator >= l_length;
IF l_quote_enclosed
THEN
l_stop_separator := l_stop_separator + 1;
END IF;
l_start_separator := l_stop_separator;
END LOOP;
END csv_to_array; --}}}
PROCEDURE get_records(p_blob IN blob,p_records OUT varchar2_t) --{{{
IS
l_record_separator VARCHAR2(2) := chr(13)||chr(10);
l_last INTEGER;
l_current INTEGER;
BEGIN
IF (NVL(dbms_lob.instr(p_blob,utl_raw.cast_to_raw(l_record_separator),1,1),0)=0)
THEN
l_record_separator := chr(10);
END IF;
l_last := 1;
LOOP
l_current := dbms_lob.instr( p_blob, utl_raw.cast_to_raw(l_record_separator), l_last, 1 );
EXIT WHEN (nvl(l_current,0) = 0);
p_records(p_records.count+1) := utl_raw.cast_to_varchar2(dbms_lob.substr(p_blob,l_current-l_last,l_last));
l_last := l_current+length(l_record_separator);
END LOOP;
END get_records;
PROCEDURE parse_textarea (
p_textarea IN VARCHAR2,
p_collection_name IN VARCHAR2
IS
l_index INTEGER;
l_string VARCHAR2(32767) := TRANSLATE(p_textarea,chr(9)||chr(13)||chr(10)||' ,','@@@@');
l_element VARCHAR2(100);
BEGIN
l_string := l_string||'@';
htmldb_collection.create_or_truncate_collection(p_collection_name);
LOOP
l_index := instr(l_string,'@');
EXIT WHEN NVL(l_index,0)=0;
l_element := substr(l_string,1,l_index-1);
IF (trim(l_element) IS NOT NULL)
THEN
htmldb_collection.add_member(p_collection_name,l_element);
END IF;
l_string := substr(l_string,l_index+1);
END LOOP;
END parse_textarea;
PROCEDURE parse_file(
p_file_name IN VARCHAR2,
p_collection_name IN VARCHAR2,
p_headings_item IN VARCHAR2,
p_columns_item IN VARCHAR2,
p_ddl_item IN VARCHAR2,
p_table_name IN VARCHAR2 DEFAULT NULL
IS
l_blob blob;
l_records varchar2_t;
l_record wwv_flow_global.vc_arr2;
l_datatypes wwv_flow_global.vc_arr2;
l_headings VARCHAR2(4000);
l_columns VARCHAR2(4000);
l_seq_id NUMBER;
l_num_columns INTEGER;
l_ddl VARCHAR2(4000);
BEGIN
IF (p_table_name is not null)
THEN
l_ddl := 'insert into '||p_table_name||' '||
'select '||v(p_columns_item)||' '||
'from htmldb_collections '||
'where seq_id > 0 and collection_name='''||p_collection_name||'''';
htmldb_util.set_session_state('P149_DEBUG',v('P149_DEBUG')||'/'||l_ddl);
execute immediate l_ddl;
RETURN;
END IF;
BEGIN
select blob_content into l_blob from wwv_flow_files
where name=p_file_name;
EXCEPTION
WHEN NO_DATA_FOUND THEN
raise_application_error(-20000,'File not found, id='||p_file_name);
END;
get_records(l_blob,l_records);
IF (l_records.count < 2)
THEN
raise_application_error(-20000,'File must have at least 3 ROWS, id='||p_file_name);
END IF;
htmldb_collection.create_or_truncate_collection(p_collection_name);
csv_to_array(l_records(1),l_record);
l_num_columns := l_record.count;
if (l_num_columns > 900000) then
raise_application_error(-900000,'Max. of 9,000,00 columns allowed, id='||p_file_name);
end if;
FOR i IN 1..l_record.count
LOOP
l_headings := l_headings||':'||l_record(i);
l_columns := l_columns||',c'||lpad(i,3,'0');
END LOOP;
l_headings := ltrim(l_headings,':');
l_columns := ltrim(l_columns,',');
htmldb_util.set_session_state(p_headings_item,l_headings);
htmldb_util.set_session_state(p_columns_item,l_columns);
FOR i IN 2..l_records.count
LOOP
csv_to_array(l_records(i),l_record);
l_seq_id := htmldb_collection.add_member(p_collection_name,'dummy');
FOR i IN 1..l_record.count
LOOP
htmldb_collection.update_member_attribute(
p_collection_name=> p_collection_name,
p_seq => l_seq_id,
p_attr_number => i,
p_attr_value => l_record(i)
END LOOP;
END LOOP;
DELETE FROM wwv_flow_files WHERE name=p_file_name;
END;
BEGIN
NULL;
END;sir manu,
i started the oracleAS report Server with the following command in command prompt : rwserver server=rep_myserver
and it successfully started.
i insert this code on my button :
DECLARE
RO_Report_ID REPORT_OBJECT;
Str_Report_Server_Job VARCHAR2(100);
Str_Job_ID VARCHAR2(100);
Str_URL VARCHAR2(100);
PL_ID PARAMLIST ;
BEGIN
PL_ID := GET_PARAMETER_LIST('TEMPDATA');
IF NOT ID_NULL(PL_ID) THEN
PAUSE;
DESTROY_PARAMETER_LIST(PL_ID);
END IF;
PL_ID := CREATE_PARAMETER_LIST('TEMPDATA');
--RO_Report_ID := FIND_REPORT_OBJECT('REPORT_OBJ');
RO_Report_ID := FIND_REPORT_OBJECT('REPORT1');
ADD_PARAMETER(PL_ID, 's_sin_no', TEXT_PARAMETER,:scrap_delivery_request.sin_no);
SET_REPORT_OBJECT_PROPERTY(RO_Report_ID, REPORT_FILENAME, 'C:\New Forms\REF_SF_510.ref');
SET_REPORT_OBJECT_PROPERTY(RO_Report_ID, REPORT_COMM_MODE, SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(RO_Report_ID, REPORT_EXECUTION_MODE, BATCH);
SET_REPORT_OBJECT_PROPERTY(RO_Report_ID, REPORT_DESTYPE, cache);
SET_REPORT_OBJECT_PROPERTY(RO_Report_ID, REPORT_DESFORMAT, 'PDF');
SET_REPORT_OBJECT_PROPERTY(RO_Report_ID, REPORT_SERVER, 'rep_myserver');
Str_Report_Server_Job := RUN_REPORT_OBJECT(RO_Report_ID, PL_ID);
Str_Job_ID := SUBSTR(Str_Report_Server_Job, LENGTH('rep_myserver') + 2, LENGTH(Str_Report_Server_Job));
Str_URL := '/reports/rwservlet/getjobid' || Str_Job_ID || '?server=' || 'rep_myserver';
WEB.SHOW_DOCUMENT(Str_URL, '_SELF');
DESTROY_PARAMETER_LIST(PL_ID);
END;
after pressing the button this error come up in browser :
REP-52251: Cannot get output of job ID 3 you requested on SAt. jul 04 11:44...... <P> REP-51026 :No output for job b -
ok, so i've just bought an ipod video because i wanted the video option for travelling. Im having great problems getting movies to work in itunes. I downloaded a movies with Ares Ultra (i think that's what it's called, i;m on a different computer) and i tested the video out on VCL media player and it worked perfectly. I then converted the file with Videora. This also worked. Then, i put the movie into itunes and it again worked BUT after a few minutes of playing something within itunes has altered the video and now the sound is out of syncronisation with the video by about 3 seconds. i have tried deleted the new MPG4 file and started again with the conversion three times, but it doesn't even start off working in itunes now - it opens with unsyncronised sound. What i need to know is : can i somehow re-allign the sound with the video; is it the video itself that's dodgey and shound i try another movie; or something else?
I really need to fix this problem because i'm leaving in less than two weeks.
if you can, Please email a response to [email protected]
EVERLASTING THANKS TO ANYONE WHO CAN SHED SOME LIGHT ON MY PROBLEM!!!Try
iOS: Device not recognized in iTunes for Windows
or
iPhone, iPad, iPod touch: Device not recognized in iTunes for Mac OS X -
Help, question about "select ... for update nowait"
There is a proc code. In the beginning of the code, I used a SQL "select ... for update nowait" in order to prevent from another proc executing at the same time. When the case happens, "-54, ORA-00054: resource busy and acquire with NOWAIT specified" will be printed in the screen.
But there is a question: I need to print sth to indicate "another proc is running". I used "if (sqlca.sqlcode == -54)" as precondition, such as:
if (sqlca.sqlcode == -54) {
printf("There is another proc running.\n");
However, this line will not be printed. I doubt that the code quits directly when using "select ... for update nowait" so as not to set value (-54) to sqlca.sqlcode.
So, could you suggest whether there is another way that I can use to print "There is another proc running" when another proc is running?
Thx a lot for your kindly reply.Yes, that link. Scroll down a bit and you will see:
The calling application gets a PL/SQL exception, which it can process using the error-reporting functions SQLCODE and SQLERRM in an OTHERS handler. Also, it can use the pragma EXCEPTION_INIT to map specific error numbers returned by raise_application_error to exceptions of its own, as the following Pro*C example shows:
EXEC SQL EXECUTE
/* Execute embedded PL/SQL block using host
variables v_emp_id and v_amount, which were
assigned values in the host environment. */
DECLARE
null_salary EXCEPTION;
/* Map error number returned by raise_application_error
to user-defined exception. */
PRAGMA EXCEPTION_INIT(null_salary, -20101);
BEGIN
raise_salary(:v_emp_id, :v_amount);
EXCEPTION
WHEN null_salary THEN
INSERT INTO emp_audit VALUES (:v_emp_id, ...);
END;
END-EXEC;
This technique allows the calling application to handle error conditions in specific exception handlers. -
I need help writing a stored procedure
How do I update several tables with columns that store social security number as a single transaction? I have over 70 tables to update the ssn with correct ssn.The database I'm working on is not normalized.
The update is strictly by request. Occasionally, I get calls for a customer who entered their ssn wrongly the first time they registered on the our website. when I get such a request, I manually update all the ssn in every database table that stores information
about the customer. A very tedious task to update over 70 tables with ssn columns one by one. Does anyone have an idea how to do this efficiently ?Can someone show me how write a stored procedure that I can pass in the old SSN and the new SSN then it updates
the 70 tables accordingly?
Does anyone have a blue print that demonstrates how to write the stored procedure?
TableName ColumnName
table1 colA
table2 colB
table3 colC
table4 cold
I query the INFORMATION_SCHEMA.COLUMNS view
to retrieve all the tables that have ssn columns as shown above.You can create a procedure that receives a ssn parameter and a key value to be searched for in every table, and then a varchar(max) variable that would store a dynamically generated SQL command based on the parameter values and the tables with the ssn column.
Example:
-- THE FOLLOWING VARIABLES ARE PARAMETERS
DECLARE @SSN VARCHAR(100) = '12354676'
DECLARE @PREDICATE VARCHAR(100) = 'A'
DECLARE @CMD VARCHAR(MAX) = '' -- THIS IS THE COMMAND VARIABLE
-- THIS WILL BUILD A SCRIPT TO UPDATE ALL TABLES WHICH CONTAIN THE SSN COLUMN
SELECT @CMD = @CMD + 'UPDATE ' + T.NAME + ' SET SSN = ''' + @SSN + ''' WHERE KEY_COLUMN = ''' + @PREDICATE + '''
GO
FROM SYS.TABLES T
WHERE T.OBJECT_ID IN (SELECT OBJECT_ID FROM SYS.COLUMNS WHERE NAME = 'SSN')
EXEC (@CMD);
Just because there are clouds in the sky it doesn't mean it isn't blue. But someone will come and argue that in addition to clouds, birds, airplanes, pollution, sunsets, daltonism and nuclear bombs, all adding different colours to the sky, this
is an undocumented behavior and should not be relied upon. -
Need help asap about point and shoot for inside
trying to take pictures for auction listings, don'thave a lot of experience. have been told about canon powershot and panasonic lumix - could you tell me what will be the easiest for me to use and give me the best inside pictures of objects to list - thanks!!!!
The key to getting a good picture is to make sure that you can control the light and less about the exact camera as long as you do not purchase any junk.
For auction images, you should invest in a small light box setup with multiple strobes/flashes that illuminte the item properly. In order to do this, then you should get an inexpensive SLR. You should also get a small tripod and remote shutter release that will allow you to make correctly focus pictures.
Currently, Nikon and Canon are head to head when it comes to image quality with Nikon edging out Canon since they have recently introduced some really great lenses. Sony is doing OK, but remember Canon and Nikon own 90 % of the camera market and the other 10% is left to everyone else. Sony is having some problems with ISO images that contain a lot more noise than Canon or Nikon.
Check out www.dpreview.com and www.luminous-landscape.com for reviews by photographers.
I do not work for Best Buy and am not affiliated with them in any way. I like HT and want to help people improve their HT experience. "There is a LOT more than just having a TV to make a home theater" -
Please help: question about eclipse & xerces
hi,
i have eclipse 3.0 and am trying to get the xerces java package (ver 2.6.2) to work for it. i downloaded xerces from this link: http://www.apache.org/dist/xml/xerces-j/
there are so many different files in there, i'm not entirely sure if you download everything or just one. anyway, the one i downloaded was the fourth one down, called xerces.j.bin.2.6.2.zip (5.6m in size).
i've unzipped it, but am unsure how i go about configuring eclipse 3.0 so that i can import and make use of xerces in my java apps. could anyone who has experience with this please help me?
thanks,
ramseyit's OK guys, took me ages but i got it sorted.
-
Some question about replication procedure?
1.At the function __rep_process_message in the file D:\db-4.5.20\rep\rep_record,
there are several types of messages to be handled.
REP_LOG/REP_LOG_MORE : It indicates starting to transfer log record from
client to master
REP_PAGE/REP_PAGE_MORE: What are these messages used to ?
Does it indicate in some special case, master
will transferdatabase file directly to client to
accomplish replication synchronization ?
2. When does the master start to send log records to client?
I mend source code of ex_rep_base example provided by BDB as follow:
ret=dbenv->txn_begin(dbenv,NULL,&txn,0);
//step 1
Sleep(3000);
printf("---------------txn_begin Waken--------------------\n");
if (ret !=0 )
dbenv->err(dbenv,ret,"transaction begin fail");
goto err;
if ((ret = dbp->put(dbp,
txn, &key, &data, 0)) != 0) {
dbp->err(dbp, ret, "DB->put");
goto err;
//step 2
Sleep(3000);
printf("---------------Waken--------------------\n");
ret=txn->commit(txn,0);
//step 3
if (ret!=0)
dbenv->err(dbenv,ret,"transaction commit fail");
goto err;
I print message being processed at client.
At step 1: no message is processed.
At step 2: two REP_LOG message are processed.
At step 3: one REP_LOG message is processed.
Does it mean: the master don not need to wait for the put transaction commit to send log records to clients?
And when does the master send log records to clients ?
3. A test case is tried as follow:
Step 1: Start Master and client;
Step 2: Add records to master.
Step 3: kill client and delete the database file of the client.
Step 4: restart client, and query client's database to check if it has
caught with master.
(there is not write requests to master at step 4)
Step 5: send write requests to master.
Result: At step 4, it takes a long period of time for the client to catch
up with master.
But after step 5, the synchronization procedure is very fast. It takes a
very short period of time for the client to catch up with master.
What is the reason?
Thanks a lot !1. LOG and LOG_MORE messages convey log records, usually from the master to the client. (If using client-to-client synchronization, log records may be copied from one client to another, in certain circumstances.)
PAGE and PAGE_MORE messages convey the contents of database pages during "internal init" (which is mentioned in db-4.5.20/docs/ref/rep/mastersync.html). Again, this is usually from master to client, but could be from client to client in some circumstances.
2. The master generally sends log records to clients as soon as the operations that generated them occur (db->put, txn->commit, env->txn_checkpoint, etc). (See also the discussion of Bulk Transfer, however: db-4.5.20/docs/ref/rep/bulk.html)
3. The client realizes it has "caught up" with the master (STARTUPDONE event) when it can process the first "live" log record generated by the master. Thus it relies on the master doing some new write requests after the client has started synchronization.
Alan Bram
Oracle
Maybe you are looking for
-
Why when I am downloading music off iTunes it's not going on my music? It says it is downloading and that its done then I go into my music and nothing is there
-
Getting Error while installing Adobe CS5.5 Master Collection
I have downloaded a Adobe CS5.5 Master Collection while installing it shows me an error ( Please insert Disk Adobe Master Collection 5 Trial English to continue ) Exit Code: 24 -------------------------------------- Summary --------------------------
-
Hi I have an KM-navigation iView which is using the lauout set for News Browser. I have further diferent XML-Forms which again have a unique color. The meaning is to display the xml fomrms with diferent colors in the same iView. But when I have set a
-
Is possible to run XDK 9i on AIX? Error XSQL-027 comes up!
Running a simple XSQL file with the command-line utility xsql against the database (8.1.7 Standard) ends in: xsql-027: Failed to load oracle.xml.actions.XSQLIncludeOWAHandler class for built-in xsql: include-owa action xsql-004: Could not acquire a d
-
Hello all. For entering in Oracle 10g Db we start SQLPLUS. user-name "system" and password containing @ (my mistake), TNS error view. Presently I know that problem in "@" symbol. While understood the user "system" is locked.... As possible change p