Enter number into variable
I created a stored procedure which creates records into a table. Right now it includes all "mig_runs". Every time I execute this SP I want a little window to pop up where I can type in a specific "mig_run". Is that possible? Is it also possible to let the window pop up more than once, so that I can type in more "mig_run"s?
Thanks for your help in advanced.
Below my SP:
CREATE OR REPLACE PROCEDURE SP_FILL_EXECUTION_DETAILS IS
BEGIN
DECLARE
v_mig_run sim_execution_details.MIGRATION_RUN%TYPE;
v_success_load sim_execution_details.SUCCESSFULLY_LOADED%TYPE;
v_aborted sim_execution_details.ABORTED%TYPE;
CURSOR CUR_INSERT_EXDET
IS
select MIG_RUN, sum(OK_LOADED), sum(ABORTED)
from
select migration_run MIG_RUN, count(*) OK_LOADED, NULL ABORTED
from DM_SA.mig_topcust_tbl
where (mig_topcust_tbl.migration_status = 'ok_ETL'
or mig_topcust_tbl.migration_status = 'ok_PUBLISH'
or mig_topcust_tbl.migration_status = 'ok_UPDATE_MIGRATION_STATUS'
or mig_topcust_tbl.migration_status = 'ok_SEND_TO_NEW'
or mig_topcust_tbl.migration_status = 'ko_PUBLISH'
or mig_topcust_tbl.migration_status = 'ko_UPDATE_MIGRATION_STATUS'
or mig_topcust_tbl.migration_status = 'ko_SEND_TO_NEW')
group by DM_SA.mig_topcust_tbl.migration_run
union
select migration_run MIG_RUN, NULL OK_LOADED, count(*) ABORTED
from DM_SA.mig_topcust_tbl
where mig_topcust_tbl.migration_status = 'ok_ETL'
or mig_topcust_tbl.migration_status = 'ko_ETL'
or mig_topcust_tbl.migration_status like 'ok_PUBLISH'
or mig_topcust_tbl.migration_status like 'ok_UPDATE_MIGRATION_STATUS'
or mig_topcust_tbl.migration_status like 'ok_UNLOCK'
or mig_topcust_tbl.migration_status like 'ok_DATABASELINE3'
group by mig_topcust_tbl.migration_run
group by MIG_RUN
order by MIG_RUN
BEGIN
OPEN CUR_INSERT_EXDET;
LOOP
FETCH CUR_INSERT_EXDET
INTO v_mig_run, v_success_load, v_aborted;
EXIT WHEN CUR_INSERT_EXDET%NOTFOUND;
insert into sim_execution_details
(migration_run, mig_date, successfully_loaded, aborted)
values
(v_mig_run, sysdate, v_success_load, v_aborted);
END LOOP;
CLOSE CUR_INSERT_EXDET;
END;
COMMIT;
END SP_FILL_EXECUTION_DETAILS;
/
Thanks for your reply. But isn't a cursor the better
performance? Thought so...Absolutely not. You're doing 1 insert per row instead of one insert for all rows.
insert into sim_execution_details
(migration_run, mig_date, successfully_loaded, aborted)
select MIG_RUN, sysdate, sum(OK_LOADED), sum(ABORTED)
from
select migration_run MIG_RUN, count(*) OK_LOADED, NULL ABORTED
from DM_SA.mig_topcust_tbl
where (mig_topcust_tbl.migration_status = 'ok_ETL'
or mig_topcust_tbl.migration_status = 'ok_PUBLISH'
or mig_topcust_tbl.migration_status = 'ok_UPDATE_MIGRATION_STATUS'
or mig_topcust_tbl.migration_status = 'ok_SEND_TO_NEW'
or mig_topcust_tbl.migration_status = 'ko_PUBLISH'
or mig_topcust_tbl.migration_status = 'ko_UPDATE_MIGRATION_STATUS'
or mig_topcust_tbl.migration_status = 'ko_SEND_TO_NEW')
group by DM_SA.mig_topcust_tbl.migration_run
union
select migration_run MIG_RUN, NULL OK_LOADED, count(*) ABORTED
from DM_SA.mig_topcust_tbl
where mig_topcust_tbl.migration_status = 'ok_ETL'
or mig_topcust_tbl.migration_status = 'ko_ETL'
or mig_topcust_tbl.migration_status like 'ok_PUBLISH'
or mig_topcust_tbl.migration_status like 'ok_UPDATE_MIGRATION_STATUS'
or mig_topcust_tbl.migration_status like 'ok_UNLOCK'
or mig_topcust_tbl.migration_status like 'ok_DATABASELINE3'
group by mig_topcust_tbl.migration_run
group by MIG_RUN, sysdateThe LIKE comparisons on mig_topcust_tbl.migration_status appear unneccessary as well.
I don't want a front end. Question is only: Do I have
to type my "mig_run" into the stored procedure
directly, recompile it and start it again? Or is
there another way?Procedures have parameters for a reason.
Similar Messages
-
How to enter a 24 digit number into a mysql db
hi,
i want enter a 24 digit number into a mysql db as a mathematically manipulatable value.
when i configure the field as a bigint(24) it takes it as bigint(20)
when i keep it as bigint and parsing a double value from my application
it gives data truncation exception for the particular field.
the whole process worked well when i change the field type to varchar(24),
what i want is to enter 24 digit number into db as a mathematically manipulatable value.
if anyone can assist me, pls reply,
thanks,
dushiyou should ask in a mysql-forum. or at least in JDBC-forum here at sun-forums
you could save it as varchar and parse it when selecting it into bigint in java and make your calculations... -
I bought a refurbished Ipod touch, 3rd gen(link: http://store.apple.com/ca/product/FC086LL/A?mco=MjI4NjY2MTE)
The home button broke on me, so while setting up servicing for it, when I entered the serial number into the Apple site, my supposedly "3rd gen" Ipod showed up as a 2nd gen. Is this normal? And if not, what can I do about it?There are no 3rd gen 8GB models. They did not make them.
Identifying iPod models -
Using numberd buttons to enter text into a field
Hi all, was wondering if I had 10 seperate sprites acting as
buttons on a page, which will be numbered 0 -9, is it possible to
use them to enter text into a field. e.g.
If the user presses the sprite with a number 1 on it, would
it be possible to have a 1 displayed in an edit field. I need to
pretend as though im using a remote.
thanksYou can create a behavior that will allow you to set a
variable for each
button. When you assign the behavior to your button sprite,
it'll
prompt you to enter the ButtonNumber property. Haven't tested
this yet,
but something like this should work:
global gNumberEntered
property ButtonNumber
on getPropertyDescriptionList
description = [:]
addprop description, #ButtonNumber, [#comment:"Enter number
to assign
to this button", #format:#integer, #range:[1,10], #default:
1]
return description
end getPropertyDescriptionList
on mouseup
sprite(the currentSpriteNum).member = member("buttonOver")
gNumberEntered = ButtonNumber
cursor -1
end
on mouseEnter me
sprite(the currentSpriteNum).member = member("buttonOver")
cursor 280
end
on mouseDown me
sprite(the currentSpriteNum).member = member("buttonDown")
end
on mouseLeave me
sprite(the currentSpriteNum).member = member("buttonUp")
cursor -1
end -
How do i prevent the user from entering a RETURN/ENTER key into their username?
Hello,
i am currently trying to make a login system where the
username will obviously enter their username.
I have made my user input box editable and set up variables
to accept the user input and store them into variables, along with
error prevention for blank fields.
However i cannot prevent the user from hitting the
"enter"/"return" key. When i hit "enter" the user input box box
gets larger as the type curser moves onto the next line and when
the username is stored in a variable it is stored as "theuser
RETURN" so when variable is passed to the next frame and is
recalled by another text box to display the username, the user name
has a carriage return.
I want to prevent this, anyone got any suggestions? or know
of any websites i can visit which will explain this to me nicely??
Thank yousuggestion:
don't make the edit field editable right from the start.
rather attach a behaviour to the field/text-sprite like:
property mySprite, myMember
on beginsprite me
Sprite = me.spritenum
-- this is the channel-number of the editbox
myMember = mySprite.member.number
-- this is the field/text-member
member(myMember).editable = FALSE
end beginsprite
on mouseup me
-- when i get clicked for editing, then set me editable
member(mymember).editable = TRUE
the keydownscript = "MyKeyhandler"
-- this sets the keyhandler to YOUR keyhandler, see below
end mouseup
You would then need to have YOUR keyhandler in any mociesript
and there you
would block any unwished key, while editing
on MyKeyhandler
case the key of
RETURN:
stopevent;
otherwise
pass;
end case
end MyKeyhandler
in the end you would attach a behaviour to any
"Submit"-button (this is the
one that "gets" the userinput" and performs further action
according to your
wishes and decisions)
on mouseup
the keydownscript = EMPTY
-- this resets to normal
user-ID = member("Whatever the number or name of your
editfield
is").text
member("Whatever the number or name of your editfield
is").editable
= FALSE
-- any further actions to make in your project
-- to get along with the entered User-ID
end mouseup
something like this, I guess
Peter -
Flash movie to enter data into access
I have a simple microsoft access database (table with a handful of fields).
I want to make a flash form that operators can use on mac and pc to enter information into the database.
I know little about databases and although I've worked as a designer with flash for years, i know little about the latest scripting too.
Is there a simple way to do this?
Thanks in advance for any commentsThe answer is sort of.
Flash that is served up from a webserver cannot access a database directly with out some back end server that actually does the hand shaking.
There are a number of ways to do it though.
1. Create webservices to pass the data to and have the webservices access and save the data for you.
2. Use page scripting with .NET aspx pages or PHP pages deployed on your webserver to communicate to the database. You would use the loadvars or URLLoader in AS3 to post the variables to the page and then let the page process the data.
Those would be the simpler methods providing you have access to a PHP or .NET solution to act as your backend. -
Copying vendor's VAT registration number into FI Document
How do I get the vendor's VAT registration number from the vendor's master record to copy into the FI Document when posting a vendor invoice via tcode F-43.
Now, BSEG-STCEG is always blank now on all our vendor invoices. Also, the branch account, BSEG-FILKD, is blank. All vendor invoices are manual journals via F-43.
I think I need to configure SAP so that the user must also enter the Branch Account when posting to a vendor in tcode F-43. Then, I think that SAP standard will lookup the Branch Account Vendor to copy in the VAT registration number into BSEG-STCEG.
I see that my customer invoices posted via SD are correctly being populated with the Branch Account of the Sold-To customer.
I further see that SAP standard code in MF05AI10_STCEG_PRUEFEN appears to only update BSEG-STCEG via the Branch Account (BSEG-FILKD) and not via the vendor (BSEG-LIFNR).Hi All,
I'm facing the same problem, kindly let me know how do I get the Vendor's VAT registration number while posting invoice. As every time when I'm trying to post vendor invoice the system ask for the customer number and the Reporting country and pick up the VAT reg. no. from the customer master base and not from the vendor master base. -
Entering info into MSSQL db from a form
Hi,
I'm trying to enter data into a msSQL 7 db using a form. As long as the information I enter is an integer, it works fine, but if I enter a name like john for "enter name" in the form, I get the following error:
javax.servlet.ServletException: [Microsoft] [ODBC SQL Server Driver] [SQL Server] the name 'john' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted. at org.apache.jasper.runtime.PageContextImpl.handlePage Exception(PageContextImpl.java:457)
The datatype for 'name' is VARCHAR and I'm able to enter 'John' manually in the database, but not through the form.
The code for the jsp that processes my form is:
<html>
<head></head>
<%@ page import="java.sql.*" %>
<body>
<%
String userName=request.getParameter("userName");
String employeeID=request.getParameter("employeeID");
String phoneExtension=request.getParameter("phoneExtension");
%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:doron","user","password");
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
String sqlStatement = "INSERT INTO Employees(employee_id,name,extension) VALUES ("+employeeID+","+userName+","+phoneExtension+")";
stmt.executeUpdate(sqlStatement);
con.close();
%>
Thank you.
</body>
</html>
Does anyone have any ideas??Your SQL statement doesn't seem to be putting quotes around the employee name, so what you are submitting to the database is something like
Insert ... Values(23, John, 4406)
whereas it should be
Insert ... Values(23, 'John', 4406) -
I am using an update statement to enter a number into an
access databse where the field is set as an interger format. The
syntax used in the update statement is order = '#form.order#',
When this is processed I revieve the following error:
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in
UPDATE statement.
SQL = "UPDATE tbl_images SET mnname = 'Whitney Looking',
dimensions1 = '5', dimensions2 = '7', dimmeasure = 'Inches',
denomination = '£', price = '42.00', bgcolour = 'DADAFC',
medium = 'Inks', order = 19, framedorunframed = 'Framed', approved
= '0', makeimagelive = '0', subject = 'Animals' WHERE
tbl_images.imageid=2356"
I assume this is caused by the database recieving the number
in a text rather than interger format.
Could someone please let me know how I need to format the
update statement to over come this (or whether this may be casued
by another issue
Thanks
NeilDan's point about using a column named "order" is most likely
the culprit. Words like SELECT, WHERE and ORDER are reserved words
in SQL and should be avoided as names for database fields. Try
changing the name of your database field and running the query
again.
Also, I noticed the fields "approved" and "makeimagelive"
seemed to also contain bit or integer values. Try using the same
formatting with those fields as you did with the order field.
In fact, you can replace all of your query values with
<cfqueryparam> and let coldfusion decide which ones will
received surrounding quotes based on the cfsqltype. -
Getting result of dynamic select statement into variable
I have a function that builds a dynamic sql statement. I then want to take the result of that statement and insert it into a variable. I have tried this
execute immediate strSQL USING OUT intCounter;but that is giving me an error on that line of code. The SQL is a select count(*) and works fine. It is just how to get it into the variable that is tripping me up.
Thanks,
EvaSure. Version 11g. The complete procedure reads as follows:
CREATE OR REPLACE FUNCTION VALIDATIONQUESTIONRESULT
p_ShortName VARCHAR2,
p_SiteID VARCHAR2
RETURN NUMBER IS
strSQL VARCHAR2(5000);
strTableName VARCHAR2(200);
strPatIDFieldName VARCHAR2(200);
intCounter NUMBER;
BEGIN
select VALIDATIONSQL into strSQL from vwvalidationquestions where upper(shortname) = upper(p_ShortName);
select
case UPPER(DBTABLENAME)
when 'CPTICODES' then 'CPTIPATID'
when 'CPTIICODES' then 'CPTIIPATID'
when 'DEMOGRAPHICS' then 'PATID'
when 'FAMILYHISTORY' then 'FHPATID'
when 'GCODES' then 'GCODEPATID'
when 'HOSPITALIZATION' then 'HPATID'
when 'MEDICALHISTORY' then 'MHPATID'
when 'MEDICATIONS' then 'MPATID'
when 'PROCEDURES' then 'PPATID'
when 'VISITS' then 'VPATID' end into strPatIDFieldName
from DATASPECIFICATIONS where UPPER(SHORTNAME) = UPPER(p_ShortName);
strSQL := strSQL||' and '||strPatIDFieldName||' in (select PATID from DEMOGRAPHICS where PARTICID = '||p_SiteID||');';
execute immediate strSQL into intCounter;
return intCounter;
END VALIDATIONQUESTIONRESULT; strSQL when checked builds perfectly. I get 100% what I expect from it. An example of what I am getting from strSQL is:
select count(*) from Procedures where TO_CHAR(ProcdDt, 'MM') = TO_CHAR(ADD_MONTHS(SYSDATE, -1), 'MM') and TO_CHAR(ProcdDt, 'YYYY') = TO_CHAR(ADD_MONTHS(SYSDATE, -12), 'YYYY') and PPATID in (select PATID from DEMOGRAPHICS where PARTICID = 12);I am getting the number I would expect from this. I just need to put that number into intCounter. I tried altering strSQL so it looked like this:
select count(*) into intCounter from Procedures where TO_CHAR(ProcdDt, 'MM') = TO_CHAR(ADD_MONTHS(SYSDATE, -1), 'MM') and TO_CHAR(ProcdDt, 'YYYY') = TO_CHAR(ADD_MONTHS(SYSDATE, -12), 'YYYY') and PPATID in (select PATID from DEMOGRAPHICS where PARTICID = 12);but that gave me an error on the execute immediate line as well.
Sorry, I thought it would be simple so that was why I only put that bit of info. I guess it is more complicated than it at first appeared!
Eva -
Two fields, two scripts. User can enter data into field 1 or 2
Hi all,
New here, and to acrobat forms, so please bear with me!
What I'm trying to achieve is a form that calculates total invoice value, based on a total number of hours worked, and a rate. The user fills in the total hours, but then the problem is that some people know their fixed rate, and others have a changing rate. Those with a changing rate simply know the amount they are invoicing for. What I'd like, is a way for the TotalInvoice value to be calculated by Rate*TotalHours when the user enters a value into the Rate field... OR ... for Rate to be calculated by TotalInvoice/TotalHours when the user enters a value into the TotalInvoice field.
I can make it go one way or the other (so the script is only in TotalInvoice field or the Rate field), but I can't manage to get it to go both ways. Is this possible?
To summarise: User can enter manually into Field1 and value of Field2 is calculated, or user can enter manually into Field2 and Field1 is calculated.
Thanks!What you propose can be difficult, becuase you're describing a circular reference between the two fields. When the 1st value changes, you want the 2nd value to be calculated based on the 1st value. But when the 2nd value changes, you want the 1st value to be calculated based on the 2nd, ad infinitum. There are ways to short-circuit the loop, but it depends on whether you need to do the calculation only when there is manual entry, or whether you need it to work when either field value changes programmatically or by importing form data.
Sometimes it's just easier to have the user press a button to calculate and set the other field value. -
Error -ORA-01483: invalid length for DATE or NUMBER bind variable
In discoverer plus, attempt to save a discoverer workbook into the database fails with the error:
ORA-01483 invalid length for DATE or NUMBER bind variable
The same workbook can be safely saved in "My Computer".
Any idea why and what is the solution.Why: not quite sure, probably the code is validating the workbook when it saves it to the db and you've got an error in the sql. What happens when you run the workbook that you saved to the file system? Does it show the same error when run?
Solution: Can you post the sql in the workbook? In the meantime try the following: Replace any to_char statements around dates with to_date statements instead. For example:
Replace:
where to_char(mydate, 'dd-mon-yyyy') = '05-apr-2009'
With:
where mydate = to_date('05-APR-2009','DD-MON-YYYY') -
ForEach Loop - Parsing XML subgroup into Variables
Hi all,I am designing a new ETL process using SSAS.
We have a controller package which receives an XML string at run time into a variable called BatchRequest :-
<Batch>
<Request>
<Name>Filemon</Name>
<Params>
<filepaths>
<Sourcepath>d:\temp</Sourcepath>
<Destpath>D:\temp2</Destpath>
<Archivename>\Archive</Archivename>
</filepaths>
</Params>
</Request>
</Batch>
The Batch can contain a number of Requests and a ForEach Loop is used to parse the text for the Name node and the text for the Params Node into variables RequestName and RequestParams respectively.
however, what I want to be able to do is to take the text for <name> into Requestname but take the entire XML sub string for <Params> into RequestParams.
At the moment I get the text only (e.g. d:\tempd:\temp2\Archive).
The Requestname is used by an XML task within the ForEach loop to retrieve full package path details from an external config file, and hence it only needs to be a keyword.
I played with the idea of including <Params> as a subnode for <Name>, only populating RequestName in the loop parser and then having an XML task which would parse the related parameter string, but i don't know how to tell the XML task that I
want the parameter string where the <Name> is Filemon (in this example).
Can anyone give me some suggestions or pointers?
Thanks
Iain
IainHi idcowden,
Glad to hear that you have resolved the issue on your own. Thank you for sharing the solution.
Regards,
Mike Yin
TechNet Community Support -
Structures - I need a large number of variables
My program has one structure template but I need to have an array of 3 Million of these templates. When I put more than 6,000 in for my number of variables the program comes up with memory errors in different lines of the code. Below 6,000 variables everything works as I expect it should.
I can now compile the following:
short int resultabl[26][30][3000000]; // [row][column][height]
int main() // main() is used for DB set up
extern short int resultabl[26][30][3000000]; /* 0 - 2,999,999 ie 3M 2D arrays */
int a, d, e;
// create and then initialize data base elements all = 0
for(a = 0; a <= 2999998; ++a) // a <= 2999999
for (e = 0; e <= 25; ++e) /* set row elements = 0 */
for (d = 0; d <= 29; ++d) /* set column elements = 0 */
resultabl[e][d][a] = 0;
for (e = 0; e <= 25; ++e) /* row elements */
if(e <= 25)
printf("%d," "\n", e); // TEST
for (d = 0; d <= 29; ++d) /* column element */
printf( "%d,", resultabl[e][d][a]); // TEST
if (d == 29)
printf( "\n"); // TEST
printf( "\n \n permcalc = %ld, ", a); // TEST
return(0);
Build successful. Exit value 0.
*******But the run fails unless I reduce the 3,000,000 to 1,300,000. Then the run is successful every time - Tom
Running "/usr/bin/gnome-terminal --disable-factory --hide-menubar --title="dist/Debug/SunStudio_12.1-Solaris-x86/memorytest64-2 " -x "/opt/sunstudio12.1/netbeans/cnd2/bin/dorun.sh" -p "[Press Enter to close window]" -f "/var/tmp/nbcnd_rc4049119690132517294" dist/Debug/SunStudio_12.1-Solaris-x86/memorytest64-2 " in /export/home/tom/SunStudioProjects/memorytest64-2
Run failed. Exit value 267. -
Hello experts,
We have a BSP application that is called from a .NET application. When the BSP application is called it requires a username and password in order to enter the application. This username and password is associated with a customer number in our system. We would like to take the username and password out of the BSP and add it to the .NET side of the website. From there the user is brought to a screen that could possibly send them to the BSP application or to other areas of the website dealing with their account number, not necessarily a BSP or SAP related. Our question is, how do we pull the account number into the BSP without compromising the sequrity of showing the account number, etc. in the URL. I hope this all makes sense. Any help would be greatly appreciated!
Thanks!Hi,
You can send the User name, Password and Client of the BSP system from the .NET side by sending them as parameters (appending them to the url of the called BSP page from .NET side ).
<b>?sap-user=myName&sap-password=myPassword&sap-client=myClient</b>
append the above to the url. Then your BSP system will not prompt for the password. But for the BSP system to accept this kind of urls <b>SSO</b> need to be enabled in your BSP system.
Hope this helps,
Regards,
Ravikiran.
Maybe you are looking for
-
I installed Photoshop, and it automatically installed on the C: disk (Windows 7). The C: disk has only 11 Gb left, and I think that's the reason that I get warnings about a full scratch disk. So I rather install Photoshop on E:. So I reinstalled ever
-
How do I get A new installation disk???
Hello, I reacently was given a linksys wireless b broadband router #befw11s4 ver.4, however it did not have the installation disk with it. When I hooked it up(and yes I hooked it up correctly) it worked just fine, well just fine if you just want to u
-
Can we have a stage location outside the Server?
I am using Weblogic 9.2 and I need to have a stage location outside the server. I can use No Stage option when I deploy, but on Cluster I found that it has only one source location for the Cluster. So on the second node, it looks for the same locatio
-
I have had my iPhone 4s for one week. Now it won't turn off or on totally.
It just beeps, unless I turn the ringer to vibrate, then it keeps vibrating!! Any one else having these issues? Trying a restore right now.
-
Trying to edit contacts freezes program
I installed PSE8 a few weeks ago and was having a problem sending emails. I've since changed my internet provider and have a new email address and email provider, gmail (not by choice). I went back to PSE8 and tried to edit my contacts but every ti