Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Select specific Data from ODBC SQL Data Connection

Avatar

Avatar
Level 1
christianr95618
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
christianr95618
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
christianr95618
Level 1

03-07-2018

Hi,

so here is my Problem.

I created a Form with a DataConneciton (ODBC and an SQL Qerry).

Tried the "normal" next,first,add etc. Buttons and everthing works fine.

How can i navigate to/select a specific data record?

I want a Textbox/field where i insert the Customer number and the adressfields, fistname lastname etc. is filled automaticly.

some kind of "select * from NameOfTabel where CustomerID like NamedTextField.rawValue"

I've read a lot about filling drop down fields or listboxes, but this is not practical for me because of the large data amount. (tried it, Adobe crash CPU@100% etc)

thanks for your help and excuse my poor language skills.....

Christian

View Entire Topic

Avatar

Avatar
Validate 1
Level 1
ANCA04
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ANCA04
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ANCA04
Level 1

27-05-2019

Hi Bruce,

I have two quick questions about this tutorial if you have a chance to placate my inquiry.

When executing an SQL query such as:  "SELECT UserID FROM FormsData WHERE UserID = 'DDuck'" in a cloned node works fine if I have bound a field <TextField1> to the data connection I am using.  Makes sense.  You reopen the connection, the data connection re-queries the DB and the form remerges the data into the bound (from $record.dataconnectionname.User) object.

A problem I am having is if DDuck isn't a user in the DB.  The query seems to break, the code quits, and I don't get any errors. In SQL, if you were to query the above I might get a return of something like this:

     1761166_pastedImage_3.png       1761167_pastedImage_4.png

I was hoping for a null or something I could test against.

The query is executed but returns no records(if the searched for UserID is not present).  Programatically I can't seem to get past a return like this to evaluate if the data is present or not with Javascript.  There likely is a better SQL statement for the query being presented here which makes this use case not happen, but I can't think of it with my limited SQL skills.  I tried opening the DB with a try/catch statement to see if I could get an error, but I seem to get nothing still.  Do you have any insight on what might be going on?

The second one is quicker I think.  Executing the DB connection with the string above from the cloned  node with the following command:

var dUser = "'DDuck'"

oDB.resolveNode("#command").query.select = "SELECT UserID FROM FormsData WHERE UserID = + dUser" <just an example>

How do I get the return value into a variable.  Does it simply enter into oDB.rawValue?  I don't think it's that simple right?  I think I am a bit frazzled on the subject and could use a pointer.

Thank you for your time.

Alex