Example 1 (using OAuthClient) (recommended) – PB Docs 2017
Example 1 (using OAuthClient) (recommended)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
OAuthClient loac_Client TokenRequest ltr_Request TokenResponse ltr_Response OAuthRequest loar_Request ResourceResponse lrr_Response String ls_AccessToken String ls_Body, ls_type, ls_description, ls_uri, ls_state Long ll_return loac_Client = Create OAuthClient <span><strong>//Step 1: Get the RESTful server access token.</strong></span> ltr_Request.tokenlocation = "https://authserver.appeon.com/oauth2/token" ltr_Request.Method = "POST" ltr_Request.secureprotocol = 0 ltr_Request.clientid = "367c4163ddc1427d96655cd220c6714b" ltr_Request.clientsecret = "4079f8749939446cbc81fd0c27709187" ltr_Request.UserName = "username" ltr_Request.Password = "password123" ltr_Request.scope = "testcode" ltr_Request.granttype = "password" ll_Return = loac_Client.AccessToken( ltr_Request, ltr_Response ) If ll_Return = 1 and ltr_Response.GetStatusCode () = 200 Then ll_Return = ltr_Response.GetBody(ls_Body) If ll_Return = 1 Then ls_AccessToken = ltr_Response.GetAccessToken() <span><strong>//Step 2: Get the RESTful server resource. </strong></span> loar_Request.Method = "GET" loar_Request.Url = "https://authserver.appeon.com/order/getall" loar_Request.SetAccessToken( ls_AccessToken ) ll_Return = loac_Client.RequestResource( loar_Request, lrr_Response ) If ll_Return = 1 Then ll_Return = lrr_Response.GetBody(ls_Body) If ll_Return = 1 Then MessageBox ( "Resource", ls_Body ) End If Else MessageBox( "Requestresource Falied", "Return :" + String ( ll_return ) + "~r~n" + lrr_Response.GetStatusText() ) End If End If Else ll_Return = ltr_Response.GetTokenError(ls_type, ls_description, ls_uri, ls_state) MessageBox( "AccessToken Falied", "Return :" + String ( ll_return ) + "~r~n" + ls_description ) End If If IsValid ( loac_Client ) Then DesTroy ( loac_Client ) |
Document get from Powerbuilder help Thank you for watching.
Using cascaded calling and return values – PB Docs 2017
Using cascaded calling and return values PowerBuilder dot notation allows you to chain together several object function or event calls. The return value of the function or event becomes the object for the following call. This syntax shows the relationship between the return values of three cascaded function calls:
|
1 |
func1returnsobject( ).func2returnsobject( ).func3returnsanything( ) |
Disadvantage of cascaded calls When…
Using Embedded SQL – PB Docs 2017
Using Embedded SQL This part describes how to use embedded SQL when accessing a database with that interface in a PowerBuilder application. Contents Using Embedded SQL with ODBC ODBC SQL Support ODBC Name qualification ODBC SQL functions ODBC Using escape clauses ODBC Transaction management statements ODBC Using CONNECT, DISCONNECT, COMMIT, and ROLLBACK ODBC Performance and…
Syntax 6: For opening an OLE storage member into a storage – PB Docs 2017
Syntax 6: For opening an OLE storage member into a storage Description Opens a member of an open OLE storage and loads it into another OLE storage object in memory. Applies to OLE storage objects Syntax
|
1 |
olestorage.Open ( substoragename, readmode, sharemode, sourcestorage ) |
Argument Description olestorage The name of a object variable of type OLEStorage into which you want to load…
Using Open Client directory services – PB Docs 2017
Using Open Client directory services Contents What are Open Client directory services? Requirements for using Open Client directory services Specifying the server name with Open Client directory services Directory services DBParm parameters The Adaptive Server interfaces provide several DBParm parameters that support Open Client 11.1.x or later network-based directory services in your application. If you are using…
Using return values – PB Docs 2017
Using return values Contents Functions Events Using cascaded calling and return values You can use return values of functions and events. Document get from Powerbuilder help Thank you for watching.
Oracle Cursor statements – PB Docs 2017
Oracle Cursor statements In embedded SQL, statements that retrieve data and statements that update data can both involve cursors. Retrieval statements The retrieval statements that involve cursors are: DECLARE cursor_name CURSOR FOR … OPEN cursor_name FETCH cursor_name INTO … CLOSE cursor_name Update statements The update statements that involve cursors are: UPDATE … WHERE CURRENT OF…
SELECTBLOB – PB Docs 2017
SELECTBLOB SQL statement Description Selects a single blob column in a row in the table specified in RestOfSelectStatement. Syntax
|
1 |
SELECTBLOB RestOfSelectStatement {USING TransactionObject} ; |
Parameter Description RestOfSelectStatement The rest of the SELECTÂ statement (the INTO, FROM, and WHERE clauses). TransactionObject The name of the transaction object that identifies the database containing the table. This clause is required only for transaction…
ODBC SQL functions – PB Docs 2017
ODBC SQL functions Contents DBHandle In SQL statements, you can use any function that your backend DBMS supports (such as aggregate or mathematical functions). For example, if your DBMS supports the function Sum, you can use the function Sum in a SELECT statement:
|
1 2 3 |
SELECT Sum(salary)    INTO :salary_sum_var    FROM employee; |
Calling ODBC functions While PowerBuilder provides access to a large percentage…
Standard datatypes – PB Docs 2017
Standard datatypes The datatypes The standard datatypes in PowerBuilder are the familiar datatypes that are used in many programming languages, including char, integer, decimal, long, and string. In PowerScript, you use these datatypes to declare variables or arrays. These are the standard PowerScript datatypes, followed by a description of each: Blob LongLong Boolean Long Byte…