Jump to content

Short User-Creation script for Oracle?


3Jake
 Share

Recommended Posts

Hello Smart People!

I have a multi-column .CSV that I would like to draw information from, in order to populate (send) that info to some fields in an Oracle form.  This would be for account-creation in Oracle.

I have the basic script to navigate (tab) through the fields in the Oracle form, but I am SUPER-new to AutoIT and don’t quite see how to get the script to import and use variables from a .CSV

For example:

Quote

 

Ticket Number  Logon    Name                    Email

Tx12345                jsmith   John Smith          john.smith@anyco.com

Tx12346                ljones    Leo Jones            leo.jones@anyco.com

Tx12347                mblue   Mary Blue           mary.blue@anyco.com

 

My script just waits for the page to be active, then enters data and tabs between fields like this:

; Wait for the window to be active

WinWaitActive("Oracle is Cool - E-Business is the Best")

 

; User Name

 Send("jsmith")

 Send("{TAB}")

 

; Password

 Send("Password1")

 Send("{TAB}")

 Send("Password1")

 Send("{TAB}")

 

; Description

 Send("John Smith")

 Send("{TAB}")

(etc. etc. etc.…)

The winning solution would take one row at a time, feed it into fields on the Oracle form, save, and then start in on the next row

It looks like I’d need a combination of “FileReadToArray” ( or“FileReadLine”?) and “StringSplit” to loop through the values and set them to variables, which would then replace my current "hard-coded" values to be typed them into the form?

I found the following example in the “Help” snippets for stringsplit()… this seems like it’s in the ballpark but I’m having some trouble wrapping this around what I’ve put together, since each entry in the array would have multiple elements per line instead of just “Day”:

Func Example()
    Local $aDays = StringSplit("Mon,Tues,Wed,Thur,Fri,Sat,Sun", ",") ;Split the string of days using the delimiter "," and the default flag value.
    #cs
        The array returned will contain the following values:
        $aDays[1] = "Mon"
        $aDays[2] = "Tues"
        $aDays[3] = "Wed"
        ...
        $aDays[7] = "Sun"
    #ce

    For $i = 1 To $aDays[0] ; Loop through the array returned by StringSplit to display the individual values.
        MsgBox($MB_SYSTEMMODAL, "", "$aDays[" & $i & "] - " & $aDays[$i])
    Next
EndFunc   ;==>Example

This post also seems like a similar example, but I don’t need it to be so selective RE: one specific column:

https://www.autoitscript.com/forum/topic/166261-how-to-read-csv-specific-row-and-columns

Any advice would be appreciated!  Thanks for taking a minute to look!

 

Link to comment
Share on other sites

why would you not use SQL Developer for this? Oracle can already import Excel files. manipulating Oracle Forms is going to probably require you use UIAutomation UDFs in AutoIt.

https://www.thatjeffsmith.com/archive/2012/04/how-to-import-from-excel-to-oracle-with-sql-developer/

there are ADO and other database UDFs as well on this Forum

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

I haven't looked into using that resource yet; I'm aware that there are other options out there that may also bear fruit, but I was also looking to expand my understanding of AutoIT, and thought that this would be a good intro.

But thanks for the link, I can check that out as well.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...